UNPKG

@vocdoni/davinci-contracts

Version:

Smart contracts powering DAVINCI's digital voting protocol

372 lines (371 loc) 21.5 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 declare namespace ISequencerRegistry { type SequencerStruct = { exists: boolean; active: boolean; stake: BigNumberish; capacity: BigNumberish; registeredAt: BigNumberish; lastWithdrawalRequest: BigNumberish; }; type SequencerStructOutput = [ exists: boolean, active: boolean, stake: bigint, capacity: bigint, registeredAt: bigint, lastWithdrawalRequest: bigint ] & { exists: boolean; active: boolean; stake: bigint; capacity: bigint; registeredAt: bigint; lastWithdrawalRequest: bigint; }; } export interface ISequencerRegistryInterface extends Interface { getFunction(nameOrSignature: "addReward" | "addStake" | "chainID" | "claimRewards" | "deleteSequencer" | "getCapacity" | "getSequencer" | "isActive" | "minStake" | "pendingRewards" | "processManager" | "register" | "requestWithdraw" | "setActive" | "setInactive" | "setMinStake" | "setProcessManager" | "setVocToken" | "setWithdrawalCooldown" | "slash" | "vocToken" | "withdraw" | "withdrawalCooldown"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "Deposit" | "Registered" | "RewardAdded" | "RewardClaimed" | "SequencerDeleted" | "SequencerDisabled" | "SequencerEnabled" | "Slashed" | "WithdrawalRequested" | "Withdrawn"): EventFragment; encodeFunctionData(functionFragment: "addReward", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "addStake", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "chainID", values?: undefined): string; encodeFunctionData(functionFragment: "claimRewards", values?: undefined): string; encodeFunctionData(functionFragment: "deleteSequencer", values?: undefined): string; encodeFunctionData(functionFragment: "getCapacity", values: [AddressLike]): string; encodeFunctionData(functionFragment: "getSequencer", values: [AddressLike]): string; encodeFunctionData(functionFragment: "isActive", values: [AddressLike]): string; encodeFunctionData(functionFragment: "minStake", values?: undefined): string; encodeFunctionData(functionFragment: "pendingRewards", values: [AddressLike]): string; encodeFunctionData(functionFragment: "processManager", values?: undefined): string; encodeFunctionData(functionFragment: "register", values: [BigNumberish, BigNumberish]): string; encodeFunctionData(functionFragment: "requestWithdraw", values?: undefined): string; encodeFunctionData(functionFragment: "setActive", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setInactive", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setMinStake", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "setProcessManager", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setVocToken", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setWithdrawalCooldown", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "slash", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "vocToken", values?: undefined): string; encodeFunctionData(functionFragment: "withdraw", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "withdrawalCooldown", values?: undefined): string; decodeFunctionResult(functionFragment: "addReward", data: BytesLike): Result; decodeFunctionResult(functionFragment: "addStake", data: BytesLike): Result; decodeFunctionResult(functionFragment: "chainID", data: BytesLike): Result; decodeFunctionResult(functionFragment: "claimRewards", data: BytesLike): Result; decodeFunctionResult(functionFragment: "deleteSequencer", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getCapacity", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getSequencer", data: BytesLike): Result; decodeFunctionResult(functionFragment: "isActive", data: BytesLike): Result; decodeFunctionResult(functionFragment: "minStake", data: BytesLike): Result; decodeFunctionResult(functionFragment: "pendingRewards", data: BytesLike): Result; decodeFunctionResult(functionFragment: "processManager", data: BytesLike): Result; decodeFunctionResult(functionFragment: "register", data: BytesLike): Result; decodeFunctionResult(functionFragment: "requestWithdraw", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setActive", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setInactive", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setMinStake", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setProcessManager", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setVocToken", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setWithdrawalCooldown", data: BytesLike): Result; decodeFunctionResult(functionFragment: "slash", data: BytesLike): Result; decodeFunctionResult(functionFragment: "vocToken", data: BytesLike): Result; decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; decodeFunctionResult(functionFragment: "withdrawalCooldown", data: BytesLike): Result; } export declare namespace DepositEvent { type InputTuple = [ sequencer: AddressLike, capacity: BigNumberish, stake: BigNumberish ]; type OutputTuple = [ sequencer: string, capacity: bigint, stake: bigint ]; interface OutputObject { sequencer: string; capacity: bigint; stake: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace RegisteredEvent { type InputTuple = [ sequencer: AddressLike, capacity: BigNumberish, stake: BigNumberish ]; type OutputTuple = [ sequencer: string, capacity: bigint, stake: bigint ]; interface OutputObject { sequencer: string; capacity: bigint; stake: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace RewardAddedEvent { type InputTuple = [sequencer: AddressLike, amount: BigNumberish]; type OutputTuple = [sequencer: string, amount: bigint]; interface OutputObject { sequencer: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace RewardClaimedEvent { type InputTuple = [sequencer: AddressLike, amount: BigNumberish]; type OutputTuple = [sequencer: string, amount: bigint]; interface OutputObject { sequencer: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace SequencerDeletedEvent { type InputTuple = [sequencer: AddressLike]; type OutputTuple = [sequencer: string]; interface OutputObject { sequencer: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace SequencerDisabledEvent { type InputTuple = [sequencer: AddressLike]; type OutputTuple = [sequencer: string]; interface OutputObject { sequencer: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace SequencerEnabledEvent { type InputTuple = [sequencer: AddressLike]; type OutputTuple = [sequencer: string]; interface OutputObject { sequencer: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace SlashedEvent { type InputTuple = [sequencer: AddressLike, amount: BigNumberish]; type OutputTuple = [sequencer: string, amount: bigint]; interface OutputObject { sequencer: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace WithdrawalRequestedEvent { type InputTuple = [sequencer: AddressLike, time: BigNumberish]; type OutputTuple = [sequencer: string, time: bigint]; interface OutputObject { sequencer: string; time: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace WithdrawnEvent { type InputTuple = [sequencer: AddressLike, amount: BigNumberish]; type OutputTuple = [sequencer: string, amount: bigint]; interface OutputObject { sequencer: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface ISequencerRegistry extends BaseContract { connect(runner?: ContractRunner | null): ISequencerRegistry; waitForDeployment(): Promise<this>; interface: ISequencerRegistryInterface; 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>; addReward: TypedContractMethod<[ _sequencer: AddressLike, _amount: BigNumberish ], [ void ], "nonpayable">; addStake: TypedContractMethod<[_amount: BigNumberish], [void], "nonpayable">; chainID: TypedContractMethod<[], [string], "view">; claimRewards: TypedContractMethod<[], [void], "nonpayable">; deleteSequencer: TypedContractMethod<[], [void], "nonpayable">; getCapacity: TypedContractMethod<[_sequencer: AddressLike], [bigint], "view">; getSequencer: TypedContractMethod<[ _sequencer: AddressLike ], [ ISequencerRegistry.SequencerStructOutput ], "view">; isActive: TypedContractMethod<[_sequencer: AddressLike], [boolean], "view">; minStake: TypedContractMethod<[], [bigint], "view">; pendingRewards: TypedContractMethod<[ _sequencer: AddressLike ], [ bigint ], "view">; processManager: TypedContractMethod<[], [string], "view">; register: TypedContractMethod<[ _capacity: BigNumberish, _stake: BigNumberish ], [ void ], "nonpayable">; requestWithdraw: TypedContractMethod<[], [void], "nonpayable">; setActive: TypedContractMethod<[ _sequencer: AddressLike ], [ void ], "nonpayable">; setInactive: TypedContractMethod<[ _sequencer: AddressLike ], [ void ], "nonpayable">; setMinStake: TypedContractMethod<[ _minStake: BigNumberish ], [ void ], "nonpayable">; setProcessManager: TypedContractMethod<[ _processManager: AddressLike ], [ void ], "nonpayable">; setVocToken: TypedContractMethod<[ _vocToken: AddressLike ], [ void ], "nonpayable">; setWithdrawalCooldown: TypedContractMethod<[ _cooldown: BigNumberish ], [ void ], "nonpayable">; slash: TypedContractMethod<[ _sequencer: AddressLike, _amount: BigNumberish ], [ void ], "nonpayable">; vocToken: TypedContractMethod<[], [string], "view">; withdraw: TypedContractMethod<[_amount: BigNumberish], [void], "nonpayable">; withdrawalCooldown: TypedContractMethod<[], [bigint], "view">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "addReward"): TypedContractMethod<[ _sequencer: AddressLike, _amount: BigNumberish ], [ void ], "nonpayable">; getFunction(nameOrSignature: "addStake"): TypedContractMethod<[_amount: BigNumberish], [void], "nonpayable">; getFunction(nameOrSignature: "chainID"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "claimRewards"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "deleteSequencer"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "getCapacity"): TypedContractMethod<[_sequencer: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "getSequencer"): TypedContractMethod<[ _sequencer: AddressLike ], [ ISequencerRegistry.SequencerStructOutput ], "view">; getFunction(nameOrSignature: "isActive"): TypedContractMethod<[_sequencer: AddressLike], [boolean], "view">; getFunction(nameOrSignature: "minStake"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "pendingRewards"): TypedContractMethod<[_sequencer: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "processManager"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "register"): TypedContractMethod<[ _capacity: BigNumberish, _stake: BigNumberish ], [ void ], "nonpayable">; getFunction(nameOrSignature: "requestWithdraw"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "setActive"): TypedContractMethod<[_sequencer: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "setInactive"): TypedContractMethod<[_sequencer: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "setMinStake"): TypedContractMethod<[_minStake: BigNumberish], [void], "nonpayable">; getFunction(nameOrSignature: "setProcessManager"): TypedContractMethod<[_processManager: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "setVocToken"): TypedContractMethod<[_vocToken: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "setWithdrawalCooldown"): TypedContractMethod<[_cooldown: BigNumberish], [void], "nonpayable">; getFunction(nameOrSignature: "slash"): TypedContractMethod<[ _sequencer: AddressLike, _amount: BigNumberish ], [ void ], "nonpayable">; getFunction(nameOrSignature: "vocToken"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "withdraw"): TypedContractMethod<[_amount: BigNumberish], [void], "nonpayable">; getFunction(nameOrSignature: "withdrawalCooldown"): TypedContractMethod<[], [bigint], "view">; getEvent(key: "Deposit"): TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>; getEvent(key: "Registered"): TypedContractEvent<RegisteredEvent.InputTuple, RegisteredEvent.OutputTuple, RegisteredEvent.OutputObject>; getEvent(key: "RewardAdded"): TypedContractEvent<RewardAddedEvent.InputTuple, RewardAddedEvent.OutputTuple, RewardAddedEvent.OutputObject>; getEvent(key: "RewardClaimed"): TypedContractEvent<RewardClaimedEvent.InputTuple, RewardClaimedEvent.OutputTuple, RewardClaimedEvent.OutputObject>; getEvent(key: "SequencerDeleted"): TypedContractEvent<SequencerDeletedEvent.InputTuple, SequencerDeletedEvent.OutputTuple, SequencerDeletedEvent.OutputObject>; getEvent(key: "SequencerDisabled"): TypedContractEvent<SequencerDisabledEvent.InputTuple, SequencerDisabledEvent.OutputTuple, SequencerDisabledEvent.OutputObject>; getEvent(key: "SequencerEnabled"): TypedContractEvent<SequencerEnabledEvent.InputTuple, SequencerEnabledEvent.OutputTuple, SequencerEnabledEvent.OutputObject>; getEvent(key: "Slashed"): TypedContractEvent<SlashedEvent.InputTuple, SlashedEvent.OutputTuple, SlashedEvent.OutputObject>; getEvent(key: "WithdrawalRequested"): TypedContractEvent<WithdrawalRequestedEvent.InputTuple, WithdrawalRequestedEvent.OutputTuple, WithdrawalRequestedEvent.OutputObject>; getEvent(key: "Withdrawn"): TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>; filters: { "Deposit(address,uint256,uint256)": TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>; Deposit: TypedContractEvent<DepositEvent.InputTuple, DepositEvent.OutputTuple, DepositEvent.OutputObject>; "Registered(address,uint256,uint256)": TypedContractEvent<RegisteredEvent.InputTuple, RegisteredEvent.OutputTuple, RegisteredEvent.OutputObject>; Registered: TypedContractEvent<RegisteredEvent.InputTuple, RegisteredEvent.OutputTuple, RegisteredEvent.OutputObject>; "RewardAdded(address,uint256)": TypedContractEvent<RewardAddedEvent.InputTuple, RewardAddedEvent.OutputTuple, RewardAddedEvent.OutputObject>; RewardAdded: TypedContractEvent<RewardAddedEvent.InputTuple, RewardAddedEvent.OutputTuple, RewardAddedEvent.OutputObject>; "RewardClaimed(address,uint256)": TypedContractEvent<RewardClaimedEvent.InputTuple, RewardClaimedEvent.OutputTuple, RewardClaimedEvent.OutputObject>; RewardClaimed: TypedContractEvent<RewardClaimedEvent.InputTuple, RewardClaimedEvent.OutputTuple, RewardClaimedEvent.OutputObject>; "SequencerDeleted(address)": TypedContractEvent<SequencerDeletedEvent.InputTuple, SequencerDeletedEvent.OutputTuple, SequencerDeletedEvent.OutputObject>; SequencerDeleted: TypedContractEvent<SequencerDeletedEvent.InputTuple, SequencerDeletedEvent.OutputTuple, SequencerDeletedEvent.OutputObject>; "SequencerDisabled(address)": TypedContractEvent<SequencerDisabledEvent.InputTuple, SequencerDisabledEvent.OutputTuple, SequencerDisabledEvent.OutputObject>; SequencerDisabled: TypedContractEvent<SequencerDisabledEvent.InputTuple, SequencerDisabledEvent.OutputTuple, SequencerDisabledEvent.OutputObject>; "SequencerEnabled(address)": TypedContractEvent<SequencerEnabledEvent.InputTuple, SequencerEnabledEvent.OutputTuple, SequencerEnabledEvent.OutputObject>; SequencerEnabled: TypedContractEvent<SequencerEnabledEvent.InputTuple, SequencerEnabledEvent.OutputTuple, SequencerEnabledEvent.OutputObject>; "Slashed(address,uint256)": TypedContractEvent<SlashedEvent.InputTuple, SlashedEvent.OutputTuple, SlashedEvent.OutputObject>; Slashed: TypedContractEvent<SlashedEvent.InputTuple, SlashedEvent.OutputTuple, SlashedEvent.OutputObject>; "WithdrawalRequested(address,uint256)": TypedContractEvent<WithdrawalRequestedEvent.InputTuple, WithdrawalRequestedEvent.OutputTuple, WithdrawalRequestedEvent.OutputObject>; WithdrawalRequested: TypedContractEvent<WithdrawalRequestedEvent.InputTuple, WithdrawalRequestedEvent.OutputTuple, WithdrawalRequestedEvent.OutputObject>; "Withdrawn(address,uint256)": TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>; Withdrawn: TypedContractEvent<WithdrawnEvent.InputTuple, WithdrawnEvent.OutputTuple, WithdrawnEvent.OutputObject>; }; }