Skip to main content

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

ConstructorModifiersDescription
(constructor)(network, address, storage, options, contractWrapper)Constructs a new instance of the Vote class

Properties

PropertyModifiersTypeDescription
contractAbistaticany
contractTypestatic"vote"
encoderContractEncoder<VoteERC20>
estimatorGasCostEstimator<VoteERC20>
eventsContractEvents<VoteERC20>
metadataContractMetadata<VoteERC20, typeof Vote.schema>

Methods

MethodModifiersDescription
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