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 = await sdk.getContract("{{contract_address}}", "vote");
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(network, address, storage, options, abi, chainId, contractWrapper) | Constructs a new instance of the Vote class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
abi | Abi | ||
chainId | readonly | number | |
encoder | ContractEncoder<VoteERC20> | ||
estimator | GasCostEstimator<VoteERC20> | ||
events | ContractEvents<VoteERC20> | ||
metadata | ContractMetadata<VoteERC20, typeof VoteContractSchema> |
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