/** * The IDL of the module. * * @module */ /** The IDL of the module. */ export declare const idl: { readonly module_id: "0x1::voting"; readonly doc: "This is the general Voting module that can be used as part of a DAO Governance. Voting is designed to be used by\nstandalone governance modules, who has full control over the voting flow and is responsible for voting power\ncalculation and including proper capabilities when creating the proposal so resolution can go through.\nOn-chain governance of the Aptos network also uses Voting.\n\nThe voting flow:\n1. The Voting module can be deployed at a known address (e.g. 0x1 for Aptos on-chain governance)\n2. The governance module, e.g. AptosGovernance, can be deployed later and define a GovernanceProposal resource type\nthat can also contain other information such as Capability resource for authorization.\n3. The governance module's owner can then register the ProposalType with Voting. This also hosts the proposal list\n(forum) on the calling account.\n4. A proposer, through the governance module, can call Voting::create_proposal to create a proposal. create_proposal\ncannot be called directly not through the governance module. A script hash of the resolution script that can later\nbe called to execute the proposal is required.\n5. A voter, through the governance module, can call Voting::vote on a proposal. vote requires passing a &ProposalType\nand thus only the governance module that registers ProposalType can call vote.\n6. Once the proposal's expiration time has passed and more than the defined threshold has voted yes on the proposal,\nanyone can call resolve which returns the content of the proposal (of type ProposalType) that can be used to execute.\n7. Only the resolution script with the same script hash specified in the proposal can call Voting::resolve as part of\nthe resolution process."; readonly functions: readonly []; readonly structs: readonly [{ readonly name: "0x1::voting::CreateProposalEvent"; readonly fields: readonly [{ readonly name: "proposal_id"; readonly ty: "u64"; }, { readonly name: "early_resolution_vote_threshold"; readonly ty: { readonly struct: { readonly name: "0x1::option::Option"; readonly ty_args: readonly ["u128"]; }; }; }, { readonly name: "execution_hash"; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "expiration_secs"; readonly ty: "u64"; }, { readonly name: "metadata"; readonly ty: { readonly struct: { readonly name: "0x1::simple_map::SimpleMap"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::string::String"; }; }, { readonly vector: "u8"; }]; }; }; }, { readonly name: "min_vote_threshold"; readonly ty: "u128"; }]; readonly abilities: readonly ["drop", "store"]; }, { readonly name: "0x1::voting::Proposal"; readonly doc: "Extra metadata (e.g. description, code url) can be part of the ProposalType struct."; readonly fields: readonly [{ readonly name: "proposer"; readonly doc: "Required. The address of the proposer."; readonly ty: "address"; }, { readonly name: "execution_content"; readonly doc: "Required. Should contain enough information to execute later, for example the required capability.\nThis is stored as an option so we can return it to governance when the proposal is resolved."; readonly ty: { readonly struct: { readonly name: "0x1::option::Option"; readonly ty_args: readonly [{ readonly type_param: 0; }]; }; }; }, { readonly name: "metadata"; readonly doc: "Optional. Extra metadata about the proposal and can be empty.\nValue is serialized value of an attribute."; readonly ty: { readonly struct: { readonly name: "0x1::simple_map::SimpleMap"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::string::String"; }; }, { readonly vector: "u8"; }]; }; }; }, { readonly name: "creation_time_secs"; readonly doc: "Timestamp when the proposal was created."; readonly ty: "u64"; }, { readonly name: "execution_hash"; readonly doc: "Required. The hash for the execution script module. Only the same exact script module can resolve this\nproposal."; readonly ty: { readonly vector: "u8"; }; }, { readonly name: "min_vote_threshold"; readonly doc: "A proposal is only resolved if expiration has passed and the number of votes is above threshold."; readonly ty: "u128"; }, { readonly name: "expiration_secs"; readonly ty: "u64"; }, { readonly name: "early_resolution_vote_threshold"; readonly doc: "Optional. Early resolution threshold. If specified, the proposal can be resolved early if the total\nnumber of yes or no votes passes this threshold.\nFor example, this can be set to 50% of the total supply of the voting token, so if > 50% vote yes or no,\nthe proposal can be resolved before expiration."; readonly ty: { readonly struct: { readonly name: "0x1::option::Option"; readonly ty_args: readonly ["u128"]; }; }; }, { readonly name: "yes_votes"; readonly doc: "Number of votes for each outcome.\nu128 since the voting power is already u64 and can add up to more than u64 can hold."; readonly ty: "u128"; }, { readonly name: "no_votes"; readonly ty: "u128"; }, { readonly name: "is_resolved"; readonly doc: "Whether the proposal has been resolved."; readonly ty: "bool"; }]; readonly type_params: readonly [{ readonly name: "ProposalType"; }]; readonly abilities: readonly ["store"]; }, { readonly name: "0x1::voting::RegisterForumEvent"; readonly fields: readonly [{ readonly name: "hosting_account"; readonly ty: "address"; }, { readonly name: "proposal_type_info"; readonly ty: { readonly struct: { readonly name: "0x1::type_info::TypeInfo"; }; }; }]; readonly abilities: readonly ["drop", "store"]; }, { readonly name: "0x1::voting::ResolveProposal"; readonly fields: readonly [{ readonly name: "proposal_id"; readonly ty: "u64"; }, { readonly name: "yes_votes"; readonly ty: "u128"; }, { readonly name: "no_votes"; readonly ty: "u128"; }, { readonly name: "resolved_early"; readonly ty: "bool"; }]; readonly abilities: readonly ["drop", "store"]; }, { readonly name: "0x1::voting::VoteEvent"; readonly fields: readonly [{ readonly name: "proposal_id"; readonly ty: "u64"; }, { readonly name: "num_votes"; readonly ty: "u64"; }]; readonly abilities: readonly ["drop", "store"]; }, { readonly name: "0x1::voting::VotingEvents"; readonly fields: readonly [{ readonly name: "create_proposal_events"; readonly ty: { readonly struct: { readonly name: "0x1::event::EventHandle"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::voting::CreateProposalEvent"; }; }]; }; }; }, { readonly name: "register_forum_events"; readonly ty: { readonly struct: { readonly name: "0x1::event::EventHandle"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::voting::RegisterForumEvent"; }; }]; }; }; }, { readonly name: "resolve_proposal_events"; readonly ty: { readonly struct: { readonly name: "0x1::event::EventHandle"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::voting::ResolveProposal"; }; }]; }; }; }, { readonly name: "vote_events"; readonly ty: { readonly struct: { readonly name: "0x1::event::EventHandle"; readonly ty_args: readonly [{ readonly struct: { readonly name: "0x1::voting::VoteEvent"; }; }]; }; }; }]; readonly abilities: readonly ["store"]; }, { readonly name: "0x1::voting::VotingForum"; readonly fields: readonly [{ readonly name: "proposals"; readonly doc: "Use Table for execution optimization instead of Vector for gas cost since Vector is read entirely into memory\nduring execution while only relevant Table entries are."; readonly ty: { readonly struct: { readonly name: "0x1::table::Table"; readonly ty_args: readonly ["u64", { readonly struct: { readonly name: "0x1::voting::Proposal"; readonly ty_args: readonly [{ readonly type_param: 0; }]; }; }]; }; }; }, { readonly name: "events"; readonly ty: { readonly struct: { readonly name: "0x1::voting::VotingEvents"; }; }; }, { readonly name: "next_proposal_id"; readonly doc: "Unique identifier for a proposal. This allows for 2 * 10**19 proposals."; readonly ty: "u64"; }]; readonly type_params: readonly [{ readonly name: "ProposalType"; }]; readonly abilities: readonly ["key"]; }]; readonly errors: { readonly "1": { readonly name: "EPROPOSAL_EXECUTION_HASH_NOT_MATCHING"; readonly doc: "Current script's execution hash does not match the specified proposal's"; }; readonly "2": { readonly name: "EPROPOSAL_CANNOT_BE_RESOLVED"; readonly doc: "Proposal cannot be resolved. Either voting duration has not passed, not enough votes, or fewer yes than no votes"; }; readonly "3": { readonly name: "EPROPOSAL_ALREADY_RESOLVED"; readonly doc: "Proposal cannot be resolved more than once"; }; readonly "4": { readonly name: "EPROPOSAL_EMPTY_EXECUTION_HASH"; readonly doc: "Proposal cannot contain an empty execution script hash"; }; }; }; //# sourceMappingURL=idl.d.ts.map