@idle-finance/hardhat-proposals-plugin
Version:
Hardhat plugin for governance proposals
73 lines • 3.1 kB
TypeScript
import { BigNumber, BytesLike, Contract, Signer, BigNumberish } from "ethers";
import { Result } from "ethers/lib/utils";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { GovernorAlpha, VotingToken } from "../ethers-contracts/index";
import { Proposal, ProposalBuilder } from "./proposal";
import { ContractLike, ContractOptional, IAction } from "./types";
export declare enum AlphaProposalState {
PENDING = 0,
ACTIVE = 1,
CANCELED = 2,
DEFEATED = 3,
SUCCEDED = 4,
QUEUED = 5,
EXPIRED = 6,
EXECUTED = 7
}
export interface IAlphaProposalAction extends IAction {
contract: ContractOptional;
args: Result;
}
export declare class AlphaProposal extends Proposal {
state: AlphaProposalState;
votingToken?: VotingToken;
governor?: GovernorAlpha;
proposer?: Signer;
id: BigNumber;
description: string;
contracts: ContractOptional[];
args: Result[];
constructor(hre: HardhatRuntimeEnvironment, governor?: ContractLike, votingToken?: ContractLike);
addAction(action: IAlphaProposalAction): void;
setProposer(proposer: Signer): void;
setGovernor(governor: ContractLike): void;
setVotingToken(votingToken: ContractLike): void;
propose(proposer?: Signer): Promise<void>;
loadProposal(data: BigNumberish): Promise<AlphaProposal>;
private getProposalState;
vote(signer: Signer, support?: boolean): Promise<void>;
queue(signer?: Signer): Promise<void>;
execute(signer?: Signer): Promise<void>;
/**
* This method will simulate the proposal using the full on-chain process.
* This may take significant time depending on the hardware you are using.
*
* @notice For this method to work the proposal must have a proposer with enough votes to reach quorem
*/
_fullSimulate(): Promise<void>;
_simulate(): Promise<void>;
printProposalInfo(): Promise<void>;
}
export declare class AlphaProposalBuilder extends ProposalBuilder {
maxActions: number;
proposal: AlphaProposal;
constructor(hre: HardhatRuntimeEnvironment, governor?: ContractLike, votingToken?: ContractLike, maxActions?: number);
setGovernor(governor: ContractLike): AlphaProposalBuilder;
setVotingToken(votingToken: ContractLike): AlphaProposalBuilder;
addAction(target: string, value: BigNumberish, signature: string, calldata: BytesLike): AlphaProposalBuilder;
addContractAction(contract: Contract, method: string, functionArgs: any[], value?: BigNumberish): AlphaProposalBuilder;
setProposer(proposer: Signer): AlphaProposalBuilder;
/**
* Set the description for the proposal
*
* Some UI interfaces for proposals require a newline `\n`
* be added in the description to partition the proposal
* title and the proposal description. It is at the users
* descresion whether to add this or not.
*
* @param description The description field to set for the proposal
*/
setDescription(description: string): AlphaProposalBuilder;
build(): AlphaProposal;
}
//# sourceMappingURL=compound-alpha.d.ts.map