UNPKG

@vocdoni/davinci-contracts

Version:

Smart contracts powering DAVINCI's digital voting protocol

68 lines (67 loc) 4.37 kB
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers"; import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "../../common"; export interface ICensusValidatorInterface extends Interface { getFunction(nameOrSignature: "getCensusRoot" | "getRootBlockNumber" | "getTotalVotingPowerAtRoot"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "WeightChanged"): EventFragment; encodeFunctionData(functionFragment: "getCensusRoot", values?: undefined): string; encodeFunctionData(functionFragment: "getRootBlockNumber", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "getTotalVotingPowerAtRoot", values: [BigNumberish]): string; decodeFunctionResult(functionFragment: "getCensusRoot", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getRootBlockNumber", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getTotalVotingPowerAtRoot", data: BytesLike): Result; } export declare namespace WeightChangedEvent { type InputTuple = [ account: AddressLike, previousWeight: BigNumberish, newWeight: BigNumberish ]; type OutputTuple = [ account: string, previousWeight: bigint, newWeight: bigint ]; interface OutputObject { account: string; previousWeight: bigint; newWeight: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface ICensusValidator extends BaseContract { connect(runner?: ContractRunner | null): ICensusValidator; waitForDeployment(): Promise<this>; interface: ICensusValidatorInterface; queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>; queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>; on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>; on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>; once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>; once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>; listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>; listeners(eventName?: string): Promise<Array<Listener>>; removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>; getCensusRoot: TypedContractMethod<[], [bigint], "view">; getRootBlockNumber: TypedContractMethod<[ root: BigNumberish ], [ bigint ], "view">; getTotalVotingPowerAtRoot: TypedContractMethod<[ root: BigNumberish ], [ bigint ], "view">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "getCensusRoot"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getRootBlockNumber"): TypedContractMethod<[root: BigNumberish], [bigint], "view">; getFunction(nameOrSignature: "getTotalVotingPowerAtRoot"): TypedContractMethod<[root: BigNumberish], [bigint], "view">; getEvent(key: "WeightChanged"): TypedContractEvent<WeightChangedEvent.InputTuple, WeightChangedEvent.OutputTuple, WeightChangedEvent.OutputObject>; filters: { "WeightChanged(address,uint88,uint88)": TypedContractEvent<WeightChangedEvent.InputTuple, WeightChangedEvent.OutputTuple, WeightChangedEvent.OutputObject>; WeightChanged: TypedContractEvent<WeightChangedEvent.InputTuple, WeightChangedEvent.OutputTuple, WeightChangedEvent.OutputObject>; }; }