Vote class
Create a decentralized organization for token holders to vote on proposals.
Example
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("{{chainName}}");
const contract = sdk.getVote("{{contract_address}}");
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(network, address, storage, options, contractWrapper) | Constructs a new instance of the Vote class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| contractAbi | static | any | |
| contractType | static | "vote" | |
| encoder | ContractEncoder<VoteERC20> | ||
| estimator | GasCostEstimator<VoteERC20> | ||
| events | ContractEvents<VoteERC20> | ||
| metadata | ContractMetadata<VoteERC20, typeof Vote.schema> |
Methods
| Method | Modifiers | Description |
|---|---|---|
| balance() | Check the balance of the project wallet in the native token of the chain | |
| balanceOfToken(tokenAddress) | Check the balance of the project wallet in a particular ERC20 token contract | |
| canExecute(proposalId) | Can Execute | |
| execute(proposalId) | Execute Proposal | |
| get(proposalId) | Get a proposal by id. | |
| getAddress() | ||
| getAll() | Get All Proposals | |
| getProposalVotes(proposalId) | Get the votes for a specific proposal | |
| hasVoted(proposalId, account) | Check If Wallet Voted | |
| onNetworkUpdated(network) | ||
| propose(description, executions) | Create Proposal | |
| settings() | Get the Vote contract configuration | |
| vote(proposalId, voteType, reason) | Vote |
Signature:
export declare class Vote implements UpdateableNetwork
Implements: UpdateableNetwork