From 3cdedddaf8faddab13a19fcfeae56fbc50f74ef3 Mon Sep 17 00:00:00 2001 From: Joaquin Battilana Date: Fri, 8 Dec 2023 01:51:49 +0000 Subject: [PATCH 01/41] feat: type generation for new contreacts gov v3 --- .../governance-data-helper/index.ts | 3 + .../typechain/GovernanceDataHelper.ts | 383 ++++ .../governance-v3/typechain/VotingMachine.ts | 1545 +++++++++++++++++ .../src/governance-v3/typechain/common.ts | 44 + .../GovernanceDataHelper__factory.ts | 328 ++++ .../factories/VotingMachine__factory.ts | 1161 +++++++++++++ .../typechain/factories/index.ts | 5 + .../src/governance-v3/typechain/index.ts | 8 + .../src/governance-v3/voting-machine/index.ts | 2 + 9 files changed, 3479 insertions(+) create mode 100644 packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/common.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/voting-machine/index.ts diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts new file mode 100644 index 00000000..906a8373 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -0,0 +1,3 @@ +export class GovernanceDataHelperService { + +} \ No newline at end of file diff --git a/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts b/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts new file mode 100644 index 00000000..33f4b806 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts @@ -0,0 +1,383 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; + +export declare namespace IGovernanceCore { + export type VotingConfigStruct = { + coolDownBeforeVotingStart: BigNumberish; + votingDuration: BigNumberish; + yesThreshold: BigNumberish; + yesNoDifferential: BigNumberish; + minPropositionPower: BigNumberish; + }; + + export type VotingConfigStructOutput = [ + number, + number, + BigNumber, + BigNumber, + BigNumber + ] & { + coolDownBeforeVotingStart: number; + votingDuration: number; + yesThreshold: BigNumber; + yesNoDifferential: BigNumber; + minPropositionPower: BigNumber; + }; + + export type ProposalStruct = { + state: BigNumberish; + accessLevel: BigNumberish; + creationTime: BigNumberish; + votingDuration: BigNumberish; + votingActivationTime: BigNumberish; + queuingTime: BigNumberish; + cancelTimestamp: BigNumberish; + creator: string; + votingPortal: string; + snapshotBlockHash: BytesLike; + ipfsHash: BytesLike; + forVotes: BigNumberish; + againstVotes: BigNumberish; + cancellationFee: BigNumberish; + payloads: PayloadsControllerUtils.PayloadStruct[]; + }; + + export type ProposalStructOutput = [ + number, + number, + number, + number, + number, + number, + number, + string, + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + PayloadsControllerUtils.PayloadStructOutput[] + ] & { + state: number; + accessLevel: number; + creationTime: number; + votingDuration: number; + votingActivationTime: number; + queuingTime: number; + cancelTimestamp: number; + creator: string; + votingPortal: string; + snapshotBlockHash: string; + ipfsHash: string; + forVotes: BigNumber; + againstVotes: BigNumber; + cancellationFee: BigNumber; + payloads: PayloadsControllerUtils.PayloadStructOutput[]; + }; +} + +export declare namespace IGovernanceDataHelper { + export type VotingConfigStruct = { + accessLevel: BigNumberish; + config: IGovernanceCore.VotingConfigStruct; + }; + + export type VotingConfigStructOutput = [ + number, + IGovernanceCore.VotingConfigStructOutput + ] & { accessLevel: number; config: IGovernanceCore.VotingConfigStructOutput }; + + export type ConstantsStruct = { + votingConfigs: IGovernanceDataHelper.VotingConfigStruct[]; + precisionDivider: BigNumberish; + cooldownPeriod: BigNumberish; + expirationTime: BigNumberish; + cancellationFee: BigNumberish; + }; + + export type ConstantsStructOutput = [ + IGovernanceDataHelper.VotingConfigStructOutput[], + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + votingConfigs: IGovernanceDataHelper.VotingConfigStructOutput[]; + precisionDivider: BigNumber; + cooldownPeriod: BigNumber; + expirationTime: BigNumber; + cancellationFee: BigNumber; + }; + + export type ProposalStruct = { + id: BigNumberish; + votingChainId: BigNumberish; + proposalData: IGovernanceCore.ProposalStruct; + }; + + export type ProposalStructOutput = [ + BigNumber, + BigNumber, + IGovernanceCore.ProposalStructOutput + ] & { + id: BigNumber; + votingChainId: BigNumber; + proposalData: IGovernanceCore.ProposalStructOutput; + }; + + export type RepresentativesStruct = { + chainId: BigNumberish; + representative: string; + }; + + export type RepresentativesStructOutput = [BigNumber, string] & { + chainId: BigNumber; + representative: string; + }; + + export type RepresentedStruct = { + chainId: BigNumberish; + votersRepresented: string[]; + }; + + export type RepresentedStructOutput = [BigNumber, string[]] & { + chainId: BigNumber; + votersRepresented: string[]; + }; +} + +export declare namespace PayloadsControllerUtils { + export type PayloadStruct = { + chain: BigNumberish; + accessLevel: BigNumberish; + payloadsController: string; + payloadId: BigNumberish; + }; + + export type PayloadStructOutput = [BigNumber, number, string, number] & { + chain: BigNumber; + accessLevel: number; + payloadsController: string; + payloadId: number; + }; +} + +export interface GovernanceDataHelperInterface extends utils.Interface { + functions: { + "getConstants(address,uint8[])": FunctionFragment; + "getProposalsData(address,uint256,uint256,uint256)": FunctionFragment; + "getRepresentationData(address,address,uint256[])": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "getConstants" + | "getProposalsData" + | "getRepresentationData" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "getConstants", + values: [string, BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "getProposalsData", + values: [string, BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getRepresentationData", + values: [string, string, BigNumberish[]] + ): string; + + decodeFunctionResult( + functionFragment: "getConstants", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProposalsData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRepresentationData", + data: BytesLike + ): Result; + + events: {}; +} + +export interface GovernanceDataHelper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: GovernanceDataHelperInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + getConstants( + govCore: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides + ): Promise<[IGovernanceDataHelper.ConstantsStructOutput]>; + + getProposalsData( + govCore: string, + from: BigNumberish, + to: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise<[IGovernanceDataHelper.ProposalStructOutput[]]>; + + getRepresentationData( + govCore: string, + wallet: string, + chainIds: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [ + IGovernanceDataHelper.RepresentativesStructOutput[], + IGovernanceDataHelper.RepresentedStructOutput[] + ] + >; + }; + + getConstants( + govCore: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getProposalsData( + govCore: string, + from: BigNumberish, + to: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRepresentationData( + govCore: string, + wallet: string, + chainIds: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [ + IGovernanceDataHelper.RepresentativesStructOutput[], + IGovernanceDataHelper.RepresentedStructOutput[] + ] + >; + + callStatic: { + getConstants( + govCore: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getProposalsData( + govCore: string, + from: BigNumberish, + to: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRepresentationData( + govCore: string, + wallet: string, + chainIds: BigNumberish[], + overrides?: CallOverrides + ): Promise< + [ + IGovernanceDataHelper.RepresentativesStructOutput[], + IGovernanceDataHelper.RepresentedStructOutput[] + ] + >; + }; + + filters: {}; + + estimateGas: { + getConstants( + govCore: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getProposalsData( + govCore: string, + from: BigNumberish, + to: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRepresentationData( + govCore: string, + wallet: string, + chainIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + getConstants( + govCore: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides + ): Promise; + + getProposalsData( + govCore: string, + from: BigNumberish, + to: BigNumberish, + pageSize: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getRepresentationData( + govCore: string, + wallet: string, + chainIds: BigNumberish[], + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts b/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts new file mode 100644 index 00000000..317f0557 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts @@ -0,0 +1,1545 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; + +export declare namespace IVotingMachineWithProofs { + export type VotingAssetWithSlotStruct = { + underlyingAsset: string; + slot: BigNumberish; + }; + + export type VotingAssetWithSlotStructOutput = [string, BigNumber] & { + underlyingAsset: string; + slot: BigNumber; + }; + + export type ProposalWithoutVotesStruct = { + id: BigNumberish; + sentToGovernance: boolean; + startTime: BigNumberish; + endTime: BigNumberish; + votingClosedAndSentTimestamp: BigNumberish; + forVotes: BigNumberish; + againstVotes: BigNumberish; + creationBlockNumber: BigNumberish; + votingClosedAndSentBlockNumber: BigNumberish; + }; + + export type ProposalWithoutVotesStructOutput = [ + BigNumber, + boolean, + number, + number, + number, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ] & { + id: BigNumber; + sentToGovernance: boolean; + startTime: number; + endTime: number; + votingClosedAndSentTimestamp: number; + forVotes: BigNumber; + againstVotes: BigNumber; + creationBlockNumber: BigNumber; + votingClosedAndSentBlockNumber: BigNumber; + }; + + export type ProposalVoteConfigurationStruct = { + votingDuration: BigNumberish; + l1ProposalBlockHash: BytesLike; + }; + + export type ProposalVoteConfigurationStructOutput = [number, string] & { + votingDuration: number; + l1ProposalBlockHash: string; + }; + + export type VoteStruct = { support: boolean; votingPower: BigNumberish }; + + export type VoteStructOutput = [boolean, BigNumber] & { + support: boolean; + votingPower: BigNumber; + }; + + export type VotingBalanceProofStruct = { + underlyingAsset: string; + slot: BigNumberish; + proof: BytesLike; + }; + + export type VotingBalanceProofStructOutput = [string, BigNumber, string] & { + underlyingAsset: string; + slot: BigNumber; + proof: string; + }; + + export type SignatureParamsStruct = { + v: BigNumberish; + r: BytesLike; + s: BytesLike; + }; + + export type SignatureParamsStructOutput = [number, string, string] & { + v: number; + r: string; + s: string; + }; +} + +export interface VotingMachineInterface extends utils.Interface { + functions: { + "CROSS_CHAIN_CONTROLLER()": FunctionFragment; + "DATA_WAREHOUSE()": FunctionFragment; + "DOMAIN_SEPARATOR()": FunctionFragment; + "GOVERNANCE()": FunctionFragment; + "L1_VOTING_PORTAL()": FunctionFragment; + "L1_VOTING_PORTAL_CHAIN_ID()": FunctionFragment; + "NAME()": FunctionFragment; + "REPRESENTATIVES_SLOT()": FunctionFragment; + "VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH()": FunctionFragment; + "VOTE_SUBMITTED_TYPEHASH()": FunctionFragment; + "VOTING_ASSET_WITH_SLOT_RAW()": FunctionFragment; + "VOTING_ASSET_WITH_SLOT_TYPEHASH()": FunctionFragment; + "VOTING_STRATEGY()": FunctionFragment; + "closeAndSendVote(uint256)": FunctionFragment; + "decodeMessage(bytes)": FunctionFragment; + "decodeProposalMessage(bytes)": FunctionFragment; + "decodeVoteMessage(bytes)": FunctionFragment; + "eip712Domain()": FunctionFragment; + "getGasLimit()": FunctionFragment; + "getProposalById(uint256)": FunctionFragment; + "getProposalState(uint256)": FunctionFragment; + "getProposalVoteConfiguration(uint256)": FunctionFragment; + "getProposalsVoteConfigurationIds(uint256,uint256)": FunctionFragment; + "getUserProposalVote(address,uint256)": FunctionFragment; + "owner()": FunctionFragment; + "receiveCrossChainMessage(address,uint256,bytes)": FunctionFragment; + "renounceOwnership()": FunctionFragment; + "startProposalVote(uint256)": FunctionFragment; + "submitVote(uint256,bool,(address,uint128,bytes)[])": FunctionFragment; + "submitVoteAsRepresentative(uint256,bool,address,bytes,(address,uint128,bytes)[])": FunctionFragment; + "submitVoteAsRepresentativeBySignature(uint256,address,address,bool,bytes,(address,uint128,bytes)[],(uint8,bytes32,bytes32))": FunctionFragment; + "submitVoteBySignature(uint256,address,bool,(address,uint128,bytes)[],uint8,bytes32,bytes32)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + "updateGasLimit(uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "CROSS_CHAIN_CONTROLLER" + | "DATA_WAREHOUSE" + | "DOMAIN_SEPARATOR" + | "GOVERNANCE" + | "L1_VOTING_PORTAL" + | "L1_VOTING_PORTAL_CHAIN_ID" + | "NAME" + | "REPRESENTATIVES_SLOT" + | "VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH" + | "VOTE_SUBMITTED_TYPEHASH" + | "VOTING_ASSET_WITH_SLOT_RAW" + | "VOTING_ASSET_WITH_SLOT_TYPEHASH" + | "VOTING_STRATEGY" + | "closeAndSendVote" + | "decodeMessage" + | "decodeProposalMessage" + | "decodeVoteMessage" + | "eip712Domain" + | "getGasLimit" + | "getProposalById" + | "getProposalState" + | "getProposalVoteConfiguration" + | "getProposalsVoteConfigurationIds" + | "getUserProposalVote" + | "owner" + | "receiveCrossChainMessage" + | "renounceOwnership" + | "startProposalVote" + | "submitVote" + | "submitVoteAsRepresentative" + | "submitVoteAsRepresentativeBySignature" + | "submitVoteBySignature" + | "transferOwnership" + | "updateGasLimit" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "CROSS_CHAIN_CONTROLLER", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DATA_WAREHOUSE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "GOVERNANCE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "L1_VOTING_PORTAL", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "L1_VOTING_PORTAL_CHAIN_ID", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "NAME", values?: undefined): string; + encodeFunctionData( + functionFragment: "REPRESENTATIVES_SLOT", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "VOTE_SUBMITTED_TYPEHASH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "VOTING_ASSET_WITH_SLOT_RAW", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "VOTING_ASSET_WITH_SLOT_TYPEHASH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "VOTING_STRATEGY", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "closeAndSendVote", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "decodeMessage", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "decodeProposalMessage", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "decodeVoteMessage", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "eip712Domain", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getGasLimit", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getProposalById", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getProposalState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getProposalVoteConfiguration", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getProposalsVoteConfigurationIds", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getUserProposalVote", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "receiveCrossChainMessage", + values: [string, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "startProposalVote", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "submitVote", + values: [ + BigNumberish, + boolean, + IVotingMachineWithProofs.VotingBalanceProofStruct[] + ] + ): string; + encodeFunctionData( + functionFragment: "submitVoteAsRepresentative", + values: [ + BigNumberish, + boolean, + string, + BytesLike, + IVotingMachineWithProofs.VotingBalanceProofStruct[] + ] + ): string; + encodeFunctionData( + functionFragment: "submitVoteAsRepresentativeBySignature", + values: [ + BigNumberish, + string, + string, + boolean, + BytesLike, + IVotingMachineWithProofs.VotingBalanceProofStruct[], + IVotingMachineWithProofs.SignatureParamsStruct + ] + ): string; + encodeFunctionData( + functionFragment: "submitVoteBySignature", + values: [ + BigNumberish, + string, + boolean, + IVotingMachineWithProofs.VotingBalanceProofStruct[], + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "updateGasLimit", + values: [BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "CROSS_CHAIN_CONTROLLER", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DATA_WAREHOUSE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "GOVERNANCE", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "L1_VOTING_PORTAL", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "L1_VOTING_PORTAL_CHAIN_ID", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "NAME", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "REPRESENTATIVES_SLOT", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "VOTE_SUBMITTED_TYPEHASH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "VOTING_ASSET_WITH_SLOT_RAW", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "VOTING_ASSET_WITH_SLOT_TYPEHASH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "VOTING_STRATEGY", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "closeAndSendVote", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "decodeMessage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "decodeProposalMessage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "decodeVoteMessage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "eip712Domain", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getGasLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProposalById", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProposalState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProposalVoteConfiguration", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProposalsVoteConfigurationIds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUserProposalVote", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "receiveCrossChainMessage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "startProposalVote", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "submitVote", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "submitVoteAsRepresentative", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitVoteAsRepresentativeBySignature", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitVoteBySignature", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateGasLimit", + data: BytesLike + ): Result; + + events: { + "EIP712DomainChanged()": EventFragment; + "GasLimitUpdated(uint256)": EventFragment; + "IncorrectTypeMessageReceived(address,uint256,bytes,bytes)": EventFragment; + "MessageReceived(address,uint256,bool,uint8,bytes,bytes)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "ProposalResultsSent(uint256,uint256,uint256)": EventFragment; + "ProposalVoteConfigurationBridged(uint256,bytes32,uint24,bool)": EventFragment; + "ProposalVoteStarted(uint256,bytes32,uint256,uint256)": EventFragment; + "VoteEmitted(uint256,address,bool,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "GasLimitUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "IncorrectTypeMessageReceived" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "MessageReceived"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProposalResultsSent"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "ProposalVoteConfigurationBridged" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProposalVoteStarted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "VoteEmitted"): EventFragment; +} + +export interface EIP712DomainChangedEventObject {} +export type EIP712DomainChangedEvent = TypedEvent< + [], + EIP712DomainChangedEventObject +>; + +export type EIP712DomainChangedEventFilter = + TypedEventFilter; + +export interface GasLimitUpdatedEventObject { + gasLimit: BigNumber; +} +export type GasLimitUpdatedEvent = TypedEvent< + [BigNumber], + GasLimitUpdatedEventObject +>; + +export type GasLimitUpdatedEventFilter = TypedEventFilter; + +export interface IncorrectTypeMessageReceivedEventObject { + originSender: string; + originChainId: BigNumber; + message: string; + reason: string; +} +export type IncorrectTypeMessageReceivedEvent = TypedEvent< + [string, BigNumber, string, string], + IncorrectTypeMessageReceivedEventObject +>; + +export type IncorrectTypeMessageReceivedEventFilter = + TypedEventFilter; + +export interface MessageReceivedEventObject { + originSender: string; + originChainId: BigNumber; + delivered: boolean; + messageType: number; + message: string; + reason: string; +} +export type MessageReceivedEvent = TypedEvent< + [string, BigNumber, boolean, number, string, string], + MessageReceivedEventObject +>; + +export type MessageReceivedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +>; + +export type OwnershipTransferredEventFilter = + TypedEventFilter; + +export interface ProposalResultsSentEventObject { + proposalId: BigNumber; + forVotes: BigNumber; + againstVotes: BigNumber; +} +export type ProposalResultsSentEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + ProposalResultsSentEventObject +>; + +export type ProposalResultsSentEventFilter = + TypedEventFilter; + +export interface ProposalVoteConfigurationBridgedEventObject { + proposalId: BigNumber; + blockHash: string; + votingDuration: number; + voteCreated: boolean; +} +export type ProposalVoteConfigurationBridgedEvent = TypedEvent< + [BigNumber, string, number, boolean], + ProposalVoteConfigurationBridgedEventObject +>; + +export type ProposalVoteConfigurationBridgedEventFilter = + TypedEventFilter; + +export interface ProposalVoteStartedEventObject { + proposalId: BigNumber; + l1BlockHash: string; + startTime: BigNumber; + endTime: BigNumber; +} +export type ProposalVoteStartedEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber], + ProposalVoteStartedEventObject +>; + +export type ProposalVoteStartedEventFilter = + TypedEventFilter; + +export interface VoteEmittedEventObject { + proposalId: BigNumber; + voter: string; + support: boolean; + votingPower: BigNumber; +} +export type VoteEmittedEvent = TypedEvent< + [BigNumber, string, boolean, BigNumber], + VoteEmittedEventObject +>; + +export type VoteEmittedEventFilter = TypedEventFilter; + +export interface VotingMachine extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: VotingMachineInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CROSS_CHAIN_CONTROLLER(overrides?: CallOverrides): Promise<[string]>; + + DATA_WAREHOUSE(overrides?: CallOverrides): Promise<[string]>; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>; + + GOVERNANCE(overrides?: CallOverrides): Promise<[string]>; + + L1_VOTING_PORTAL(overrides?: CallOverrides): Promise<[string]>; + + L1_VOTING_PORTAL_CHAIN_ID(overrides?: CallOverrides): Promise<[BigNumber]>; + + NAME(overrides?: CallOverrides): Promise<[string]>; + + REPRESENTATIVES_SLOT(overrides?: CallOverrides): Promise<[BigNumber]>; + + VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH( + overrides?: CallOverrides + ): Promise<[string]>; + + VOTE_SUBMITTED_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + VOTING_ASSET_WITH_SLOT_RAW(overrides?: CallOverrides): Promise<[string]>; + + VOTING_ASSET_WITH_SLOT_TYPEHASH( + overrides?: CallOverrides + ): Promise<[string]>; + + VOTING_STRATEGY(overrides?: CallOverrides): Promise<[string]>; + + closeAndSendVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decodeMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[number, string]>; + + decodeProposalMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string, number]>; + + decodeVoteMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + string, + boolean, + IVotingMachineWithProofs.VotingAssetWithSlotStructOutput[] + ] + >; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getGasLimit(overrides?: CallOverrides): Promise<[BigNumber]>; + + getProposalById( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise<[IVotingMachineWithProofs.ProposalWithoutVotesStructOutput]>; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise<[number]>; + + getProposalVoteConfiguration( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise< + [IVotingMachineWithProofs.ProposalVoteConfigurationStructOutput] + >; + + getProposalsVoteConfigurationIds( + skip: BigNumberish, + size: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber[]]>; + + getUserProposalVote( + user: string, + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise<[IVotingMachineWithProofs.VoteStructOutput]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + receiveCrossChainMessage( + originSender: string, + originChainId: BigNumberish, + messageWithType: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + startProposalVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVote( + proposalId: BigNumberish, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentative( + proposalId: BigNumberish, + support: boolean, + voter: string, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentativeBySignature( + proposalId: BigNumberish, + voter: string, + representative: string, + support: boolean, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + signatureParams: IVotingMachineWithProofs.SignatureParamsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteBySignature( + proposalId: BigNumberish, + voter: string, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateGasLimit( + gasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + CROSS_CHAIN_CONTROLLER(overrides?: CallOverrides): Promise; + + DATA_WAREHOUSE(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + GOVERNANCE(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL_CHAIN_ID(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + REPRESENTATIVES_SLOT(overrides?: CallOverrides): Promise; + + VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTE_SUBMITTED_TYPEHASH(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_RAW(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_TYPEHASH(overrides?: CallOverrides): Promise; + + VOTING_STRATEGY(overrides?: CallOverrides): Promise; + + closeAndSendVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decodeMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[number, string]>; + + decodeProposalMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string, number]>; + + decodeVoteMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + string, + boolean, + IVotingMachineWithProofs.VotingAssetWithSlotStructOutput[] + ] + >; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getGasLimit(overrides?: CallOverrides): Promise; + + getProposalById( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalVoteConfiguration( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalsVoteConfigurationIds( + skip: BigNumberish, + size: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getUserProposalVote( + user: string, + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + receiveCrossChainMessage( + originSender: string, + originChainId: BigNumberish, + messageWithType: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + startProposalVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVote( + proposalId: BigNumberish, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentative( + proposalId: BigNumberish, + support: boolean, + voter: string, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentativeBySignature( + proposalId: BigNumberish, + voter: string, + representative: string, + support: boolean, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + signatureParams: IVotingMachineWithProofs.SignatureParamsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteBySignature( + proposalId: BigNumberish, + voter: string, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateGasLimit( + gasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + CROSS_CHAIN_CONTROLLER(overrides?: CallOverrides): Promise; + + DATA_WAREHOUSE(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + GOVERNANCE(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL_CHAIN_ID(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + REPRESENTATIVES_SLOT(overrides?: CallOverrides): Promise; + + VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTE_SUBMITTED_TYPEHASH(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_RAW(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_TYPEHASH(overrides?: CallOverrides): Promise; + + VOTING_STRATEGY(overrides?: CallOverrides): Promise; + + closeAndSendVote( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + decodeMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[number, string]>; + + decodeProposalMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise<[BigNumber, string, number]>; + + decodeVoteMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + string, + boolean, + IVotingMachineWithProofs.VotingAssetWithSlotStructOutput[] + ] + >; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getGasLimit(overrides?: CallOverrides): Promise; + + getProposalById( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalVoteConfiguration( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalsVoteConfigurationIds( + skip: BigNumberish, + size: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getUserProposalVote( + user: string, + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + receiveCrossChainMessage( + originSender: string, + originChainId: BigNumberish, + messageWithType: BytesLike, + overrides?: CallOverrides + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + startProposalVote( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + submitVote( + proposalId: BigNumberish, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: CallOverrides + ): Promise; + + submitVoteAsRepresentative( + proposalId: BigNumberish, + support: boolean, + voter: string, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: CallOverrides + ): Promise; + + submitVoteAsRepresentativeBySignature( + proposalId: BigNumberish, + voter: string, + representative: string, + support: boolean, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + signatureParams: IVotingMachineWithProofs.SignatureParamsStruct, + overrides?: CallOverrides + ): Promise; + + submitVoteBySignature( + proposalId: BigNumberish, + voter: string, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides + ): Promise; + + updateGasLimit( + gasLimit: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "EIP712DomainChanged()"(): EIP712DomainChangedEventFilter; + EIP712DomainChanged(): EIP712DomainChangedEventFilter; + + "GasLimitUpdated(uint256)"( + gasLimit?: BigNumberish | null + ): GasLimitUpdatedEventFilter; + GasLimitUpdated(gasLimit?: BigNumberish | null): GasLimitUpdatedEventFilter; + + "IncorrectTypeMessageReceived(address,uint256,bytes,bytes)"( + originSender?: string | null, + originChainId?: BigNumberish | null, + message?: null, + reason?: null + ): IncorrectTypeMessageReceivedEventFilter; + IncorrectTypeMessageReceived( + originSender?: string | null, + originChainId?: BigNumberish | null, + message?: null, + reason?: null + ): IncorrectTypeMessageReceivedEventFilter; + + "MessageReceived(address,uint256,bool,uint8,bytes,bytes)"( + originSender?: string | null, + originChainId?: BigNumberish | null, + delivered?: boolean | null, + messageType?: null, + message?: null, + reason?: null + ): MessageReceivedEventFilter; + MessageReceived( + originSender?: string | null, + originChainId?: BigNumberish | null, + delivered?: boolean | null, + messageType?: null, + message?: null, + reason?: null + ): MessageReceivedEventFilter; + + "OwnershipTransferred(address,address)"( + previousOwner?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + + "ProposalResultsSent(uint256,uint256,uint256)"( + proposalId?: BigNumberish | null, + forVotes?: null, + againstVotes?: null + ): ProposalResultsSentEventFilter; + ProposalResultsSent( + proposalId?: BigNumberish | null, + forVotes?: null, + againstVotes?: null + ): ProposalResultsSentEventFilter; + + "ProposalVoteConfigurationBridged(uint256,bytes32,uint24,bool)"( + proposalId?: BigNumberish | null, + blockHash?: BytesLike | null, + votingDuration?: null, + voteCreated?: boolean | null + ): ProposalVoteConfigurationBridgedEventFilter; + ProposalVoteConfigurationBridged( + proposalId?: BigNumberish | null, + blockHash?: BytesLike | null, + votingDuration?: null, + voteCreated?: boolean | null + ): ProposalVoteConfigurationBridgedEventFilter; + + "ProposalVoteStarted(uint256,bytes32,uint256,uint256)"( + proposalId?: BigNumberish | null, + l1BlockHash?: BytesLike | null, + startTime?: null, + endTime?: null + ): ProposalVoteStartedEventFilter; + ProposalVoteStarted( + proposalId?: BigNumberish | null, + l1BlockHash?: BytesLike | null, + startTime?: null, + endTime?: null + ): ProposalVoteStartedEventFilter; + + "VoteEmitted(uint256,address,bool,uint256)"( + proposalId?: BigNumberish | null, + voter?: string | null, + support?: boolean | null, + votingPower?: null + ): VoteEmittedEventFilter; + VoteEmitted( + proposalId?: BigNumberish | null, + voter?: string | null, + support?: boolean | null, + votingPower?: null + ): VoteEmittedEventFilter; + }; + + estimateGas: { + CROSS_CHAIN_CONTROLLER(overrides?: CallOverrides): Promise; + + DATA_WAREHOUSE(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + GOVERNANCE(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL_CHAIN_ID(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + REPRESENTATIVES_SLOT(overrides?: CallOverrides): Promise; + + VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTE_SUBMITTED_TYPEHASH(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_RAW(overrides?: CallOverrides): Promise; + + VOTING_ASSET_WITH_SLOT_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTING_STRATEGY(overrides?: CallOverrides): Promise; + + closeAndSendVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decodeMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + decodeProposalMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + decodeVoteMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getGasLimit(overrides?: CallOverrides): Promise; + + getProposalById( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalVoteConfiguration( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalsVoteConfigurationIds( + skip: BigNumberish, + size: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getUserProposalVote( + user: string, + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + receiveCrossChainMessage( + originSender: string, + originChainId: BigNumberish, + messageWithType: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + startProposalVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVote( + proposalId: BigNumberish, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentative( + proposalId: BigNumberish, + support: boolean, + voter: string, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentativeBySignature( + proposalId: BigNumberish, + voter: string, + representative: string, + support: boolean, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + signatureParams: IVotingMachineWithProofs.SignatureParamsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteBySignature( + proposalId: BigNumberish, + voter: string, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateGasLimit( + gasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + CROSS_CHAIN_CONTROLLER( + overrides?: CallOverrides + ): Promise; + + DATA_WAREHOUSE(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + GOVERNANCE(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL(overrides?: CallOverrides): Promise; + + L1_VOTING_PORTAL_CHAIN_ID( + overrides?: CallOverrides + ): Promise; + + NAME(overrides?: CallOverrides): Promise; + + REPRESENTATIVES_SLOT( + overrides?: CallOverrides + ): Promise; + + VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTE_SUBMITTED_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTING_ASSET_WITH_SLOT_RAW( + overrides?: CallOverrides + ): Promise; + + VOTING_ASSET_WITH_SLOT_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + VOTING_STRATEGY(overrides?: CallOverrides): Promise; + + closeAndSendVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + decodeMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + decodeProposalMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + decodeVoteMessage( + message: BytesLike, + overrides?: CallOverrides + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getGasLimit(overrides?: CallOverrides): Promise; + + getProposalById( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalVoteConfiguration( + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getProposalsVoteConfigurationIds( + skip: BigNumberish, + size: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getUserProposalVote( + user: string, + proposalId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + receiveCrossChainMessage( + originSender: string, + originChainId: BigNumberish, + messageWithType: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + startProposalVote( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVote( + proposalId: BigNumberish, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentative( + proposalId: BigNumberish, + support: boolean, + voter: string, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteAsRepresentativeBySignature( + proposalId: BigNumberish, + voter: string, + representative: string, + support: boolean, + proofOfRepresentation: BytesLike, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + signatureParams: IVotingMachineWithProofs.SignatureParamsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + submitVoteBySignature( + proposalId: BigNumberish, + voter: string, + support: boolean, + votingBalanceProofs: IVotingMachineWithProofs.VotingBalanceProofStruct[], + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + updateGasLimit( + gasLimit: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/common.ts b/packages/contract-helpers/src/governance-v3/typechain/common.ts new file mode 100644 index 00000000..2fc40c7f --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/common.ts @@ -0,0 +1,44 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Listener } from "@ethersproject/providers"; +import type { Event, EventFilter } from "ethers"; + +export interface TypedEvent< + TArgsArray extends Array = any, + TArgsObject = any +> extends Event { + args: TArgsArray & TArgsObject; +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> + extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never; + +export interface OnEvent { + ( + eventFilter: TypedEventFilter, + listener: TypedListener + ): TRes; + (eventName: string, listener: Listener): TRes; +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts new file mode 100644 index 00000000..fd2d6e71 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts @@ -0,0 +1,328 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + GovernanceDataHelper, + GovernanceDataHelperInterface, +} from "../GovernanceDataHelper"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract IGovernanceCore", + name: "govCore", + type: "address", + }, + { + internalType: "enum PayloadsControllerUtils.AccessControl[]", + name: "accessLevels", + type: "uint8[]", + }, + ], + name: "getConstants", + outputs: [ + { + components: [ + { + components: [ + { + internalType: "enum PayloadsControllerUtils.AccessControl", + name: "accessLevel", + type: "uint8", + }, + { + components: [ + { + internalType: "uint24", + name: "coolDownBeforeVotingStart", + type: "uint24", + }, + { + internalType: "uint24", + name: "votingDuration", + type: "uint24", + }, + { + internalType: "uint56", + name: "yesThreshold", + type: "uint56", + }, + { + internalType: "uint56", + name: "yesNoDifferential", + type: "uint56", + }, + { + internalType: "uint56", + name: "minPropositionPower", + type: "uint56", + }, + ], + internalType: "struct IGovernanceCore.VotingConfig", + name: "config", + type: "tuple", + }, + ], + internalType: "struct IGovernanceDataHelper.VotingConfig[]", + name: "votingConfigs", + type: "tuple[]", + }, + { + internalType: "uint256", + name: "precisionDivider", + type: "uint256", + }, + { + internalType: "uint256", + name: "cooldownPeriod", + type: "uint256", + }, + { + internalType: "uint256", + name: "expirationTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "cancellationFee", + type: "uint256", + }, + ], + internalType: "struct IGovernanceDataHelper.Constants", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IGovernanceCore", + name: "govCore", + type: "address", + }, + { + internalType: "uint256", + name: "from", + type: "uint256", + }, + { + internalType: "uint256", + name: "to", + type: "uint256", + }, + { + internalType: "uint256", + name: "pageSize", + type: "uint256", + }, + ], + name: "getProposalsData", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "uint256", + name: "votingChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "enum IGovernanceCore.State", + name: "state", + type: "uint8", + }, + { + internalType: "enum PayloadsControllerUtils.AccessControl", + name: "accessLevel", + type: "uint8", + }, + { + internalType: "uint40", + name: "creationTime", + type: "uint40", + }, + { + internalType: "uint24", + name: "votingDuration", + type: "uint24", + }, + { + internalType: "uint40", + name: "votingActivationTime", + type: "uint40", + }, + { + internalType: "uint40", + name: "queuingTime", + type: "uint40", + }, + { + internalType: "uint40", + name: "cancelTimestamp", + type: "uint40", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "address", + name: "votingPortal", + type: "address", + }, + { + internalType: "bytes32", + name: "snapshotBlockHash", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "ipfsHash", + type: "bytes32", + }, + { + internalType: "uint128", + name: "forVotes", + type: "uint128", + }, + { + internalType: "uint128", + name: "againstVotes", + type: "uint128", + }, + { + internalType: "uint256", + name: "cancellationFee", + type: "uint256", + }, + { + components: [ + { + internalType: "uint256", + name: "chain", + type: "uint256", + }, + { + internalType: "enum PayloadsControllerUtils.AccessControl", + name: "accessLevel", + type: "uint8", + }, + { + internalType: "address", + name: "payloadsController", + type: "address", + }, + { + internalType: "uint40", + name: "payloadId", + type: "uint40", + }, + ], + internalType: "struct PayloadsControllerUtils.Payload[]", + name: "payloads", + type: "tuple[]", + }, + ], + internalType: "struct IGovernanceCore.Proposal", + name: "proposalData", + type: "tuple", + }, + ], + internalType: "struct IGovernanceDataHelper.Proposal[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IGovernanceCore", + name: "govCore", + type: "address", + }, + { + internalType: "address", + name: "wallet", + type: "address", + }, + { + internalType: "uint256[]", + name: "chainIds", + type: "uint256[]", + }, + ], + name: "getRepresentationData", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "address", + name: "representative", + type: "address", + }, + ], + internalType: "struct IGovernanceDataHelper.Representatives[]", + name: "", + type: "tuple[]", + }, + { + components: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "address[]", + name: "votersRepresented", + type: "address[]", + }, + ], + internalType: "struct IGovernanceDataHelper.Represented[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class GovernanceDataHelper__factory { + static readonly abi = _abi; + static createInterface(): GovernanceDataHelperInterface { + return new utils.Interface(_abi) as GovernanceDataHelperInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): GovernanceDataHelper { + return new Contract( + address, + _abi, + signerOrProvider + ) as GovernanceDataHelper; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts new file mode 100644 index 00000000..1ddacbe3 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts @@ -0,0 +1,1161 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { VotingMachine, VotingMachineInterface } from "../VotingMachine"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "crossChainController", + type: "address", + }, + { + internalType: "uint256", + name: "gasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "l1VotingPortalChainId", + type: "uint256", + }, + { + internalType: "contract IVotingStrategy", + name: "votingStrategy", + type: "address", + }, + { + internalType: "address", + name: "l1VotingPortal", + type: "address", + }, + { + internalType: "address", + name: "governance", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "ECDSAInvalidSignature", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + ], + name: "ECDSAInvalidSignatureLength", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "ECDSAInvalidSignatureS", + type: "error", + }, + { + inputs: [], + name: "InvalidShortString", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "str", + type: "string", + }, + ], + name: "StringTooLong", + type: "error", + }, + { + anonymous: false, + inputs: [], + name: "EIP712DomainChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "gasLimit", + type: "uint256", + }, + ], + name: "GasLimitUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "originSender", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "originChainId", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "message", + type: "bytes", + }, + { + indexed: false, + internalType: "bytes", + name: "reason", + type: "bytes", + }, + ], + name: "IncorrectTypeMessageReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "originSender", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "originChainId", + type: "uint256", + }, + { + indexed: true, + internalType: "bool", + name: "delivered", + type: "bool", + }, + { + indexed: false, + internalType: "enum IVotingPortal.MessageType", + name: "messageType", + type: "uint8", + }, + { + indexed: false, + internalType: "bytes", + name: "message", + type: "bytes", + }, + { + indexed: false, + internalType: "bytes", + name: "reason", + type: "bytes", + }, + ], + name: "MessageReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "forVotes", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "againstVotes", + type: "uint256", + }, + ], + name: "ProposalResultsSent", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + indexed: true, + internalType: "bytes32", + name: "blockHash", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint24", + name: "votingDuration", + type: "uint24", + }, + { + indexed: true, + internalType: "bool", + name: "voteCreated", + type: "bool", + }, + ], + name: "ProposalVoteConfigurationBridged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + indexed: true, + internalType: "bytes32", + name: "l1BlockHash", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "startTime", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "endTime", + type: "uint256", + }, + ], + name: "ProposalVoteStarted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "voter", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "support", + type: "bool", + }, + { + indexed: false, + internalType: "uint256", + name: "votingPower", + type: "uint256", + }, + ], + name: "VoteEmitted", + type: "event", + }, + { + inputs: [], + name: "CROSS_CHAIN_CONTROLLER", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DATA_WAREHOUSE", + outputs: [ + { + internalType: "contract IDataWarehouse", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "GOVERNANCE", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "L1_VOTING_PORTAL", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "L1_VOTING_PORTAL_CHAIN_ID", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "NAME", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "REPRESENTATIVES_SLOT", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VOTE_SUBMITTED_BY_REPRESENTATIVE_TYPEHASH", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VOTE_SUBMITTED_TYPEHASH", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VOTING_ASSET_WITH_SLOT_RAW", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VOTING_ASSET_WITH_SLOT_TYPEHASH", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "VOTING_STRATEGY", + outputs: [ + { + internalType: "contract IVotingStrategy", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "closeAndSendVote", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "message", + type: "bytes", + }, + ], + name: "decodeMessage", + outputs: [ + { + internalType: "enum IVotingPortal.MessageType", + name: "", + type: "uint8", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "message", + type: "bytes", + }, + ], + name: "decodeProposalMessage", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "uint24", + name: "", + type: "uint24", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "message", + type: "bytes", + }, + ], + name: "decodeVoteMessage", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "bool", + name: "", + type: "bool", + }, + { + components: [ + { + internalType: "address", + name: "underlyingAsset", + type: "address", + }, + { + internalType: "uint128", + name: "slot", + type: "uint128", + }, + ], + internalType: "struct IVotingMachineWithProofs.VotingAssetWithSlot[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "eip712Domain", + outputs: [ + { + internalType: "bytes1", + name: "fields", + type: "bytes1", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "version", + type: "string", + }, + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "address", + name: "verifyingContract", + type: "address", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + { + internalType: "uint256[]", + name: "extensions", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getGasLimit", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "getProposalById", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + internalType: "bool", + name: "sentToGovernance", + type: "bool", + }, + { + internalType: "uint40", + name: "startTime", + type: "uint40", + }, + { + internalType: "uint40", + name: "endTime", + type: "uint40", + }, + { + internalType: "uint40", + name: "votingClosedAndSentTimestamp", + type: "uint40", + }, + { + internalType: "uint128", + name: "forVotes", + type: "uint128", + }, + { + internalType: "uint128", + name: "againstVotes", + type: "uint128", + }, + { + internalType: "uint256", + name: "creationBlockNumber", + type: "uint256", + }, + { + internalType: "uint256", + name: "votingClosedAndSentBlockNumber", + type: "uint256", + }, + ], + internalType: "struct IVotingMachineWithProofs.ProposalWithoutVotes", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "getProposalState", + outputs: [ + { + internalType: "enum IVotingMachineWithProofs.ProposalState", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "getProposalVoteConfiguration", + outputs: [ + { + components: [ + { + internalType: "uint24", + name: "votingDuration", + type: "uint24", + }, + { + internalType: "bytes32", + name: "l1ProposalBlockHash", + type: "bytes32", + }, + ], + internalType: + "struct IVotingMachineWithProofs.ProposalVoteConfiguration", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "skip", + type: "uint256", + }, + { + internalType: "uint256", + name: "size", + type: "uint256", + }, + ], + name: "getProposalsVoteConfigurationIds", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "getUserProposalVote", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "support", + type: "bool", + }, + { + internalType: "uint248", + name: "votingPower", + type: "uint248", + }, + ], + internalType: "struct IVotingMachineWithProofs.Vote", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "originSender", + type: "address", + }, + { + internalType: "uint256", + name: "originChainId", + type: "uint256", + }, + { + internalType: "bytes", + name: "messageWithType", + type: "bytes", + }, + ], + name: "receiveCrossChainMessage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + ], + name: "startProposalVote", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + internalType: "bool", + name: "support", + type: "bool", + }, + { + components: [ + { + internalType: "address", + name: "underlyingAsset", + type: "address", + }, + { + internalType: "uint128", + name: "slot", + type: "uint128", + }, + { + internalType: "bytes", + name: "proof", + type: "bytes", + }, + ], + internalType: "struct IVotingMachineWithProofs.VotingBalanceProof[]", + name: "votingBalanceProofs", + type: "tuple[]", + }, + ], + name: "submitVote", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + internalType: "bool", + name: "support", + type: "bool", + }, + { + internalType: "address", + name: "voter", + type: "address", + }, + { + internalType: "bytes", + name: "proofOfRepresentation", + type: "bytes", + }, + { + components: [ + { + internalType: "address", + name: "underlyingAsset", + type: "address", + }, + { + internalType: "uint128", + name: "slot", + type: "uint128", + }, + { + internalType: "bytes", + name: "proof", + type: "bytes", + }, + ], + internalType: "struct IVotingMachineWithProofs.VotingBalanceProof[]", + name: "votingBalanceProofs", + type: "tuple[]", + }, + ], + name: "submitVoteAsRepresentative", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + internalType: "address", + name: "voter", + type: "address", + }, + { + internalType: "address", + name: "representative", + type: "address", + }, + { + internalType: "bool", + name: "support", + type: "bool", + }, + { + internalType: "bytes", + name: "proofOfRepresentation", + type: "bytes", + }, + { + components: [ + { + internalType: "address", + name: "underlyingAsset", + type: "address", + }, + { + internalType: "uint128", + name: "slot", + type: "uint128", + }, + { + internalType: "bytes", + name: "proof", + type: "bytes", + }, + ], + internalType: "struct IVotingMachineWithProofs.VotingBalanceProof[]", + name: "votingBalanceProofs", + type: "tuple[]", + }, + { + components: [ + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + internalType: "struct IVotingMachineWithProofs.SignatureParams", + name: "signatureParams", + type: "tuple", + }, + ], + name: "submitVoteAsRepresentativeBySignature", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "proposalId", + type: "uint256", + }, + { + internalType: "address", + name: "voter", + type: "address", + }, + { + internalType: "bool", + name: "support", + type: "bool", + }, + { + components: [ + { + internalType: "address", + name: "underlyingAsset", + type: "address", + }, + { + internalType: "uint128", + name: "slot", + type: "uint128", + }, + { + internalType: "bytes", + name: "proof", + type: "bytes", + }, + ], + internalType: "struct IVotingMachineWithProofs.VotingBalanceProof[]", + name: "votingBalanceProofs", + type: "tuple[]", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "submitVoteBySignature", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "gasLimit", + type: "uint256", + }, + ], + name: "updateGasLimit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class VotingMachine__factory { + static readonly abi = _abi; + static createInterface(): VotingMachineInterface { + return new utils.Interface(_abi) as VotingMachineInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): VotingMachine { + return new Contract(address, _abi, signerOrProvider) as VotingMachine; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts new file mode 100644 index 00000000..a615252b --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { GovernanceDataHelper__factory } from "./GovernanceDataHelper__factory"; +export { VotingMachine__factory } from "./VotingMachine__factory"; diff --git a/packages/contract-helpers/src/governance-v3/typechain/index.ts b/packages/contract-helpers/src/governance-v3/typechain/index.ts new file mode 100644 index 00000000..d2a33871 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/index.ts @@ -0,0 +1,8 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { GovernanceDataHelper } from "./GovernanceDataHelper"; +export type { VotingMachine } from "./VotingMachine"; +export * as factories from "./factories"; +export { GovernanceDataHelper__factory } from "./factories/GovernanceDataHelper__factory"; +export { VotingMachine__factory } from "./factories/VotingMachine__factory"; diff --git a/packages/contract-helpers/src/governance-v3/voting-machine/index.ts b/packages/contract-helpers/src/governance-v3/voting-machine/index.ts new file mode 100644 index 00000000..6696eeaa --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/voting-machine/index.ts @@ -0,0 +1,2 @@ +export class VotingMachineService { +} \ No newline at end of file From 6e236ad7f857d0d65b8d5ef20f96a1ee65fff347 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 09:16:18 -0600 Subject: [PATCH 02/41] feat: gov data helpers --- .../governance-data-helper/index.ts | 67 ++++++++++++++++++- ...ataHelper.ts => GovernanceDataHelper.d.ts} | 1 - .../src/governance-v3/typechain/common.ts | 1 - .../GovernanceDataHelper__factory.ts | 1 - 4 files changed, 65 insertions(+), 5 deletions(-) rename packages/contract-helpers/src/governance-v3/typechain/{GovernanceDataHelper.ts => GovernanceDataHelper.d.ts} (99%) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 906a8373..c6396648 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -1,3 +1,66 @@ -export class GovernanceDataHelperService { +import { providers } from 'ethers'; +import { + GovernanceDataHelper as GovernanceDataHelperContract, + IGovernanceDataHelper, +} from '../typechain/GovernanceDataHelper'; +import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; -} \ No newline at end of file +export interface GovernanceDataHelperInterface { + getConstants: ( + govCore: string, + accessLevels: number[], + ) => Promise; + getProposalsData: ( + govCore: string, + from: number, + to: number, + pageSize: number, + ) => Promise; + getRepresentationData: ( + govCore: string, + wallet: string, + chainIds: number[], + ) => Promise< + [ + IGovernanceDataHelper.RepresentativesStruct[], + IGovernanceDataHelper.RepresentedStruct[], + ] + >; +} + +export class GovernanceDataHelperService + implements GovernanceDataHelperInterface +{ + private readonly _contract: GovernanceDataHelperContract; + + constructor( + governanceDataHelperContractAddress: string, + provider: providers.Provider, + ) { + this._contract = GovernanceDataHelper__factory.connect( + governanceDataHelperContractAddress, + provider, + ); + } + + public async getConstants(govCore: string, accessLevels: number[]) { + return this._contract.getConstants(govCore, accessLevels); + } + + public async getProposalsData( + govCore: string, + from: number, + to: number, + pageSize: number, + ) { + return this._contract.getProposalsData(govCore, from, to, pageSize); + } + + public async getRepresentationData( + govCore: string, + wallet: string, + chainIds: number[], + ) { + return this._contract.getRepresentationData(govCore, wallet, chainIds); + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts b/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.d.ts similarity index 99% rename from packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts rename to packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.d.ts index 33f4b806..9f519677 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/GovernanceDataHelper.d.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ import type { BaseContract, diff --git a/packages/contract-helpers/src/governance-v3/typechain/common.ts b/packages/contract-helpers/src/governance-v3/typechain/common.ts index 2fc40c7f..3e1b0b2b 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/common.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/common.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ import type { Listener } from "@ethersproject/providers"; import type { Event, EventFilter } from "ethers"; diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts index fd2d6e71..88617dee 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceDataHelper__factory.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ import { Contract, Signer, utils } from "ethers"; From dffafc6980e2e7d43b29bd3aa63f89fcdcc8f2e1 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 10:35:02 -0600 Subject: [PATCH 03/41] fix: export --- packages/contract-helpers/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index 4d8d94ef..fa87cc12 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -30,6 +30,7 @@ export * from './v3-migration-contract'; export * from './erc20-2612'; export * from './paraswap-debtSwitch-contract'; export * from './paraswap-withdrawAndSwitchAdapter-contract'; +export * from './governance-v3/governance-data-helper'; // commons export * from './commons/types'; From 40a6b889eb2f86145a1e9aad1ca27a785498aaf9 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 13:04:56 -0600 Subject: [PATCH 04/41] fix: typings --- .../governance-data-helper/index.ts | 80 ++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index c6396648..bfb663ab 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -5,6 +5,54 @@ import { } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; +export enum ProposalState { + /** proposal does not exist */ + Null, + /** created, waiting for a cooldown to initiate the balances snapshot */ + Created, + /** balances snapshot set, voting in progress */ + Active, + /** voting results submitted, but proposal is under grace period when guardian can cancel it */ + Queued, + /** results sent to the execution chain(s) */ + Executed, + /** voting was not successful */ + Failed, + /** got cancelled by guardian, or because proposition power of creator dropped below allowed minimum */ + Cancelled, + Expired, +} + +export type ProposalPayload = { + chain: number; + accessLevel: number; + payloadsController: string; + payloadId: number; +}; + +export type Proposal = { + state: ProposalState; + accessLevel: number; + creationTime: number; + votingDuration: number; + votingActivationTime: number; + queuingTime: number; + cancelTimestamp: number; + creator: string; + votingPortal: string; + snapshotBlockHash: string; + ipfsHash: string; + forVotes: string; + againstVotes: string; + cancellationFee: string; +}; + +export type ProposalData = { + id: string; + votingChainId: number; + proposalData: Proposal; +}; + export interface GovernanceDataHelperInterface { getConstants: ( govCore: string, @@ -15,7 +63,7 @@ export interface GovernanceDataHelperInterface { from: number, to: number, pageSize: number, - ) => Promise; + ) => Promise; getRepresentationData: ( govCore: string, wallet: string, @@ -53,7 +101,35 @@ export class GovernanceDataHelperService to: number, pageSize: number, ) { - return this._contract.getProposalsData(govCore, from, to, pageSize); + const data = await this._contract.getProposalsData( + govCore, + from, + to, + pageSize, + ); + + return data.map(proposalData => { + return { + id: proposalData.id.toString(), + votingChainId: proposalData.votingChainId.toNumber(), + proposalData: { + state: proposalData.proposalData.state, + accessLevel: proposalData.proposalData.accessLevel, + creationTime: proposalData.proposalData.creationTime, + votingDuration: proposalData.proposalData.votingDuration, + votingActivationTime: proposalData.proposalData.votingActivationTime, + queuingTime: proposalData.proposalData.queuingTime, + cancelTimestamp: proposalData.proposalData.cancelTimestamp, + creator: proposalData.proposalData.creator, + votingPortal: proposalData.proposalData.votingPortal, + snapshotBlockHash: proposalData.proposalData.snapshotBlockHash, + ipfsHash: proposalData.proposalData.ipfsHash, + forVotes: proposalData.proposalData.forVotes.toString(), + againstVotes: proposalData.proposalData.againstVotes.toString(), + cancellationFee: proposalData.proposalData.cancellationFee.toString(), + }, + }; + }); } public async getRepresentationData( From d87da87e54fce073e23013f812c29a5e48916c73 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 13:07:09 -0600 Subject: [PATCH 05/41] fix: rename --- .../src/governance-v3/governance-data-helper/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index bfb663ab..9093bcd0 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -5,7 +5,7 @@ import { } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; -export enum ProposalState { +export enum ProposalV3State { /** proposal does not exist */ Null, /** created, waiting for a cooldown to initiate the balances snapshot */ @@ -30,8 +30,8 @@ export type ProposalPayload = { payloadId: number; }; -export type Proposal = { - state: ProposalState; +export type ProposalV3 = { + state: ProposalV3State; accessLevel: number; creationTime: number; votingDuration: number; @@ -50,7 +50,7 @@ export type Proposal = { export type ProposalData = { id: string; votingChainId: number; - proposalData: Proposal; + proposalData: ProposalV3; }; export interface GovernanceDataHelperInterface { From d78bb15dc0253e18f3f73db8e4e9bcafe75b9dc2 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 13:23:17 -0600 Subject: [PATCH 06/41] fix: types --- .../src/governance-v3/governance-data-helper/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 9093bcd0..6d0382aa 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -5,6 +5,15 @@ import { } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; +export enum AccessLevel { + /** Do not use */ + None, + /** listing assets, changes of assets params, updates of the protocol etc */ + Short_Executor, + /** payloads controller updates */ + Long_Executor, +} + export enum ProposalV3State { /** proposal does not exist */ Null, @@ -32,7 +41,7 @@ export type ProposalPayload = { export type ProposalV3 = { state: ProposalV3State; - accessLevel: number; + accessLevel: AccessLevel; creationTime: number; votingDuration: number; votingActivationTime: number; From 749ebcf9f2b11776b40c828a6090cd1557b77552 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 13:41:31 -0600 Subject: [PATCH 07/41] fix: types --- .../src/governance-v3/governance-data-helper/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 6d0382aa..9b29fac4 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -34,7 +34,7 @@ export enum ProposalV3State { export type ProposalPayload = { chain: number; - accessLevel: number; + accessLevel: AccessLevel; payloadsController: string; payloadId: number; }; From 1b378371707b7b1c33626c342393fe20049f2fe2 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 14:36:12 -0600 Subject: [PATCH 08/41] feat: helper methods --- .../governance-data-helper/index.ts | 89 ++++++++++++++++--- 1 file changed, 79 insertions(+), 10 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 9b29fac4..ea166c40 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -62,6 +62,35 @@ export type ProposalData = { proposalData: ProposalV3; }; +export type VotingConfig = { + accessLevel: AccessLevel; + config: { + coolDownBeforeVotingStart: string; + votingDuration: string; + yesThreshold: string; + yesNoDifferential: string; + minPropositionPower: string; + }; +}; + +export type Constants = { + votingConfigs: VotingConfig[]; + precisionDivider: string; + cooldownPeriod: string; + expirationTime: string; + cancellationFee: string; +}; + +export type Representative = { + chainId: number; + representative: string; +}; + +export type Rpresented = { + chainId: number; + votersRepresented: string[]; +}; + export interface GovernanceDataHelperInterface { getConstants: ( govCore: string, @@ -77,12 +106,10 @@ export interface GovernanceDataHelperInterface { govCore: string, wallet: string, chainIds: number[], - ) => Promise< - [ - IGovernanceDataHelper.RepresentativesStruct[], - IGovernanceDataHelper.RepresentedStruct[], - ] - >; + ) => Promise<{ + Representatives: Representative[]; + Represented: Rpresented[]; + }>; } export class GovernanceDataHelperService @@ -100,8 +127,31 @@ export class GovernanceDataHelperService ); } - public async getConstants(govCore: string, accessLevels: number[]) { - return this._contract.getConstants(govCore, accessLevels); + public async getConstants( + govCore: string, + accessLevels: number[], + ): Promise { + const data = await this._contract.getConstants(govCore, accessLevels); + return { + votingConfigs: data.votingConfigs.map(votingConfig => { + return { + accessLevel: votingConfig.accessLevel, + config: { + coolDownBeforeVotingStart: + votingConfig.config.coolDownBeforeVotingStart.toString(), + votingDuration: votingConfig.config.votingDuration.toString(), + yesThreshold: votingConfig.config.yesThreshold.toString(), + yesNoDifferential: votingConfig.config.yesNoDifferential.toString(), + minPropositionPower: + votingConfig.config.minPropositionPower.toString(), + }, + }; + }), + precisionDivider: data.precisionDivider.toString(), + cooldownPeriod: data.cooldownPeriod.toString(), + expirationTime: data.expirationTime.toString(), + cancellationFee: data.cancellationFee.toString(), + }; } public async getProposalsData( @@ -145,7 +195,26 @@ export class GovernanceDataHelperService govCore: string, wallet: string, chainIds: number[], - ) { - return this._contract.getRepresentationData(govCore, wallet, chainIds); + ): Promise<{ Representatives: Representative[]; Represented: Rpresented[] }> { + const data = await this._contract.getRepresentationData( + govCore, + wallet, + chainIds, + ); + + return { + Representatives: data[0].map(representative => { + return { + chainId: representative.chainId.toNumber(), + representative: representative.representative, + }; + }), + Represented: data[1].map(represented => { + return { + chainId: represented.chainId.toNumber(), + votersRepresented: represented.votersRepresented, + }; + }), + }; } } From 91bcd5a509cab7528610d9a941f2979afad6c7b3 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 8 Dec 2023 15:29:07 -0600 Subject: [PATCH 09/41] fix: types --- .../governance-data-helper/index.ts | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index ea166c40..58737694 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -1,8 +1,5 @@ import { providers } from 'ethers'; -import { - GovernanceDataHelper as GovernanceDataHelperContract, - IGovernanceDataHelper, -} from '../typechain/GovernanceDataHelper'; +import { GovernanceDataHelper as GovernanceDataHelperContract } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; export enum AccessLevel { @@ -67,8 +64,8 @@ export type VotingConfig = { config: { coolDownBeforeVotingStart: string; votingDuration: string; - yesThreshold: string; - yesNoDifferential: string; + quorum: string; + differential: string; minPropositionPower: string; }; }; @@ -92,10 +89,7 @@ export type Rpresented = { }; export interface GovernanceDataHelperInterface { - getConstants: ( - govCore: string, - accessLevels: number[], - ) => Promise; + getConstants: (govCore: string, accessLevels: number[]) => Promise; getProposalsData: ( govCore: string, from: number, @@ -132,21 +126,24 @@ export class GovernanceDataHelperService accessLevels: number[], ): Promise { const data = await this._contract.getConstants(govCore, accessLevels); + + const votingConfigs = data.votingConfigs.map(votingConfig => { + return { + accessLevel: votingConfig.accessLevel, + config: { + coolDownBeforeVotingStart: + votingConfig.config.coolDownBeforeVotingStart.toString(), + votingDuration: votingConfig.config.votingDuration.toString(), + quorum: votingConfig.config.yesThreshold.toString(), + differential: votingConfig.config.yesNoDifferential.toString(), + minPropositionPower: + votingConfig.config.minPropositionPower.toString(), + }, + }; + }); + return { - votingConfigs: data.votingConfigs.map(votingConfig => { - return { - accessLevel: votingConfig.accessLevel, - config: { - coolDownBeforeVotingStart: - votingConfig.config.coolDownBeforeVotingStart.toString(), - votingDuration: votingConfig.config.votingDuration.toString(), - yesThreshold: votingConfig.config.yesThreshold.toString(), - yesNoDifferential: votingConfig.config.yesNoDifferential.toString(), - minPropositionPower: - votingConfig.config.minPropositionPower.toString(), - }, - }; - }), + votingConfigs, precisionDivider: data.precisionDivider.toString(), cooldownPeriod: data.cooldownPeriod.toString(), expirationTime: data.expirationTime.toString(), From fda96ff170cf629253360b704db9b2c0b8332f34 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Mon, 11 Dec 2023 12:53:47 -0600 Subject: [PATCH 10/41] feat: voting machine data helper --- .../governance-data-helper/index.ts | 28 +-- .../governance-v3/typechain/VotingMachine.ts | 1 - .../typechain/VotingMachineDataHelper.d.ts | 208 ++++++++++++++++++ .../VotingMachineDataHelper__factory.ts | 185 ++++++++++++++++ .../factories/VotingMachine__factory.ts | 1 - .../typechain/factories/index.ts | 6 +- .../src/governance-v3/typechain/index.ts | 12 +- .../src/governance-v3/types.ts | 26 +++ .../voting-machine-data-helper/index.ts | 112 ++++++++++ packages/contract-helpers/src/index.ts | 1 + 10 files changed, 542 insertions(+), 38 deletions(-) create mode 100644 packages/contract-helpers/src/governance-v3/typechain/VotingMachineDataHelper.d.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachineDataHelper__factory.ts create mode 100644 packages/contract-helpers/src/governance-v3/types.ts create mode 100644 packages/contract-helpers/src/governance-v3/voting-machine-data-helper/index.ts diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 58737694..625a2d49 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -1,33 +1,7 @@ import { providers } from 'ethers'; import { GovernanceDataHelper as GovernanceDataHelperContract } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; - -export enum AccessLevel { - /** Do not use */ - None, - /** listing assets, changes of assets params, updates of the protocol etc */ - Short_Executor, - /** payloads controller updates */ - Long_Executor, -} - -export enum ProposalV3State { - /** proposal does not exist */ - Null, - /** created, waiting for a cooldown to initiate the balances snapshot */ - Created, - /** balances snapshot set, voting in progress */ - Active, - /** voting results submitted, but proposal is under grace period when guardian can cancel it */ - Queued, - /** results sent to the execution chain(s) */ - Executed, - /** voting was not successful */ - Failed, - /** got cancelled by guardian, or because proposition power of creator dropped below allowed minimum */ - Cancelled, - Expired, -} +import { AccessLevel, ProposalV3State } from '../types'; export type ProposalPayload = { chain: number; diff --git a/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts b/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts index 317f0557..95471c25 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/VotingMachine.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ import type { BaseContract, diff --git a/packages/contract-helpers/src/governance-v3/typechain/VotingMachineDataHelper.d.ts b/packages/contract-helpers/src/governance-v3/typechain/VotingMachineDataHelper.d.ts new file mode 100644 index 00000000..01e6a710 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/VotingMachineDataHelper.d.ts @@ -0,0 +1,208 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export declare namespace IVotingMachineDataHelper { + export type InitialProposalStruct = { + id: BigNumberish; + snapshotBlockHash: BytesLike; + }; + + export type InitialProposalStructOutput = [BigNumber, string] & { + id: BigNumber; + snapshotBlockHash: string; + }; + + export type VotedInfoStruct = { support: boolean; votingPower: BigNumberish }; + + export type VotedInfoStructOutput = [boolean, BigNumber] & { + support: boolean; + votingPower: BigNumber; + }; + + export type ProposalStruct = { + proposalData: IVotingMachineWithProofs.ProposalWithoutVotesStruct; + votedInfo: IVotingMachineDataHelper.VotedInfoStruct; + strategy: string; + dataWarehouse: string; + votingAssets: string[]; + hasRequiredRoots: boolean; + voteConfig: IVotingMachineWithProofs.ProposalVoteConfigurationStruct; + state: BigNumberish; + }; + + export type ProposalStructOutput = [ + IVotingMachineWithProofs.ProposalWithoutVotesStructOutput, + IVotingMachineDataHelper.VotedInfoStructOutput, + string, + string, + string[], + boolean, + IVotingMachineWithProofs.ProposalVoteConfigurationStructOutput, + number, + ] & { + proposalData: IVotingMachineWithProofs.ProposalWithoutVotesStructOutput; + votedInfo: IVotingMachineDataHelper.VotedInfoStructOutput; + strategy: string; + dataWarehouse: string; + votingAssets: string[]; + hasRequiredRoots: boolean; + voteConfig: IVotingMachineWithProofs.ProposalVoteConfigurationStructOutput; + state: number; + }; +} + +export declare namespace IVotingMachineWithProofs { + export type ProposalWithoutVotesStruct = { + id: BigNumberish; + sentToGovernance: boolean; + startTime: BigNumberish; + endTime: BigNumberish; + votingClosedAndSentTimestamp: BigNumberish; + forVotes: BigNumberish; + againstVotes: BigNumberish; + creationBlockNumber: BigNumberish; + votingClosedAndSentBlockNumber: BigNumberish; + }; + + export type ProposalWithoutVotesStructOutput = [ + BigNumber, + boolean, + number, + number, + number, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + ] & { + id: BigNumber; + sentToGovernance: boolean; + startTime: number; + endTime: number; + votingClosedAndSentTimestamp: number; + forVotes: BigNumber; + againstVotes: BigNumber; + creationBlockNumber: BigNumber; + votingClosedAndSentBlockNumber: BigNumber; + }; + + export type ProposalVoteConfigurationStruct = { + votingDuration: BigNumberish; + l1ProposalBlockHash: BytesLike; + }; + + export type ProposalVoteConfigurationStructOutput = [number, string] & { + votingDuration: number; + l1ProposalBlockHash: string; + }; +} + +export interface VotingMachineDataHelperInterface extends utils.Interface { + functions: { + 'getProposalsData(address,(uint256,bytes32)[],address)': FunctionFragment; + }; + + getFunction(nameOrSignatureOrTopic: 'getProposalsData'): FunctionFragment; + + encodeFunctionData( + functionFragment: 'getProposalsData', + values: [string, IVotingMachineDataHelper.InitialProposalStruct[], string], + ): string; + + decodeFunctionResult( + functionFragment: 'getProposalsData', + data: BytesLike, + ): Result; + + events: {}; +} + +export interface VotingMachineDataHelper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: VotingMachineDataHelperInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + getProposalsData( + votingMachine: string, + initialProposals: IVotingMachineDataHelper.InitialProposalStruct[], + user: string, + overrides?: CallOverrides, + ): Promise<[IVotingMachineDataHelper.ProposalStructOutput[]]>; + }; + + getProposalsData( + votingMachine: string, + initialProposals: IVotingMachineDataHelper.InitialProposalStruct[], + user: string, + overrides?: CallOverrides, + ): Promise; + + callStatic: { + getProposalsData( + votingMachine: string, + initialProposals: IVotingMachineDataHelper.InitialProposalStruct[], + user: string, + overrides?: CallOverrides, + ): Promise; + }; + + filters: {}; + + estimateGas: { + getProposalsData( + votingMachine: string, + initialProposals: IVotingMachineDataHelper.InitialProposalStruct[], + user: string, + overrides?: CallOverrides, + ): Promise; + }; + + populateTransaction: { + getProposalsData( + votingMachine: string, + initialProposals: IVotingMachineDataHelper.InitialProposalStruct[], + user: string, + overrides?: CallOverrides, + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachineDataHelper__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachineDataHelper__factory.ts new file mode 100644 index 00000000..4d36cd66 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachineDataHelper__factory.ts @@ -0,0 +1,185 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { + VotingMachineDataHelper, + VotingMachineDataHelperInterface, +} from '../VotingMachineDataHelper'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract IVotingMachineWithProofs', + name: 'votingMachine', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'snapshotBlockHash', + type: 'bytes32', + }, + ], + internalType: 'struct IVotingMachineDataHelper.InitialProposal[]', + name: 'initialProposals', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getProposalsData', + outputs: [ + { + components: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'sentToGovernance', + type: 'bool', + }, + { + internalType: 'uint40', + name: 'startTime', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'endTime', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'votingClosedAndSentTimestamp', + type: 'uint40', + }, + { + internalType: 'uint128', + name: 'forVotes', + type: 'uint128', + }, + { + internalType: 'uint128', + name: 'againstVotes', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'creationBlockNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'votingClosedAndSentBlockNumber', + type: 'uint256', + }, + ], + internalType: + 'struct IVotingMachineWithProofs.ProposalWithoutVotes', + name: 'proposalData', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bool', + name: 'support', + type: 'bool', + }, + { + internalType: 'uint248', + name: 'votingPower', + type: 'uint248', + }, + ], + internalType: 'struct IVotingMachineDataHelper.VotedInfo', + name: 'votedInfo', + type: 'tuple', + }, + { + internalType: 'contract IVotingStrategy', + name: 'strategy', + type: 'address', + }, + { + internalType: 'contract IDataWarehouse', + name: 'dataWarehouse', + type: 'address', + }, + { + internalType: 'address[]', + name: 'votingAssets', + type: 'address[]', + }, + { + internalType: 'bool', + name: 'hasRequiredRoots', + type: 'bool', + }, + { + components: [ + { + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + { + internalType: 'bytes32', + name: 'l1ProposalBlockHash', + type: 'bytes32', + }, + ], + internalType: + 'struct IVotingMachineWithProofs.ProposalVoteConfiguration', + name: 'voteConfig', + type: 'tuple', + }, + { + internalType: 'enum IVotingMachineWithProofs.ProposalState', + name: 'state', + type: 'uint8', + }, + ], + internalType: 'struct IVotingMachineDataHelper.Proposal[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] as const; + +export class VotingMachineDataHelper__factory { + static readonly abi = _abi; + static createInterface(): VotingMachineDataHelperInterface { + return new utils.Interface(_abi) as VotingMachineDataHelperInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): VotingMachineDataHelper { + return new Contract( + address, + _abi, + signerOrProvider, + ) as VotingMachineDataHelper; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts index 1ddacbe3..db54fd7a 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/VotingMachine__factory.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ import { Contract, Signer, utils } from "ethers"; diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts index a615252b..33af0453 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/index.ts @@ -1,5 +1,5 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ -export { GovernanceDataHelper__factory } from "./GovernanceDataHelper__factory"; -export { VotingMachine__factory } from "./VotingMachine__factory"; +export { GovernanceDataHelper__factory } from './GovernanceDataHelper__factory'; +export { VotingMachine__factory } from './VotingMachine__factory'; +export { VotingMachineDataHelper__factory } from './VotingMachineDataHelper__factory'; diff --git a/packages/contract-helpers/src/governance-v3/typechain/index.ts b/packages/contract-helpers/src/governance-v3/typechain/index.ts index d2a33871..e42ae127 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/index.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/index.ts @@ -1,8 +1,8 @@ /* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ /* eslint-disable */ -export type { GovernanceDataHelper } from "./GovernanceDataHelper"; -export type { VotingMachine } from "./VotingMachine"; -export * as factories from "./factories"; -export { GovernanceDataHelper__factory } from "./factories/GovernanceDataHelper__factory"; -export { VotingMachine__factory } from "./factories/VotingMachine__factory"; +export type { GovernanceDataHelper } from './GovernanceDataHelper'; +export type { VotingMachine } from './VotingMachine'; +export * as factories from './factories'; +export { GovernanceDataHelper__factory } from './factories/GovernanceDataHelper__factory'; +export { VotingMachine__factory } from './factories/VotingMachine__factory'; +export { VotingMachineDataHelper__factory } from './factories/VotingMachineDataHelper__factory'; diff --git a/packages/contract-helpers/src/governance-v3/types.ts b/packages/contract-helpers/src/governance-v3/types.ts new file mode 100644 index 00000000..1ec6a23a --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/types.ts @@ -0,0 +1,26 @@ +export enum AccessLevel { + /** Do not use */ + None, + /** listing assets, changes of assets params, updates of the protocol etc */ + Short_Executor, + /** payloads controller updates */ + Long_Executor, +} + +export enum ProposalV3State { + /** proposal does not exist */ + Null, + /** created, waiting for a cooldown to initiate the balances snapshot */ + Created, + /** balances snapshot set, voting in progress */ + Active, + /** voting results submitted, but proposal is under grace period when guardian can cancel it */ + Queued, + /** results sent to the execution chain(s) */ + Executed, + /** voting was not successful */ + Failed, + /** got cancelled by guardian, or because proposition power of creator dropped below allowed minimum */ + Cancelled, + Expired, +} diff --git a/packages/contract-helpers/src/governance-v3/voting-machine-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/voting-machine-data-helper/index.ts new file mode 100644 index 00000000..7caffa30 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/voting-machine-data-helper/index.ts @@ -0,0 +1,112 @@ +import { BytesLike, providers } from 'ethers'; +import { VotingMachineDataHelper } from '../typechain/VotingMachineDataHelper'; +import { VotingMachineDataHelper__factory } from '../typechain/index'; + +export type InitialProposals = { + id: number; + snapshotBlockHash: BytesLike; +}; + +export enum VotingMachineProposalState { + NotCreated, + Active, + Finished, + SentToGovernance, +} + +type Proposal = { + id: string; + sentToGovernance: boolean; + startTime: number; + endTime: number; + votingClosedAndSentTimestamp: number; + forVotes: string; + againstVotes: string; + creationBlockNumber: number; + votingClosedAndSentBlockNumber: number; +}; + +export type VotingMachineProposal = { + proposalData: Proposal; + votedInfo: { + support: boolean; + votingPower: string; + }; + strategy: string; + dataWarehouse: string; + votingAssets: string[]; + hasRequiredRoots: boolean; + voteConfig: { + votingDuration: string; + l1ProposalBlockHash: BytesLike; + }; + state: VotingMachineProposalState; +}; + +export interface VotingMachineDataHelperInterface { + getProposalsData: ( + votingMachineContractAddress: string, + proposals: InitialProposals[], + userAddress?: string, + ) => Promise; +} + +export class VotingMachineDataHelperService + implements VotingMachineDataHelperInterface +{ + private readonly _contract: VotingMachineDataHelper; + + constructor( + votingMachineDataHelperContractAddress: string, + provider: providers.Provider, + ) { + this._contract = VotingMachineDataHelper__factory.connect( + votingMachineDataHelperContractAddress, + provider, + ); + } + + public async getProposalsData( + votingMachineContractAddress: string, + proposals: InitialProposals[], + userAddress?: string, + ) { + const data = await this._contract.getProposalsData( + votingMachineContractAddress, + proposals, + userAddress ?? '0x0', + ); + + return data.map(proposal => { + return { + proposalData: { + id: proposal.proposalData.id.toString(), + sentToGovernance: proposal.proposalData.sentToGovernance, + startTime: proposal.proposalData.startTime, + endTime: proposal.proposalData.endTime, + votingClosedAndSentTimestamp: + proposal.proposalData.votingClosedAndSentTimestamp, + forVotes: proposal.proposalData.forVotes.toString(), + againstVotes: proposal.proposalData.againstVotes.toString(), + creationBlockNumber: + proposal.proposalData.creationBlockNumber.toNumber(), + votingClosedAndSentBlockNumber: + proposal.proposalData.votingClosedAndSentBlockNumber.toNumber(), + }, + votedInfo: { + support: proposal.votedInfo.support, + votingPower: proposal.votedInfo.votingPower.toString(), + }, + strategy: proposal.strategy, + dataWarehouse: proposal.dataWarehouse, + votingAssets: proposal.votingAssets, + hasRequiredRoots: proposal.hasRequiredRoots, + voteConfig: { + votingDuration: proposal.voteConfig.votingDuration.toString(), + l1ProposalBlockHash: proposal.voteConfig.l1ProposalBlockHash, + }, + state: proposal.state, + }; + }); + } +} diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index fa87cc12..833d094f 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -31,6 +31,7 @@ export * from './erc20-2612'; export * from './paraswap-debtSwitch-contract'; export * from './paraswap-withdrawAndSwitchAdapter-contract'; export * from './governance-v3/governance-data-helper'; +export * from './governance-v3/voting-machine-data-helper'; // commons export * from './commons/types'; From 644ea70fc21625a27584bf4f0c00132f10da2362 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Mon, 11 Dec 2023 13:13:22 -0600 Subject: [PATCH 11/41] fix: build --- .../governance-data-helper/index.ts | 28 ++++++++++++++++++- .../src/governance-v3/types.ts | 26 ----------------- 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 packages/contract-helpers/src/governance-v3/types.ts diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 625a2d49..58737694 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -1,7 +1,33 @@ import { providers } from 'ethers'; import { GovernanceDataHelper as GovernanceDataHelperContract } from '../typechain/GovernanceDataHelper'; import { GovernanceDataHelper__factory } from '../typechain/factories/GovernanceDataHelper__factory'; -import { AccessLevel, ProposalV3State } from '../types'; + +export enum AccessLevel { + /** Do not use */ + None, + /** listing assets, changes of assets params, updates of the protocol etc */ + Short_Executor, + /** payloads controller updates */ + Long_Executor, +} + +export enum ProposalV3State { + /** proposal does not exist */ + Null, + /** created, waiting for a cooldown to initiate the balances snapshot */ + Created, + /** balances snapshot set, voting in progress */ + Active, + /** voting results submitted, but proposal is under grace period when guardian can cancel it */ + Queued, + /** results sent to the execution chain(s) */ + Executed, + /** voting was not successful */ + Failed, + /** got cancelled by guardian, or because proposition power of creator dropped below allowed minimum */ + Cancelled, + Expired, +} export type ProposalPayload = { chain: number; diff --git a/packages/contract-helpers/src/governance-v3/types.ts b/packages/contract-helpers/src/governance-v3/types.ts deleted file mode 100644 index 1ec6a23a..00000000 --- a/packages/contract-helpers/src/governance-v3/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -export enum AccessLevel { - /** Do not use */ - None, - /** listing assets, changes of assets params, updates of the protocol etc */ - Short_Executor, - /** payloads controller updates */ - Long_Executor, -} - -export enum ProposalV3State { - /** proposal does not exist */ - Null, - /** created, waiting for a cooldown to initiate the balances snapshot */ - Created, - /** balances snapshot set, voting in progress */ - Active, - /** voting results submitted, but proposal is under grace period when guardian can cancel it */ - Queued, - /** results sent to the execution chain(s) */ - Executed, - /** voting was not successful */ - Failed, - /** got cancelled by guardian, or because proposition power of creator dropped below allowed minimum */ - Cancelled, - Expired, -} From 40e2352bacfa027c1074c40377678a81724fd92a Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Mon, 11 Dec 2023 15:11:40 -0600 Subject: [PATCH 12/41] feat: gov core --- .../governance-v3/governance-core/index.ts | 25 + .../typechain/GovernanceCore.d.ts | 1713 +++++++++++++++++ .../factories/GovernanceCore__factory.ts | 1164 +++++++++++ 3 files changed, 2902 insertions(+) create mode 100644 packages/contract-helpers/src/governance-v3/governance-core/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/GovernanceCore.d.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceCore__factory.ts diff --git a/packages/contract-helpers/src/governance-v3/governance-core/index.ts b/packages/contract-helpers/src/governance-v3/governance-core/index.ts new file mode 100644 index 00000000..debf9233 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/governance-core/index.ts @@ -0,0 +1,25 @@ +import { providers } from 'ethers'; +import { GovernanceCore } from '../typechain/GovernanceCore'; +import { GovernanceCore__factory } from '../typechain/factories/GovernanceCore__factory'; + +export interface GovernanceCoreInterface { + getProposalCount: () => Promise; +} +export class GovernanceCoreService implements GovernanceCoreInterface { + private readonly _contract: GovernanceCore; + + constructor( + governanceCoreContractAddress: string, + provider: providers.Provider, + ) { + this._contract = GovernanceCore__factory.connect( + governanceCoreContractAddress, + provider, + ); + } + + public async getProposalCount(): Promise { + const count = await this._contract.getProposalsCount(); + return count.toNumber(); + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/GovernanceCore.d.ts b/packages/contract-helpers/src/governance-v3/typechain/GovernanceCore.d.ts new file mode 100644 index 00000000..7dc4be1d --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/GovernanceCore.d.ts @@ -0,0 +1,1713 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { + FunctionFragment, + Result, + EventFragment, +} from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export declare namespace IVotingMachineWithProofs { + export type VotingAssetWithSlotStruct = { + underlyingAsset: string; + slot: BigNumberish; + }; + + export type VotingAssetWithSlotStructOutput = [string, BigNumber] & { + underlyingAsset: string; + slot: BigNumber; + }; +} + +export declare namespace PayloadsControllerUtils { + export type PayloadStruct = { + chain: BigNumberish; + accessLevel: BigNumberish; + payloadsController: string; + payloadId: BigNumberish; + }; + + export type PayloadStructOutput = [BigNumber, number, string, number] & { + chain: BigNumber; + accessLevel: number; + payloadsController: string; + payloadId: number; + }; +} + +export declare namespace IGovernanceCore { + export type ProposalStruct = { + state: BigNumberish; + accessLevel: BigNumberish; + creationTime: BigNumberish; + votingDuration: BigNumberish; + votingActivationTime: BigNumberish; + queuingTime: BigNumberish; + cancelTimestamp: BigNumberish; + creator: string; + votingPortal: string; + snapshotBlockHash: BytesLike; + ipfsHash: BytesLike; + forVotes: BigNumberish; + againstVotes: BigNumberish; + cancellationFee: BigNumberish; + payloads: PayloadsControllerUtils.PayloadStruct[]; + }; + + export type ProposalStructOutput = [ + number, + number, + number, + number, + number, + number, + number, + string, + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + PayloadsControllerUtils.PayloadStructOutput[], + ] & { + state: number; + accessLevel: number; + creationTime: number; + votingDuration: number; + votingActivationTime: number; + queuingTime: number; + cancelTimestamp: number; + creator: string; + votingPortal: string; + snapshotBlockHash: string; + ipfsHash: string; + forVotes: BigNumber; + againstVotes: BigNumber; + cancellationFee: BigNumber; + payloads: PayloadsControllerUtils.PayloadStructOutput[]; + }; + + export type VotingConfigStruct = { + coolDownBeforeVotingStart: BigNumberish; + votingDuration: BigNumberish; + yesThreshold: BigNumberish; + yesNoDifferential: BigNumberish; + minPropositionPower: BigNumberish; + }; + + export type VotingConfigStructOutput = [ + number, + number, + BigNumber, + BigNumber, + BigNumber, + ] & { + coolDownBeforeVotingStart: number; + votingDuration: number; + yesThreshold: BigNumber; + yesNoDifferential: BigNumber; + minPropositionPower: BigNumber; + }; + + export type SetVotingConfigInputStruct = { + accessLevel: BigNumberish; + coolDownBeforeVotingStart: BigNumberish; + votingDuration: BigNumberish; + yesThreshold: BigNumberish; + yesNoDifferential: BigNumberish; + minPropositionPower: BigNumberish; + }; + + export type SetVotingConfigInputStructOutput = [ + number, + number, + number, + BigNumber, + BigNumber, + BigNumber, + ] & { + accessLevel: number; + coolDownBeforeVotingStart: number; + votingDuration: number; + yesThreshold: BigNumber; + yesNoDifferential: BigNumber; + minPropositionPower: BigNumber; + }; + + export type RepresentativeInputStruct = { + representative: string; + chainId: BigNumberish; + }; + + export type RepresentativeInputStructOutput = [string, BigNumber] & { + representative: string; + chainId: BigNumber; + }; +} + +export interface GovernanceCoreInterface extends utils.Interface { + functions: { + 'ACHIEVABLE_VOTING_PARTICIPATION()': FunctionFragment; + 'CANCELLATION_FEE_COLLECTOR()': FunctionFragment; + 'COOLDOWN_PERIOD()': FunctionFragment; + 'MIN_VOTING_DURATION()': FunctionFragment; + 'NAME()': FunctionFragment; + 'PRECISION_DIVIDER()': FunctionFragment; + 'PROPOSAL_EXPIRATION_TIME()': FunctionFragment; + 'VOTING_TOKENS_CAP()': FunctionFragment; + 'activateVoting(uint256)': FunctionFragment; + 'addVotingPortals(address[])': FunctionFragment; + 'cancelProposal(uint256)': FunctionFragment; + 'createProposal((uint256,uint8,address,uint40)[],address,bytes32)': FunctionFragment; + 'executeProposal(uint256)': FunctionFragment; + 'getCancellationFee()': FunctionFragment; + 'getPowerStrategy()': FunctionFragment; + 'getProposal(uint256)': FunctionFragment; + 'getProposalState(uint256)': FunctionFragment; + 'getProposalsCount()': FunctionFragment; + 'getRepresentativeByChain(address,uint256)': FunctionFragment; + 'getRepresentedVotersByChain(address,uint256)': FunctionFragment; + 'getVotingConfig(uint8)': FunctionFragment; + 'getVotingPortalsCount()': FunctionFragment; + 'guardian()': FunctionFragment; + 'isVotingPortalApproved(address)': FunctionFragment; + 'owner()': FunctionFragment; + 'queueProposal(uint256,uint128,uint128)': FunctionFragment; + 'redeemCancellationFee(uint256[])': FunctionFragment; + 'removeVotingPortals(address[])': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'rescueVotingPortal(address)': FunctionFragment; + 'setPowerStrategy(address)': FunctionFragment; + 'setVotingConfigs((uint8,uint24,uint24,uint256,uint256,uint256)[])': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'updateCancellationFee(uint256)': FunctionFragment; + 'updateGuardian(address)': FunctionFragment; + 'updateRepresentativesForChain((address,uint256)[])': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'ACHIEVABLE_VOTING_PARTICIPATION' + | 'CANCELLATION_FEE_COLLECTOR' + | 'COOLDOWN_PERIOD' + | 'MIN_VOTING_DURATION' + | 'NAME' + | 'PRECISION_DIVIDER' + | 'PROPOSAL_EXPIRATION_TIME' + | 'VOTING_TOKENS_CAP' + | 'activateVoting' + | 'addVotingPortals' + | 'cancelProposal' + | 'createProposal' + | 'executeProposal' + | 'getCancellationFee' + | 'getPowerStrategy' + | 'getProposal' + | 'getProposalState' + | 'getProposalsCount' + | 'getRepresentativeByChain' + | 'getRepresentedVotersByChain' + | 'getVotingConfig' + | 'getVotingPortalsCount' + | 'guardian' + | 'isVotingPortalApproved' + | 'owner' + | 'queueProposal' + | 'redeemCancellationFee' + | 'removeVotingPortals' + | 'renounceOwnership' + | 'rescueVotingPortal' + | 'setPowerStrategy' + | 'setVotingConfigs' + | 'transferOwnership' + | 'updateCancellationFee' + | 'updateGuardian' + | 'updateRepresentativesForChain', + ): FunctionFragment; + + encodeFunctionData( + functionFragment: 'ACHIEVABLE_VOTING_PARTICIPATION', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'CANCELLATION_FEE_COLLECTOR', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'COOLDOWN_PERIOD', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'MIN_VOTING_DURATION', + values?: undefined, + ): string; + encodeFunctionData(functionFragment: 'NAME', values?: undefined): string; + encodeFunctionData( + functionFragment: 'PRECISION_DIVIDER', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'PROPOSAL_EXPIRATION_TIME', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'VOTING_TOKENS_CAP', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'activateVoting', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'addVotingPortals', + values: [string[]], + ): string; + encodeFunctionData( + functionFragment: 'cancelProposal', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'createProposal', + values: [PayloadsControllerUtils.PayloadStruct[], string, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'executeProposal', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getCancellationFee', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getPowerStrategy', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getProposal', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getProposalState', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getProposalsCount', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getRepresentativeByChain', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getRepresentedVotersByChain', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getVotingConfig', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getVotingPortalsCount', + values?: undefined, + ): string; + encodeFunctionData(functionFragment: 'guardian', values?: undefined): string; + encodeFunctionData( + functionFragment: 'isVotingPortalApproved', + values: [string], + ): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData( + functionFragment: 'queueProposal', + values: [BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'redeemCancellationFee', + values: [BigNumberish[]], + ): string; + encodeFunctionData( + functionFragment: 'removeVotingPortals', + values: [string[]], + ): string; + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'rescueVotingPortal', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'setPowerStrategy', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'setVotingConfigs', + values: [IGovernanceCore.SetVotingConfigInputStruct[]], + ): string; + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'updateCancellationFee', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'updateGuardian', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'updateRepresentativesForChain', + values: [IGovernanceCore.RepresentativeInputStruct[]], + ): string; + + decodeFunctionResult( + functionFragment: 'ACHIEVABLE_VOTING_PARTICIPATION', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'CANCELLATION_FEE_COLLECTOR', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'COOLDOWN_PERIOD', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'MIN_VOTING_DURATION', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'NAME', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'PRECISION_DIVIDER', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'PROPOSAL_EXPIRATION_TIME', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'VOTING_TOKENS_CAP', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'activateVoting', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'addVotingPortals', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'cancelProposal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'createProposal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'executeProposal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getCancellationFee', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPowerStrategy', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getProposal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getProposalState', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getProposalsCount', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getRepresentativeByChain', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getRepresentedVotersByChain', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getVotingConfig', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getVotingPortalsCount', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'guardian', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'isVotingPortalApproved', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'queueProposal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'redeemCancellationFee', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'removeVotingPortals', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'rescueVotingPortal', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'setPowerStrategy', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'setVotingConfigs', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'updateCancellationFee', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'updateGuardian', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'updateRepresentativesForChain', + data: BytesLike, + ): Result; + + events: { + 'CancellationFeeRedeemed(uint256,address,uint256,bool)': EventFragment; + 'CancellationFeeUpdated(uint256)': EventFragment; + 'GuardianUpdated(address,address)': EventFragment; + 'Initialized(uint8)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'PayloadSent(uint256,uint40,address,uint256,uint256,uint256)': EventFragment; + 'PowerStrategyUpdated(address)': EventFragment; + 'ProposalCanceled(uint256)': EventFragment; + 'ProposalCreated(uint256,address,uint8,bytes32)': EventFragment; + 'ProposalExecuted(uint256)': EventFragment; + 'ProposalFailed(uint256,uint128,uint128)': EventFragment; + 'ProposalQueued(uint256,uint128,uint128)': EventFragment; + 'RepresentativeUpdated(address,address,uint256)': EventFragment; + 'VoteForwarded(uint256,address,bool,(address,uint128)[])': EventFragment; + 'VotingActivated(uint256,bytes32,uint24)': EventFragment; + 'VotingConfigUpdated(uint8,uint24,uint24,uint256,uint256,uint256)': EventFragment; + 'VotingPortalUpdated(address,bool)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'CancellationFeeRedeemed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'CancellationFeeUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GuardianUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Initialized'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PayloadSent'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PowerStrategyUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ProposalCanceled'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ProposalCreated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ProposalExecuted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ProposalFailed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ProposalQueued'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RepresentativeUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VoteForwarded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VotingActivated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VotingConfigUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VotingPortalUpdated'): EventFragment; +} + +export interface CancellationFeeRedeemedEventObject { + proposalId: BigNumber; + to: string; + cancellationFee: BigNumber; + success: boolean; +} +export type CancellationFeeRedeemedEvent = TypedEvent< + [BigNumber, string, BigNumber, boolean], + CancellationFeeRedeemedEventObject +>; + +export type CancellationFeeRedeemedEventFilter = + TypedEventFilter; + +export interface CancellationFeeUpdatedEventObject { + cancellationFee: BigNumber; +} +export type CancellationFeeUpdatedEvent = TypedEvent< + [BigNumber], + CancellationFeeUpdatedEventObject +>; + +export type CancellationFeeUpdatedEventFilter = + TypedEventFilter; + +export interface GuardianUpdatedEventObject { + oldGuardian: string; + newGuardian: string; +} +export type GuardianUpdatedEvent = TypedEvent< + [string, string], + GuardianUpdatedEventObject +>; + +export type GuardianUpdatedEventFilter = TypedEventFilter; + +export interface InitializedEventObject { + version: number; +} +export type InitializedEvent = TypedEvent<[number], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +>; + +export type OwnershipTransferredEventFilter = + TypedEventFilter; + +export interface PayloadSentEventObject { + proposalId: BigNumber; + payloadId: number; + payloadsController: string; + chainId: BigNumber; + payloadNumberOnProposal: BigNumber; + numberOfPayloadsOnProposal: BigNumber; +} +export type PayloadSentEvent = TypedEvent< + [BigNumber, number, string, BigNumber, BigNumber, BigNumber], + PayloadSentEventObject +>; + +export type PayloadSentEventFilter = TypedEventFilter; + +export interface PowerStrategyUpdatedEventObject { + newPowerStrategy: string; +} +export type PowerStrategyUpdatedEvent = TypedEvent< + [string], + PowerStrategyUpdatedEventObject +>; + +export type PowerStrategyUpdatedEventFilter = + TypedEventFilter; + +export interface ProposalCanceledEventObject { + proposalId: BigNumber; +} +export type ProposalCanceledEvent = TypedEvent< + [BigNumber], + ProposalCanceledEventObject +>; + +export type ProposalCanceledEventFilter = + TypedEventFilter; + +export interface ProposalCreatedEventObject { + proposalId: BigNumber; + creator: string; + accessLevel: number; + ipfsHash: string; +} +export type ProposalCreatedEvent = TypedEvent< + [BigNumber, string, number, string], + ProposalCreatedEventObject +>; + +export type ProposalCreatedEventFilter = TypedEventFilter; + +export interface ProposalExecutedEventObject { + proposalId: BigNumber; +} +export type ProposalExecutedEvent = TypedEvent< + [BigNumber], + ProposalExecutedEventObject +>; + +export type ProposalExecutedEventFilter = + TypedEventFilter; + +export interface ProposalFailedEventObject { + proposalId: BigNumber; + votesFor: BigNumber; + votesAgainst: BigNumber; +} +export type ProposalFailedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + ProposalFailedEventObject +>; + +export type ProposalFailedEventFilter = TypedEventFilter; + +export interface ProposalQueuedEventObject { + proposalId: BigNumber; + votesFor: BigNumber; + votesAgainst: BigNumber; +} +export type ProposalQueuedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber], + ProposalQueuedEventObject +>; + +export type ProposalQueuedEventFilter = TypedEventFilter; + +export interface RepresentativeUpdatedEventObject { + voter: string; + representative: string; + chainId: BigNumber; +} +export type RepresentativeUpdatedEvent = TypedEvent< + [string, string, BigNumber], + RepresentativeUpdatedEventObject +>; + +export type RepresentativeUpdatedEventFilter = + TypedEventFilter; + +export interface VoteForwardedEventObject { + proposalId: BigNumber; + voter: string; + support: boolean; + votingAssetsWithSlot: IVotingMachineWithProofs.VotingAssetWithSlotStructOutput[]; +} +export type VoteForwardedEvent = TypedEvent< + [ + BigNumber, + string, + boolean, + IVotingMachineWithProofs.VotingAssetWithSlotStructOutput[], + ], + VoteForwardedEventObject +>; + +export type VoteForwardedEventFilter = TypedEventFilter; + +export interface VotingActivatedEventObject { + proposalId: BigNumber; + snapshotBlockHash: string; + votingDuration: number; +} +export type VotingActivatedEvent = TypedEvent< + [BigNumber, string, number], + VotingActivatedEventObject +>; + +export type VotingActivatedEventFilter = TypedEventFilter; + +export interface VotingConfigUpdatedEventObject { + accessLevel: number; + votingDuration: number; + coolDownBeforeVotingStart: number; + yesThreshold: BigNumber; + yesNoDifferential: BigNumber; + minPropositionPower: BigNumber; +} +export type VotingConfigUpdatedEvent = TypedEvent< + [number, number, number, BigNumber, BigNumber, BigNumber], + VotingConfigUpdatedEventObject +>; + +export type VotingConfigUpdatedEventFilter = + TypedEventFilter; + +export interface VotingPortalUpdatedEventObject { + votingPortal: string; + approved: boolean; +} +export type VotingPortalUpdatedEvent = TypedEvent< + [string, boolean], + VotingPortalUpdatedEventObject +>; + +export type VotingPortalUpdatedEventFilter = + TypedEventFilter; + +export interface GovernanceCore extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: GovernanceCoreInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + ACHIEVABLE_VOTING_PARTICIPATION( + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + CANCELLATION_FEE_COLLECTOR(overrides?: CallOverrides): Promise<[string]>; + + COOLDOWN_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]>; + + MIN_VOTING_DURATION(overrides?: CallOverrides): Promise<[BigNumber]>; + + NAME(overrides?: CallOverrides): Promise<[string]>; + + PRECISION_DIVIDER(overrides?: CallOverrides): Promise<[BigNumber]>; + + PROPOSAL_EXPIRATION_TIME(overrides?: CallOverrides): Promise<[BigNumber]>; + + VOTING_TOKENS_CAP(overrides?: CallOverrides): Promise<[BigNumber]>; + + activateVoting( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + addVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cancelProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + createProposal( + payloads: PayloadsControllerUtils.PayloadStruct[], + votingPortal: string, + ipfsHash: BytesLike, + overrides?: PayableOverrides & { from?: string }, + ): Promise; + + executeProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + getCancellationFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + getPowerStrategy(overrides?: CallOverrides): Promise<[string]>; + + getProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[IGovernanceCore.ProposalStructOutput]>; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[number]>; + + getProposalsCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + getRepresentativeByChain( + voter: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[string]>; + + getRepresentedVotersByChain( + representative: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise<[string[]]>; + + getVotingConfig( + accessLevel: BigNumberish, + overrides?: CallOverrides, + ): Promise<[IGovernanceCore.VotingConfigStructOutput]>; + + getVotingPortalsCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + guardian(overrides?: CallOverrides): Promise<[string]>; + + isVotingPortalApproved( + votingPortal: string, + overrides?: CallOverrides, + ): Promise<[boolean]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + queueProposal( + proposalId: BigNumberish, + forVotes: BigNumberish, + againstVotes: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemCancellationFee( + proposalIds: BigNumberish[], + overrides?: Overrides & { from?: string }, + ): Promise; + + removeVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string }, + ): Promise; + + rescueVotingPortal( + votingPortal: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPowerStrategy( + powerStrategy: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setVotingConfigs( + votingConfigs: IGovernanceCore.SetVotingConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateCancellationFee( + cancellationFee: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateGuardian( + newGuardian: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateRepresentativesForChain( + representatives: IGovernanceCore.RepresentativeInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + ACHIEVABLE_VOTING_PARTICIPATION( + overrides?: CallOverrides, + ): Promise; + + CANCELLATION_FEE_COLLECTOR(overrides?: CallOverrides): Promise; + + COOLDOWN_PERIOD(overrides?: CallOverrides): Promise; + + MIN_VOTING_DURATION(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + PRECISION_DIVIDER(overrides?: CallOverrides): Promise; + + PROPOSAL_EXPIRATION_TIME(overrides?: CallOverrides): Promise; + + VOTING_TOKENS_CAP(overrides?: CallOverrides): Promise; + + activateVoting( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + addVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cancelProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + createProposal( + payloads: PayloadsControllerUtils.PayloadStruct[], + votingPortal: string, + ipfsHash: BytesLike, + overrides?: PayableOverrides & { from?: string }, + ): Promise; + + executeProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + getCancellationFee(overrides?: CallOverrides): Promise; + + getPowerStrategy(overrides?: CallOverrides): Promise; + + getProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalsCount(overrides?: CallOverrides): Promise; + + getRepresentativeByChain( + voter: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getRepresentedVotersByChain( + representative: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingConfig( + accessLevel: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingPortalsCount(overrides?: CallOverrides): Promise; + + guardian(overrides?: CallOverrides): Promise; + + isVotingPortalApproved( + votingPortal: string, + overrides?: CallOverrides, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + queueProposal( + proposalId: BigNumberish, + forVotes: BigNumberish, + againstVotes: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemCancellationFee( + proposalIds: BigNumberish[], + overrides?: Overrides & { from?: string }, + ): Promise; + + removeVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string }, + ): Promise; + + rescueVotingPortal( + votingPortal: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPowerStrategy( + powerStrategy: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setVotingConfigs( + votingConfigs: IGovernanceCore.SetVotingConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateCancellationFee( + cancellationFee: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateGuardian( + newGuardian: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateRepresentativesForChain( + representatives: IGovernanceCore.RepresentativeInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + callStatic: { + ACHIEVABLE_VOTING_PARTICIPATION( + overrides?: CallOverrides, + ): Promise; + + CANCELLATION_FEE_COLLECTOR(overrides?: CallOverrides): Promise; + + COOLDOWN_PERIOD(overrides?: CallOverrides): Promise; + + MIN_VOTING_DURATION(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + PRECISION_DIVIDER(overrides?: CallOverrides): Promise; + + PROPOSAL_EXPIRATION_TIME(overrides?: CallOverrides): Promise; + + VOTING_TOKENS_CAP(overrides?: CallOverrides): Promise; + + activateVoting( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + addVotingPortals( + votingPortals: string[], + overrides?: CallOverrides, + ): Promise; + + cancelProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + createProposal( + payloads: PayloadsControllerUtils.PayloadStruct[], + votingPortal: string, + ipfsHash: BytesLike, + overrides?: CallOverrides, + ): Promise; + + executeProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getCancellationFee(overrides?: CallOverrides): Promise; + + getPowerStrategy(overrides?: CallOverrides): Promise; + + getProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalsCount(overrides?: CallOverrides): Promise; + + getRepresentativeByChain( + voter: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getRepresentedVotersByChain( + representative: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingConfig( + accessLevel: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingPortalsCount(overrides?: CallOverrides): Promise; + + guardian(overrides?: CallOverrides): Promise; + + isVotingPortalApproved( + votingPortal: string, + overrides?: CallOverrides, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + queueProposal( + proposalId: BigNumberish, + forVotes: BigNumberish, + againstVotes: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeemCancellationFee( + proposalIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + removeVotingPortals( + votingPortals: string[], + overrides?: CallOverrides, + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + rescueVotingPortal( + votingPortal: string, + overrides?: CallOverrides, + ): Promise; + + setPowerStrategy( + powerStrategy: string, + overrides?: CallOverrides, + ): Promise; + + setVotingConfigs( + votingConfigs: IGovernanceCore.SetVotingConfigInputStruct[], + overrides?: CallOverrides, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides, + ): Promise; + + updateCancellationFee( + cancellationFee: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + updateGuardian( + newGuardian: string, + overrides?: CallOverrides, + ): Promise; + + updateRepresentativesForChain( + representatives: IGovernanceCore.RepresentativeInputStruct[], + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'CancellationFeeRedeemed(uint256,address,uint256,bool)'( + proposalId?: BigNumberish | null, + to?: string | null, + cancellationFee?: null, + success?: boolean | null, + ): CancellationFeeRedeemedEventFilter; + CancellationFeeRedeemed( + proposalId?: BigNumberish | null, + to?: string | null, + cancellationFee?: null, + success?: boolean | null, + ): CancellationFeeRedeemedEventFilter; + + 'CancellationFeeUpdated(uint256)'( + cancellationFee?: null, + ): CancellationFeeUpdatedEventFilter; + CancellationFeeUpdated( + cancellationFee?: null, + ): CancellationFeeUpdatedEventFilter; + + 'GuardianUpdated(address,address)'( + oldGuardian?: null, + newGuardian?: null, + ): GuardianUpdatedEventFilter; + GuardianUpdated( + oldGuardian?: null, + newGuardian?: null, + ): GuardianUpdatedEventFilter; + + 'Initialized(uint8)'(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + 'OwnershipTransferred(address,address)'( + previousOwner?: string | null, + newOwner?: string | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: string | null, + newOwner?: string | null, + ): OwnershipTransferredEventFilter; + + 'PayloadSent(uint256,uint40,address,uint256,uint256,uint256)'( + proposalId?: BigNumberish | null, + payloadId?: null, + payloadsController?: string | null, + chainId?: BigNumberish | null, + payloadNumberOnProposal?: null, + numberOfPayloadsOnProposal?: null, + ): PayloadSentEventFilter; + PayloadSent( + proposalId?: BigNumberish | null, + payloadId?: null, + payloadsController?: string | null, + chainId?: BigNumberish | null, + payloadNumberOnProposal?: null, + numberOfPayloadsOnProposal?: null, + ): PayloadSentEventFilter; + + 'PowerStrategyUpdated(address)'( + newPowerStrategy?: string | null, + ): PowerStrategyUpdatedEventFilter; + PowerStrategyUpdated( + newPowerStrategy?: string | null, + ): PowerStrategyUpdatedEventFilter; + + 'ProposalCanceled(uint256)'( + proposalId?: BigNumberish | null, + ): ProposalCanceledEventFilter; + ProposalCanceled( + proposalId?: BigNumberish | null, + ): ProposalCanceledEventFilter; + + 'ProposalCreated(uint256,address,uint8,bytes32)'( + proposalId?: BigNumberish | null, + creator?: string | null, + accessLevel?: BigNumberish | null, + ipfsHash?: null, + ): ProposalCreatedEventFilter; + ProposalCreated( + proposalId?: BigNumberish | null, + creator?: string | null, + accessLevel?: BigNumberish | null, + ipfsHash?: null, + ): ProposalCreatedEventFilter; + + 'ProposalExecuted(uint256)'( + proposalId?: BigNumberish | null, + ): ProposalExecutedEventFilter; + ProposalExecuted( + proposalId?: BigNumberish | null, + ): ProposalExecutedEventFilter; + + 'ProposalFailed(uint256,uint128,uint128)'( + proposalId?: BigNumberish | null, + votesFor?: null, + votesAgainst?: null, + ): ProposalFailedEventFilter; + ProposalFailed( + proposalId?: BigNumberish | null, + votesFor?: null, + votesAgainst?: null, + ): ProposalFailedEventFilter; + + 'ProposalQueued(uint256,uint128,uint128)'( + proposalId?: BigNumberish | null, + votesFor?: null, + votesAgainst?: null, + ): ProposalQueuedEventFilter; + ProposalQueued( + proposalId?: BigNumberish | null, + votesFor?: null, + votesAgainst?: null, + ): ProposalQueuedEventFilter; + + 'RepresentativeUpdated(address,address,uint256)'( + voter?: string | null, + representative?: string | null, + chainId?: BigNumberish | null, + ): RepresentativeUpdatedEventFilter; + RepresentativeUpdated( + voter?: string | null, + representative?: string | null, + chainId?: BigNumberish | null, + ): RepresentativeUpdatedEventFilter; + + 'VoteForwarded(uint256,address,bool,(address,uint128)[])'( + proposalId?: BigNumberish | null, + voter?: string | null, + support?: boolean | null, + votingAssetsWithSlot?: null, + ): VoteForwardedEventFilter; + VoteForwarded( + proposalId?: BigNumberish | null, + voter?: string | null, + support?: boolean | null, + votingAssetsWithSlot?: null, + ): VoteForwardedEventFilter; + + 'VotingActivated(uint256,bytes32,uint24)'( + proposalId?: BigNumberish | null, + snapshotBlockHash?: BytesLike | null, + votingDuration?: null, + ): VotingActivatedEventFilter; + VotingActivated( + proposalId?: BigNumberish | null, + snapshotBlockHash?: BytesLike | null, + votingDuration?: null, + ): VotingActivatedEventFilter; + + 'VotingConfigUpdated(uint8,uint24,uint24,uint256,uint256,uint256)'( + accessLevel?: BigNumberish | null, + votingDuration?: null, + coolDownBeforeVotingStart?: null, + yesThreshold?: null, + yesNoDifferential?: null, + minPropositionPower?: null, + ): VotingConfigUpdatedEventFilter; + VotingConfigUpdated( + accessLevel?: BigNumberish | null, + votingDuration?: null, + coolDownBeforeVotingStart?: null, + yesThreshold?: null, + yesNoDifferential?: null, + minPropositionPower?: null, + ): VotingConfigUpdatedEventFilter; + + 'VotingPortalUpdated(address,bool)'( + votingPortal?: string | null, + approved?: boolean | null, + ): VotingPortalUpdatedEventFilter; + VotingPortalUpdated( + votingPortal?: string | null, + approved?: boolean | null, + ): VotingPortalUpdatedEventFilter; + }; + + estimateGas: { + ACHIEVABLE_VOTING_PARTICIPATION( + overrides?: CallOverrides, + ): Promise; + + CANCELLATION_FEE_COLLECTOR(overrides?: CallOverrides): Promise; + + COOLDOWN_PERIOD(overrides?: CallOverrides): Promise; + + MIN_VOTING_DURATION(overrides?: CallOverrides): Promise; + + NAME(overrides?: CallOverrides): Promise; + + PRECISION_DIVIDER(overrides?: CallOverrides): Promise; + + PROPOSAL_EXPIRATION_TIME(overrides?: CallOverrides): Promise; + + VOTING_TOKENS_CAP(overrides?: CallOverrides): Promise; + + activateVoting( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + addVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cancelProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + createProposal( + payloads: PayloadsControllerUtils.PayloadStruct[], + votingPortal: string, + ipfsHash: BytesLike, + overrides?: PayableOverrides & { from?: string }, + ): Promise; + + executeProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + getCancellationFee(overrides?: CallOverrides): Promise; + + getPowerStrategy(overrides?: CallOverrides): Promise; + + getProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalsCount(overrides?: CallOverrides): Promise; + + getRepresentativeByChain( + voter: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getRepresentedVotersByChain( + representative: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingConfig( + accessLevel: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingPortalsCount(overrides?: CallOverrides): Promise; + + guardian(overrides?: CallOverrides): Promise; + + isVotingPortalApproved( + votingPortal: string, + overrides?: CallOverrides, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + queueProposal( + proposalId: BigNumberish, + forVotes: BigNumberish, + againstVotes: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemCancellationFee( + proposalIds: BigNumberish[], + overrides?: Overrides & { from?: string }, + ): Promise; + + removeVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string }, + ): Promise; + + rescueVotingPortal( + votingPortal: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPowerStrategy( + powerStrategy: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setVotingConfigs( + votingConfigs: IGovernanceCore.SetVotingConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateCancellationFee( + cancellationFee: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateGuardian( + newGuardian: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateRepresentativesForChain( + representatives: IGovernanceCore.RepresentativeInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + populateTransaction: { + ACHIEVABLE_VOTING_PARTICIPATION( + overrides?: CallOverrides, + ): Promise; + + CANCELLATION_FEE_COLLECTOR( + overrides?: CallOverrides, + ): Promise; + + COOLDOWN_PERIOD(overrides?: CallOverrides): Promise; + + MIN_VOTING_DURATION( + overrides?: CallOverrides, + ): Promise; + + NAME(overrides?: CallOverrides): Promise; + + PRECISION_DIVIDER(overrides?: CallOverrides): Promise; + + PROPOSAL_EXPIRATION_TIME( + overrides?: CallOverrides, + ): Promise; + + VOTING_TOKENS_CAP(overrides?: CallOverrides): Promise; + + activateVoting( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + addVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cancelProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + createProposal( + payloads: PayloadsControllerUtils.PayloadStruct[], + votingPortal: string, + ipfsHash: BytesLike, + overrides?: PayableOverrides & { from?: string }, + ): Promise; + + executeProposal( + proposalId: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + getCancellationFee( + overrides?: CallOverrides, + ): Promise; + + getPowerStrategy(overrides?: CallOverrides): Promise; + + getProposal( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalState( + proposalId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getProposalsCount(overrides?: CallOverrides): Promise; + + getRepresentativeByChain( + voter: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getRepresentedVotersByChain( + representative: string, + chainId: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingConfig( + accessLevel: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getVotingPortalsCount( + overrides?: CallOverrides, + ): Promise; + + guardian(overrides?: CallOverrides): Promise; + + isVotingPortalApproved( + votingPortal: string, + overrides?: CallOverrides, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + queueProposal( + proposalId: BigNumberish, + forVotes: BigNumberish, + againstVotes: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemCancellationFee( + proposalIds: BigNumberish[], + overrides?: Overrides & { from?: string }, + ): Promise; + + removeVotingPortals( + votingPortals: string[], + overrides?: Overrides & { from?: string }, + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string }, + ): Promise; + + rescueVotingPortal( + votingPortal: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPowerStrategy( + powerStrategy: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + setVotingConfigs( + votingConfigs: IGovernanceCore.SetVotingConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateCancellationFee( + cancellationFee: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateGuardian( + newGuardian: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + updateRepresentativesForChain( + representatives: IGovernanceCore.RepresentativeInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceCore__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceCore__factory.ts new file mode 100644 index 00000000..032bc4de --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/GovernanceCore__factory.ts @@ -0,0 +1,1164 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { + GovernanceCore, + GovernanceCoreInterface, +} from '../GovernanceCore'; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'cancellationFee', + type: 'uint256', + }, + { + indexed: true, + internalType: 'bool', + name: 'success', + type: 'bool', + }, + ], + name: 'CancellationFeeRedeemed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'cancellationFee', + type: 'uint256', + }, + ], + name: 'CancellationFeeUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldGuardian', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newGuardian', + type: 'address', + }, + ], + name: 'GuardianUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint40', + name: 'payloadId', + type: 'uint40', + }, + { + indexed: true, + internalType: 'address', + name: 'payloadsController', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'payloadNumberOnProposal', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'numberOfPayloadsOnProposal', + type: 'uint256', + }, + ], + name: 'PayloadSent', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newPowerStrategy', + type: 'address', + }, + ], + name: 'PowerStrategyUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'ProposalCanceled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'creator', + type: 'address', + }, + { + indexed: true, + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'ipfsHash', + type: 'bytes32', + }, + ], + name: 'ProposalCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'ProposalExecuted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'votesFor', + type: 'uint128', + }, + { + indexed: false, + internalType: 'uint128', + name: 'votesAgainst', + type: 'uint128', + }, + ], + name: 'ProposalFailed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'votesFor', + type: 'uint128', + }, + { + indexed: false, + internalType: 'uint128', + name: 'votesAgainst', + type: 'uint128', + }, + ], + name: 'ProposalQueued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'voter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'representative', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + ], + name: 'RepresentativeUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'voter', + type: 'address', + }, + { + indexed: true, + internalType: 'bool', + name: 'support', + type: 'bool', + }, + { + components: [ + { + internalType: 'address', + name: 'underlyingAsset', + type: 'address', + }, + { + internalType: 'uint128', + name: 'slot', + type: 'uint128', + }, + ], + indexed: false, + internalType: 'struct IVotingMachineWithProofs.VotingAssetWithSlot[]', + name: 'votingAssetsWithSlot', + type: 'tuple[]', + }, + ], + name: 'VoteForwarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'snapshotBlockHash', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + ], + name: 'VotingActivated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + indexed: false, + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + { + indexed: false, + internalType: 'uint24', + name: 'coolDownBeforeVotingStart', + type: 'uint24', + }, + { + indexed: false, + internalType: 'uint256', + name: 'yesThreshold', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'yesNoDifferential', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minPropositionPower', + type: 'uint256', + }, + ], + name: 'VotingConfigUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'votingPortal', + type: 'address', + }, + { + indexed: true, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'VotingPortalUpdated', + type: 'event', + }, + { + inputs: [], + name: 'ACHIEVABLE_VOTING_PARTICIPATION', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CANCELLATION_FEE_COLLECTOR', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'COOLDOWN_PERIOD', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MIN_VOTING_DURATION', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'NAME', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PRECISION_DIVIDER', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PROPOSAL_EXPIRATION_TIME', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'VOTING_TOKENS_CAP', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'activateVoting', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'votingPortals', + type: 'address[]', + }, + ], + name: 'addVotingPortals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'cancelProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'chain', + type: 'uint256', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + internalType: 'address', + name: 'payloadsController', + type: 'address', + }, + { + internalType: 'uint40', + name: 'payloadId', + type: 'uint40', + }, + ], + internalType: 'struct PayloadsControllerUtils.Payload[]', + name: 'payloads', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'votingPortal', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'ipfsHash', + type: 'bytes32', + }, + ], + name: 'createProposal', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'executeProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getCancellationFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPowerStrategy', + outputs: [ + { + internalType: 'contract IGovernancePowerStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'getProposal', + outputs: [ + { + components: [ + { + internalType: 'enum IGovernanceCore.State', + name: 'state', + type: 'uint8', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + internalType: 'uint40', + name: 'creationTime', + type: 'uint40', + }, + { + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + { + internalType: 'uint40', + name: 'votingActivationTime', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'queuingTime', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'cancelTimestamp', + type: 'uint40', + }, + { + internalType: 'address', + name: 'creator', + type: 'address', + }, + { + internalType: 'address', + name: 'votingPortal', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'snapshotBlockHash', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'ipfsHash', + type: 'bytes32', + }, + { + internalType: 'uint128', + name: 'forVotes', + type: 'uint128', + }, + { + internalType: 'uint128', + name: 'againstVotes', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'cancellationFee', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'chain', + type: 'uint256', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + internalType: 'address', + name: 'payloadsController', + type: 'address', + }, + { + internalType: 'uint40', + name: 'payloadId', + type: 'uint40', + }, + ], + internalType: 'struct PayloadsControllerUtils.Payload[]', + name: 'payloads', + type: 'tuple[]', + }, + ], + internalType: 'struct IGovernanceCore.Proposal', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'getProposalState', + outputs: [ + { + internalType: 'enum IGovernanceCore.State', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getProposalsCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'voter', + type: 'address', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + ], + name: 'getRepresentativeByChain', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'representative', + type: 'address', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + ], + name: 'getRepresentedVotersByChain', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + ], + name: 'getVotingConfig', + outputs: [ + { + components: [ + { + internalType: 'uint24', + name: 'coolDownBeforeVotingStart', + type: 'uint24', + }, + { + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + { + internalType: 'uint56', + name: 'yesThreshold', + type: 'uint56', + }, + { + internalType: 'uint56', + name: 'yesNoDifferential', + type: 'uint56', + }, + { + internalType: 'uint56', + name: 'minPropositionPower', + type: 'uint56', + }, + ], + internalType: 'struct IGovernanceCore.VotingConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVotingPortalsCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'guardian', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'votingPortal', + type: 'address', + }, + ], + name: 'isVotingPortalApproved', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint128', + name: 'forVotes', + type: 'uint128', + }, + { + internalType: 'uint128', + name: 'againstVotes', + type: 'uint128', + }, + ], + name: 'queueProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'proposalIds', + type: 'uint256[]', + }, + ], + name: 'redeemCancellationFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'votingPortals', + type: 'address[]', + }, + ], + name: 'removeVotingPortals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'votingPortal', + type: 'address', + }, + ], + name: 'rescueVotingPortal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IGovernancePowerStrategy', + name: 'powerStrategy', + type: 'address', + }, + ], + name: 'setPowerStrategy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + internalType: 'uint24', + name: 'coolDownBeforeVotingStart', + type: 'uint24', + }, + { + internalType: 'uint24', + name: 'votingDuration', + type: 'uint24', + }, + { + internalType: 'uint256', + name: 'yesThreshold', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yesNoDifferential', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minPropositionPower', + type: 'uint256', + }, + ], + internalType: 'struct IGovernanceCore.SetVotingConfigInput[]', + name: 'votingConfigs', + type: 'tuple[]', + }, + ], + name: 'setVotingConfigs', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'cancellationFee', + type: 'uint256', + }, + ], + name: 'updateCancellationFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newGuardian', + type: 'address', + }, + ], + name: 'updateGuardian', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'representative', + type: 'address', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + ], + internalType: 'struct IGovernanceCore.RepresentativeInput[]', + name: 'representatives', + type: 'tuple[]', + }, + ], + name: 'updateRepresentativesForChain', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; + +export class GovernanceCore__factory { + static readonly abi = _abi; + static createInterface(): GovernanceCoreInterface { + return new utils.Interface(_abi) as GovernanceCoreInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): GovernanceCore { + return new Contract(address, _abi, signerOrProvider) as GovernanceCore; + } +} From 1433358e2652d0d14a3119b90fca41cad59d08c9 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Mon, 11 Dec 2023 15:25:22 -0600 Subject: [PATCH 13/41] fix: export --- packages/contract-helpers/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index 833d094f..19b16e80 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -32,6 +32,7 @@ export * from './paraswap-debtSwitch-contract'; export * from './paraswap-withdrawAndSwitchAdapter-contract'; export * from './governance-v3/governance-data-helper'; export * from './governance-v3/voting-machine-data-helper'; +export * from './governance-v3/governance-core'; // commons export * from './commons/types'; From d0266e10411329ea9ae0ad5e4793c390d5eca701 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 13 Dec 2023 16:44:35 -0600 Subject: [PATCH 14/41] feat: update reps --- .../governance-v3/governance-core/index.ts | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/governance-core/index.ts b/packages/contract-helpers/src/governance-v3/governance-core/index.ts index debf9233..3e5a8aca 100644 --- a/packages/contract-helpers/src/governance-v3/governance-core/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-core/index.ts @@ -1,25 +1,52 @@ -import { providers } from 'ethers'; -import { GovernanceCore } from '../typechain/GovernanceCore'; +import { ChainId } from 'contract-helpers/src/commons/types'; +import { BigNumber, PopulatedTransaction, providers } from 'ethers'; +import { + GovernanceCore, + GovernanceCoreInterface, +} from '../typechain/GovernanceCore'; import { GovernanceCore__factory } from '../typechain/factories/GovernanceCore__factory'; -export interface GovernanceCoreInterface { +export interface GovernanceCoreServiceInterface { getProposalCount: () => Promise; + updateRepresentativesForChain: ( + user: string, + representatives: Array<{ representative: string; chainId: ChainId }>, + ) => PopulatedTransaction; } -export class GovernanceCoreService implements GovernanceCoreInterface { - private readonly _contract: GovernanceCore; +export class GovernanceCoreService implements GovernanceCoreServiceInterface { + private readonly _contractInterface: GovernanceCoreInterface; + private readonly _contractInstance: GovernanceCore; constructor( governanceCoreContractAddress: string, provider: providers.Provider, ) { - this._contract = GovernanceCore__factory.connect( + this._contractInterface = GovernanceCore__factory.createInterface(); + this._contractInstance = GovernanceCore__factory.connect( governanceCoreContractAddress, provider, ); } public async getProposalCount(): Promise { - const count = await this._contract.getProposalsCount(); + const count = await this._contractInstance.getProposalsCount(); return count.toNumber(); } + + public updateRepresentativesForChain( + user: string, + representatives: Array<{ representative: string; chainId: ChainId }>, + ): PopulatedTransaction { + const actionTx: PopulatedTransaction = { + data: this._contractInterface.encodeFunctionData( + 'updateRepresentativesForChain', + [representatives], + ), + to: this._contractInstance.address, + from: user, + gasLimit: BigNumber.from('1000000'), + }; + + return actionTx; + } } From e8b6223002e5618eb6c529c7d08a269b64fa88d7 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 19 Dec 2023 10:35:03 -0600 Subject: [PATCH 15/41] feat: aave v3 token --- .../src/governance-v3/aave-token-v3/index.ts | 27 + .../governance-v3/typechain/AaveTokenV3.d.ts | 1109 +++++++++++++++++ .../factories/AaveTokenV3__factory.ts | 778 ++++++++++++ .../src/governance-v3/typechain/index.ts | 3 +- packages/contract-helpers/src/index.ts | 1 + 5 files changed, 1917 insertions(+), 1 deletion(-) create mode 100644 packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/AaveTokenV3.d.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/AaveTokenV3__factory.ts diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts new file mode 100644 index 00000000..48b76a4e --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -0,0 +1,27 @@ +import { providers } from 'ethers'; +import { AaveTokenV3 } from '../typechain/AaveTokenV3'; +import { AaveTokenV3__factory } from '../typechain/factories/AaveTokenV3__factory'; + +export enum GovernancePowerType { + VOTING, + PROPOSITION, +} + +export class AaveTokenV3Service { + readonly _contract: AaveTokenV3; + + constructor(tokenAddress: string, provider: providers.Provider) { + this._contract = AaveTokenV3__factory.connect(tokenAddress, provider); + } + + public async balanceOf(user: string) { + return this._contract.balanceOf(user); + } + + public async getPowerCurrent( + user: string, + delegationType: GovernancePowerType, + ) { + return this._contract.getPowerCurrent(user, delegationType); + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/AaveTokenV3.d.ts b/packages/contract-helpers/src/governance-v3/typechain/AaveTokenV3.d.ts new file mode 100644 index 00000000..d6b4f0a1 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/AaveTokenV3.d.ts @@ -0,0 +1,1109 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { + FunctionFragment, + Result, + EventFragment, +} from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export interface AaveTokenV3Interface extends utils.Interface { + functions: { + 'DELEGATE_BY_TYPE_TYPEHASH()': FunctionFragment; + 'DELEGATE_TYPEHASH()': FunctionFragment; + 'DOMAIN_SEPARATOR()': FunctionFragment; + 'PERMIT_TYPEHASH()': FunctionFragment; + 'POWER_SCALE_FACTOR()': FunctionFragment; + 'REVISION()': FunctionFragment; + '_nonces(address)': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'delegate(address)': FunctionFragment; + 'delegateByType(address,uint8)': FunctionFragment; + 'eip712Domain()': FunctionFragment; + 'getDelegateeByType(address,uint8)': FunctionFragment; + 'getDelegates(address)': FunctionFragment; + 'getPowerCurrent(address,uint8)': FunctionFragment; + 'getPowersCurrent(address)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'initialize()': FunctionFragment; + 'metaDelegate(address,address,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'metaDelegateByType(address,address,uint8,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'name()': FunctionFragment; + 'permit(address,address,uint256,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'DELEGATE_BY_TYPE_TYPEHASH' + | 'DELEGATE_TYPEHASH' + | 'DOMAIN_SEPARATOR' + | 'PERMIT_TYPEHASH' + | 'POWER_SCALE_FACTOR' + | 'REVISION' + | '_nonces' + | 'allowance' + | 'approve' + | 'balanceOf' + | 'decimals' + | 'decreaseAllowance' + | 'delegate' + | 'delegateByType' + | 'eip712Domain' + | 'getDelegateeByType' + | 'getDelegates' + | 'getPowerCurrent' + | 'getPowersCurrent' + | 'increaseAllowance' + | 'initialize' + | 'metaDelegate' + | 'metaDelegateByType' + | 'name' + | 'permit' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData( + functionFragment: 'DELEGATE_BY_TYPE_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DELEGATE_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DOMAIN_SEPARATOR', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'PERMIT_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'POWER_SCALE_FACTOR', + values?: undefined, + ): string; + encodeFunctionData(functionFragment: 'REVISION', values?: undefined): string; + encodeFunctionData(functionFragment: '_nonces', values: [string]): string; + encodeFunctionData( + functionFragment: 'allowance', + values: [string, string], + ): string; + encodeFunctionData( + functionFragment: 'approve', + values: [string, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData( + functionFragment: 'decreaseAllowance', + values: [string, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'delegate', values: [string]): string; + encodeFunctionData( + functionFragment: 'delegateByType', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'eip712Domain', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getDelegateeByType', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getDelegates', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'getPowerCurrent', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getPowersCurrent', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'increaseAllowance', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'initialize', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'metaDelegate', + values: [string, string, BigNumberish, BigNumberish, BytesLike, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'metaDelegateByType', + values: [ + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike, + ], + ): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData( + functionFragment: 'permit', + values: [ + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike, + ], + ): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData( + functionFragment: 'totalSupply', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [string, string, BigNumberish], + ): string; + + decodeFunctionResult( + functionFragment: 'DELEGATE_BY_TYPE_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DELEGATE_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DOMAIN_SEPARATOR', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'PERMIT_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'POWER_SCALE_FACTOR', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'REVISION', data: BytesLike): Result; + decodeFunctionResult(functionFragment: '_nonces', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'decreaseAllowance', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'delegate', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'delegateByType', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'eip712Domain', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getDelegateeByType', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getDelegates', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPowerCurrent', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPowersCurrent', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'increaseAllowance', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'metaDelegate', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'metaDelegateByType', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'permit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'totalSupply', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'transferFrom', + data: BytesLike, + ): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'DelegateChanged(address,address,uint8)': EventFragment; + 'EIP712DomainChanged()': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DelegateChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'EIP712DomainChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface DelegateChangedEventObject { + delegator: string; + delegatee: string; + delegationType: number; +} +export type DelegateChangedEvent = TypedEvent< + [string, string, number], + DelegateChangedEventObject +>; + +export type DelegateChangedEventFilter = TypedEventFilter; + +export interface EIP712DomainChangedEventObject {} +export type EIP712DomainChangedEvent = TypedEvent< + [], + EIP712DomainChangedEventObject +>; + +export type EIP712DomainChangedEventFilter = + TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; + +export type TransferEventFilter = TypedEventFilter; + +export interface AaveTokenV3 extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: AaveTokenV3Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise<[BigNumber]>; + + REVISION(overrides?: CallOverrides): Promise<[BigNumber]>; + + _nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise<[string]>; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + callStatic: { + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + delegate(delegatee: string, overrides?: CallOverrides): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + initialize(overrides?: CallOverrides): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + + 'DelegateChanged(address,address,uint8)'( + delegator?: string | null, + delegatee?: string | null, + delegationType?: null, + ): DelegateChangedEventFilter; + DelegateChanged( + delegator?: string | null, + delegatee?: string | null, + delegationType?: null, + ): DelegateChangedEventFilter; + + 'EIP712DomainChanged()'(): EIP712DomainChangedEventFilter; + EIP712DomainChanged(): EIP712DomainChangedEventFilter; + + 'Transfer(address,address,uint256)'( + from?: string | null, + to?: string | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null, + ): TransferEventFilter; + }; + + estimateGas: { + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize(overrides?: Overrides & { from?: string }): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + populateTransaction: { + DELEGATE_BY_TYPE_TYPEHASH( + overrides?: CallOverrides, + ): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR( + overrides?: CallOverrides, + ): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + _nonces( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/AaveTokenV3__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/AaveTokenV3__factory.ts new file mode 100644 index 00000000..268a6bdb --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/AaveTokenV3__factory.ts @@ -0,0 +1,778 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from 'ethers'; +import type { Provider, TransactionRequest } from '@ethersproject/providers'; +import type { AaveTokenV3, AaveTokenV3Interface } from '../AaveTokenV3'; + +const _abi = [ + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + indexed: false, + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'DELEGATE_BY_TYPE_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DELEGATE_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'POWER_SCALE_FACTOR', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REVISION', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: '_nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'delegateByType', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'getDelegateeByType', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + ], + name: 'getDelegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'getPowerCurrent', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPowersCurrent', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'metaDelegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'metaDelegateByType', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; + +const _bytecode = + '0x61016060405260006006553480156200001757600080fd5b506040518060400160405280600d81526020016c4161766520746f6b656e20563360981b815250604051806040016040528060018152602001601960f91b81525062000069826200011560201b60201c565b61012052620000788162000115565b61014052815160208084019190912060e052815190820120610100524660a0526200010660e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052620001d9565b600080829050601f815111156200014c578260405163305a27a960e01b815260040162000143919062000161565b60405180910390fd5b80516200015982620001b1565b179392505050565b600060208083528351808285015260005b81811015620001905785810183015185820160400152820162000172565b506000604082860101526040601f19601f8301168501019250505092915050565b80516020808301519190811015620001d3576000198160200360031b1b821691505b50919050565b60805160a05160c05160e0516101005161012051610140516121cf62000234600039600061149101526000611466015260006112b40152600061128c015260006111e7015260006112110152600061123b01526121cf6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636f50458d11610104578063a9059cbb116100a2578063d505accf11610071578063d505accf1461043d578063dc937e1c14610450578063dd62ed3e14610463578063dde43cba1461049c57600080fd5b8063a9059cbb146103d0578063aa9fbe02146103e3578063b2f4201d1461040a578063b9844d8d1461041d57600080fd5b806384b0196e116100de57806384b0196e1461038757806395d89b41146103a2578063a095ac19146103aa578063a457c2d7146103bd57600080fd5b80636f50458d1461034157806370a082311461036c5780638129fc1c1461037f57600080fd5b8063313ce5671161017157806341cbf54a1161014b57806341cbf54a146102e6578063570a97141461030d5780635c19a95c14610319578063657f0cde1461032e57600080fd5b8063313ce567146102bc5780633644e515146102cb57806339509351146102d357600080fd5b806318160ddd116101ad57806318160ddd1461024857806323b872dd1461025a5780632a8b36681461026d57806330adf81f1461029557600080fd5b806306fdde03146101d4578063095ea7b3146101f2578063169db77d14610215575b600080fd5b6101dc6104a4565b6040516101e99190611c86565b60405180910390f35b610205610200366004611cb5565b610536565b60405190151581526020016101e9565b610228610223366004611cdf565b610550565b604080516001600160a01b039384168152929091166020830152016101e9565b6002545b6040519081526020016101e9565b610205610268366004611cfa565b610582565b61028061027b366004611cdf565b6105a8565b604080519283526020830191909152016101e9565b61024c7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b604051601281526020016101e9565b61024c6105ca565b6102056102e1366004611cb5565b6105d9565b61024c7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e81565b61024c6402540be40081565b61032c610327366004611cdf565b610618565b005b61032c61033c366004611d56565b610633565b61035461034f366004611dc7565b610778565b6040516001600160a01b0390911681526020016101e9565b61024c61037a366004611cdf565b61078d565b61032c6107b1565b61038f610821565b6040516101e99796959493929190611dfa565b6101dc610867565b61032c6103b8366004611e90565b610876565b6102056103cb366004611cb5565b6109a8565b6102056103de366004611cb5565b610a45565b61024c7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a0381565b61024c610418366004611dc7565b610a53565b61024c61042b366004611cdf565b60396020526000908152604090205481565b61032c61044b366004611eef565b610ad5565b61032c61045e366004611dc7565b610c1c565b61024c610471366004611f3d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61024c600481565b6060600380546104b390611f67565b80601f01602080910402602001604051908101604052809291908181526020018280546104df90611f67565b801561052c5780601f106105015761010080835404028352916020019161052c565b820191906000526020600020905b81548152906001019060200180831161050f57829003601f168201915b5050505050905090565b600033610544818585610c2b565b60019150505b92915050565b600080600061055e84610d50565b905061056c84826000610e53565b61057885836001610e53565b9250925050915091565b600033610590858285610f03565b61059b858585610f95565b60019150505b9392505050565b6000806105b6836000610a53565b6105c1846001610a53565b91509150915091565b60006105d46111da565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906105449082908690610613908790611fb7565b610c2b565b61062433826000611305565b61063033826001611305565b50565b6001600160a01b0387166106625760405162461bcd60e51b815260040161065990611fca565b60405180910390fd5b834211156106825760405162461bcd60e51b815260040161065990611ff1565b600061072561068f61142d565b7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a038a8a8a6106da8e6001600160a01b0316600090815260396020526040902080546001810190915590565b8b6040516020016106f096959493929190612055565b6040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b905061073381858585611437565b6001600160a01b0316886001600160a01b0316146107635760405162461bcd60e51b815260040161065990612094565b61076e888888611305565b5050505050505050565b60006105a18361078785610d50565b84610e53565b6001600160a01b03166000908152602081905260409020546001600160681b031690565b600654600490811161081c5760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b6064820152608401610659565b600655565b60006060806000806000606061083561145f565b61083d61148a565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6060600480546104b390611f67565b6001600160a01b03861661089c5760405162461bcd60e51b815260040161065990611fca565b834211156108bc5760405162461bcd60e51b815260040161065990611ff1565b60006109496108c961142d565b7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e89896109138c6001600160a01b0316600090815260396020526040902080546001810190915590565b6040805160208101959095526001600160a01b039384169085015291166060830152608082015260a0810188905260c0016106f0565b905061095781858585611437565b6001600160a01b0316876001600160a01b0316146109875760405162461bcd60e51b815260040161065990612094565b61099387876000611305565b61099f87876001611305565b50505050505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015610a2d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610659565b610a3a8286868403610c2b565b506001949350505050565b600033610544818585610f95565b600080610a5f84610d50565b90506000836001811115610a7557610a7561201d565b610a809060016120bf565b82604001516003811115610a9657610a9661201d565b1660ff16600014610aa8576000610ab1565b610ab18561078d565b90506000610abf83866114b5565b9050610acb8183611fb7565b9695505050505050565b6001600160a01b038716610afb5760405162461bcd60e51b815260040161065990611fca565b83421115610b1b5760405162461bcd60e51b815260040161065990611ff1565b6001600160a01b0387811660008181526039602090815260408083205481517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9938101939093529082019390935292891660608401526080830188905260a0830182905260c083018790529091610baa9060e001604051602081830303815290604052805190602001206114f4565b9050610bb881868686611437565b6001600160a01b0316896001600160a01b031614610be85760405162461bcd60e51b815260040161065990612094565b6001600160a01b0389166000908152603960205260409020600183019055610c11898989610c2b565b505050505050505050565b610c27338383611305565b5050565b6001600160a01b038316610c8d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610659565b6001600160a01b038216610cee5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610659565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b610d7160408051606081018252600080825260208201819052909182015290565b6001600160a01b038216600090815260208181526040808320815160808101835281546001600160681b03811682526001600160481b03600160681b8204811695830195909552600160b01b8104909416928101929092529091606083019060ff600160f81b909104166003811115610dec57610dec61201d565b6003811115610dfd57610dfd61201d565b815250509050604051806060016040528082602001516001600160481b0316815260200182604001516001600160481b0316815260200182606001516003811115610e4a57610e4a61201d565b90529392505050565b600080826001811115610e6857610e6861201d565b03610eba57600183604001516003811115610e8557610e8561201d565b1660ff16600003610e97576000610eb3565b6001600160a01b03808516600090815260426020526040902054165b90506105a1565b600283604001516003811115610ed257610ed261201d565b1015610edf576000610efb565b6001600160a01b03808516600090815260436020526040902054165b949350505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610f8f5781811015610f825760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610659565b610f8f8484848403610c2b565b50505050565b6001600160a01b038316610ff95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610659565b6001600160a01b03821661105b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610659565b816001600160a01b0316836001600160a01b031614611195576001600160a01b038084166000908152602081905260408082205492851682529020546001600160681b039182169116828210156111035760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610659565b6001600160a01b038516600090815260208190526040902080546cffffffffffffffffffffffffff19168484036001600160681b031617905561114683826120d8565b6001600160a01b038516600090815260208190526040902080546cffffffffffffffffffffffffff19166001600160681b03928316179055611192908690869085811690851687611521565b50505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d4391815260200190565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561123357507f000000000000000000000000000000000000000000000000000000000000000046145b1561125d57507f000000000000000000000000000000000000000000000000000000000000000090565b6105d4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6000836001600160a01b0316836001600160a01b0316146113265782611329565b60005b9050600061133685610d50565b90506000611345868386610e53565b9050806001600160a01b0316836001600160a01b03160361136857505050505050565b6001600160a01b038181161515908416151560006113858961078d565b9050821561139a5761139a816000868a611535565b81156113ad576113ad600082888a611535565b6113b88988886115ff565b821515821515146113d7576113d7896113d2878a866116a2565b6117c2565b856001600160a01b0316896001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd8960405161141a91906120ff565b60405180910390a3505050505050505050565b60006105d46105ca565b600080600061144887878787611862565b9150915061145581611926565b5095945050505050565b60606105d47f0000000000000000000000000000000000000000000000000000000000000000611a70565b60606105d47f0000000000000000000000000000000000000000000000000000000000000000611a70565b6000808260018111156114ca576114ca61201d565b146114d65782516114dc565b82602001515b6105a1906001600160481b03166402540be40061210d565b600061054a6115016111da565b8360405161190160f01b8152600281019290925260228201526042902090565b61152e8585858585611aaf565b5050505050565b6001600160a01b03821615610f8f57838314610f8f57600061156461155f6402540be40087612124565b611bac565b9050600061157a61155f6402540be40087612124565b9050600061158785610d50565b9050600084600181111561159d5761159d61201d565b036115d057818382602001516115b39190612146565b6115bd9190612166565b6001600160481b031660208201526115f5565b805182906115df908590612146565b6115e99190612166565b6001600160481b031681525b61099f85826117c2565b6000836001600160a01b0316826001600160a01b0316146116205781611623565b60005b905060008360018111156116395761163961201d565b03611671576001600160a01b03848116600090815260426020526040902080546001600160a01b031916918316919091179055610f8f565b6001600160a01b03938416600090815260436020526040902080546001600160a01b03191691909416179092555050565b6116c360408051606081018252600080825260208201819052909182015290565b8115611742578260018111156116db576116db61201d565b6116e69060016120bf565b846040015160038111156116fc576116fc61201d565b1760ff1660038111156117115761171161201d565b846040019060038111156117275761172761201d565b9081600381111561173a5761173a61201d565b9052506117ba565b60038360018111156117565761175661201d565b6117619060016120bf565b18846040015160038111156117785761177861201d565b1660ff16600381111561178d5761178d61201d565b846040019060038111156117a3576117a361201d565b908160038111156117b6576117b661201d565b9052505b509192915050565b6001600160a01b03821660009081526020818152604091829020835181549285015171ffffffffffffffffffffffffffffffffffff60681b19909316600160681b6001600160481b039283160268ffffffffffffffffff60b01b191617600160b01b91909316029190911780825591830151909182906001600160f81b0316600160f81b8360038111156118585761185861201d565b0217905550505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611899575060009050600361191d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156118ed573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166119165760006001925092505061191d565b9150600090505b94509492505050565b600081600481111561193a5761193a61201d565b036119425750565b60018160048111156119565761195661201d565b036119a35760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610659565b60028160048111156119b7576119b761201d565b03611a045760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610659565b6003816004811115611a1857611a1861201d565b036106305760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610659565b60606000611a7d83611c18565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b836001600160a01b0316856001600160a01b0316031561152e576001600160a01b03851615611b43576000611ae386610d50565b90506000611af18386612186565b9050600082604001516003811115611b0b57611b0b61201d565b14611b4057611b288582611b218a866000610e53565b6000611535565b611b408582611b398a866001610e53565b6001611535565b50505b6001600160a01b0384161561152e576000611b5d85610d50565b90506000611b6b8385611fb7565b9050600082604001516003811115611b8557611b8561201d565b1461099f57611b9b8482611b2189866000610e53565b61099f8482611b3989866001610e53565b60006001600160481b03821115611c145760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201526532206269747360d01b6064820152608401610659565b5090565b600060ff8216601f81111561054a57604051632cd44ac360e21b815260040160405180910390fd5b6000815180845260005b81811015611c6657602081850181015186830182015201611c4a565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006105a16020830184611c40565b80356001600160a01b0381168114611cb057600080fd5b919050565b60008060408385031215611cc857600080fd5b611cd183611c99565b946020939093013593505050565b600060208284031215611cf157600080fd5b6105a182611c99565b600080600060608486031215611d0f57600080fd5b611d1884611c99565b9250611d2660208501611c99565b9150604084013590509250925092565b803560028110611cb057600080fd5b803560ff81168114611cb057600080fd5b600080600080600080600060e0888a031215611d7157600080fd5b611d7a88611c99565b9650611d8860208901611c99565b9550611d9660408901611d36565b945060608801359350611dab60808901611d45565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611dda57600080fd5b611de383611c99565b9150611df160208401611d36565b90509250929050565b60ff60f81b881681526000602060e081840152611e1a60e084018a611c40565b8381036040850152611e2c818a611c40565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015611e7e57835183529284019291840191600101611e62565b50909c9b505050505050505050505050565b60008060008060008060c08789031215611ea957600080fd5b611eb287611c99565b9550611ec060208801611c99565b945060408701359350611ed560608801611d45565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a031215611f0a57600080fd5b611f1388611c99565b9650611f2160208901611c99565b95506040880135945060608801359350611dab60808901611d45565b60008060408385031215611f5057600080fd5b611f5983611c99565b9150611df160208401611c99565b600181811c90821680611f7b57607f821691505b602082108103611f9b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561054a5761054a611fa1565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b6002811061205157634e487b7160e01b600052602160045260246000fd5b9052565b8681526001600160a01b0386811660208301528516604082015260c081016120806060830186612033565b608082019390935260a00152949350505050565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b60ff818116838216019081111561054a5761054a611fa1565b6001600160681b038181168382160190808211156120f8576120f8611fa1565b5092915050565b6020810161054a8284612033565b808202811582820484141761054a5761054a611fa1565b60008261214157634e487b7160e01b600052601260045260246000fd5b500490565b6001600160481b038281168282160390808211156120f8576120f8611fa1565b6001600160481b038181168382160190808211156120f8576120f8611fa1565b8181038181111561054a5761054a611fa156fea2646970667358221220031d3febae0d90117808e443ab3b4b6923733bd26a4184ff7cedb41ae7c1a14564736f6c63430008140033'; + +type AaveTokenV3ConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: AaveTokenV3ConstructorParams, +): xs is ConstructorParameters => xs.length > 1; + +export class AaveTokenV3__factory extends ContractFactory { + constructor(...args: AaveTokenV3ConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + overrides?: Overrides & { from?: string }, + ): Promise { + return super.deploy(overrides || {}) as Promise; + } + override getDeployTransaction( + overrides?: Overrides & { from?: string }, + ): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + override attach(address: string): AaveTokenV3 { + return super.attach(address) as AaveTokenV3; + } + override connect(signer: Signer): AaveTokenV3__factory { + return super.connect(signer) as AaveTokenV3__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): AaveTokenV3Interface { + return new utils.Interface(_abi) as AaveTokenV3Interface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): AaveTokenV3 { + return new Contract(address, _abi, signerOrProvider) as AaveTokenV3; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/index.ts b/packages/contract-helpers/src/governance-v3/typechain/index.ts index e42ae127..a7af9abb 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/index.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/index.ts @@ -1,8 +1,9 @@ /* Autogenerated file. Do not edit manually. */ -/* eslint-disable */ + export type { GovernanceDataHelper } from './GovernanceDataHelper'; export type { VotingMachine } from './VotingMachine'; export * as factories from './factories'; export { GovernanceDataHelper__factory } from './factories/GovernanceDataHelper__factory'; export { VotingMachine__factory } from './factories/VotingMachine__factory'; export { VotingMachineDataHelper__factory } from './factories/VotingMachineDataHelper__factory'; +export { AaveTokenV3__factory } from './factories/AaveTokenV3__factory'; diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index 19b16e80..aee3d00d 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -33,6 +33,7 @@ export * from './paraswap-withdrawAndSwitchAdapter-contract'; export * from './governance-v3/governance-data-helper'; export * from './governance-v3/voting-machine-data-helper'; export * from './governance-v3/governance-core'; +export * from './governance-v3/aave-token-v3'; // commons export * from './commons/types'; From 69530bfb4329c0af9a5f9f3663950c956a53230f Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 19 Dec 2023 11:13:48 -0600 Subject: [PATCH 16/41] fix: specify block number --- .../src/governance-v3/aave-token-v3/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 48b76a4e..22f9bcca 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -18,10 +18,13 @@ export class AaveTokenV3Service { return this._contract.balanceOf(user); } - public async getPowerCurrent( + public async getPowerAt( + blockNumber: number, user: string, delegationType: GovernancePowerType, ) { - return this._contract.getPowerCurrent(user, delegationType); + return this._contract.functions.getPowerCurrent(user, delegationType, { + blockTag: blockNumber, + }); } } From ddd24845a0c7681745dd1de7749ad71ece4b11bc Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 19 Dec 2023 20:01:30 -0600 Subject: [PATCH 17/41] feat: payloads data service --- .../governance-data-helper/index.ts | 11 + .../payloads-data-helper/index.ts | 88 +++++++ .../PayloadsControllerDataHelper.d.ts | 247 ++++++++++++++++++ .../PayloadsControllerDataHelper__factory.ts | 203 ++++++++++++++ 4 files changed, 549 insertions(+) create mode 100644 packages/contract-helpers/src/governance-v3/payloads-data-helper/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/PayloadsControllerDataHelper.d.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/PayloadsControllerDataHelper__factory.ts diff --git a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts index 58737694..3c7abb78 100644 --- a/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-data-helper/index.ts @@ -51,6 +51,7 @@ export type ProposalV3 = { forVotes: string; againstVotes: string; cancellationFee: string; + payloads: ProposalPayload[]; }; export type ProposalData = { @@ -183,6 +184,16 @@ export class GovernanceDataHelperService forVotes: proposalData.proposalData.forVotes.toString(), againstVotes: proposalData.proposalData.againstVotes.toString(), cancellationFee: proposalData.proposalData.cancellationFee.toString(), + payloads: proposalData.proposalData.payloads.map( + payload => { + return { + chain: payload.chain.toNumber(), + accessLevel: payload.accessLevel, + payloadsController: payload.payloadsController, + payloadId: payload.payloadId, + }; + }, + ), }, }; }); diff --git a/packages/contract-helpers/src/governance-v3/payloads-data-helper/index.ts b/packages/contract-helpers/src/governance-v3/payloads-data-helper/index.ts new file mode 100644 index 00000000..0c6e96e4 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/payloads-data-helper/index.ts @@ -0,0 +1,88 @@ +import { providers } from 'ethers'; +import { AccessLevel } from '../governance-data-helper'; +import { PayloadsControllerDataHelper } from '../typechain/PayloadsControllerDataHelper'; +import { PayloadsControllerDataHelper__factory } from '../typechain/factories/PayloadsControllerDataHelper__factory'; + +export enum PayloadState { + None, + Created, + Queued, + Executed, + Cancelled, + Expired, +} + +export type ExecutionAction = { + target: string; + withDelegateCall: boolean; + accessLevel: AccessLevel; + value: string; + signature: string; + callData: string; +}; + +export type Payload = { + id: string; + creator: string; + maximumAccessLevelRequired: AccessLevel; + state: PayloadState; + createdAt: number; + queuedAt: number; + executedAt: number; + cancelledAt: number; + expirationTime: number; + delay: number; + gracePeriod: number; + actions: ExecutionAction[]; +}; +export class PayloadsDataHelperService { + private readonly _contract: PayloadsControllerDataHelper; + + constructor( + payloadsHelperContracAddress: string, + provider: providers.Provider, + ) { + this._contract = PayloadsControllerDataHelper__factory.connect( + payloadsHelperContracAddress, + provider, + ); + } + + public async getPayloadsData( + payloadsControllerAddress: string, + payloadsIds: number[], + ): Promise { + const data = await this._contract.getPayloadsData( + payloadsControllerAddress, + payloadsIds, + ); + + const payloads = data.map(payload => { + return { + id: payload.id.toString(), + creator: payload.data.creator, + maximumAccessLevelRequired: payload.data.maximumAccessLevelRequired, + state: payload.data.state, + createdAt: payload.data.createdAt, + queuedAt: payload.data.queuedAt, + executedAt: payload.data.executedAt, + cancelledAt: payload.data.cancelledAt, + expirationTime: payload.data.expirationTime, + delay: payload.data.delay, + gracePeriod: payload.data.gracePeriod, + actions: payload.data.actions.map(action => { + return { + target: action.target, + withDelegateCall: action.withDelegateCall, + accessLevel: action.accessLevel, + value: action.value.toString(), + signature: action.signature, + callData: action.callData, + }; + }), + }; + }); + + return payloads; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/PayloadsControllerDataHelper.d.ts b/packages/contract-helpers/src/governance-v3/typechain/PayloadsControllerDataHelper.d.ts new file mode 100644 index 00000000..51a1db6f --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/PayloadsControllerDataHelper.d.ts @@ -0,0 +1,247 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export declare namespace IPayloadsControllerCore { + export type ExecutorConfigStruct = { executor: string; delay: BigNumberish }; + + export type ExecutorConfigStructOutput = [string, number] & { + executor: string; + delay: number; + }; + + export type ExecutionActionStruct = { + target: string; + withDelegateCall: boolean; + accessLevel: BigNumberish; + value: BigNumberish; + signature: string; + callData: BytesLike; + }; + + export type ExecutionActionStructOutput = [ + string, + boolean, + number, + BigNumber, + string, + string, + ] & { + target: string; + withDelegateCall: boolean; + accessLevel: number; + value: BigNumber; + signature: string; + callData: string; + }; + + export type PayloadStruct = { + creator: string; + maximumAccessLevelRequired: BigNumberish; + state: BigNumberish; + createdAt: BigNumberish; + queuedAt: BigNumberish; + executedAt: BigNumberish; + cancelledAt: BigNumberish; + expirationTime: BigNumberish; + delay: BigNumberish; + gracePeriod: BigNumberish; + actions: IPayloadsControllerCore.ExecutionActionStruct[]; + }; + + export type PayloadStructOutput = [ + string, + number, + number, + number, + number, + number, + number, + number, + number, + number, + IPayloadsControllerCore.ExecutionActionStructOutput[], + ] & { + creator: string; + maximumAccessLevelRequired: number; + state: number; + createdAt: number; + queuedAt: number; + executedAt: number; + cancelledAt: number; + expirationTime: number; + delay: number; + gracePeriod: number; + actions: IPayloadsControllerCore.ExecutionActionStructOutput[]; + }; +} + +export declare namespace IPayloadsControllerDataHelper { + export type ExecutorConfigStruct = { + accessLevel: BigNumberish; + config: IPayloadsControllerCore.ExecutorConfigStruct; + }; + + export type ExecutorConfigStructOutput = [ + number, + IPayloadsControllerCore.ExecutorConfigStructOutput, + ] & { + accessLevel: number; + config: IPayloadsControllerCore.ExecutorConfigStructOutput; + }; + + export type PayloadStruct = { + id: BigNumberish; + data: IPayloadsControllerCore.PayloadStruct; + }; + + export type PayloadStructOutput = [ + BigNumber, + IPayloadsControllerCore.PayloadStructOutput, + ] & { id: BigNumber; data: IPayloadsControllerCore.PayloadStructOutput }; +} + +export interface PayloadsControllerDataHelperInterface extends utils.Interface { + functions: { + 'getExecutorConfigs(address,uint8[])': FunctionFragment; + 'getPayloadsData(address,uint40[])': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: 'getExecutorConfigs' | 'getPayloadsData', + ): FunctionFragment; + + encodeFunctionData( + functionFragment: 'getExecutorConfigs', + values: [string, BigNumberish[]], + ): string; + encodeFunctionData( + functionFragment: 'getPayloadsData', + values: [string, BigNumberish[]], + ): string; + + decodeFunctionResult( + functionFragment: 'getExecutorConfigs', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPayloadsData', + data: BytesLike, + ): Result; + + events: {}; +} + +export interface PayloadsControllerDataHelper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PayloadsControllerDataHelperInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + getExecutorConfigs( + payloadsController: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides, + ): Promise<[IPayloadsControllerDataHelper.ExecutorConfigStructOutput[]]>; + + getPayloadsData( + payloadsController: string, + payloadsIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise<[IPayloadsControllerDataHelper.PayloadStructOutput[]]>; + }; + + getExecutorConfigs( + payloadsController: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getPayloadsData( + payloadsController: string, + payloadsIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + callStatic: { + getExecutorConfigs( + payloadsController: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getPayloadsData( + payloadsController: string, + payloadsIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + }; + + filters: {}; + + estimateGas: { + getExecutorConfigs( + payloadsController: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getPayloadsData( + payloadsController: string, + payloadsIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + }; + + populateTransaction: { + getExecutorConfigs( + payloadsController: string, + accessLevels: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + + getPayloadsData( + payloadsController: string, + payloadsIds: BigNumberish[], + overrides?: CallOverrides, + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/PayloadsControllerDataHelper__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/PayloadsControllerDataHelper__factory.ts new file mode 100644 index 00000000..de700c18 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/PayloadsControllerDataHelper__factory.ts @@ -0,0 +1,203 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { + PayloadsControllerDataHelper, + PayloadsControllerDataHelperInterface, +} from '../PayloadsControllerDataHelper'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract IPayloadsController', + name: 'payloadsController', + type: 'address', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl[]', + name: 'accessLevels', + type: 'uint8[]', + }, + ], + name: 'getExecutorConfigs', + outputs: [ + { + components: [ + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + components: [ + { + internalType: 'address', + name: 'executor', + type: 'address', + }, + { + internalType: 'uint40', + name: 'delay', + type: 'uint40', + }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutorConfig', + name: 'config', + type: 'tuple', + }, + ], + internalType: 'struct IPayloadsControllerDataHelper.ExecutorConfig[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IPayloadsController', + name: 'payloadsController', + type: 'address', + }, + { + internalType: 'uint40[]', + name: 'payloadsIds', + type: 'uint40[]', + }, + ], + name: 'getPayloadsData', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + components: [ + { + internalType: 'address', + name: 'creator', + type: 'address', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'maximumAccessLevelRequired', + type: 'uint8', + }, + { + internalType: 'enum IPayloadsControllerCore.PayloadState', + name: 'state', + type: 'uint8', + }, + { + internalType: 'uint40', + name: 'createdAt', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'queuedAt', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'executedAt', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'cancelledAt', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'expirationTime', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'delay', + type: 'uint40', + }, + { + internalType: 'uint40', + name: 'gracePeriod', + type: 'uint40', + }, + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bool', + name: 'withDelegateCall', + type: 'bool', + }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'accessLevel', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'string', + name: 'signature', + type: 'string', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: + 'struct IPayloadsControllerCore.ExecutionAction[]', + name: 'actions', + type: 'tuple[]', + }, + ], + internalType: 'struct IPayloadsControllerCore.Payload', + name: 'data', + type: 'tuple', + }, + ], + internalType: 'struct IPayloadsControllerDataHelper.Payload[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] as const; + +export class PayloadsControllerDataHelper__factory { + static readonly abi = _abi; + static createInterface(): PayloadsControllerDataHelperInterface { + return new utils.Interface(_abi) as PayloadsControllerDataHelperInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): PayloadsControllerDataHelper { + return new Contract( + address, + _abi, + signerOrProvider, + ) as PayloadsControllerDataHelper; + } +} From 0513918ea5a08b3fbd67072f4e7b66a87acd716b Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 19 Dec 2023 20:04:45 -0600 Subject: [PATCH 18/41] fix: export --- packages/contract-helpers/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index aee3d00d..7076c8d7 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -34,6 +34,7 @@ export * from './governance-v3/governance-data-helper'; export * from './governance-v3/voting-machine-data-helper'; export * from './governance-v3/governance-core'; export * from './governance-v3/aave-token-v3'; +export * from './governance-v3/payloads-data-helper'; // commons export * from './commons/types'; From 7ec09595aeb828b83409d5b5b45b17e88fb8f76e Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Thu, 21 Dec 2023 09:10:32 -0600 Subject: [PATCH 19/41] feat: meta delegation --- .../governance-v3/delegate-helper/index.ts | 52 +++++++ .../typechain/MetaDelegateHelper.d.ts | 137 ++++++++++++++++++ .../factories/MetaDelegateHelper__factory.ts | 116 +++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 packages/contract-helpers/src/governance-v3/delegate-helper/index.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/MetaDelegateHelper.d.ts create mode 100644 packages/contract-helpers/src/governance-v3/typechain/factories/MetaDelegateHelper__factory.ts diff --git a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts new file mode 100644 index 00000000..3a02c3aa --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts @@ -0,0 +1,52 @@ +import { SignatureLike } from '@ethersproject/bytes'; +import { BigNumber, PopulatedTransaction, Signature, utils } from 'ethers'; +import { MetaDelegateHelperInterface } from '../typechain/MetaDelegateHelper'; +import { MetaDelegateHelper__factory } from '../typechain/factories/MetaDelegateHelper__factory'; + +export enum DelegationType { + VOTING, + PROPOSITION, + ALL, +} + +export type MetaDelegateParams = { + underlyingAsset: string; + delegationType: DelegationType; + delegator: string; + delegatee: string; + deadline: string; + signature: SignatureLike; +}; + +export class MetaDelegateHelperService { + private readonly _contractInterface: MetaDelegateHelperInterface; + + constructor(private readonly metaDelegateHelperContracAddress: string) { + this._contractInterface = MetaDelegateHelper__factory.createInterface(); + } + + public batchMetaDelegate( + user: string, + delegateParams: MetaDelegateParams[], + ): PopulatedTransaction { + const params = delegateParams.map(p => { + const sig: Signature = utils.splitSignature(p.signature); + return { + ...p, + v: sig.v, + r: sig.r, + s: sig.s, + }; + }); + + const tx: PopulatedTransaction = { + data: this._contractInterface.encodeFunctionData('batchMetaDelegate', [ + params, + ]), + to: this.metaDelegateHelperContracAddress, + from: user, + gasLimit: BigNumber.from('1000000'), + }; + return tx; + } +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/MetaDelegateHelper.d.ts b/packages/contract-helpers/src/governance-v3/typechain/MetaDelegateHelper.d.ts new file mode 100644 index 00000000..ae69c6d4 --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/MetaDelegateHelper.d.ts @@ -0,0 +1,137 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export declare namespace IMetaDelegateHelper { + export type MetaDelegateParamsStruct = { + underlyingAsset: string; + delegationType: BigNumberish; + delegator: string; + delegatee: string; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + }; + + export type MetaDelegateParamsStructOutput = [ + string, + number, + string, + string, + BigNumber, + number, + string, + string, + ] & { + underlyingAsset: string; + delegationType: number; + delegator: string; + delegatee: string; + deadline: BigNumber; + v: number; + r: string; + s: string; + }; +} + +export interface MetaDelegateHelperInterface extends utils.Interface { + functions: { + 'batchMetaDelegate((address,uint8,address,address,uint256,uint8,bytes32,bytes32)[])': FunctionFragment; + }; + + getFunction(nameOrSignatureOrTopic: 'batchMetaDelegate'): FunctionFragment; + + encodeFunctionData( + functionFragment: 'batchMetaDelegate', + values: [IMetaDelegateHelper.MetaDelegateParamsStruct[]], + ): string; + + decodeFunctionResult( + functionFragment: 'batchMetaDelegate', + data: BytesLike, + ): Result; + + events: {}; +} + +export interface MetaDelegateHelper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: MetaDelegateHelperInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + batchMetaDelegate( + delegateParams: IMetaDelegateHelper.MetaDelegateParamsStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + batchMetaDelegate( + delegateParams: IMetaDelegateHelper.MetaDelegateParamsStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + callStatic: { + batchMetaDelegate( + delegateParams: IMetaDelegateHelper.MetaDelegateParamsStruct[], + overrides?: CallOverrides, + ): Promise; + }; + + filters: {}; + + estimateGas: { + batchMetaDelegate( + delegateParams: IMetaDelegateHelper.MetaDelegateParamsStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + populateTransaction: { + batchMetaDelegate( + delegateParams: IMetaDelegateHelper.MetaDelegateParamsStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + }; +} diff --git a/packages/contract-helpers/src/governance-v3/typechain/factories/MetaDelegateHelper__factory.ts b/packages/contract-helpers/src/governance-v3/typechain/factories/MetaDelegateHelper__factory.ts new file mode 100644 index 00000000..244e662c --- /dev/null +++ b/packages/contract-helpers/src/governance-v3/typechain/factories/MetaDelegateHelper__factory.ts @@ -0,0 +1,116 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from 'ethers'; +import type { Provider, TransactionRequest } from '@ethersproject/providers'; +import type { + MetaDelegateHelper, + MetaDelegateHelperInterface, +} from '../MetaDelegateHelper'; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: 'contract IGovernancePowerDelegationToken', + name: 'underlyingAsset', + type: 'address', + }, + { + internalType: 'enum IMetaDelegateHelper.DelegationType', + name: 'delegationType', + type: 'uint8', + }, + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + internalType: 'struct IMetaDelegateHelper.MetaDelegateParams[]', + name: 'delegateParams', + type: 'tuple[]', + }, + ], + name: 'batchMetaDelegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; + +const _bytecode = + '0x608060405234801561001057600080fd5b50610662806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063dfec976814610030575b600080fd5b61004361003e366004610434565b610045565b005b6000805b828110156103ed576002848483818110610065576100656104bf565b90506101000201602001602081019061007e91906104d5565b600281111561008f5761008f6104a9565b03610228578383828181106100a6576100a66104bf565b6100bd926020610100909202019081019150610515565b6001600160a01b031663a095ac198585848181106100dd576100dd6104bf565b9050610100020160400160208101906100f69190610515565b868685818110610108576101086104bf565b9050610100020160600160208101906101219190610515565b878786818110610133576101336104bf565b9050610100020160800135888887818110610150576101506104bf565b9050610100020160a00160208101906101699190610532565b89898881811061017b5761017b6104bf565b9050610100020160c001358a8a89818110610198576101986104bf565b60405160e08a811b6001600160e01b03191682526001600160a01b03998a16600483015297909816602489015260448801959095525060ff929092166064860152608485015261010090910201013560a482015260c401600060405180830381600087803b15801561020957600080fd5b505af192505050801561021a575060015b156103db57600191506103db565b83838281811061023a5761023a6104bf565b610251926020610100909202019081019150610515565b6001600160a01b031663657f0cde858584818110610271576102716104bf565b90506101000201604001602081019061028a9190610515565b86868581811061029c5761029c6104bf565b9050610100020160600160208101906102b59190610515565b60008888878181106102c9576102c96104bf565b9050610100020160200160208101906102e291906104d5565b60028111156102f3576102f36104a9565b146102ff576001610302565b60005b888887818110610314576103146104bf565b9050610100020160800135898988818110610331576103316104bf565b9050610100020160a001602081019061034a9190610532565b8a8a8981811061035c5761035c6104bf565b9050610100020160c001358b8b8a818110610379576103796104bf565b9050610100020160e001356040518863ffffffff1660e01b81526004016103a69796959493929190610555565b600060405180830381600087803b1580156103c057600080fd5b505af19250505080156103d1575060015b156103db57600191505b806103e5816105b7565b915050610049565b50604080518082019091526002815261072760f31b60208201528161042e5760405162461bcd60e51b815260040161042591906105de565b60405180910390fd5b50505050565b6000806020838503121561044757600080fd5b823567ffffffffffffffff8082111561045f57600080fd5b818501915085601f83011261047357600080fd5b81358181111561048257600080fd5b8660208260081b850101111561049757600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156104e757600080fd5b8135600381106104f657600080fd5b9392505050565b6001600160a01b038116811461051257600080fd5b50565b60006020828403121561052757600080fd5b81356104f6816104fd565b60006020828403121561054457600080fd5b813560ff811681146104f657600080fd5b6001600160a01b0388811682528716602082015260e081016002871061058b57634e487b7160e01b600052602160045260246000fd5b6040820196909652606081019490945260ff92909216608084015260a083015260c09091015292915050565b6000600182016105d757634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208083528351808285015260005b8181101561060b578581018301518582016040015282016105ef565b506000604082860101526040601f19601f830116850101925050509291505056fea26469706673582212203dced7f46a3999c58a7e8dd9fb69bbfb2191166296934c957b5c98f1adb8b70c64736f6c63430008130033'; + +type MetaDelegateHelperConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: MetaDelegateHelperConstructorParams, +): xs is ConstructorParameters => xs.length > 1; + +export class MetaDelegateHelper__factory extends ContractFactory { + constructor(...args: MetaDelegateHelperConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + overrides?: Overrides & { from?: string }, + ): Promise { + return super.deploy(overrides || {}) as Promise; + } + override getDeployTransaction( + overrides?: Overrides & { from?: string }, + ): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + override attach(address: string): MetaDelegateHelper { + return super.attach(address) as MetaDelegateHelper; + } + override connect(signer: Signer): MetaDelegateHelper__factory { + return super.connect(signer) as MetaDelegateHelper__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): MetaDelegateHelperInterface { + return new utils.Interface(_abi) as MetaDelegateHelperInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): MetaDelegateHelper { + return new Contract(address, _abi, signerOrProvider) as MetaDelegateHelper; + } +} From 7ec04b025cebd9f9f6eb0c1b7d4dd0960f354110 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Thu, 21 Dec 2023 09:59:39 -0600 Subject: [PATCH 20/41] feat: token delegate --- .../src/governance-v3/aave-token-v3/index.ts | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 22f9bcca..6f0b4c7b 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -1,14 +1,16 @@ -import { providers } from 'ethers'; +import { BigNumber, PopulatedTransaction, providers } from 'ethers'; import { AaveTokenV3 } from '../typechain/AaveTokenV3'; import { AaveTokenV3__factory } from '../typechain/factories/AaveTokenV3__factory'; export enum GovernancePowerType { VOTING, PROPOSITION, + ALL, } export class AaveTokenV3Service { readonly _contract: AaveTokenV3; + readonly _contractInterface = AaveTokenV3__factory.createInterface(); constructor(tokenAddress: string, provider: providers.Provider) { this._contract = AaveTokenV3__factory.connect(tokenAddress, provider); @@ -27,4 +29,29 @@ export class AaveTokenV3Service { blockTag: blockNumber, }); } + + public getDelegateTxData( + user: string, + delegateTo: string, + type: GovernancePowerType, + ): PopulatedTransaction { + const tx: PopulatedTransaction = {}; + if (type === GovernancePowerType.ALL) { + tx.data = this._contractInterface.encodeFunctionData('delegate', [ + delegateTo, + ]); + } else { + tx.data = this._contractInterface.encodeFunctionData('delegateByType', [ + delegateTo, + type, + ]); + } + + return { + ...tx, + to: this._contract.address, + from: user, + gasLimit: BigNumber.from('1000000'), + }; + } } From 182191f2c1d2a6c84597cedec2c2dee3e77b117e Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 22 Dec 2023 09:37:49 -0600 Subject: [PATCH 21/41] fix: export --- packages/contract-helpers/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contract-helpers/src/index.ts b/packages/contract-helpers/src/index.ts index 7076c8d7..89639cd9 100644 --- a/packages/contract-helpers/src/index.ts +++ b/packages/contract-helpers/src/index.ts @@ -35,6 +35,7 @@ export * from './governance-v3/voting-machine-data-helper'; export * from './governance-v3/governance-core'; export * from './governance-v3/aave-token-v3'; export * from './governance-v3/payloads-data-helper'; +export * from './governance-v3/delegate-helper'; // commons export * from './commons/types'; From 2022bac22871a85776f017f1d6214d9ecfcc5abe Mon Sep 17 00:00:00 2001 From: JoaquinBattilana Date: Tue, 26 Dec 2023 12:52:51 -0300 Subject: [PATCH 22/41] feat: deleted export --- packages/contract-helpers/src/governance-v3/typechain/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/contract-helpers/src/governance-v3/typechain/index.ts b/packages/contract-helpers/src/governance-v3/typechain/index.ts index a7af9abb..9de1ac10 100644 --- a/packages/contract-helpers/src/governance-v3/typechain/index.ts +++ b/packages/contract-helpers/src/governance-v3/typechain/index.ts @@ -2,7 +2,6 @@ export type { GovernanceDataHelper } from './GovernanceDataHelper'; export type { VotingMachine } from './VotingMachine'; -export * as factories from './factories'; export { GovernanceDataHelper__factory } from './factories/GovernanceDataHelper__factory'; export { VotingMachine__factory } from './factories/VotingMachine__factory'; export { VotingMachineDataHelper__factory } from './factories/VotingMachineDataHelper__factory'; From 000dc6b5500fb654efefdbbb53ad5a323c1cb73e Mon Sep 17 00:00:00 2001 From: JoaquinBattilana Date: Fri, 29 Dec 2023 14:01:07 -0300 Subject: [PATCH 23/41] feat: added getPowers --- .../src/governance-v3/aave-token-v3/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 6f0b4c7b..87175f69 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -30,6 +30,22 @@ export class AaveTokenV3Service { }); } + public async getPowers( + user: string, + ) { + const powers = await this._contract.getPowersCurrent(user); + return { + votingPower: powers[0], + propositionPower: powers[1] + } + } + + public getDelegateeData( + user: string, + ) { + return this._contract.getDelegates(user) + } + public getDelegateTxData( user: string, delegateTo: string, From a36249a4280cf8f987643baeec8c685814f5fb2b Mon Sep 17 00:00:00 2001 From: JoaquinBattilana Date: Sun, 31 Dec 2023 03:54:14 -0300 Subject: [PATCH 24/41] feat: added delegateedata --- .../src/governance-v3/aave-token-v3/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 87175f69..4d7413f6 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -40,10 +40,14 @@ export class AaveTokenV3Service { } } - public getDelegateeData( + public async getDelegateeData( user: string, ) { - return this._contract.getDelegates(user) + const data = await this._contract.getDelegates(user); + return { + votingDelegatee: data[0], + propositionDelegatee: data[1], + } } public getDelegateTxData( From 98720b3229107b48b15b268746fea9abcd2872fb Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 2 Jan 2024 13:36:23 -0600 Subject: [PATCH 25/41] feat: get eip712 domain --- .../src/governance-v3/aave-token-v3/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 4d7413f6..49049ad1 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -8,6 +8,13 @@ export enum GovernancePowerType { ALL, } +interface Eip712Domain { + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; +} + export class AaveTokenV3Service { readonly _contract: AaveTokenV3; readonly _contractInterface = AaveTokenV3__factory.createInterface(); @@ -74,4 +81,8 @@ export class AaveTokenV3Service { gasLimit: BigNumber.from('1000000'), }; } + + public async getEip712Domain(): Promise { + return this._contract.functions.eip712Domain(); + } } From 8760e6b5277eaa4181dc1a840bea04fe2d43b45d Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 2 Jan 2024 15:08:19 -0600 Subject: [PATCH 26/41] fix: staked token v3 --- .../src/staking-contract/index.ts | 1 - .../typechain/IStakedAaveV3.d.ts | 4490 +++++++++++------ .../typechain/IStakedAaveV3__factory.ts | 1528 +++--- 3 files changed, 3598 insertions(+), 2421 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index 933a951b..2fa44b77 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -165,7 +165,6 @@ export class StakingService const txCallback: () => Promise = this.generateTxCallback({ rawTxMethod: async () => stakingContract.populateTransaction.stakeWithPermit( - user, convertedAmount, deadline, sig.v, diff --git a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts index 99aa2ce2..35a56125 100644 --- a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts +++ b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts @@ -1,1691 +1,2967 @@ /* Autogenerated file. Do not edit manually. */ /* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { + FunctionFragment, + Result, + EventFragment, +} from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from './common'; + +export declare namespace DistributionTypes { + export type AssetConfigInputStruct = { + emissionPerSecond: BigNumberish; + totalStaked: BigNumberish; + underlyingAsset: string; + }; + + export type AssetConfigInputStructOutput = [BigNumber, BigNumber, string] & { + emissionPerSecond: BigNumber; + totalStaked: BigNumber; + underlyingAsset: string; + }; +} -import { - ethers, - EventFilter, - Signer, - BigNumber, - BigNumberish, - PopulatedTransaction, - Contract, - ContractTransaction, - Overrides, - CallOverrides, -} from "ethers"; -import { BytesLike } from "@ethersproject/bytes"; -import { Listener, Provider } from "@ethersproject/providers"; -import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; -import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; - -interface IStakedAaveV3Interface extends ethers.utils.Interface { - functions: { - "COOLDOWN_SECONDS()": FunctionFragment; - 'REWARD_TOKEN()': FunctionFragment; - 'STAKED_TOKEN()': FunctionFragment; - "claimRewards(address,uint256)": FunctionFragment; - "claimRewardsAndRedeem(address,uint256,uint256)": FunctionFragment; - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)": FunctionFragment; - "claimRewardsAndStake(address,uint256)": FunctionFragment; - "claimRewardsAndStakeOnBehalf(address,address,uint256)": FunctionFragment; - "claimRewardsOnBehalf(address,address,uint256)": FunctionFragment; - "cooldown()": FunctionFragment; - "cooldownOnBehalfOf(address)": FunctionFragment; - "getCooldownSeconds()": FunctionFragment; - "getExchangeRate()": FunctionFragment; - "getExchangeRateSnapshot(uint32)": FunctionFragment; - "getExchangeRateSnapshotsCount()": FunctionFragment; - "getMaxSlashablePercentage()": FunctionFragment; - "getTotalRewardsBalance(address)": FunctionFragment; - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; - "previewRedeem(uint256)": FunctionFragment; - "previewStake(uint256)": FunctionFragment; - "redeem(address,uint256)": FunctionFragment; - "redeemOnBehalf(address,address,uint256)": FunctionFragment; - "stake(address,uint256)": FunctionFragment; - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; - }; - - encodeFunctionData( - functionFragment: "COOLDOWN_SECONDS", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: 'REWARD_TOKEN', - values?: undefined, - ): string; - encodeFunctionData( - functionFragment: 'STAKED_TOKEN', - values?: undefined, - ): string; - encodeFunctionData( - functionFragment: "claimRewards", - values: [string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "claimRewardsAndRedeem", - values: [string, BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "claimRewardsAndRedeemOnBehalf", - values: [string, string, BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "claimRewardsAndStake", - values: [string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "claimRewardsAndStakeOnBehalf", - values: [string, string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "claimRewardsOnBehalf", - values: [string, string, BigNumberish] - ): string; - encodeFunctionData(functionFragment: "cooldown", values?: undefined): string; - encodeFunctionData( - functionFragment: "cooldownOnBehalfOf", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "getCooldownSeconds", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getExchangeRate", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getExchangeRateSnapshot", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "getExchangeRateSnapshotsCount", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getMaxSlashablePercentage", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getTotalRewardsBalance", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "permit", - values: [ - string, - string, - BigNumberish, - BigNumberish, - BigNumberish, - BytesLike, - BytesLike - ] - ): string; - encodeFunctionData( - functionFragment: "previewRedeem", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "previewStake", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "redeem", - values: [string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "redeemOnBehalf", - values: [string, string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "stake", - values: [string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "stakeWithPermit", - values: [ - string, - BigNumberish, - BigNumberish, - BigNumberish, - BytesLike, - BytesLike - ] - ): string; - - decodeFunctionResult( - functionFragment: "COOLDOWN_SECONDS", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: 'REWARD_TOKEN', - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: 'STAKED_TOKEN', - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "claimRewards", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "claimRewardsAndRedeem", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "claimRewardsAndRedeemOnBehalf", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "claimRewardsAndStake", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "claimRewardsAndStakeOnBehalf", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "claimRewardsOnBehalf", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "cooldown", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "cooldownOnBehalfOf", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getCooldownSeconds", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getExchangeRate", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getExchangeRateSnapshot", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getExchangeRateSnapshotsCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getMaxSlashablePercentage", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getTotalRewardsBalance", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "previewRedeem", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "previewStake", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "redeem", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "redeemOnBehalf", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "stake", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "stakeWithPermit", - data: BytesLike - ): Result; - - events: { - "Cooldown(address,uint256)": EventFragment; - "CooldownSecondsChanged(uint256)": EventFragment; - "ExchangeRateChanged(uint216)": EventFragment; - "FundsReturned(uint256)": EventFragment; - "GHODebtTokenChanged(address)": EventFragment; - "MaxSlashablePercentageChanged(uint256)": EventFragment; - "Redeem(address,address,uint256,uint256)": EventFragment; - "RewardsAccrued(address,uint256)": EventFragment; - "RewardsClaimed(address,address,uint256)": EventFragment; - "Slashed(address,uint256)": EventFragment; - "SlashingExitWindowDurationChanged(uint256)": EventFragment; - "SlashingSettled()": EventFragment; - "Staked(address,address,uint256,uint256)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "Cooldown"): EventFragment; - getEvent(nameOrSignatureOrTopic: "CooldownSecondsChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ExchangeRateChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "FundsReturned"): EventFragment; - getEvent(nameOrSignatureOrTopic: "GHODebtTokenChanged"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "MaxSlashablePercentageChanged" - ): EventFragment; - getEvent(nameOrSignatureOrTopic: "Redeem"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsAccrued"): EventFragment; - getEvent(nameOrSignatureOrTopic: "RewardsClaimed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Slashed"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "SlashingExitWindowDurationChanged" - ): EventFragment; - getEvent(nameOrSignatureOrTopic: "SlashingSettled"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Staked"): EventFragment; +export interface IStakedAaveV3Interface extends utils.Interface { + functions: { + 'CLAIM_HELPER_ROLE()': FunctionFragment; + 'COOLDOWN_ADMIN_ROLE()': FunctionFragment; + 'COOLDOWN_SECONDS()': FunctionFragment; + 'DELEGATE_BY_TYPE_TYPEHASH()': FunctionFragment; + 'DELEGATE_TYPEHASH()': FunctionFragment; + 'DISTRIBUTION_END()': FunctionFragment; + 'DOMAIN_SEPARATOR()': FunctionFragment; + 'EIP712_REVISION()': FunctionFragment; + 'EMISSION_MANAGER()': FunctionFragment; + 'EXCHANGE_RATE_UNIT()': FunctionFragment; + 'INITIAL_EXCHANGE_RATE()': FunctionFragment; + 'LOWER_BOUND()': FunctionFragment; + 'PERMIT_TYPEHASH()': FunctionFragment; + 'POWER_SCALE_FACTOR()': FunctionFragment; + 'PRECISION()': FunctionFragment; + 'REVISION()': FunctionFragment; + 'REWARDS_VAULT()': FunctionFragment; + 'REWARD_TOKEN()': FunctionFragment; + 'SLASH_ADMIN_ROLE()': FunctionFragment; + 'STAKED_TOKEN()': FunctionFragment; + 'UNSTAKE_WINDOW()': FunctionFragment; + '_nonces(address)': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'assets(address)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'claimRewards(address,uint256)': FunctionFragment; + 'claimRewardsAndRedeem(address,uint256,uint256)': FunctionFragment; + 'claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)': FunctionFragment; + 'claimRewardsAndStake(address,uint256)': FunctionFragment; + 'claimRewardsAndStakeOnBehalf(address,address,uint256)': FunctionFragment; + 'claimRewardsOnBehalf(address,address,uint256)': FunctionFragment; + 'claimRoleAdmin(uint256)': FunctionFragment; + 'configureAssets((uint128,uint256,address)[])': FunctionFragment; + 'cooldown()': FunctionFragment; + 'cooldownOnBehalfOf(address)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'delegate(address)': FunctionFragment; + 'delegateByType(address,uint8)': FunctionFragment; + 'eip712Domain()': FunctionFragment; + 'getAdmin(uint256)': FunctionFragment; + 'getCooldownSeconds()': FunctionFragment; + 'getDelegateeByType(address,uint8)': FunctionFragment; + 'getDelegates(address)': FunctionFragment; + 'getExchangeRate()': FunctionFragment; + 'getMaxSlashablePercentage()': FunctionFragment; + 'getPendingAdmin(uint256)': FunctionFragment; + 'getPowerCurrent(address,uint8)': FunctionFragment; + 'getPowersCurrent(address)': FunctionFragment; + 'getTotalRewardsBalance(address)': FunctionFragment; + 'getUserAssetData(address,address)': FunctionFragment; + 'ghoDebtToken()': FunctionFragment; + 'inPostSlashingPeriod()': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'initialize()': FunctionFragment; + 'metaDelegate(address,address,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'metaDelegateByType(address,address,uint8,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'name()': FunctionFragment; + 'permit(address,address,uint256,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'previewRedeem(uint256)': FunctionFragment; + 'previewStake(uint256)': FunctionFragment; + 'redeem(address,uint256)': FunctionFragment; + 'redeemOnBehalf(address,address,uint256)': FunctionFragment; + 'returnFunds(uint256)': FunctionFragment; + 'setCooldownSeconds(uint256)': FunctionFragment; + 'setMaxSlashablePercentage(uint256)': FunctionFragment; + 'setPendingAdmin(uint256,address)': FunctionFragment; + 'settleSlashing()': FunctionFragment; + 'slash(address,uint256)': FunctionFragment; + 'stake(address,uint256)': FunctionFragment; + 'stakeWithPermit(uint256,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'stakerRewardsToClaim(address)': FunctionFragment; + 'stakersCooldowns(address)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'CLAIM_HELPER_ROLE' + | 'COOLDOWN_ADMIN_ROLE' + | 'COOLDOWN_SECONDS' + | 'DELEGATE_BY_TYPE_TYPEHASH' + | 'DELEGATE_TYPEHASH' + | 'DISTRIBUTION_END' + | 'DOMAIN_SEPARATOR' + | 'EIP712_REVISION' + | 'EMISSION_MANAGER' + | 'EXCHANGE_RATE_UNIT' + | 'INITIAL_EXCHANGE_RATE' + | 'LOWER_BOUND' + | 'PERMIT_TYPEHASH' + | 'POWER_SCALE_FACTOR' + | 'PRECISION' + | 'REVISION' + | 'REWARDS_VAULT' + | 'REWARD_TOKEN' + | 'SLASH_ADMIN_ROLE' + | 'STAKED_TOKEN' + | 'UNSTAKE_WINDOW' + | '_nonces' + | 'allowance' + | 'approve' + | 'assets' + | 'balanceOf' + | 'claimRewards' + | 'claimRewardsAndRedeem' + | 'claimRewardsAndRedeemOnBehalf' + | 'claimRewardsAndStake' + | 'claimRewardsAndStakeOnBehalf' + | 'claimRewardsOnBehalf' + | 'claimRoleAdmin' + | 'configureAssets' + | 'cooldown' + | 'cooldownOnBehalfOf' + | 'decimals' + | 'decreaseAllowance' + | 'delegate' + | 'delegateByType' + | 'eip712Domain' + | 'getAdmin' + | 'getCooldownSeconds' + | 'getDelegateeByType' + | 'getDelegates' + | 'getExchangeRate' + | 'getMaxSlashablePercentage' + | 'getPendingAdmin' + | 'getPowerCurrent' + | 'getPowersCurrent' + | 'getTotalRewardsBalance' + | 'getUserAssetData' + | 'ghoDebtToken' + | 'inPostSlashingPeriod' + | 'increaseAllowance' + | 'initialize' + | 'metaDelegate' + | 'metaDelegateByType' + | 'name' + | 'permit' + | 'previewRedeem' + | 'previewStake' + | 'redeem' + | 'redeemOnBehalf' + | 'returnFunds' + | 'setCooldownSeconds' + | 'setMaxSlashablePercentage' + | 'setPendingAdmin' + | 'settleSlashing' + | 'slash' + | 'stake' + | 'stakeWithPermit' + | 'stakerRewardsToClaim' + | 'stakersCooldowns' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData( + functionFragment: 'CLAIM_HELPER_ROLE', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'COOLDOWN_ADMIN_ROLE', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'COOLDOWN_SECONDS', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DELEGATE_BY_TYPE_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DELEGATE_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DISTRIBUTION_END', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'DOMAIN_SEPARATOR', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'EIP712_REVISION', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'EMISSION_MANAGER', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'EXCHANGE_RATE_UNIT', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'INITIAL_EXCHANGE_RATE', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'LOWER_BOUND', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'PERMIT_TYPEHASH', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'POWER_SCALE_FACTOR', + values?: undefined, + ): string; + encodeFunctionData(functionFragment: 'PRECISION', values?: undefined): string; + encodeFunctionData(functionFragment: 'REVISION', values?: undefined): string; + encodeFunctionData( + functionFragment: 'REWARDS_VAULT', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'REWARD_TOKEN', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'SLASH_ADMIN_ROLE', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'STAKED_TOKEN', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'UNSTAKE_WINDOW', + values?: undefined, + ): string; + encodeFunctionData(functionFragment: '_nonces', values: [string]): string; + encodeFunctionData( + functionFragment: 'allowance', + values: [string, string], + ): string; + encodeFunctionData( + functionFragment: 'approve', + values: [string, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'assets', values: [string]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData( + functionFragment: 'claimRewards', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRewardsAndRedeem', + values: [string, BigNumberish, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRewardsAndRedeemOnBehalf', + values: [string, string, BigNumberish, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRewardsAndStake', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRewardsAndStakeOnBehalf', + values: [string, string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRewardsOnBehalf', + values: [string, string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'claimRoleAdmin', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'configureAssets', + values: [DistributionTypes.AssetConfigInputStruct[]], + ): string; + encodeFunctionData(functionFragment: 'cooldown', values?: undefined): string; + encodeFunctionData( + functionFragment: 'cooldownOnBehalfOf', + values: [string], + ): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData( + functionFragment: 'decreaseAllowance', + values: [string, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'delegate', values: [string]): string; + encodeFunctionData( + functionFragment: 'delegateByType', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'eip712Domain', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getAdmin', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getCooldownSeconds', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getDelegateeByType', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getDelegates', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'getExchangeRate', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getMaxSlashablePercentage', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'getPendingAdmin', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getPowerCurrent', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'getPowersCurrent', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'getTotalRewardsBalance', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'getUserAssetData', + values: [string, string], + ): string; + encodeFunctionData( + functionFragment: 'ghoDebtToken', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'inPostSlashingPeriod', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'increaseAllowance', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'initialize', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'metaDelegate', + values: [string, string, BigNumberish, BigNumberish, BytesLike, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'metaDelegateByType', + values: [ + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike, + ], + ): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData( + functionFragment: 'permit', + values: [ + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike, + ], + ): string; + encodeFunctionData( + functionFragment: 'previewRedeem', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'previewStake', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'redeem', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'redeemOnBehalf', + values: [string, string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'returnFunds', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'setCooldownSeconds', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'setMaxSlashablePercentage', + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'setPendingAdmin', + values: [BigNumberish, string], + ): string; + encodeFunctionData( + functionFragment: 'settleSlashing', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'slash', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'stake', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'stakeWithPermit', + values: [BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'stakerRewardsToClaim', + values: [string], + ): string; + encodeFunctionData( + functionFragment: 'stakersCooldowns', + values: [string], + ): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData( + functionFragment: 'totalSupply', + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [string, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [string, string, BigNumberish], + ): string; + + decodeFunctionResult( + functionFragment: 'CLAIM_HELPER_ROLE', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'COOLDOWN_ADMIN_ROLE', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'COOLDOWN_SECONDS', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DELEGATE_BY_TYPE_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DELEGATE_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DISTRIBUTION_END', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'DOMAIN_SEPARATOR', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'EIP712_REVISION', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'EMISSION_MANAGER', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'EXCHANGE_RATE_UNIT', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'INITIAL_EXCHANGE_RATE', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'LOWER_BOUND', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'PERMIT_TYPEHASH', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'POWER_SCALE_FACTOR', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'PRECISION', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'REVISION', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'REWARDS_VAULT', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'REWARD_TOKEN', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'SLASH_ADMIN_ROLE', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'STAKED_TOKEN', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'UNSTAKE_WINDOW', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: '_nonces', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'assets', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'claimRewards', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRewardsAndRedeem', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRewardsAndRedeemOnBehalf', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRewardsAndStake', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRewardsAndStakeOnBehalf', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRewardsOnBehalf', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'claimRoleAdmin', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'configureAssets', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'cooldown', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'cooldownOnBehalfOf', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'decreaseAllowance', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'delegate', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'delegateByType', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'eip712Domain', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'getAdmin', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'getCooldownSeconds', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getDelegateeByType', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getDelegates', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getExchangeRate', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getMaxSlashablePercentage', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPendingAdmin', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPowerCurrent', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getPowersCurrent', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getTotalRewardsBalance', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'getUserAssetData', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'ghoDebtToken', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'inPostSlashingPeriod', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'increaseAllowance', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'metaDelegate', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'metaDelegateByType', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'permit', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'previewRedeem', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'previewStake', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'redeemOnBehalf', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'returnFunds', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'setCooldownSeconds', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'setMaxSlashablePercentage', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'setPendingAdmin', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'settleSlashing', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'slash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stake', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'stakeWithPermit', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'stakerRewardsToClaim', + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: 'stakersCooldowns', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'totalSupply', + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult( + functionFragment: 'transferFrom', + data: BytesLike, + ): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'AssetConfigUpdated(address,uint256)': EventFragment; + 'AssetIndexUpdated(address,uint256)': EventFragment; + 'Cooldown(address,uint256)': EventFragment; + 'CooldownSecondsChanged(uint256)': EventFragment; + 'DelegateChanged(address,address,uint8)': EventFragment; + 'EIP712DomainChanged()': EventFragment; + 'ExchangeRateChanged(uint216)': EventFragment; + 'FundsReturned(uint256)': EventFragment; + 'MaxSlashablePercentageChanged(uint256)': EventFragment; + 'PendingAdminChanged(address,uint256)': EventFragment; + 'Redeem(address,address,uint256,uint256)': EventFragment; + 'RewardsAccrued(address,uint256)': EventFragment; + 'RewardsClaimed(address,address,uint256)': EventFragment; + 'RoleClaimed(address,uint256)': EventFragment; + 'Slashed(address,uint256)': EventFragment; + 'SlashingExitWindowDurationChanged(uint256)': EventFragment; + 'SlashingSettled()': EventFragment; + 'Staked(address,address,uint256,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'UserIndexUpdated(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'AssetConfigUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'AssetIndexUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Cooldown'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'CooldownSecondsChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DelegateChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'EIP712DomainChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ExchangeRateChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FundsReturned'): EventFragment; + getEvent( + nameOrSignatureOrTopic: 'MaxSlashablePercentageChanged', + ): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PendingAdminChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Redeem'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardsAccrued'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardsClaimed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RoleClaimed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Slashed'): EventFragment; + getEvent( + nameOrSignatureOrTopic: 'SlashingExitWindowDurationChanged', + ): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SlashingSettled'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Staked'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'UserIndexUpdated'): EventFragment; } -export class IStakedAaveV3 extends Contract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - listeners, EventArgsObject>( - eventFilter?: TypedEventFilter - ): Array>; - off, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - on, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - once, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - removeListener, EventArgsObject>( - eventFilter: TypedEventFilter, - listener: TypedListener - ): this; - removeAllListeners, EventArgsObject>( - eventFilter: TypedEventFilter - ): this; - - listeners(eventName?: string): Array; - off(eventName: string, listener: Listener): this; - on(eventName: string, listener: Listener): this; - once(eventName: string, listener: Listener): this; - removeListener(eventName: string, listener: Listener): this; - removeAllListeners(eventName?: string): this; - - queryFilter, EventArgsObject>( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>>; - - interface: IStakedAaveV3Interface; - - functions: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise<[BigNumber]>; - - "COOLDOWN_SECONDS()"(overrides?: CallOverrides): Promise<[BigNumber]>; - - REWARD_TOKEN(overrides?: CallOverrides): Promise<{ - 0: string; - }>; - - 'REWARD_TOKEN()'(overrides?: CallOverrides): Promise<{ - 0: string; - }>; - - STAKED_TOKEN(overrides?: CallOverrides): Promise<{ - 0: string; - }>; - - 'STAKED_TOKEN()'(overrides?: CallOverrides): Promise<{ - 0: string; - }>; - - claimRewards( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewards(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeem( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeem(address,uint256,uint256)"( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeemOnBehalf( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)"( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStakeOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStakeOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldown()"( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldownOnBehalfOf( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldownOnBehalfOf(address)"( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - getCooldownSeconds(overrides?: CallOverrides): Promise<[BigNumber]>; - - "getCooldownSeconds()"(overrides?: CallOverrides): Promise<[BigNumber]>; - - getExchangeRate(overrides?: CallOverrides): Promise<[BigNumber]>; - - "getExchangeRate()"(overrides?: CallOverrides): Promise<[BigNumber]>; - - getExchangeRateSnapshot( - index: BigNumberish, - overrides?: CallOverrides - ): Promise< - [[number, BigNumber] & { blockNumber: number; value: BigNumber }] - >; - - "getExchangeRateSnapshot(uint32)"( - index: BigNumberish, - overrides?: CallOverrides - ): Promise< - [[number, BigNumber] & { blockNumber: number; value: BigNumber }] - >; - - getExchangeRateSnapshotsCount(overrides?: CallOverrides): Promise<[number]>; - - "getExchangeRateSnapshotsCount()"( - overrides?: CallOverrides - ): Promise<[number]>; - - getMaxSlashablePercentage(overrides?: CallOverrides): Promise<[BigNumber]>; - - "getMaxSlashablePercentage()"( - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getTotalRewardsBalance( - staker: string, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - "getTotalRewardsBalance(address)"( - staker: string, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - permit( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - previewRedeem( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - "previewRedeem(uint256)"( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - previewStake( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - "previewStake(uint256)"( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - redeem( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeem(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - redeemOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeemOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stakeWithPermit( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)"( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - }; +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; - REWARD_TOKEN(overrides?: CallOverrides): Promise; +export type ApprovalEventFilter = TypedEventFilter; - 'REWARD_TOKEN()'(overrides?: CallOverrides): Promise; +export interface AssetConfigUpdatedEventObject { + asset: string; + emission: BigNumber; +} +export type AssetConfigUpdatedEvent = TypedEvent< + [string, BigNumber], + AssetConfigUpdatedEventObject +>; - STAKED_TOKEN(overrides?: CallOverrides): Promise; +export type AssetConfigUpdatedEventFilter = + TypedEventFilter; - 'STAKED_TOKEN()'(overrides?: CallOverrides): Promise; +export interface AssetIndexUpdatedEventObject { + asset: string; + index: BigNumber; +} +export type AssetIndexUpdatedEvent = TypedEvent< + [string, BigNumber], + AssetIndexUpdatedEventObject +>; - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; +export type AssetIndexUpdatedEventFilter = + TypedEventFilter; - "COOLDOWN_SECONDS()"(overrides?: CallOverrides): Promise; +export interface CooldownEventObject { + user: string; + amount: BigNumber; +} +export type CooldownEvent = TypedEvent< + [string, BigNumber], + CooldownEventObject +>; - claimRewards( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } +export type CooldownEventFilter = TypedEventFilter; + +export interface CooldownSecondsChangedEventObject { + cooldownSeconds: BigNumber; +} +export type CooldownSecondsChangedEvent = TypedEvent< + [BigNumber], + CooldownSecondsChangedEventObject +>; + +export type CooldownSecondsChangedEventFilter = + TypedEventFilter; + +export interface DelegateChangedEventObject { + delegator: string; + delegatee: string; + delegationType: number; +} +export type DelegateChangedEvent = TypedEvent< + [string, string, number], + DelegateChangedEventObject +>; + +export type DelegateChangedEventFilter = TypedEventFilter; + +export interface EIP712DomainChangedEventObject {} +export type EIP712DomainChangedEvent = TypedEvent< + [], + EIP712DomainChangedEventObject +>; + +export type EIP712DomainChangedEventFilter = + TypedEventFilter; + +export interface ExchangeRateChangedEventObject { + exchangeRate: BigNumber; +} +export type ExchangeRateChangedEvent = TypedEvent< + [BigNumber], + ExchangeRateChangedEventObject +>; + +export type ExchangeRateChangedEventFilter = + TypedEventFilter; + +export interface FundsReturnedEventObject { + amount: BigNumber; +} +export type FundsReturnedEvent = TypedEvent< + [BigNumber], + FundsReturnedEventObject +>; + +export type FundsReturnedEventFilter = TypedEventFilter; + +export interface MaxSlashablePercentageChangedEventObject { + newPercentage: BigNumber; +} +export type MaxSlashablePercentageChangedEvent = TypedEvent< + [BigNumber], + MaxSlashablePercentageChangedEventObject +>; + +export type MaxSlashablePercentageChangedEventFilter = + TypedEventFilter; + +export interface PendingAdminChangedEventObject { + newPendingAdmin: string; + role: BigNumber; +} +export type PendingAdminChangedEvent = TypedEvent< + [string, BigNumber], + PendingAdminChangedEventObject +>; + +export type PendingAdminChangedEventFilter = + TypedEventFilter; + +export interface RedeemEventObject { + from: string; + to: string; + assets: BigNumber; + shares: BigNumber; +} +export type RedeemEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + RedeemEventObject +>; + +export type RedeemEventFilter = TypedEventFilter; + +export interface RewardsAccruedEventObject { + user: string; + amount: BigNumber; +} +export type RewardsAccruedEvent = TypedEvent< + [string, BigNumber], + RewardsAccruedEventObject +>; + +export type RewardsAccruedEventFilter = TypedEventFilter; + +export interface RewardsClaimedEventObject { + from: string; + to: string; + amount: BigNumber; +} +export type RewardsClaimedEvent = TypedEvent< + [string, string, BigNumber], + RewardsClaimedEventObject +>; + +export type RewardsClaimedEventFilter = TypedEventFilter; + +export interface RoleClaimedEventObject { + newAdmin: string; + role: BigNumber; +} +export type RoleClaimedEvent = TypedEvent< + [string, BigNumber], + RoleClaimedEventObject +>; + +export type RoleClaimedEventFilter = TypedEventFilter; + +export interface SlashedEventObject { + destination: string; + amount: BigNumber; +} +export type SlashedEvent = TypedEvent<[string, BigNumber], SlashedEventObject>; + +export type SlashedEventFilter = TypedEventFilter; + +export interface SlashingExitWindowDurationChangedEventObject { + windowSeconds: BigNumber; +} +export type SlashingExitWindowDurationChangedEvent = TypedEvent< + [BigNumber], + SlashingExitWindowDurationChangedEventObject +>; + +export type SlashingExitWindowDurationChangedEventFilter = + TypedEventFilter; + +export interface SlashingSettledEventObject {} +export type SlashingSettledEvent = TypedEvent<[], SlashingSettledEventObject>; + +export type SlashingSettledEventFilter = TypedEventFilter; + +export interface StakedEventObject { + from: string; + to: string; + assets: BigNumber; + shares: BigNumber; +} +export type StakedEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + StakedEventObject +>; + +export type StakedEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; + +export type TransferEventFilter = TypedEventFilter; + +export interface UserIndexUpdatedEventObject { + user: string; + asset: string; + index: BigNumber; +} +export type UserIndexUpdatedEvent = TypedEvent< + [string, string, BigNumber], + UserIndexUpdatedEventObject +>; + +export type UserIndexUpdatedEventFilter = + TypedEventFilter; + +export interface IStakedAaveV3 extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: StakedAaveV3Interface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter, + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter, + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + CLAIM_HELPER_ROLE(overrides?: CallOverrides): Promise<[BigNumber]>; + + COOLDOWN_ADMIN_ROLE(overrides?: CallOverrides): Promise<[BigNumber]>; + + COOLDOWN_SECONDS(overrides?: CallOverrides): Promise<[BigNumber]>; + + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + DISTRIBUTION_END(overrides?: CallOverrides): Promise<[BigNumber]>; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>; + + EIP712_REVISION(overrides?: CallOverrides): Promise<[string]>; + + EMISSION_MANAGER(overrides?: CallOverrides): Promise<[string]>; + + EXCHANGE_RATE_UNIT(overrides?: CallOverrides): Promise<[BigNumber]>; + + INITIAL_EXCHANGE_RATE(overrides?: CallOverrides): Promise<[BigNumber]>; + + LOWER_BOUND(overrides?: CallOverrides): Promise<[BigNumber]>; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise<[BigNumber]>; + + PRECISION(overrides?: CallOverrides): Promise<[number]>; + + REVISION(overrides?: CallOverrides): Promise<[BigNumber]>; + + REWARDS_VAULT(overrides?: CallOverrides): Promise<[string]>; + + REWARD_TOKEN(overrides?: CallOverrides): Promise<[string]>; + + SLASH_ADMIN_ROLE(overrides?: CallOverrides): Promise<[BigNumber]>; + + STAKED_TOKEN(overrides?: CallOverrides): Promise<[string]>; + + UNSTAKE_WINDOW(overrides?: CallOverrides): Promise<[BigNumber]>; + + _nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewards(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + assets( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + emissionPerSecond: BigNumber; + lastUpdateTimestamp: BigNumber; + index: BigNumber; + } + >; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + claimRewards( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; claimRewardsAndRedeem( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewardsAndRedeem(address,uint256,uint256)"( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + claimRewardsAndRedeemOnBehalf( + from: string, + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - claimRewardsAndRedeemOnBehalf( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + claimRewardsAndStake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)"( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + claimRewardsAndStakeOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - claimRewardsAndStake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + claimRewardsOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewardsAndStake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + claimRoleAdmin( + role: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - claimRewardsAndStakeOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + configureAssets( + assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewardsAndStakeOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + cooldown( + overrides?: Overrides & { from?: string }, ): Promise; - claimRewardsOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + cooldownOnBehalfOf( + from: string, + overrides?: Overrides & { from?: string }, ): Promise; - "claimRewardsOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - cooldown( - overrides?: Overrides & { from?: string | Promise } + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, ): Promise; - "cooldown()"( - overrides?: Overrides & { from?: string | Promise } + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - cooldownOnBehalfOf( - from: string, - overrides?: Overrides & { from?: string | Promise } + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getAdmin(role: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + getCooldownSeconds(overrides?: CallOverrides): Promise<[BigNumber]>; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise<[string]>; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; + + getExchangeRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + getMaxSlashablePercentage(overrides?: CallOverrides): Promise<[BigNumber]>; + + getPendingAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise<[string]>; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + getTotalRewardsBalance( + staker: string, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + getUserAssetData( + user: string, + asset: string, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + ghoDebtToken(overrides?: CallOverrides): Promise<[string]>; + + inPostSlashingPeriod(overrides?: CallOverrides): Promise<[boolean]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, ): Promise; - "cooldownOnBehalfOf(address)"( - from: string, - overrides?: Overrides & { from?: string | Promise } + name(overrides?: CallOverrides): Promise<[string]>; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + previewRedeem( + shares: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + previewStake( + assets: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + redeem( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + returnFunds( + amount: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; + setCooldownSeconds( + cooldownSeconds: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setMaxSlashablePercentage( + percentage: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPendingAdmin( + role: BigNumberish, + newPendingAdmin: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + settleSlashing( + overrides?: Overrides & { from?: string }, + ): Promise; + + slash( + destination: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakeWithPermit( + amount: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakerRewardsToClaim( + arg0: string, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + stakersCooldowns( + arg0: string, + overrides?: CallOverrides, + ): Promise<[number, BigNumber] & { timestamp: number; amount: BigNumber }>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + CLAIM_HELPER_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; + + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DISTRIBUTION_END(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + EIP712_REVISION(overrides?: CallOverrides): Promise; + + EMISSION_MANAGER(overrides?: CallOverrides): Promise; + + EXCHANGE_RATE_UNIT(overrides?: CallOverrides): Promise; + + INITIAL_EXCHANGE_RATE(overrides?: CallOverrides): Promise; + + LOWER_BOUND(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + REWARDS_VAULT(overrides?: CallOverrides): Promise; + + REWARD_TOKEN(overrides?: CallOverrides): Promise; + + SLASH_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + STAKED_TOKEN(overrides?: CallOverrides): Promise; + + UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + assets( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + emissionPerSecond: BigNumber; + lastUpdateTimestamp: BigNumber; + index: BigNumber; + } + >; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + claimRewards( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeem( + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeemOnBehalf( + from: string, + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStakeOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRoleAdmin( + role: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + configureAssets( + assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cooldown( + overrides?: Overrides & { from?: string }, + ): Promise; + + cooldownOnBehalfOf( + from: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getAdmin(role: BigNumberish, overrides?: CallOverrides): Promise; + + getCooldownSeconds(overrides?: CallOverrides): Promise; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; + + getExchangeRate(overrides?: CallOverrides): Promise; + + getMaxSlashablePercentage(overrides?: CallOverrides): Promise; + + getPendingAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + getTotalRewardsBalance( + staker: string, + overrides?: CallOverrides, + ): Promise; + + getUserAssetData( + user: string, + asset: string, + overrides?: CallOverrides, + ): Promise; + + ghoDebtToken(overrides?: CallOverrides): Promise; + + inPostSlashingPeriod(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + previewRedeem( + shares: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + previewStake( + assets: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeem( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + returnFunds( + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setCooldownSeconds( + cooldownSeconds: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setMaxSlashablePercentage( + percentage: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPendingAdmin( + role: BigNumberish, + newPendingAdmin: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + settleSlashing( + overrides?: Overrides & { from?: string }, + ): Promise; + + slash( + destination: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakeWithPermit( + amount: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakerRewardsToClaim( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + stakersCooldowns( + arg0: string, + overrides?: CallOverrides, + ): Promise<[number, BigNumber] & { timestamp: number; amount: BigNumber }>; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + callStatic: { + CLAIM_HELPER_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; + + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DISTRIBUTION_END(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + EIP712_REVISION(overrides?: CallOverrides): Promise; + + EMISSION_MANAGER(overrides?: CallOverrides): Promise; + + EXCHANGE_RATE_UNIT(overrides?: CallOverrides): Promise; + + INITIAL_EXCHANGE_RATE(overrides?: CallOverrides): Promise; + + LOWER_BOUND(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + REWARDS_VAULT(overrides?: CallOverrides): Promise; + + REWARD_TOKEN(overrides?: CallOverrides): Promise; + + SLASH_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + STAKED_TOKEN(overrides?: CallOverrides): Promise; + + UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + assets( + arg0: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + emissionPerSecond: BigNumber; + lastUpdateTimestamp: BigNumber; + index: BigNumber; + } + >; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + claimRewards( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRewardsAndRedeem( + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRewardsAndRedeemOnBehalf( + from: string, + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRewardsAndStake( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRewardsAndStakeOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRewardsOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + claimRoleAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + configureAssets( + assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], + overrides?: CallOverrides, + ): Promise; + + cooldown(overrides?: CallOverrides): Promise; + + cooldownOnBehalfOf(from: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + delegate(delegatee: string, overrides?: CallOverrides): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getAdmin(role: BigNumberish, overrides?: CallOverrides): Promise; + getCooldownSeconds(overrides?: CallOverrides): Promise; - "getCooldownSeconds()"(overrides?: CallOverrides): Promise; + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise<[string, string]>; getExchangeRate(overrides?: CallOverrides): Promise; - "getExchangeRate()"(overrides?: CallOverrides): Promise; + getMaxSlashablePercentage(overrides?: CallOverrides): Promise; + + getPendingAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber]>; + + getTotalRewardsBalance( + staker: string, + overrides?: CallOverrides, + ): Promise; + + getUserAssetData( + user: string, + asset: string, + overrides?: CallOverrides, + ): Promise; + + ghoDebtToken(overrides?: CallOverrides): Promise; + + inPostSlashingPeriod(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + initialize(overrides?: CallOverrides): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + previewRedeem( + shares: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + previewStake( + assets: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeem( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeemOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + returnFunds(amount: BigNumberish, overrides?: CallOverrides): Promise; + + setCooldownSeconds( + cooldownSeconds: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + setMaxSlashablePercentage( + percentage: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + setPendingAdmin( + role: BigNumberish, + newPendingAdmin: string, + overrides?: CallOverrides, + ): Promise; + + settleSlashing(overrides?: CallOverrides): Promise; + + slash( + destination: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + stake( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + stakeWithPermit( + amount: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + stakerRewardsToClaim( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + stakersCooldowns( + arg0: string, + overrides?: CallOverrides, + ): Promise<[number, BigNumber] & { timestamp: number; amount: BigNumber }>; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + + 'AssetConfigUpdated(address,uint256)'( + asset?: string | null, + emission?: null, + ): AssetConfigUpdatedEventFilter; + AssetConfigUpdated( + asset?: string | null, + emission?: null, + ): AssetConfigUpdatedEventFilter; + + 'AssetIndexUpdated(address,uint256)'( + asset?: string | null, + index?: null, + ): AssetIndexUpdatedEventFilter; + AssetIndexUpdated( + asset?: string | null, + index?: null, + ): AssetIndexUpdatedEventFilter; + + 'Cooldown(address,uint256)'( + user?: string | null, + amount?: null, + ): CooldownEventFilter; + Cooldown(user?: string | null, amount?: null): CooldownEventFilter; + + 'CooldownSecondsChanged(uint256)'( + cooldownSeconds?: null, + ): CooldownSecondsChangedEventFilter; + CooldownSecondsChanged( + cooldownSeconds?: null, + ): CooldownSecondsChangedEventFilter; + + 'DelegateChanged(address,address,uint8)'( + delegator?: string | null, + delegatee?: string | null, + delegationType?: null, + ): DelegateChangedEventFilter; + DelegateChanged( + delegator?: string | null, + delegatee?: string | null, + delegationType?: null, + ): DelegateChangedEventFilter; + + 'EIP712DomainChanged()'(): EIP712DomainChangedEventFilter; + EIP712DomainChanged(): EIP712DomainChangedEventFilter; + + 'ExchangeRateChanged(uint216)'( + exchangeRate?: null, + ): ExchangeRateChangedEventFilter; + ExchangeRateChanged(exchangeRate?: null): ExchangeRateChangedEventFilter; + + 'FundsReturned(uint256)'(amount?: null): FundsReturnedEventFilter; + FundsReturned(amount?: null): FundsReturnedEventFilter; + + 'MaxSlashablePercentageChanged(uint256)'( + newPercentage?: null, + ): MaxSlashablePercentageChangedEventFilter; + MaxSlashablePercentageChanged( + newPercentage?: null, + ): MaxSlashablePercentageChangedEventFilter; + + 'PendingAdminChanged(address,uint256)'( + newPendingAdmin?: string | null, + role?: null, + ): PendingAdminChangedEventFilter; + PendingAdminChanged( + newPendingAdmin?: string | null, + role?: null, + ): PendingAdminChangedEventFilter; + + 'Redeem(address,address,uint256,uint256)'( + from?: string | null, + to?: string | null, + assets?: null, + shares?: null, + ): RedeemEventFilter; + Redeem( + from?: string | null, + to?: string | null, + assets?: null, + shares?: null, + ): RedeemEventFilter; + + 'RewardsAccrued(address,uint256)'( + user?: null, + amount?: null, + ): RewardsAccruedEventFilter; + RewardsAccrued(user?: null, amount?: null): RewardsAccruedEventFilter; + + 'RewardsClaimed(address,address,uint256)'( + from?: string | null, + to?: string | null, + amount?: null, + ): RewardsClaimedEventFilter; + RewardsClaimed( + from?: string | null, + to?: string | null, + amount?: null, + ): RewardsClaimedEventFilter; + + 'RoleClaimed(address,uint256)'( + newAdmin?: string | null, + role?: null, + ): RoleClaimedEventFilter; + RoleClaimed(newAdmin?: string | null, role?: null): RoleClaimedEventFilter; + + 'Slashed(address,uint256)'( + destination?: string | null, + amount?: null, + ): SlashedEventFilter; + Slashed(destination?: string | null, amount?: null): SlashedEventFilter; + + 'SlashingExitWindowDurationChanged(uint256)'( + windowSeconds?: null, + ): SlashingExitWindowDurationChangedEventFilter; + SlashingExitWindowDurationChanged( + windowSeconds?: null, + ): SlashingExitWindowDurationChangedEventFilter; + + 'SlashingSettled()'(): SlashingSettledEventFilter; + SlashingSettled(): SlashingSettledEventFilter; + + 'Staked(address,address,uint256,uint256)'( + from?: string | null, + to?: string | null, + assets?: null, + shares?: null, + ): StakedEventFilter; + Staked( + from?: string | null, + to?: string | null, + assets?: null, + shares?: null, + ): StakedEventFilter; + + 'Transfer(address,address,uint256)'( + from?: string | null, + to?: string | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: string | null, + to?: string | null, + value?: null, + ): TransferEventFilter; + + 'UserIndexUpdated(address,address,uint256)'( + user?: string | null, + asset?: string | null, + index?: null, + ): UserIndexUpdatedEventFilter; + UserIndexUpdated( + user?: string | null, + asset?: string | null, + index?: null, + ): UserIndexUpdatedEventFilter; + }; + + estimateGas: { + CLAIM_HELPER_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; + + DELEGATE_BY_TYPE_TYPEHASH(overrides?: CallOverrides): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DISTRIBUTION_END(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + EIP712_REVISION(overrides?: CallOverrides): Promise; + + EMISSION_MANAGER(overrides?: CallOverrides): Promise; + + EXCHANGE_RATE_UNIT(overrides?: CallOverrides): Promise; + + INITIAL_EXCHANGE_RATE(overrides?: CallOverrides): Promise; + + LOWER_BOUND(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; - getExchangeRateSnapshot( - index: BigNumberish, - overrides?: CallOverrides - ): Promise<[number, BigNumber] & { blockNumber: number; value: BigNumber }>; + POWER_SCALE_FACTOR(overrides?: CallOverrides): Promise; - "getExchangeRateSnapshot(uint32)"( - index: BigNumberish, - overrides?: CallOverrides - ): Promise<[number, BigNumber] & { blockNumber: number; value: BigNumber }>; + PRECISION(overrides?: CallOverrides): Promise; - getExchangeRateSnapshotsCount(overrides?: CallOverrides): Promise; + REVISION(overrides?: CallOverrides): Promise; - "getExchangeRateSnapshotsCount()"(overrides?: CallOverrides): Promise; + REWARDS_VAULT(overrides?: CallOverrides): Promise; + + REWARD_TOKEN(overrides?: CallOverrides): Promise; + + SLASH_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + STAKED_TOKEN(overrides?: CallOverrides): Promise; + + UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; + + _nonces(arg0: string, overrides?: CallOverrides): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + assets(arg0: string, overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + claimRewards( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeem( + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeemOnBehalf( + from: string, + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStakeOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRoleAdmin( + role: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + configureAssets( + assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cooldown(overrides?: Overrides & { from?: string }): Promise; + + cooldownOnBehalfOf( + from: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getAdmin(role: BigNumberish, overrides?: CallOverrides): Promise; + + getCooldownSeconds(overrides?: CallOverrides): Promise; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise; + + getExchangeRate(overrides?: CallOverrides): Promise; getMaxSlashablePercentage(overrides?: CallOverrides): Promise; - "getMaxSlashablePercentage()"(overrides?: CallOverrides): Promise; + getPendingAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise; getTotalRewardsBalance( - staker: string, - overrides?: CallOverrides + staker: string, + overrides?: CallOverrides, ): Promise; - "getTotalRewardsBalance(address)"( - staker: string, - overrides?: CallOverrides + getUserAssetData( + user: string, + asset: string, + overrides?: CallOverrides, ): Promise; - permit( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + ghoDebtToken(overrides?: CallOverrides): Promise; - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + inPostSlashingPeriod(overrides?: CallOverrides): Promise; - previewRedeem( - shares: BigNumberish, - overrides?: CallOverrides + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, ): Promise; - "previewRedeem(uint256)"( - shares: BigNumberish, - overrides?: CallOverrides + initialize(overrides?: Overrides & { from?: string }): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, ): Promise; - previewStake( - assets: BigNumberish, - overrides?: CallOverrides + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, ): Promise; - "previewStake(uint256)"( - assets: BigNumberish, - overrides?: CallOverrides + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, ): Promise; - redeem( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + previewRedeem( + shares: BigNumberish, + overrides?: CallOverrides, + ): Promise; - "redeem(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + previewStake( + assets: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeem( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; redeemOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; - "redeemOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + returnFunds( + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; - stake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + setCooldownSeconds( + cooldownSeconds: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; - "stake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + setMaxSlashablePercentage( + percentage: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPendingAdmin( + role: BigNumberish, + newPendingAdmin: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + settleSlashing( + overrides?: Overrides & { from?: string }, + ): Promise; + + slash( + destination: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; stakeWithPermit( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + amount: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)"( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; + stakerRewardsToClaim( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + stakersCooldowns( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; + + populateTransaction: { + CLAIM_HELPER_ROLE(overrides?: CallOverrides): Promise; + + COOLDOWN_ADMIN_ROLE( + overrides?: CallOverrides, + ): Promise; + + COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - callStatic: { - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - 'REWARD_TOKEN()'(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - 'STAKED_TOKEN()'(overrides?: CallOverrides): Promise; - - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - "COOLDOWN_SECONDS()"(overrides?: CallOverrides): Promise; - - claimRewards( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewards(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - claimRewardsAndRedeem( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewardsAndRedeem(address,uint256,uint256)"( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - claimRewardsAndRedeemOnBehalf( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)"( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - claimRewardsAndStake( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewardsAndStake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - claimRewardsAndStakeOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewardsAndStakeOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - claimRewardsOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "claimRewardsOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - cooldown(overrides?: CallOverrides): Promise; - - "cooldown()"(overrides?: CallOverrides): Promise; - - cooldownOnBehalfOf(from: string, overrides?: CallOverrides): Promise; - - "cooldownOnBehalfOf(address)"( - from: string, - overrides?: CallOverrides - ): Promise; - - getCooldownSeconds(overrides?: CallOverrides): Promise; - - "getCooldownSeconds()"(overrides?: CallOverrides): Promise; - - getExchangeRate(overrides?: CallOverrides): Promise; - - "getExchangeRate()"(overrides?: CallOverrides): Promise; - - getExchangeRateSnapshot( - index: BigNumberish, - overrides?: CallOverrides - ): Promise<[number, BigNumber] & { blockNumber: number; value: BigNumber }>; - - "getExchangeRateSnapshot(uint32)"( - index: BigNumberish, - overrides?: CallOverrides - ): Promise<[number, BigNumber] & { blockNumber: number; value: BigNumber }>; - - getExchangeRateSnapshotsCount(overrides?: CallOverrides): Promise; - - "getExchangeRateSnapshotsCount()"( - overrides?: CallOverrides - ): Promise; - - getMaxSlashablePercentage(overrides?: CallOverrides): Promise; - - "getMaxSlashablePercentage()"( - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: string, - overrides?: CallOverrides - ): Promise; - - "getTotalRewardsBalance(address)"( - staker: string, - overrides?: CallOverrides - ): Promise; - - permit( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: CallOverrides - ): Promise; - - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: CallOverrides - ): Promise; - - previewRedeem( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewRedeem(uint256)"( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - previewStake( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewStake(uint256)"( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - redeem( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "redeem(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - redeemOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "redeemOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "slash(address,uint256)"( - destination: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - stake( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "stake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - stakeWithPermit( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: CallOverrides - ): Promise; - - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)"( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - Cooldown( - user: string | null, - amount: null - ): TypedEventFilter< - [string, BigNumber], - { user: string; amount: BigNumber } - >; - - CooldownSecondsChanged( - cooldownSeconds: null - ): TypedEventFilter<[BigNumber], { cooldownSeconds: BigNumber }>; - - ExchangeRateChanged( - exchangeRate: null - ): TypedEventFilter<[BigNumber], { exchangeRate: BigNumber }>; - - FundsReturned( - amount: null - ): TypedEventFilter<[BigNumber], { amount: BigNumber }>; - - GHODebtTokenChanged( - newDebtToken: string | null - ): TypedEventFilter<[string], { newDebtToken: string }>; - - MaxSlashablePercentageChanged( - newPercentage: null - ): TypedEventFilter<[BigNumber], { newPercentage: BigNumber }>; - - Redeem( - from: string | null, - to: string | null, - assets: null, - shares: null - ): TypedEventFilter< - [string, string, BigNumber, BigNumber], - { from: string; to: string; assets: BigNumber; shares: BigNumber } - >; - - RewardsAccrued( - user: null, - amount: null - ): TypedEventFilter< - [string, BigNumber], - { user: string; amount: BigNumber } - >; - - RewardsClaimed( - from: string | null, - to: string | null, - amount: null - ): TypedEventFilter< - [string, string, BigNumber], - { from: string; to: string; amount: BigNumber } - >; - - Slashed( - destination: string | null, - amount: null - ): TypedEventFilter< - [string, BigNumber], - { destination: string; amount: BigNumber } - >; - - SlashingExitWindowDurationChanged( - windowSeconds: null - ): TypedEventFilter<[BigNumber], { windowSeconds: BigNumber }>; - - SlashingSettled(): TypedEventFilter<[], {}>; - - Staked( - from: string | null, - to: string | null, - assets: null, - shares: null - ): TypedEventFilter< - [string, string, BigNumber, BigNumber], - { from: string; to: string; assets: BigNumber; shares: BigNumber } - >; - }; - - estimateGas: { - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - 'REWARD_TOKEN()'(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - 'STAKED_TOKEN()'(overrides?: CallOverrides): Promise; - - - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - "COOLDOWN_SECONDS()"(overrides?: CallOverrides): Promise; - - claimRewards( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewards(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeem( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeem(address,uint256,uint256)"( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeemOnBehalf( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)"( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStakeOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStakeOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldown()"( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldownOnBehalfOf( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldownOnBehalfOf(address)"( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - getCooldownSeconds(overrides?: CallOverrides): Promise; - - "getCooldownSeconds()"(overrides?: CallOverrides): Promise; - - getExchangeRate(overrides?: CallOverrides): Promise; - - "getExchangeRate()"(overrides?: CallOverrides): Promise; - - getExchangeRateSnapshot( - index: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "getExchangeRateSnapshot(uint32)"( - index: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getExchangeRateSnapshotsCount( - overrides?: CallOverrides - ): Promise; - - "getExchangeRateSnapshotsCount()"( - overrides?: CallOverrides - ): Promise; - - getMaxSlashablePercentage(overrides?: CallOverrides): Promise; - - "getMaxSlashablePercentage()"( - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: string, - overrides?: CallOverrides - ): Promise; - - "getTotalRewardsBalance(address)"( - staker: string, - overrides?: CallOverrides - ): Promise; - - permit( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - previewRedeem( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewRedeem(uint256)"( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - previewStake( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewStake(uint256)"( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - redeem( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeem(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - redeemOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeemOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stakeWithPermit( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)"( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - }; - - populateTransaction: { - COOLDOWN_SECONDS(overrides?: CallOverrides): Promise; - - "COOLDOWN_SECONDS()"( - overrides?: CallOverrides - ): Promise; - - REWARD_TOKEN(overrides?: CallOverrides): Promise; - - 'REWARD_TOKEN()'(overrides?: CallOverrides): Promise; - - STAKED_TOKEN(overrides?: CallOverrides): Promise; - - 'STAKED_TOKEN()'(overrides?: CallOverrides): Promise; - - claimRewards( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewards(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeem( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeem(address,uint256,uint256)"( - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndRedeemOnBehalf( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndRedeemOnBehalf(address,address,uint256,uint256)"( - from: string, - to: string, - claimAmount: BigNumberish, - redeemAmount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsAndStakeOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsAndStakeOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - claimRewardsOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "claimRewardsOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldown( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldown()"( - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - cooldownOnBehalfOf( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "cooldownOnBehalfOf(address)"( - from: string, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - getCooldownSeconds( - overrides?: CallOverrides - ): Promise; - - "getCooldownSeconds()"( - overrides?: CallOverrides - ): Promise; - - getExchangeRate(overrides?: CallOverrides): Promise; - - "getExchangeRate()"( - overrides?: CallOverrides - ): Promise; - - getExchangeRateSnapshot( - index: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "getExchangeRateSnapshot(uint32)"( - index: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getExchangeRateSnapshotsCount( - overrides?: CallOverrides - ): Promise; - - "getExchangeRateSnapshotsCount()"( - overrides?: CallOverrides - ): Promise; - - getMaxSlashablePercentage( - overrides?: CallOverrides - ): Promise; - - "getMaxSlashablePercentage()"( - overrides?: CallOverrides - ): Promise; - - getTotalRewardsBalance( - staker: string, - overrides?: CallOverrides - ): Promise; - - "getTotalRewardsBalance(address)"( - staker: string, - overrides?: CallOverrides - ): Promise; - - permit( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( - owner: string, - spender: string, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - previewRedeem( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewRedeem(uint256)"( - shares: BigNumberish, - overrides?: CallOverrides - ): Promise; - - previewStake( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "previewStake(uint256)"( - assets: BigNumberish, - overrides?: CallOverrides - ): Promise; - - redeem( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeem(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - redeemOnBehalf( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "redeemOnBehalf(address,address,uint256)"( - from: string, - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stake( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stake(address,uint256)"( - to: string, - amount: BigNumberish, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - stakeWithPermit( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - - "stakeWithPermit(address,uint256,uint256,uint8,bytes32,bytes32)"( - from: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise } - ): Promise; - }; + DELEGATE_BY_TYPE_TYPEHASH( + overrides?: CallOverrides, + ): Promise; + + DELEGATE_TYPEHASH(overrides?: CallOverrides): Promise; + + DISTRIBUTION_END(overrides?: CallOverrides): Promise; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + EIP712_REVISION(overrides?: CallOverrides): Promise; + + EMISSION_MANAGER(overrides?: CallOverrides): Promise; + + EXCHANGE_RATE_UNIT( + overrides?: CallOverrides, + ): Promise; + + INITIAL_EXCHANGE_RATE( + overrides?: CallOverrides, + ): Promise; + + LOWER_BOUND(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + POWER_SCALE_FACTOR( + overrides?: CallOverrides, + ): Promise; + + PRECISION(overrides?: CallOverrides): Promise; + + REVISION(overrides?: CallOverrides): Promise; + + REWARDS_VAULT(overrides?: CallOverrides): Promise; + + REWARD_TOKEN(overrides?: CallOverrides): Promise; + + SLASH_ADMIN_ROLE(overrides?: CallOverrides): Promise; + + STAKED_TOKEN(overrides?: CallOverrides): Promise; + + UNSTAKE_WINDOW(overrides?: CallOverrides): Promise; + + _nonces( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + assets( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides, + ): Promise; + + claimRewards( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeem( + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndRedeemOnBehalf( + from: string, + to: string, + claimAmount: BigNumberish, + redeemAmount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsAndStakeOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRewardsOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + claimRoleAdmin( + role: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + configureAssets( + assetsConfigInput: DistributionTypes.AssetConfigInputStruct[], + overrides?: Overrides & { from?: string }, + ): Promise; + + cooldown( + overrides?: Overrides & { from?: string }, + ): Promise; + + cooldownOnBehalfOf( + from: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegate( + delegatee: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + delegateByType( + delegatee: string, + delegationType: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getCooldownSeconds( + overrides?: CallOverrides, + ): Promise; + + getDelegateeByType( + delegator: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getDelegates( + delegator: string, + overrides?: CallOverrides, + ): Promise; + + getExchangeRate(overrides?: CallOverrides): Promise; + + getMaxSlashablePercentage( + overrides?: CallOverrides, + ): Promise; + + getPendingAdmin( + role: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowerCurrent( + user: string, + delegationType: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPowersCurrent( + user: string, + overrides?: CallOverrides, + ): Promise; + + getTotalRewardsBalance( + staker: string, + overrides?: CallOverrides, + ): Promise; + + getUserAssetData( + user: string, + asset: string, + overrides?: CallOverrides, + ): Promise; + + ghoDebtToken(overrides?: CallOverrides): Promise; + + inPostSlashingPeriod( + overrides?: CallOverrides, + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + initialize( + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegate( + delegator: string, + delegatee: string, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + metaDelegateByType( + delegator: string, + delegatee: string, + delegationType: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + previewRedeem( + shares: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + previewStake( + assets: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeem( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + redeemOnBehalf( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + returnFunds( + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setCooldownSeconds( + cooldownSeconds: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setMaxSlashablePercentage( + percentage: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + setPendingAdmin( + role: BigNumberish, + newPendingAdmin: string, + overrides?: Overrides & { from?: string }, + ): Promise; + + settleSlashing( + overrides?: Overrides & { from?: string }, + ): Promise; + + slash( + destination: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stake( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakeWithPermit( + amount: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string }, + ): Promise; + + stakerRewardsToClaim( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + stakersCooldowns( + arg0: string, + overrides?: CallOverrides, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise; + }; } diff --git a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts index af231f36..724b4d2a 100644 --- a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts +++ b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts @@ -1,820 +1,722 @@ /* Autogenerated file. Do not edit manually. */ /* eslint-disable */ -import { Contract, Signer } from "ethers"; -import { Provider } from "@ethersproject/providers"; +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { IStakedAaveV3, IStakedAaveV3Interface } from './IStakedAaveV3'; -import type { IStakedAaveV3 } from "./IStakedAaveV3"; +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Cooldown', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'cooldownSeconds', + type: 'uint256', + }, + ], + name: 'CooldownSecondsChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint216', + name: 'exchangeRate', + type: 'uint216', + }, + ], + name: 'ExchangeRateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'FundsReturned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPercentage', + type: 'uint256', + }, + ], + name: 'MaxSlashablePercentageChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Redeem', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RewardsAccrued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RewardsClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'destination', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Slashed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'windowSeconds', + type: 'uint256', + }, + ], + name: 'SlashingExitWindowDurationChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'SlashingSettled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + inputs: [], + name: 'COOLDOWN_SECONDS', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'claimAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'redeemAmount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndRedeem', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'claimAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'redeemAmount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndRedeemOnBehalf', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndStakeOnBehalf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsOnBehalf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cooldown', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + ], + name: 'cooldownOnBehalfOf', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getCooldownSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getExchangeRate', + outputs: [ + { + internalType: 'uint216', + name: '', + type: 'uint216', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxSlashablePercentage', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'getTotalRewardsBalance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'previewRedeem', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + name: 'previewStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'redeem', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'redeemOnBehalf', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'returnFunds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'cooldownSeconds', + type: 'uint256', + }, + ], + name: 'setCooldownSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'percentage', + type: 'uint256', + }, + ], + name: 'setMaxSlashablePercentage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'settleSlashing', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'destination', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'slash', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'stakeWithPermit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; export class IStakedAaveV3__factory { - static connect( - address: string, - signerOrProvider: Signer | Provider - ): IStakedAaveV3 { - return new Contract(address, _abi, signerOrProvider) as IStakedAaveV3; - } + static readonly abi = _abi; + static createInterface(): IStakedAaveV3Interface { + return new utils.Interface(_abi) as IStakedAaveV3Interface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): IStakedAaveV3 { + return new Contract(address, _abi, signerOrProvider) as IStakedAaveV3; + } } - -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Cooldown", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "cooldownSeconds", - type: "uint256", - }, - ], - name: "CooldownSecondsChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint216", - name: "exchangeRate", - type: "uint216", - }, - ], - name: "ExchangeRateChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "FundsReturned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "newDebtToken", - type: "address", - }, - ], - name: "GHODebtTokenChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "newPercentage", - type: "uint256", - }, - ], - name: "MaxSlashablePercentageChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "assets", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "shares", - type: "uint256", - }, - ], - name: "Redeem", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "RewardsAccrued", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "RewardsClaimed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "destination", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Slashed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "windowSeconds", - type: "uint256", - }, - ], - name: "SlashingExitWindowDurationChanged", - type: "event", - }, - { - anonymous: false, - inputs: [], - name: "SlashingSettled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "assets", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "shares", - type: "uint256", - }, - ], - name: "Staked", - type: "event", - }, - { - inputs: [], - name: 'REWARD_TOKEN', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'STAKED_TOKEN', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: "COOLDOWN_SECONDS", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "claimRewards", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "claimAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "redeemAmount", - type: "uint256", - }, - ], - name: "claimRewardsAndRedeem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "claimAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "redeemAmount", - type: "uint256", - }, - ], - name: "claimRewardsAndRedeemOnBehalf", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "claimRewardsAndStake", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "claimRewardsAndStakeOnBehalf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "claimRewardsOnBehalf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "cooldown", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - ], - name: "cooldownOnBehalfOf", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getCooldownSeconds", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getExchangeRate", - outputs: [ - { - internalType: "uint216", - name: "", - type: "uint216", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "index", - type: "uint32", - }, - ], - name: "getExchangeRateSnapshot", - outputs: [ - { - components: [ - { - internalType: "uint40", - name: "blockNumber", - type: "uint40", - }, - { - internalType: "uint216", - name: "value", - type: "uint216", - }, - ], - internalType: "struct IStakedAaveV3.ExchangeRateSnapshot", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getExchangeRateSnapshotsCount", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMaxSlashablePercentage", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "staker", - type: "address", - }, - ], - name: "getTotalRewardsBalance", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "spender", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "shares", - type: "uint256", - }, - ], - name: "previewRedeem", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "assets", - type: "uint256", - }, - ], - name: "previewStake", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "redeem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "redeemOnBehalf", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "returnFunds", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "cooldownSeconds", - type: "uint256", - }, - ], - name: "setCooldownSeconds", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IGhoVariableDebtTokenTransferHook", - name: "newGHODebtToken", - type: "address", - }, - ], - name: "setGHODebtToken", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "percentage", - type: "uint256", - }, - ], - name: "setMaxSlashablePercentage", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "settleSlashing", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "destination", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "slash", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "stake", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "stakeWithPermit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; From 666caa67b7f2fa88222c99a97f18ab3c4686316e Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 2 Jan 2024 15:11:38 -0600 Subject: [PATCH 27/41] fix: staking test --- .../src/staking-contract/staking.test.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/staking.test.ts b/packages/contract-helpers/src/staking-contract/staking.test.ts index 56fa6b5b..d13ef420 100644 --- a/packages/contract-helpers/src/staking-contract/staking.test.ts +++ b/packages/contract-helpers/src/staking-contract/staking.test.ts @@ -220,18 +220,17 @@ describe('StakingService', () => { expect(tx.gasLimit).toEqual(BigNumber.from(1)); const decoded = utils.defaultAbiCoder.decode( - ['address', 'uint256', 'uint256', 'uint8', 'bytes32', 'bytes32'], + ['uint256', 'uint256', 'uint8', 'bytes32', 'bytes32'], utils.hexDataSlice(tx.data ?? '', 4), ); - expect(decoded[0]).toEqual(user); - expect(decoded[1]).toEqual(BigNumber.from(valueToWei(amount, 18))); - expect(decoded[2]).toEqual(BigNumber.from(deadline)); - expect(decoded[3]).toEqual(28); - expect(decoded[4]).toEqual( + expect(decoded[0]).toEqual(BigNumber.from(valueToWei(amount, 18))); + expect(decoded[1]).toEqual(BigNumber.from(deadline)); + expect(decoded[2]).toEqual(28); + expect(decoded[3]).toEqual( '0x532f8df4e2502bd869fb35e9301156f9b307380afdcc25cfbc87b2e939f16f7e', ); - expect(decoded[5]).toEqual( + expect(decoded[4]).toEqual( '0x47c326dc26eb918d327358797ee67ad7415d871ef7eaf0d4f6352d3ad021fbb4', ); From a59b6468c86efcca8f01d36fa2700ec7c2952e36 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Tue, 2 Jan 2024 21:28:31 -0600 Subject: [PATCH 28/41] fix: staked token types --- .../src/governance-v3/aave-token-v3/index.ts | 14 +- .../src/staking-contract/index.ts | 22 +- .../src/staking-contract/staking.test.ts | 124 +- .../typechain/IStakedAaveV3.d.ts | 4 +- .../typechain/IStakedAaveV3__factory.ts | 1609 +++++++++++++++-- 5 files changed, 1546 insertions(+), 227 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 49049ad1..396aac38 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -37,24 +37,20 @@ export class AaveTokenV3Service { }); } - public async getPowers( - user: string, - ) { + public async getPowers(user: string) { const powers = await this._contract.getPowersCurrent(user); return { votingPower: powers[0], - propositionPower: powers[1] - } + propositionPower: powers[1], + }; } - public async getDelegateeData( - user: string, - ) { + public async getDelegateeData(user: string) { const data = await this._contract.getDelegates(user); return { votingDelegatee: data[0], propositionDelegatee: data[1], - } + }; } public getDelegateTxData( diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index 2fa44b77..0e00e7ac 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -20,8 +20,8 @@ import { } from '../commons/validators/paramValidators'; import { ERC20_2612Interface, ERC20_2612Service } from '../erc20-2612'; import { ERC20Service, IERC20ServiceInterface } from '../erc20-contract'; -import { IStakedAaveV3 } from './typechain/IStakedAaveV3'; -import { IStakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; +import { StakedAaveV3 } from './typechain/IStakedAaveV3'; +import { StakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; export interface StakingInterface { stakingContractAddress: tEthereumAddress; @@ -62,7 +62,7 @@ type StakingServiceConfig = { }; export class StakingService - extends BaseService + extends BaseService implements StakingInterface { public readonly stakingContractAddress: tEthereumAddress; @@ -75,7 +75,7 @@ export class StakingService provider: providers.Provider, stakingServiceConfig: StakingServiceConfig, ) { - super(provider, IStakedAaveV3__factory); + super(provider, StakedAaveV3__factory); this.erc20Service = new ERC20Service(provider); @@ -91,7 +91,7 @@ export class StakingService deadline: string, ): Promise { const { getTokenData } = this.erc20Service; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); // eslint-disable-next-line new-cap @@ -153,7 +153,7 @@ export class StakingService ): Promise { const txs: EthereumTransactionTypeExtended[] = []; const { decimalsOf } = this.erc20Service; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); // eslint-disable-next-line new-cap @@ -195,7 +195,7 @@ export class StakingService ): Promise { const txs: EthereumTransactionTypeExtended[] = []; const { decimalsOf, isApproved, approve } = this.erc20Service; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); // eslint-disable-next-line new-cap @@ -247,7 +247,7 @@ export class StakingService @isPositiveOrMinusOneAmount() amount: string, ): Promise { let convertedAmount: string; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); if (amount === '-1') { @@ -281,7 +281,7 @@ export class StakingService public cooldown( @isEthAddress() user: tEthereumAddress, ): EthereumTransactionTypeExtended[] { - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); @@ -305,7 +305,7 @@ export class StakingService @isPositiveOrMinusOneAmount() amount: string, ): Promise { let convertedAmount: string; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); if (amount === '-1') { @@ -345,7 +345,7 @@ export class StakingService @isPositiveOrMinusOneAmount() amount: string, ): Promise { let convertedAmount: string; - const stakingContract: IStakedAaveV3 = this.getContractInstance( + const stakingContract: StakedAaveV3 = this.getContractInstance( this.stakingContractAddress, ); if (amount === '-1') { diff --git a/packages/contract-helpers/src/staking-contract/staking.test.ts b/packages/contract-helpers/src/staking-contract/staking.test.ts index d13ef420..0ef10792 100644 --- a/packages/contract-helpers/src/staking-contract/staking.test.ts +++ b/packages/contract-helpers/src/staking-contract/staking.test.ts @@ -6,8 +6,8 @@ import { transactionType, } from '../commons/types'; import { gasLimitRecommendations, valueToWei } from '../commons/utils'; -import { IStakedAaveV3 } from './typechain/IStakedAaveV3'; -import { IStakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; +import { StakedAaveV3 } from './typechain/IStakedAaveV3'; +import { StakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; import { StakingService } from './index'; jest.mock('../commons/gasStation', () => { @@ -70,12 +70,10 @@ describe('StakingService', () => { address: '0x0000000000000000000000000000000000000006', }), ); - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const nonce = 1; @@ -155,10 +153,10 @@ describe('StakingService', () => { address: '0x0000000000000000000000000000000000000006', }), ); - jest.spyOn(IStakedAaveV3__factory, 'connect').mockReturnValue({ + jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ STAKED_TOKEN: async () => Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + } as unknown as StakedAaveV3); jest .spyOn(instance.erc20_2612Service, 'getNonce') @@ -178,7 +176,7 @@ describe('StakingService', () => { const signature = '0x532f8df4e2502bd869fb35e9301156f9b307380afdcc25cfbc87b2e939f16f7e47c326dc26eb918d327358797ee67ad7415d871ef7eaf0d4f6352d3ad021fbb41c'; - const { populateTransaction } = IStakedAaveV3__factory.connect( + const { populateTransaction } = StakedAaveV3__factory.connect( TOKEN_STAKING_ADDRESS, provider, ); @@ -195,13 +193,11 @@ describe('StakingService', () => { .spyOn(instance.erc20Service, 'decimalsOf') .mockReturnValue(Promise.resolve(decimals)); - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const stakeTxObj = await instance.stakeWithPermit( user, @@ -287,18 +283,16 @@ describe('StakingService', () => { jest.clearAllMocks(); }); - const { populateTransaction } = IStakedAaveV3__factory.connect( + const { populateTransaction } = StakedAaveV3__factory.connect( TOKEN_STAKING_ADDRESS, provider, ); it('Expects the tx object when all params passed with no approval needed', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS }); jest @@ -339,13 +333,11 @@ describe('StakingService', () => { expect(gasPrice?.gasPrice).toEqual('1'); }); it('Expects the tx object when all params passed and no onBehalfOf with approval needed', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS }); jest @@ -441,18 +433,16 @@ describe('StakingService', () => { jest.clearAllMocks(); }); - const { populateTransaction } = IStakedAaveV3__factory.connect( + const { populateTransaction } = StakedAaveV3__factory.connect( TOKEN_STAKING_ADDRESS, provider, ); it('Expects the tx object when all params passed and specific amount', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS }); jest @@ -485,13 +475,11 @@ describe('StakingService', () => { expect(gasPrice?.gasPrice).toEqual('1'); }); it('Expects the tx object when all params passed and -1 amount', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS }); const amount = '-1'; @@ -556,18 +544,16 @@ describe('StakingService', () => { jest.clearAllMocks(); }); - const { populateTransaction } = IStakedAaveV3__factory.connect( + const { populateTransaction } = StakedAaveV3__factory.connect( TOKEN_STAKING_ADDRESS, provider, ); it('Expects the tx object when all params passed and specific amount', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS, }); @@ -608,13 +594,11 @@ describe('StakingService', () => { expect(gasPrice?.gasPrice).toEqual('1'); }); it('Expects the tx object when all params passed and -1 amount', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - STAKED_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + STAKED_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS, }); @@ -744,18 +728,16 @@ describe('StakingService', () => { jest.clearAllMocks(); }); - const { populateTransaction } = IStakedAaveV3__factory.connect( + const { populateTransaction } = StakedAaveV3__factory.connect( TOKEN_STAKING_ADDRESS, provider, ); it('Expects the tx object when all params passed with specific amount', async () => { - const spy = jest - .spyOn(IStakedAaveV3__factory, 'connect') - .mockReturnValue({ - populateTransaction, - REWARD_TOKEN: async () => - Promise.resolve('0x0000000000000000000000000000000000000006'), - } as unknown as IStakedAaveV3); + const spy = jest.spyOn(StakedAaveV3__factory, 'connect').mockReturnValue({ + populateTransaction, + REWARD_TOKEN: async () => + Promise.resolve('0x0000000000000000000000000000000000000006'), + } as unknown as StakedAaveV3); const instance = new StakingService(provider, { TOKEN_STAKING_ADDRESS }); jest diff --git a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts index 35a56125..29c62a72 100644 --- a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts +++ b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3.d.ts @@ -39,7 +39,7 @@ export declare namespace DistributionTypes { }; } -export interface IStakedAaveV3Interface extends utils.Interface { +export interface StakedAaveV3Interface extends utils.Interface { functions: { 'CLAIM_HELPER_ROLE()': FunctionFragment; 'COOLDOWN_ADMIN_ROLE()': FunctionFragment; @@ -1041,7 +1041,7 @@ export type UserIndexUpdatedEvent = TypedEvent< export type UserIndexUpdatedEventFilter = TypedEventFilter; -export interface IStakedAaveV3 extends BaseContract { +export interface StakedAaveV3 extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; diff --git a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts index 724b4d2a..1d42d31e 100644 --- a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts +++ b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts @@ -1,11 +1,159 @@ /* Autogenerated file. Do not edit manually. */ /* eslint-disable */ - -import { Contract, Signer, utils } from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import type { IStakedAaveV3, IStakedAaveV3Interface } from './IStakedAaveV3'; +import { + Signer, + utils, + Contract, + ContractFactory, + BigNumberish, + Overrides, +} from 'ethers'; +import type { Provider, TransactionRequest } from '@ethersproject/providers'; +import type { StakedAaveV3, StakedAaveV3Interface } from './IStakedAaveV3'; const _abi = [ + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'stakedToken', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'rewardToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'unstakeWindow', + type: 'uint256', + }, + { + internalType: 'address', + name: 'rewardsVault', + type: 'address', + }, + { + internalType: 'address', + name: 'emissionManager', + type: 'address', + }, + { + internalType: 'uint128', + name: 'distributionDuration', + type: 'uint128', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'ECDSAInvalidSignature', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'length', + type: 'uint256', + }, + ], + name: 'ECDSAInvalidSignatureLength', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'ECDSAInvalidSignatureS', + type: 'error', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'emission', + type: 'uint256', + }, + ], + name: 'AssetConfigUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'AssetIndexUpdated', + type: 'event', + }, { anonymous: false, inputs: [ @@ -38,6 +186,38 @@ const _abi = [ name: 'CooldownSecondsChanged', type: 'event', }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + indexed: false, + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, { anonymous: false, inputs: [ @@ -64,6 +244,19 @@ const _abi = [ name: 'FundsReturned', type: 'event', }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newDebtToken', + type: 'address', + }, + ], + name: 'GHODebtTokenChanged', + type: 'event', + }, { anonymous: false, inputs: [ @@ -77,6 +270,25 @@ const _abi = [ name: 'MaxSlashablePercentageChanged', type: 'event', }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newPendingAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + ], + name: 'PendingAdminChanged', + type: 'event', + }, { anonymous: false, inputs: [ @@ -152,6 +364,25 @@ const _abi = [ name: 'RewardsClaimed', type: 'event', }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + ], + name: 'RoleClaimed', + type: 'event', + }, { anonymous: false, inputs: [ @@ -222,172 +453,1078 @@ const _abi = [ type: 'event', }, { - inputs: [], - name: 'COOLDOWN_SECONDS', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { + anonymous: false, inputs: [ { + indexed: true, internalType: 'address', - name: 'to', + name: 'from', type: 'address', }, { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'claimRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { + indexed: true, internalType: 'address', name: 'to', type: 'address', }, { + indexed: false, internalType: 'uint256', - name: 'claimAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'redeemAmount', + name: 'value', type: 'uint256', }, ], - name: 'claimRewardsAndRedeem', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', + name: 'Transfer', + type: 'event', }, { + anonymous: false, inputs: [ { + indexed: true, internalType: 'address', - name: 'from', + name: 'user', type: 'address', }, { + indexed: true, internalType: 'address', - name: 'to', + name: 'asset', type: 'address', }, { + indexed: false, internalType: 'uint256', - name: 'claimAmount', + name: 'index', type: 'uint256', }, + ], + name: 'UserIndexUpdated', + type: 'event', + }, + { + inputs: [], + name: 'CLAIM_HELPER_ROLE', + outputs: [ { internalType: 'uint256', - name: 'redeemAmount', + name: '', type: 'uint256', }, ], - name: 'claimRewardsAndRedeemOnBehalf', - outputs: [], - stateMutability: 'nonpayable', + stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, + inputs: [], + name: 'COOLDOWN_ADMIN_ROLE', + outputs: [ { internalType: 'uint256', - name: 'amount', + name: '', type: 'uint256', }, ], - name: 'claimRewardsAndStake', - outputs: [ - { + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'COOLDOWN_SECONDS', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DELEGATE_BY_TYPE_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DELEGATE_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DISTRIBUTION_END', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'EIP712_REVISION', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'EMISSION_MANAGER', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'EXCHANGE_RATE_UNIT', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'INITIAL_EXCHANGE_RATE', + outputs: [ + { + internalType: 'uint216', + name: '', + type: 'uint216', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'LOWER_BOUND', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'POWER_SCALE_FACTOR', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PRECISION', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REVISION', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'REWARDS_VAULT', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REWARD_TOKEN', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'SLASH_ADMIN_ROLE', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'STAKED_TOKEN', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'UNSTAKE_WINDOW', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: '_nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'assets', + outputs: [ + { + internalType: 'uint128', + name: 'emissionPerSecond', + type: 'uint128', + }, + { + internalType: 'uint128', + name: 'lastUpdateTimestamp', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'claimAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'redeemAmount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndRedeem', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'claimAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'redeemAmount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndRedeemOnBehalf', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsAndStakeOnBehalf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'claimRewardsOnBehalf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + ], + name: 'claimRoleAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint128', + name: 'emissionPerSecond', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'totalStaked', + type: 'uint256', + }, + { + internalType: 'address', + name: 'underlyingAsset', + type: 'address', + }, + ], + internalType: 'struct DistributionTypes.AssetConfigInput[]', + name: 'assetsConfigInput', + type: 'tuple[]', + }, + ], + name: 'configureAssets', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cooldown', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + ], + name: 'cooldownOnBehalfOf', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'delegateByType', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + ], + name: 'getAdmin', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCooldownSeconds', + outputs: [ + { internalType: 'uint256', name: '', type: 'uint256', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'getDelegateeByType', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegator', + type: 'address', + }, + ], + name: 'getDelegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getExchangeRate', + outputs: [ + { + internalType: 'uint216', + name: '', + type: 'uint216', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxSlashablePercentage', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + ], + name: 'getPendingAdmin', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', + }, + ], + name: 'getPowerCurrent', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPowersCurrent', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'getTotalRewardsBalance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'address', + name: 'asset', + type: 'address', + }, + ], + name: 'getUserAssetData', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ghoDebtToken', + outputs: [ + { + internalType: 'contract IGhoVariableDebtTokenTransferHook', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'inPostSlashingPeriod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', type: 'function', }, { inputs: [ { internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', + name: 'spender', type: 'address', }, { internalType: 'uint256', - name: 'amount', + name: 'addedValue', type: 'uint256', }, ], - name: 'claimRewardsAndStakeOnBehalf', + name: 'increaseAllowance', outputs: [ { - internalType: 'uint256', + internalType: 'bool', name: '', - type: 'uint256', + type: 'bool', }, ], stateMutability: 'nonpayable', type: 'function', }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, { inputs: [ { internalType: 'address', - name: 'from', + name: 'delegator', type: 'address', }, { internalType: 'address', - name: 'to', + name: 'delegatee', type: 'address', }, { internalType: 'uint256', - name: 'amount', + name: 'deadline', type: 'uint256', }, - ], - name: 'claimRewardsOnBehalf', - outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256', + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', }, ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'cooldown', + name: 'metaDelegate', outputs: [], stateMutability: 'nonpayable', type: 'function', @@ -396,68 +1533,54 @@ const _abi = [ inputs: [ { internalType: 'address', - name: 'from', + name: 'delegator', type: 'address', }, - ], - name: 'cooldownOnBehalfOf', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getCooldownSeconds', - outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256', + internalType: 'address', + name: 'delegatee', + type: 'address', }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getExchangeRate', - outputs: [ { - internalType: 'uint216', - name: '', - type: 'uint216', + internalType: + 'enum IGovernancePowerDelegationToken.GovernancePowerType', + name: 'delegationType', + type: 'uint8', }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMaxSlashablePercentage', - outputs: [ { internalType: 'uint256', - name: '', + name: 'deadline', type: 'uint256', }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, ], - stateMutability: 'view', + name: 'metaDelegateByType', + outputs: [], + stateMutability: 'nonpayable', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'staker', - type: 'address', - }, - ], - name: 'getTotalRewardsBalance', + inputs: [], + name: 'name', outputs: [ { - internalType: 'uint256', + internalType: 'string', name: '', - type: 'uint256', + type: 'string', }, ], stateMutability: 'view', @@ -611,6 +1734,19 @@ const _abi = [ stateMutability: 'nonpayable', type: 'function', }, + { + inputs: [ + { + internalType: 'contract IGhoVariableDebtTokenTransferHook', + name: 'newGHODebtToken', + type: 'address', + }, + ], + name: 'setGHODebtToken', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, { inputs: [ { @@ -624,6 +1760,24 @@ const _abi = [ stateMutability: 'nonpayable', type: 'function', }, + { + inputs: [ + { + internalType: 'uint256', + name: 'role', + type: 'uint256', + }, + { + internalType: 'address', + name: 'newPendingAdmin', + type: 'address', + }, + ], + name: 'setPendingAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, { inputs: [], name: 'settleSlashing', @@ -706,17 +1860,204 @@ const _abi = [ stateMutability: 'nonpayable', type: 'function', }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'stakerRewardsToClaim', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'stakersCooldowns', + outputs: [ + { + internalType: 'uint40', + name: 'timestamp', + type: 'uint40', + }, + { + internalType: 'uint216', + name: 'amount', + type: 'uint216', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, ] as const; -export class IStakedAaveV3__factory { +const _bytecode = + '0x61024060405260006009553480156200001757600080fd5b50604051620058a5380380620058a58339810160408190526200003a9162000294565b8585858585858585858585856040518060400160405280600b81526020016a5374616b6564204161766560a81b815250604051806040016040528060018152602001601960f91b81525083836001600160801b031680426200009d91906200033d565b608052506001600160a01b031660a052620000b8826200022a565b61016052620000c7816200022a565b61018052815160208084019190912061012052815190820120610140524660e052620001576101205161014051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60c0525050306101005250506001600160a01b039384166101a0529183166101c0526101e052166102005260066009819055506000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f1919062000359565b60ff1690506200020381600a62000482565b61022052506200021a955050620002769350505050565b6009555062000508945050505050565b600080829050601f8151111562000261578260405163305a27a960e01b815260040162000258919062000490565b60405180910390fd5b80516200026e82620004e0565b179392505050565b600690565b6001600160a01b03811681146200029157600080fd5b50565b60008060008060008060c08789031215620002ae57600080fd5b8651620002bb816200027b565b6020880151909650620002ce816200027b565b604088015160608901519196509450620002e8816200027b565b6080880151909350620002fb816200027b565b60a08801519092506001600160801b03811681146200031957600080fd5b809150509295509295509295565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000353576200035362000327565b92915050565b6000602082840312156200036c57600080fd5b815160ff811681146200037e57600080fd5b9392505050565b600181815b80851115620003c6578160001904821115620003aa57620003aa62000327565b80851615620003b857918102915b93841c93908002906200038a565b509250929050565b600082620003df5750600162000353565b81620003ee5750600062000353565b8160018114620004075760028114620004125762000432565b600191505062000353565b60ff84111562000426576200042662000327565b50506001821b62000353565b5060208310610133831016604e8410600b841016171562000457575081810a62000353565b62000463838362000385565b80600019048211156200047a576200047a62000327565b029392505050565b60006200037e8383620003ce565b600060208083528351808285015260005b81811015620004bf57858101830151858201604001528201620004a1565b506000604082860101526040601f19601f8301168501019250505092915050565b8051602080830151919081101562000502576000198160200360031b1b821691505b50919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051610200516102205161527e62000627600039600081816107f701528181610d30015281816110d80152611149015260008181610934015261283f0152600081816106de01526123100152600081816109760152818161281d015261306d01526000818161066401528181610dd9015281816111db01528181611d610152818161254c01528181613043015261326001526000612ead01526000612f0d01526000612c3501526000612c0d01526000612b6801526000612b9201526000612bbc015260008181610aba0152611a7a01526000818161090d015281816140440152818161408001526140ad015261527e6000f3fe608060405234801561001057600080fd5b50600436106104755760003560e01c80637b5b115711610257578063ab406fe611610146578063dc937e1c116100c3578063ecd9ba8211610087578063ecd9ba8214610b6e578063f036bc6814610b81578063f11b818814610b95578063f34d96da14610bf7578063fde9eb6914610bff57600080fd5b8063dc937e1c14610af7578063dd62ed3e14610b0a578063dde43cba14610b43578063e6aa216c14610b4a578063eab5231814610b5b57600080fd5b8063b9844d8d1161010a578063b9844d8d14610a82578063c18f539a14610aa2578063cbcbb50714610ab5578063d505accf14610adc578063dbc0ed8a14610aef57600080fd5b8063ab406fe614610a2e578063adc9772e14610a41578063aff05aa914610a54578063b2a5dbfa14610a5c578063b2f4201d14610a6f57600080fd5b806395d89b41116101d4578063a095ac1911610198578063a095ac19146109c6578063a457c2d7146109d9578063a9059cbb146109ec578063aa9fbe02146109ff578063aaf5eb6814610a2657600080fd5b806395d89b411461096957806399248ea7146109715780639a99b4f0146109985780639c9b5154146109ab5780639e3ffce0146109be57600080fd5b80638dbefee21161021b5780638dbefee2146108e65780638e9b2ca4146108f9578063919cd40f14610908578063946776cd1461092f578063955e18af1461095657600080fd5b80637b5b1157146108885780637e90d7ef1461089b5780638129fc1c146108bb57806384b0196e146108c35780638c9a281d146108de57600080fd5b80633644e51511610373578063616e0bf9116102f0578063727a5d57116102b4578063727a5d571461085257806372b49d63146107ea57806374011f56146108655780637816037614610878578063787a08a61461088057600080fd5b8063616e0bf9146107ea5780636198e135146107f2578063657f0cde146108195780636f50458d1461082c57806370a082311461083f57600080fd5b80634998fffd116103375780634998fffd1461077e5780634cdad50614610791578063570a9714146107a457806358146d17146107b05780635c19a95c146107d757600080fd5b80633644e51514610700578063395093511461070857806341cbf54a1461071b57806345755dd6146107425780634575e69b1461075557600080fd5b80631e9a69501161040157806330adf81f116103c557806330adf81f14610638578063312f6b831461065f578063313ce567146106865780633373ee4c1461069b578063359c4a96146106d957600080fd5b80631e9a6950146105c457806320fb80b5146105d757806323b872dd146105ea578063250201db146105fd5780632a8b36681461061057600080fd5b8063111fd88b11610448578063111fd88b14610536578063112d037c14610561578063169db77d14610576578063174ed542146105a957806318160ddd146105bc57600080fd5b806302fb4d851461047a57806306fdde03146104a0578063091030c3146104b5578063095ea7b314610513575b600080fd5b61048d610488366004614867565b610c12565b6040519081526020015b60405180910390f35b6104a8610e50565b60405161049791906148e3565b6104ee6104c33660046148f6565b603e6020526000908152604090205464ffffffffff811690600160281b90046001600160d81b031682565b6040805164ffffffffff90931683526001600160d81b03909116602083015201610497565b610526610521366004614867565b610ee2565b6040519015158152602001610497565b610549610544366004614913565b610efa565b6040516001600160a01b039091168152602001610497565b61057461056f36600461492c565b610f15565b005b6105896105843660046148f6565b610f67565b604080516001600160a01b03938416815292909116602083015201610497565b605354610549906001600160a01b031681565b60025461048d565b6105746105d2366004614867565b610f99565b61048d6105e536600461492c565b610fab565b6105266105f836600461492c565b610ffc565b61057461060b3660046148f6565b611020565b61062361061e3660046148f6565b611066565b60408051928352602083019190915201610497565b61048d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b60125b60405160ff9091168152602001610497565b61048d6106a936600461496d565b6001600160a01b038082166000908152603c60209081526040808320938616835260029093019052205492915050565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b61048d611088565b610526610716366004614867565b611097565b61048d7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e81565b610574610750366004614913565b6110d6565b610549610763366004614913565b6000908152604660205260409020546001600160a01b031690565b61057461078c3660046148f6565b61123b565b61048d61079f366004614913565b6112a5565b61048d6402540be40081565b6107bf670de0b6b3a764000081565b6040516001600160d81b039091168152602001610497565b6105746107e53660046148f6565b6112d0565b604f5461048d565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b6105746108273660046149cb565b6112e8565b61054961083a366004614a40565b611424565b61048d61084d3660046148f6565b611439565b61048d610860366004614913565b61145d565b610574610873366004614913565b611480565b6104a86114c3565b6105746114cd565b610574610896366004614913565b6114d8565b61048d6108a93660046148f6565b603d6020526000908152604090205481565b61057461154b565b6108cb6115bb565b6040516104979796959493929190614a75565b61048d600081565b61048d6108f43660046148f6565b611601565b61048d670de0b6b3a764000081565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b61048d610964366004614867565b6116dc565b6104a86116e9565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b6105746109a6366004614867565b6116f8565b6105746109b9366004614b0b565b611703565b61048d600181565b6105746109d4366004614b51565b61175d565b6105266109e7366004614867565b61188f565b6105266109fa366004614867565b611921565b61048d7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a0381565b610689601281565b610574610a3c366004614bb4565b61192f565b610574610a4f366004614867565b6119f2565b6105746119fd565b610574610a6a366004614c49565b611a6f565b61048d610a7d366004614a40565b611b2a565b61048d610a903660046148f6565b60446020526000908152604090205481565b61048d610ab036600461492c565b611b6e565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b610574610aea366004614d30565b611bb5565b61048d600281565b610574610b05366004614a40565b611cfc565b61048d610b1836600461496d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600661048d565b6051546001600160d81b03166107bf565b610574610b69366004614d82565b611d07565b610574610b7c366004614db7565b611d21565b60515461052690600160d81b900460ff1681565b610bd1610ba33660046148f6565b603c60205260009081526040902080546001909101546001600160801b0380831692600160801b9004169083565b604080516001600160801b03948516815293909216602084015290820152606001610497565b60505461048d565b610574610c0d366004614913565b611e06565b6000610c1e6000610efa565b6001600160a01b0316336001600160a01b031614610c575760405162461bcd60e51b8152600401610c4e90614dfe565b60405180910390fd5b605154600160d81b900460ff1615610cb15760405162461bcd60e51b815260206004820152601d60248201527f50524556494f55535f534c415348494e475f4e4f545f534554544c45440000006044820152606401610c4e565b60008211610cef5760405162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b6044820152606401610c4e565b6000610cfa60025490565b90506000610d07826112a5565b90506000610d2060505483611ed790919063ffffffff16565b905080851115610d2e578094505b7f0000000000000000000000000000000000000000000000000000000000000000610d598684614e4b565b1015610d9e5760405162461bcd60e51b815260206004820152601460248201527352454d41494e494e475f4c545f4d494e494d554d60601b6044820152606401610c4e565b6051805460ff60d81b1916600160d81b179055610dcc610dc7610dc18785614e4b565b85611f59565b611f97565b610e006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016878761203a565b856001600160a01b03167f4ed05e9673c26d2ed44f7ef6a7f2942df0ee3b5e1e17db4b99f9dcd261a339cd86604051610e3b91815260200190565b60405180910390a28493505050505b92915050565b606060038054610e5f90614e5e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8b90614e5e565b8015610ed85780601f10610ead57610100808354040283529160200191610ed8565b820191906000526020600020905b815481529060010190602001808311610ebb57829003601f168201915b5050505050905090565b600033610ef081858561209d565b5060019392505050565b6000908152604560205260409020546001600160a01b031690565b610f1f6002610efa565b6001600160a01b0316336001600160a01b031614610f4f5760405162461bcd60e51b8152600401610c4e90614e98565b610f628383610f5d846121c2565b61222f565b505050565b6000806000610f75846125d3565b9050610f83848260006126d6565b610f8f858360016126d6565b9250925050915091565b610fa73383610f5d846121c2565b5050565b6000610fb76002610efa565b6001600160a01b0316336001600160a01b031614610fe75760405162461bcd60e51b8152600401610c4e90614e98565b610ff2848484612783565b90505b9392505050565b60003361100a8582856128bb565b611015858585612947565b506001949350505050565b61102a6002610efa565b6001600160a01b0316336001600160a01b03161461105a5760405162461bcd60e51b8152600401610c4e90614e98565b61106381612a78565b50565b600080611074836000611b2a565b61107f846001611b2a565b91509150915091565b6000611092612b5b565b905090565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610ef090829086906110d1908790614ecf565b61209d565b7f000000000000000000000000000000000000000000000000000000000000000081101561113a5760405162461bcd60e51b8152602060048201526011602482015270414d4f554e545f4c545f4d494e494d554d60781b6044820152606401610c4e565b600061114560025490565b90507f00000000000000000000000000000000000000000000000000000000000000008110156111ab5760405162461bcd60e51b81526020600482015260116024820152705348415245535f4c545f4d494e494d554d60781b6044820152606401610c4e565b60006111b6826112a5565b90506111ce610dc76111c88584614ecf565b84611f59565b6112036001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086612c86565b6040518381527f278e51d3323fbf18b9fb8df3f8b97e31b145bc1146c52e764cf4aa1bfc4ba17d9060200160405180910390a1505050565b73ee56e2b3d491590b5b31738cc34d5232f378a8d5331461125b57600080fd5b605380546001600160a01b0319166001600160a01b0383169081179091556040517f62bbced765bccc9ed93d0bae1b2a8c86e13b4663f8bf27d5936d9d619194c8a990600090a250565b6051546000906001600160d81b03166112c683670de0b6b3a7640000614ee2565b610e4a9190614ef9565b6112dc33826000612cbe565b61106333826001612cbe565b6001600160a01b03871661130e5760405162461bcd60e51b8152600401610c4e90614f1b565b8342111561132e5760405162461bcd60e51b8152600401610c4e90614f42565b60006113d161133b612de6565b7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a038a8a8a6113868e6001600160a01b0316600090815260446020526040902080546001810190915590565b8b60405160200161139c96959493929190614fa6565b6040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b90506113df81858585612df0565b6001600160a01b0316886001600160a01b03161461140f5760405162461bcd60e51b8152600401610c4e90614fe5565b61141a888888612cbe565b5050505050505050565b6000610ff583611433856125d3565b846126d6565b6001600160a01b03166000908152602081905260409020546001600160681b031690565b605154600090670de0b6b3a7640000906112c6906001600160d81b031684614ee2565b61148a6000610efa565b6001600160a01b0316336001600160a01b0316146114ba5760405162461bcd60e51b8152600401610c4e90614dfe565b61106381612e20565b6060611092612ea6565b6114d633612a78565b565b6114e26001610efa565b6001600160a01b0316336001600160a01b0316146115425760405162461bcd60e51b815260206004820152601960248201527f43414c4c45525f4e4f545f434f4f4c444f574e5f41444d494e000000000000006044820152606401610c4e565b61106381612ed1565b60095460069081116115b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b6064820152608401610c4e565b600955565b6000606080600080600060606115cf612f06565b6115d7612ea6565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b604080516001808252818301909252600091829190816020015b611648604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b81526020019060019003908161161b5790505090506040518060600160405280306001600160a01b0316815260200161168085611439565b815260200161168e60025490565b815250816000815181106116a4576116a4615010565b60200260200101819052506116b98382612f31565b6001600160a01b0384166000908152603d6020526040902054610ff59190614ecf565b6000610ff533848461303f565b606060048054610e5f90614e5e565b610f62338383612783565b61170d6002610efa565b6001600160a01b0316336001600160a01b03161461173d5760405162461bcd60e51b8152600401610c4e90614e98565b611748848484612783565b506117578484610f5d846121c2565b50505050565b6001600160a01b0386166117835760405162461bcd60e51b8152600401610c4e90614f1b565b834211156117a35760405162461bcd60e51b8152600401610c4e90614f42565b60006118306117b0612de6565b7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e89896117fa8c6001600160a01b0316600090815260446020526040902080546001810190915590565b6040805160208101959095526001600160a01b039384169085015291166060830152608082015260a0810188905260c00161139c565b905061183e81858585612df0565b6001600160a01b0316876001600160a01b03161461186e5760405162461bcd60e51b8152600401610c4e90614fe5565b61187a87876000612cbe565b61188687876001612cbe565b50505050505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156119145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c4e565b611015828686840361209d565b600033610ef0818585612947565b60008281526045602052604090205482906001600160a01b0316331461198f5760405162461bcd60e51b815260206004820152601560248201527421a0a62622a92fa727aa2fa927a622afa0a226a4a760591b6044820152606401610c4e565b60008381526046602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591518581527fc3d1bf52795a20771ee6de3e59948fd83e10db956122d4709a3b86c512963855910160405180910390a2505050565b610fa7338383613133565b611a076000610efa565b6001600160a01b0316336001600160a01b031614611a375760405162461bcd60e51b8152600401610c4e90614dfe565b6051805460ff60d81b191690556040517fcdee157e87ba915be681d4fa3f3d511afe7348eca06448a3accd6ac227fa40af90600090a1565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611adf5760405162461bcd60e51b815260206004820152601560248201527427a7262cafa2a6a4a9a9a4a7a72fa6a0a720a3a2a960591b6044820152606401610c4e565b60005b8151811015611b2057600254828281518110611b0057611b00615010565b602090810291909101810151015280611b1881615026565b915050611ae2565b50611063816132f8565b6000611b3e6051546001600160d81b031690565b6001600160d81b0316670de0b6b3a7640000611b5a8585613466565b611b649190614ee2565b610ff59190614ef9565b6000611b7a6002610efa565b6001600160a01b0316336001600160a01b031614611baa5760405162461bcd60e51b8152600401610c4e90614e98565b610ff284848461303f565b6001600160a01b038716611bdb5760405162461bcd60e51b8152600401610c4e90614f1b565b83421115611bfb5760405162461bcd60e51b8152600401610c4e90614f42565b6001600160a01b0387811660008181526044602090815260408083205481517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9938101939093529082019390935292891660608401526080830188905260a0830182905260c083018790529091611c8a9060e001604051602081830303815290604052805190602001206134e8565b9050611c9881868686612df0565b6001600160a01b0316896001600160a01b031614611cc85760405162461bcd60e51b8152600401610c4e90614fe5565b6001600160a01b0389166000908152604460205260409020600183019055611cf189898961209d565b505050505050505050565b610fa7338383612cbe565b611d12338484612783565b50610f623384610f5d846121c2565b60405163d505accf60e01b8152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015611dad57600080fd5b505af1925050508015611dbe575060015b611df4573d808015611dec576040519150601f19603f3d011682016040523d82523d6000602084013e611df1565b606091505b50505b611dff333387613133565b5050505050565b60008181526046602052604090205481906001600160a01b03163314611e6e5760405162461bcd60e51b815260206004820152601d60248201527f43414c4c45525f4e4f545f50454e44494e475f524f4c455f41444d494e0000006044820152606401610c4e565b60008281526045602090815260408083208054336001600160a01b0319918216811790925560468452938290208054909416909355518481527f83a9ddad961dcb7c6894c9585a16ff7792c2ec8281256a3cc7303ae830152dcf91015b60405180910390a25050565b6000821580611ee4575081155b15611ef157506000610e4a565b611efd82600019614ef9565b831115611f4c5760405162461bcd60e51b815260206004820152601c60248201527f4d4154485f4d554c5449504c49434154494f4e5f4f564552464c4f57000000006044820152606401610c4e565b612710611b648385614ee2565b6000610ff583600181611f74670de0b6b3a764000087614ee2565b611f7e9190614ecf565b611f889190614e4b565b611f929190614ef9565b613515565b806001600160d81b0316600003611fe55760405162461bcd60e51b81526020600482015260126024820152715a45524f5f45584348414e47455f5241544560701b6044820152606401610c4e565b605180546001600160d81b0319166001600160d81b0383169081179091556040519081527fa9c433f9734baa3cf48b209454bb0ace054e191f677ba50e74b696c0d35ef262906020015b60405180910390a150565b6040516001600160a01b038316602482015260448101829052610f6290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261357e565b6001600160a01b0383166120ff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c4e565b6001600160a01b0382166121605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c4e565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006001600160681b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663034206269747360c81b6064820152608401610c4e565b5090565b806001600160681b03166000036122585760405162461bcd60e51b8152600401610c4e9061503f565b6001600160a01b0383166000908152603e602090815260409182902082518084019093525464ffffffffff81168352600160281b90046001600160d81b031690820152605154600160d81b900460ff1661239857604f5481516122c2919064ffffffffff16614ecf565b4210156123095760405162461bcd60e51b815260206004820152601560248201527424a729aaa32324a1a4a2a72a2fa1a7a7a62227aba760591b6044820152606401610c4e565b604f5481517f0000000000000000000000000000000000000000000000000000000000000000916123409164ffffffffff16614ecf565b61234a9042614e4b565b11156123985760405162461bcd60e51b815260206004820152601760248201527f554e5354414b455f57494e444f575f46494e49534845440000000000000000006044820152606401610c4e565b60006123a385611439565b605154909150600090600160d81b900460ff166123cd5782602001516001600160d81b03166123cf565b815b9050806000036124215760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f5a45524f5f4d41585f52454445454d41424c4500000000006044820152606401610c4e565b600081856001600160681b03161161244257846001600160681b0316612444565b815b905061245287846001613650565b50600061245e826112a5565b90506124728861246d846121c2565b6136ff565b845164ffffffffff161561253f578185602001516001600160d81b03166124999190614e4b565b6000036124be576001600160a01b0388166000908152603e602052604081205561253f565b6124c78261387b565b6001600160a01b0389166000908152603e6020526040902054612503916001600160b81b031690600160281b90046001600160d81b031661506c565b6001600160a01b0389166000908152603e6020526040902080546001600160d81b0392909216600160281b0264ffffffffff9092169190911790555b6125736001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016888361203a565b866001600160a01b0316886001600160a01b03167f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc83856040516125c1929190918252602082015260400190565b60405180910390a35050505050505050565b6125f460408051606081018252600080825260208201819052909182015290565b6001600160a01b038216600090815260208181526040808320815160808101835281546001600160681b03811682526001600160481b03600160681b8204811695830195909552600160b01b8104909416928101929092529091606083019060ff600160f81b90910416600381111561266f5761266f614f6e565b600381111561268057612680614f6e565b815250509050604051806060016040528082602001516001600160481b0316815260200182604001516001600160481b03168152602001826060015160038111156126cd576126cd614f6e565b90529392505050565b6000808260018111156126eb576126eb614f6e565b0361273d5760018360400151600381111561270857612708614f6e565b1660ff1660000361271a576000612736565b6001600160a01b03808516600090815260476020526040902054165b9050610ff5565b60028360400151600381111561275557612755614f6e565b1015612762576000610ff2565b5050506001600160a01b039081166000908152604860205260409020541690565b6000816000036127a55760405162461bcd60e51b8152600401610c4e9061503f565b60006127bb856127b487611439565b6000613650565b905060008184116127cc57836127ce565b815b9050806000036127f05760405162461bcd60e51b8152600401610c4e9061503f565b6127fa8183614e4b565b6001600160a01b038088166000908152603d6020526040902091909155612865907f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000008784612c86565b846001600160a01b0316866001600160a01b03167f9310ccfcb8de723f578a9e4282ea9f521f05ae40dc08f3068dfad528a65ee3c7836040516128aa91815260200190565b60405180910390a395945050505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611757578181101561293a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610c4e565b611757848484840361209d565b600061295284611439565b905061296084826001613650565b50826001600160a01b0316846001600160a01b031614612a6d57600061298584611439565b905061299384826001613650565b506001600160a01b0385166000908152603e602090815260409182902082518084019093525464ffffffffff8116808452600160281b9091046001600160d81b03169183019190915215612a6a57838303612a06576001600160a01b0386166000908152603e6020526040812055612a6a565b60208101516001600160d81b0316612a1e8585614e4b565b1015612a6a57612a2e8484614e4b565b6001600160a01b0387166000908152603e6020526040902080546001600160d81b0392909216600160281b0264ffffffffff9092169190911790555b50505b6117578484846138e4565b6000612a8382611439565b905080600003612ad55760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f42414c414e43455f4f4e5f434f4f4c444f574e00000000006044820152606401610c4e565b60408051808201825264ffffffffff42811682526001600160d81b0380851660208085019182526001600160a01b0388166000818152603e9092529086902094519151909216600160281b0292169190911790915590517f8a05f911d8ab7fc50fec37ef4ba7f9bfcb1a3c191c81dcd824ad0946c4e20d6590611ecb9084815260200190565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612bb457507f000000000000000000000000000000000000000000000000000000000000000046145b15612bde57507f000000000000000000000000000000000000000000000000000000000000000090565b611092604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6040516001600160a01b03808516602483015283166044820152606481018290526117579085906323b872dd60e01b90608401612066565b6000836001600160a01b0316836001600160a01b031614612cdf5782612ce2565b60005b90506000612cef856125d3565b90506000612cfe8683866126d6565b9050806001600160a01b0316836001600160a01b031603612d2157505050505050565b6001600160a01b03818116151590841615156000612d3e89613b1d565b90508215612d5357612d53816000868a613b28565b8115612d6657612d66600082888a613b28565b612d71898888613bf2565b82151582151514612d9057612d9089612d8b878a86613c95565b613db5565b856001600160a01b0316896001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd89604051612dd39190615093565b60405180910390a3505050505050505050565b6000611092611088565b600080600080612e0288888888613e55565b925092509250612e128282613f24565b50909150505b949350505050565b6127108110612e715760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f534c415348494e475f50455243454e5441474500000000006044820152606401610c4e565b60508190556040518181527fb79c2d6c7f5c95eec9dc05affc0ed002620a4ec6d72b7b0744cc8638168c600a9060200161202f565b60606110927f0000000000000000000000000000000000000000000000000000000000000000613fdd565b604f8190556040518181527fbbf67247b5c97564e30ffc0a355e71c006836de7b9149e09e3d5d6054cb033559060200161202f565b60606110927f0000000000000000000000000000000000000000000000000000000000000000613fdd565b600080805b8351811015613037576000603c6000868481518110612f5757612f57615010565b602090810291909101810151516001600160a01b031682528101919091526040016000908120600181015481548851929450612fc5926001600160801b0380831692600160801b900416908a9088908110612fb457612fb4615010565b60200260200101516040015161401c565b9050613016868481518110612fdc57612fdc615010565b602002602001015160200151828460020160008b6001600160a01b03166001600160a01b0316815260200190815260200160002054614127565b6130209085614ecf565b93505050808061302f90615026565b915050612f36565b509392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146130e25760405162461bcd60e51b815260206004820181905260248201527f5245574152445f544f4b454e5f49535f4e4f545f5354414b45445f544f4b454e6044820152606401610c4e565b60006130f8856130f187611439565b6001613650565b90506000818411613109578361310b565b815b9050801561312a5761311e863083612783565b5061312a308683613133565b95945050505050565b605154600160d81b900460ff16156131805760405162461bcd60e51b815260206004820152601060248201526f534c415348494e475f4f4e474f494e4760801b6044820152606401610c4e565b806000036131a05760405162461bcd60e51b8152600401610c4e9061503f565b60006131ab83611439565b905060006131c38430846131be60025490565b614153565b90508015613246576001600160a01b0384166000908152603d60205260409020546131ef908290614ecf565b6001600160a01b0385166000818152603d60209081526040918290209390935580519182529181018390527f2468f9268c60ad90e2d49edb0032c8a001e733ae888b3ab8e982edf535be1a76910160405180910390a15b60006132518461145d565b90506132886001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873087612c86565b61329a85613295836121c2565b614214565b846001600160a01b0316866001600160a01b03167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc86846040516132e8929190918252602082015260400190565b60405180910390a3505050505050565b60005b8151811015610fa7576000603c600084848151811061331c5761331c615010565b6020026020010151604001516001600160a01b03166001600160a01b03168152602001908152602001600020905061338f83838151811061335f5761335f615010565b6020026020010151604001518285858151811061337e5761337e615010565b602002602001015160200151614379565b508282815181106133a2576133a2615010565b60209081029190910101515181546fffffffffffffffffffffffffffffffff19166001600160801b0390911617815582518390839081106133e5576133e5615010565b6020026020010151604001516001600160a01b03167f87fa03892a0556cb6b8f97e6d533a150d4d55fcbf275fff5fa003fa636bcc7fa84848151811061342d5761342d615010565b602090810291909101810151516040516001600160801b0390911681520160405180910390a2508061345e81615026565b9150506132fb565b600080613472846125d3565b9050600083600181111561348857613488614f6e565b6134939060016150a1565b826040015160038111156134a9576134a9614f6e565b1660ff166000146134bb5760006134c4565b6134c485613b1d565b905060006134d28386614431565b90506134de8183614ecf565b9695505050505050565b6000610e4a6134f5612b5b565b8360405161190160f01b8152600281019290925260228201526042902090565b60006001600160d81b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663136206269747360c81b6064820152608401610c4e565b60006135d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166144709092919063ffffffff16565b805190915015610f6257808060200190518101906135f191906150ba565b610f625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c4e565b6000806136628530866131be60025490565b6001600160a01b0386166000908152603d60205260408120549192509061368a908390614ecf565b9050811561312a5783156136b4576001600160a01b0386166000908152603d602052604090208190555b604080516001600160a01b0388168152602081018490527f2468f9268c60ad90e2d49edb0032c8a001e733ae888b3ab8e982edf535be1a76910160405180910390a195945050505050565b6001600160a01b03821661375f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610c4e565b6001600160a01b0382166000908152602081905260409020546001600160681b039081169082168110156137e05760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610c4e565b6001600160a01b03831660008181526020818152604080832080546001600160681b0319168787036001600160681b03908116919091179091556002805491881691829003905590519081529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610f62836000836001600160681b03166000866001600160681b031661447f565b60006001600160b81b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663834206269747360c81b6064820152608401610c4e565b6001600160a01b0383166139485760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c4e565b6001600160a01b0382166139aa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c4e565b816001600160a01b0316836001600160a01b031614613ad8576001600160a01b038084166000908152602081905260408082205492851682529020546001600160681b03918216911682821015613a525760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610c4e565b6001600160a01b038516600090815260208190526040902080546001600160681b0319168484036001600160681b0316179055613a8f83826150dc565b6001600160a01b038516600090815260208190526040902080546001600160681b0319166001600160681b03928316179055613ad590869086908581169085168761447f565b50505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516121b591815260200190565b6000610e4a82611439565b6001600160a01b0382161561175757838314611757576000613b57613b526402540be40087614ef9565b614545565b90506000613b6d613b526402540be40087614ef9565b90506000613b7a856125d3565b90506000846001811115613b9057613b90614f6e565b03613bc35781838260200151613ba691906150fc565b613bb0919061511c565b6001600160481b03166020820152613be8565b80518290613bd29085906150fc565b613bdc919061511c565b6001600160481b031681525b6118868582613db5565b6000836001600160a01b0316826001600160a01b031614613c135781613c16565b60005b90506000836001811115613c2c57613c2c614f6e565b03613c64576001600160a01b03848116600090815260476020526040902080546001600160a01b031916918316919091179055611757565b6001600160a01b03938416600090815260486020526040902080546001600160a01b03191691909416179092555050565b613cb660408051606081018252600080825260208201819052909182015290565b8115613d3557826001811115613cce57613cce614f6e565b613cd99060016150a1565b84604001516003811115613cef57613cef614f6e565b1760ff166003811115613d0457613d04614f6e565b84604001906003811115613d1a57613d1a614f6e565b90816003811115613d2d57613d2d614f6e565b905250613dad565b6003836001811115613d4957613d49614f6e565b613d549060016150a1565b1884604001516003811115613d6b57613d6b614f6e565b1660ff166003811115613d8057613d80614f6e565b84604001906003811115613d9657613d96614f6e565b90816003811115613da957613da9614f6e565b9052505b509192915050565b6001600160a01b03821660009081526020818152604091829020835181549285015171ffffffffffffffffffffffffffffffffffff60681b19909316600160681b6001600160481b039283160268ffffffffffffffffff60b01b191617600160b01b91909316029190911780825591830151909182906001600160f81b0316600160f81b836003811115613e4b57613e4b614f6e565b0217905550505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115613e905750600091506003905082613f1a565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613ee4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613f1057506000925060019150829050613f1a565b9250600091508190505b9450945094915050565b6000826003811115613f3857613f38614f6e565b03613f41575050565b6001826003811115613f5557613f55614f6e565b03613f735760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115613f8757613f87614f6e565b03613fa85760405163fce698f760e01b815260048101829052602401610c4e565b6003826003811115613fbc57613fbc614f6e565b03610fa7576040516335e2f38360e21b815260048101829052602401610c4e565b60606000613fea836145ad565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000831580614029575081155b8061403c575042836001600160801b0316145b8061407057507f0000000000000000000000000000000000000000000000000000000000000000836001600160801b031610155b1561407c575083612e18565b60007f000000000000000000000000000000000000000000000000000000000000000042116140ab57426140cd565b7f00000000000000000000000000000000000000000000000000000000000000005b905060006140e46001600160801b03861683614e4b565b905086846140f46012600a615220565b6140fe848a614ee2565b6141089190614ee2565b6141129190614ef9565b61411c9190614ecf565b979650505050505050565b60006141356012600a615220565b61413f8385614e4b565b6141499086614ee2565b610ff29190614ef9565b6001600160a01b038084166000908152603c60209081526040808320938816835260028401909152812054909190828061418e888588614379565b90508083146142085786156141ab576141a8878285614127565b91505b6001600160a01b03808a1660008181526002870160205260409081902084905551918a16917fbb123b5c06d5408bbea3c4fef481578175cfb432e3b482c6186f02ed9086585b906141ff9085815260200190565b60405180910390a35b50979650505050505050565b6001600160a01b03821661426a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610c4e565b6001600160a01b038216600090815260208190526040812054600280546001600160681b039283169392851692906142a3908490614ecf565b90915550506001600160a01b038316600090815260208190526040812080548492906142d99084906001600160681b03166150dc565b92506101000a8154816001600160681b0302191690836001600160681b03160217905550826001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161435091906001600160681b0391909116815260200190565b60405180910390a3610f626000846000846001600160681b0316866001600160681b031661447f565b6001820154825460009190600160801b90046001600160801b0316428190036143a457509050610ff5565b84546000906143bf9084906001600160801b0316848861401c565b905082811461440e57600186018190556040518181526001600160a01b038816907f5777ca300dfe5bead41006fbce4389794dbc0ed8d6cccebfaf94630aa04184bc9060200160405180910390a25b85546001600160801b03428116600160801b029116178655925050509392505050565b60008082600181111561444657614446614f6e565b14614452578251614458565b82602001515b610ff5906001600160481b03166402540be400614ee2565b6060610ff284846000856145d5565b61448c85858585856146a5565b6053546001600160a01b0316801561453d57604051635b9c4cf160e01b81526001600160a01b0387811660048301528681166024830152604482018690526064820185905260848201849052821690635b9c4cf19060a401600060405180830381600087803b1580156144fe57600080fd5b505af192505050801561450f575060015b61453d573d80801561141a576040519150601f19603f3d011682016040523d82523d6000602084013e61141a565b505050505050565b60006001600160481b0382111561222b5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201526532206269747360d01b6064820152608401610c4e565b600060ff8216601f811115610e4a57604051632cd44ac360e21b815260040160405180910390fd5b6060824710156146365760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c4e565b600080866001600160a01b03168587604051614652919061522c565b60006040518083038185875af1925050503d806000811461468f576040519150601f19603f3d011682016040523d82523d6000602084013e614694565b606091505b509150915061411c878383876146b2565b611dff858585858561472b565b6060831561472157825160000361471a576001600160a01b0385163b61471a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c4e565b5081612e18565b612e188383614828565b836001600160a01b0316856001600160a01b03160315611dff576001600160a01b038516156147bf57600061475f866125d3565b9050600061476d8386614e4b565b905060008260400151600381111561478757614787614f6e565b146147bc576147a4858261479d8a8660006126d6565b6000613b28565b6147bc85826147b58a8660016126d6565b6001613b28565b50505b6001600160a01b03841615611dff5760006147d9856125d3565b905060006147e78385614ecf565b905060008260400151600381111561480157614801614f6e565b1461188657614817848261479d898660006126d6565b61188684826147b5898660016126d6565b8151156148385781518083602001fd5b8060405162461bcd60e51b8152600401610c4e91906148e3565b6001600160a01b038116811461106357600080fd5b6000806040838503121561487a57600080fd5b823561488581614852565b946020939093013593505050565b60005b838110156148ae578181015183820152602001614896565b50506000910152565b600081518084526148cf816020860160208601614893565b601f01601f19169290920160200192915050565b602081526000610ff560208301846148b7565b60006020828403121561490857600080fd5b8135610ff581614852565b60006020828403121561492557600080fd5b5035919050565b60008060006060848603121561494157600080fd5b833561494c81614852565b9250602084013561495c81614852565b929592945050506040919091013590565b6000806040838503121561498057600080fd5b823561498b81614852565b9150602083013561499b81614852565b809150509250929050565b8035600281106149b557600080fd5b919050565b803560ff811681146149b557600080fd5b600080600080600080600060e0888a0312156149e657600080fd5b87356149f181614852565b96506020880135614a0181614852565b9550614a0f604089016149a6565b945060608801359350614a24608089016149ba565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215614a5357600080fd5b8235614a5e81614852565b9150614a6c602084016149a6565b90509250929050565b60ff60f81b881681526000602060e081840152614a9560e084018a6148b7565b8381036040850152614aa7818a6148b7565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015614af957835183529284019291840191600101614add565b50909c9b505050505050505050505050565b60008060008060808587031215614b2157600080fd5b8435614b2c81614852565b93506020850135614b3c81614852565b93969395505050506040820135916060013590565b60008060008060008060c08789031215614b6a57600080fd5b8635614b7581614852565b95506020870135614b8581614852565b945060408701359350614b9a606088016149ba565b92506080870135915060a087013590509295509295509295565b60008060408385031215614bc757600080fd5b82359150602083013561499b81614852565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715614c1257614c12614bd9565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715614c4157614c41614bd9565b604052919050565b60006020808385031215614c5c57600080fd5b823567ffffffffffffffff80821115614c7457600080fd5b818501915085601f830112614c8857600080fd5b813581811115614c9a57614c9a614bd9565b614ca8848260051b01614c18565b81815284810192506060918202840185019188831115614cc757600080fd5b938501935b828510156142085780858a031215614ce45760008081fd5b614cec614bef565b85356001600160801b0381168114614d045760008081fd5b81528587013587820152604080870135614d1d81614852565b9082015284529384019392850192614ccc565b600080600080600080600060e0888a031215614d4b57600080fd5b8735614d5681614852565b96506020880135614d6681614852565b95506040880135945060608801359350614a24608089016149ba565b600080600060608486031215614d9757600080fd5b8335614da281614852565b95602085013595506040909401359392505050565b600080600080600060a08688031215614dcf57600080fd5b8535945060208601359350614de6604087016149ba565b94979396509394606081013594506080013592915050565b60208082526019908201527f43414c4c45525f4e4f545f534c415348494e475f41444d494e00000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e4a57610e4a614e35565b600181811c90821680614e7257607f821691505b602082108103614e9257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526017908201527f43414c4c45525f4e4f545f434c41494d5f48454c504552000000000000000000604082015260600190565b80820180821115610e4a57610e4a614e35565b8082028115828204841417610e4a57610e4a614e35565b600082614f1657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60028110614fa257634e487b7160e01b600052602160045260246000fd5b9052565b8681526001600160a01b0386811660208301528516604082015260c08101614fd16060830186614f84565b608082019390935260a00152949350505050565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161503857615038614e35565b5060010190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b6001600160d81b0382811682821603908082111561508c5761508c614e35565b5092915050565b60208101610e4a8284614f84565b60ff8181168382160190811115610e4a57610e4a614e35565b6000602082840312156150cc57600080fd5b81518015158114610ff557600080fd5b6001600160681b0381811683821601908082111561508c5761508c614e35565b6001600160481b0382811682821603908082111561508c5761508c614e35565b6001600160481b0381811683821601908082111561508c5761508c614e35565b600181815b8085111561517757816000190482111561515d5761515d614e35565b8085161561516a57918102915b93841c9390800290615141565b509250929050565b60008261518e57506001610e4a565b8161519b57506000610e4a565b81600181146151b157600281146151bb576151d7565b6001915050610e4a565b60ff8411156151cc576151cc614e35565b50506001821b610e4a565b5060208310610133831016604e8410600b84101617156151fa575081810a610e4a565b615204838361513c565b806000190482111561521857615218614e35565b029392505050565b6000610ff5838361517f565b6000825161523e818460208701614893565b919091019291505056fea2646970667358221220be3d771064e3a0027aba2c79bae3548c5f3ac357436fd2fbac6a583d43ad28f264736f6c63430008140033'; + +type StakedAaveV3ConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: StakedAaveV3ConstructorParams, +): xs is ConstructorParameters => xs.length > 1; + +export class StakedAaveV3__factory extends ContractFactory { + constructor(...args: StakedAaveV3ConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + stakedToken: string, + rewardToken: string, + unstakeWindow: BigNumberish, + rewardsVault: string, + emissionManager: string, + distributionDuration: BigNumberish, + overrides?: Overrides & { from?: string }, + ): Promise { + return super.deploy( + stakedToken, + rewardToken, + unstakeWindow, + rewardsVault, + emissionManager, + distributionDuration, + overrides || {}, + ) as Promise; + } + override getDeployTransaction( + stakedToken: string, + rewardToken: string, + unstakeWindow: BigNumberish, + rewardsVault: string, + emissionManager: string, + distributionDuration: BigNumberish, + overrides?: Overrides & { from?: string }, + ): TransactionRequest { + return super.getDeployTransaction( + stakedToken, + rewardToken, + unstakeWindow, + rewardsVault, + emissionManager, + distributionDuration, + overrides || {}, + ); + } + override attach(address: string): StakedAaveV3 { + return super.attach(address) as StakedAaveV3; + } + override connect(signer: Signer): StakedAaveV3__factory { + return super.connect(signer) as StakedAaveV3__factory; + } + + static readonly bytecode = _bytecode; static readonly abi = _abi; - static createInterface(): IStakedAaveV3Interface { - return new utils.Interface(_abi) as IStakedAaveV3Interface; + static createInterface(): StakedAaveV3Interface { + return new utils.Interface(_abi) as StakedAaveV3Interface; } static connect( address: string, signerOrProvider: Signer | Provider, - ): IStakedAaveV3 { - return new Contract(address, _abi, signerOrProvider) as IStakedAaveV3; + ): StakedAaveV3 { + return new Contract(address, _abi, signerOrProvider) as StakedAaveV3; } } From 83b4ed7df75bab1c92d21a2a9e267f060dcda84d Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 11:03:38 -0600 Subject: [PATCH 29/41] fix: abi --- .../typechain/IStakedAaveV3__factory.ts | 1325 +++-------------- 1 file changed, 182 insertions(+), 1143 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts index 1d42d31e..49892bce 100644 --- a/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts +++ b/packages/contract-helpers/src/staking-contract/typechain/IStakedAaveV3__factory.ts @@ -1,44 +1,18 @@ /* Autogenerated file. Do not edit manually. */ /* eslint-disable */ -import { - Signer, - utils, - Contract, - ContractFactory, - BigNumberish, - Overrides, -} from 'ethers'; -import type { Provider, TransactionRequest } from '@ethersproject/providers'; + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; import type { StakedAaveV3, StakedAaveV3Interface } from './IStakedAaveV3'; const _abi = [ { inputs: [ - { - internalType: 'contract IERC20', - name: 'stakedToken', - type: 'address', - }, - { - internalType: 'contract IERC20', - name: 'rewardToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'unstakeWindow', - type: 'uint256', - }, - { - internalType: 'address', - name: 'rewardsVault', - type: 'address', - }, - { - internalType: 'address', - name: 'emissionManager', - type: 'address', - }, + { internalType: 'contract IERC20', name: 'stakedToken', type: 'address' }, + { internalType: 'contract IERC20', name: 'rewardToken', type: 'address' }, + { internalType: 'uint256', name: 'unstakeWindow', type: 'uint256' }, + { internalType: 'address', name: 'rewardsVault', type: 'address' }, + { internalType: 'address', name: 'emissionManager', type: 'address' }, { internalType: 'uint128', name: 'distributionDuration', @@ -48,46 +22,20 @@ const _abi = [ stateMutability: 'nonpayable', type: 'constructor', }, + { inputs: [], name: 'ECDSAInvalidSignature', type: 'error' }, { - inputs: [], - name: 'ECDSAInvalidSignature', - type: 'error', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'length', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'length', type: 'uint256' }], name: 'ECDSAInvalidSignatureLength', type: 'error', }, { - inputs: [ - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], + inputs: [{ internalType: 'bytes32', name: 's', type: 'bytes32' }], name: 'ECDSAInvalidSignatureS', type: 'error', }, + { inputs: [], name: 'InvalidShortString', type: 'error' }, { - inputs: [], - name: 'InvalidShortString', - type: 'error', - }, - { - inputs: [ - { - internalType: 'string', - name: 'str', - type: 'string', - }, - ], + inputs: [{ internalType: 'string', name: 'str', type: 'string' }], name: 'StringTooLong', type: 'error', }, @@ -157,12 +105,7 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, { indexed: false, internalType: 'uint256', @@ -212,12 +155,7 @@ const _abi = [ name: 'DelegateChanged', type: 'event', }, - { - anonymous: false, - inputs: [], - name: 'EIP712DomainChanged', - type: 'event', - }, + { anonymous: false, inputs: [], name: 'EIP712DomainChanged', type: 'event' }, { anonymous: false, inputs: [ @@ -244,19 +182,6 @@ const _abi = [ name: 'FundsReturned', type: 'event', }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'newDebtToken', - type: 'address', - }, - ], - name: 'GHODebtTokenChanged', - type: 'event', - }, { anonymous: false, inputs: [ @@ -292,18 +217,8 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, { indexed: false, internalType: 'uint256', @@ -342,18 +257,8 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, { indexed: false, internalType: 'uint256', @@ -415,27 +320,12 @@ const _abi = [ name: 'SlashingExitWindowDurationChanged', type: 'event', }, - { - anonymous: false, - inputs: [], - name: 'SlashingSettled', - type: 'event', - }, + { anonymous: false, inputs: [], name: 'SlashingSettled', type: 'event' }, { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, { indexed: false, internalType: 'uint256', @@ -455,18 +345,8 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, { indexed: false, internalType: 'uint256', @@ -480,12 +360,7 @@ const _abi = [ { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, { indexed: true, internalType: 'address', @@ -505,403 +380,199 @@ const _abi = [ { inputs: [], name: 'CLAIM_HELPER_ROLE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'COOLDOWN_ADMIN_ROLE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'COOLDOWN_SECONDS', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'DELEGATE_BY_TYPE_TYPEHASH', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'DELEGATE_TYPEHASH', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'DISTRIBUTION_END', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'EIP712_REVISION', - outputs: [ - { - internalType: 'bytes', - name: '', - type: 'bytes', - }, - ], + outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'EMISSION_MANAGER', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'EXCHANGE_RATE_UNIT', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'INITIAL_EXCHANGE_RATE', - outputs: [ - { - internalType: 'uint216', - name: '', - type: 'uint216', - }, - ], + outputs: [{ internalType: 'uint216', name: '', type: 'uint216' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'LOWER_BOUND', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'PERMIT_TYPEHASH', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'POWER_SCALE_FACTOR', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'PRECISION', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'REVISION', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'pure', type: 'function', }, { inputs: [], name: 'REWARDS_VAULT', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'REWARD_TOKEN', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'contract IERC20', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'SLASH_ADMIN_ROLE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'STAKED_TOKEN', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'contract IERC20', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'UNSTAKE_WINDOW', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: '', type: 'address' }], name: '_nonces', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, ], name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'nonpayable', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: '', type: 'address' }], name: 'assets', outputs: [ - { - internalType: 'uint128', - name: 'emissionPerSecond', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'lastUpdateTimestamp', - type: 'uint128', - }, - { - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, + { internalType: 'uint128', name: 'emissionPerSecond', type: 'uint128' }, + { internalType: 'uint128', name: 'lastUpdateTimestamp', type: 'uint128' }, + { internalType: 'uint256', name: 'index', type: 'uint256' }, ], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'claimRewards', outputs: [], @@ -910,21 +581,9 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'claimAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'redeemAmount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'claimAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'redeemAmount', type: 'uint256' }, ], name: 'claimRewardsAndRedeem', outputs: [], @@ -933,26 +592,10 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'claimAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'redeemAmount', - type: 'uint256', - }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'claimAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'redeemAmount', type: 'uint256' }, ], name: 'claimRewardsAndRedeemOnBehalf', outputs: [], @@ -961,94 +604,38 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'claimRewardsAndStake', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'claimRewardsAndStakeOnBehalf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'claimRewardsOnBehalf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'nonpayable', type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'role', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'role', type: 'uint256' }], name: 'claimRoleAdmin', outputs: [], stateMutability: 'nonpayable', @@ -1063,16 +650,8 @@ const _abi = [ name: 'emissionPerSecond', type: 'uint128', }, - { - internalType: 'uint256', - name: 'totalStaked', - type: 'uint256', - }, - { - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, + { internalType: 'uint256', name: 'totalStaked', type: 'uint256' }, + { internalType: 'address', name: 'underlyingAsset', type: 'address' }, ], internalType: 'struct DistributionTypes.AssetConfigInput[]', name: 'assetsConfigInput', @@ -1092,13 +671,7 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'from', type: 'address' }], name: 'cooldownOnBehalfOf', outputs: [], stateMutability: 'nonpayable', @@ -1107,48 +680,22 @@ const _abi = [ { inputs: [], name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'subtractedValue', type: 'uint256' }, ], name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'nonpayable', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'delegatee', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'delegatee', type: 'address' }], name: 'delegate', outputs: [], stateMutability: 'nonpayable', @@ -1156,11 +703,7 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'delegatee', - type: 'address', - }, + { internalType: 'address', name: 'delegatee', type: 'address' }, { internalType: 'enum IGovernancePowerDelegationToken.GovernancePowerType', @@ -1177,84 +720,34 @@ const _abi = [ inputs: [], name: 'eip712Domain', outputs: [ - { - internalType: 'bytes1', - name: 'fields', - type: 'bytes1', - }, - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'version', - type: 'string', - }, - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'verifyingContract', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32', - }, - { - internalType: 'uint256[]', - name: 'extensions', - type: 'uint256[]', - }, + { internalType: 'bytes1', name: 'fields', type: 'bytes1' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'string', name: 'version', type: 'string' }, + { internalType: 'uint256', name: 'chainId', type: 'uint256' }, + { internalType: 'address', name: 'verifyingContract', type: 'address' }, + { internalType: 'bytes32', name: 'salt', type: 'bytes32' }, + { internalType: 'uint256[]', name: 'extensions', type: 'uint256[]' }, ], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'role', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'role', type: 'uint256' }], name: 'getAdmin', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getCooldownSeconds', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'delegator', - type: 'address', - }, + { internalType: 'address', name: 'delegator', type: 'address' }, { internalType: 'enum IGovernancePowerDelegationToken.GovernancePowerType', @@ -1263,36 +756,16 @@ const _abi = [ }, ], name: 'getDelegateeByType', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'delegator', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'delegator', type: 'address' }], name: 'getDelegates', outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, + { internalType: 'address', name: '', type: 'address' }, + { internalType: 'address', name: '', type: 'address' }, ], stateMutability: 'view', type: 'function', @@ -1300,55 +773,27 @@ const _abi = [ { inputs: [], name: 'getExchangeRate', - outputs: [ - { - internalType: 'uint216', - name: '', - type: 'uint216', - }, - ], + outputs: [{ internalType: 'uint216', name: '', type: 'uint216' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'getMaxSlashablePercentage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'role', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'role', type: 'uint256' }], name: 'getPendingAdmin', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, + { internalType: 'address', name: 'user', type: 'address' }, { internalType: 'enum IGovernancePowerDelegationToken.GovernancePowerType', @@ -1357,80 +802,34 @@ const _abi = [ }, ], name: 'getPowerCurrent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'user', type: 'address' }], name: 'getPowersCurrent', outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, + { internalType: 'uint256', name: '', type: 'uint256' }, + { internalType: 'uint256', name: '', type: 'uint256' }, ], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: 'staker', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: 'staker', type: 'address' }], name: 'getTotalRewardsBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - { - internalType: 'address', - name: 'asset', - type: 'address', - }, + { internalType: 'address', name: 'user', type: 'address' }, + { internalType: 'address', name: 'asset', type: 'address' }, ], name: 'getUserAssetData', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, @@ -1450,37 +849,17 @@ const _abi = [ { inputs: [], name: 'inPostSlashingPeriod', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'addedValue', - type: 'uint256', - }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'addedValue', type: 'uint256' }, ], name: 'increaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'nonpayable', type: 'function', }, @@ -1493,36 +872,12 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'delegator', - type: 'address', - }, - { - internalType: 'address', - name: 'delegatee', - type: 'address', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, + { internalType: 'address', name: 'delegator', type: 'address' }, + { internalType: 'address', name: 'delegatee', type: 'address' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, ], name: 'metaDelegate', outputs: [], @@ -1531,42 +886,18 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'delegator', - type: 'address', - }, - { - internalType: 'address', - name: 'delegatee', - type: 'address', - }, + { internalType: 'address', name: 'delegator', type: 'address' }, + { internalType: 'address', name: 'delegatee', type: 'address' }, { internalType: 'enum IGovernancePowerDelegationToken.GovernancePowerType', name: 'delegationType', type: 'uint8', }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, ], name: 'metaDelegateByType', outputs: [], @@ -1576,53 +907,19 @@ const _abi = [ { inputs: [], name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], + outputs: [{ internalType: 'string', name: '', type: 'string' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, ], name: 'permit', outputs: [], @@ -1630,55 +927,23 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], name: 'previewRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], name: 'previewStake', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'redeem', outputs: [], @@ -1687,21 +952,9 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'redeemOnBehalf', outputs: [], @@ -1709,13 +962,7 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }], name: 'returnFunds', outputs: [], stateMutability: 'nonpayable', @@ -1723,11 +970,7 @@ const _abi = [ }, { inputs: [ - { - internalType: 'uint256', - name: 'cooldownSeconds', - type: 'uint256', - }, + { internalType: 'uint256', name: 'cooldownSeconds', type: 'uint256' }, ], name: 'setCooldownSeconds', outputs: [], @@ -1735,26 +978,7 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'contract IGhoVariableDebtTokenTransferHook', - name: 'newGHODebtToken', - type: 'address', - }, - ], - name: 'setGHODebtToken', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'percentage', - type: 'uint256', - }, - ], + inputs: [{ internalType: 'uint256', name: 'percentage', type: 'uint256' }], name: 'setMaxSlashablePercentage', outputs: [], stateMutability: 'nonpayable', @@ -1762,16 +986,8 @@ const _abi = [ }, { inputs: [ - { - internalType: 'uint256', - name: 'role', - type: 'uint256', - }, - { - internalType: 'address', - name: 'newPendingAdmin', - type: 'address', - }, + { internalType: 'uint256', name: 'role', type: 'uint256' }, + { internalType: 'address', name: 'newPendingAdmin', type: 'address' }, ], name: 'setPendingAdmin', outputs: [], @@ -1787,40 +1003,18 @@ const _abi = [ }, { inputs: [ - { - internalType: 'address', - name: 'destination', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'slash', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'stake', outputs: [], @@ -1829,31 +1023,11 @@ const _abi = [ }, { inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, ], name: 'stakeWithPermit', outputs: [], @@ -1861,44 +1035,18 @@ const _abi = [ type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: '', type: 'address' }], name: 'stakerRewardsToClaim', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], + inputs: [{ internalType: 'address', name: '', type: 'address' }], name: 'stakersCooldowns', outputs: [ - { - internalType: 'uint40', - name: 'timestamp', - type: 'uint40', - }, - { - internalType: 'uint216', - name: 'amount', - type: 'uint216', - }, + { internalType: 'uint40', name: 'timestamp', type: 'uint40' }, + { internalType: 'uint216', name: 'amount', type: 'uint216' }, ], stateMutability: 'view', type: 'function', @@ -1906,150 +1054,41 @@ const _abi = [ { inputs: [], name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], + outputs: [{ internalType: 'string', name: '', type: 'string' }], stateMutability: 'view', type: 'function', }, { inputs: [], name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'nonpayable', type: 'function', }, { inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, ], name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'nonpayable', type: 'function', }, ] as const; -const _bytecode = - '0x61024060405260006009553480156200001757600080fd5b50604051620058a5380380620058a58339810160408190526200003a9162000294565b8585858585858585858585856040518060400160405280600b81526020016a5374616b6564204161766560a81b815250604051806040016040528060018152602001601960f91b81525083836001600160801b031680426200009d91906200033d565b608052506001600160a01b031660a052620000b8826200022a565b61016052620000c7816200022a565b61018052815160208084019190912061012052815190820120610140524660e052620001576101205161014051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60c0525050306101005250506001600160a01b039384166101a0529183166101c0526101e052166102005260066009819055506000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f1919062000359565b60ff1690506200020381600a62000482565b61022052506200021a955050620002769350505050565b6009555062000508945050505050565b600080829050601f8151111562000261578260405163305a27a960e01b815260040162000258919062000490565b60405180910390fd5b80516200026e82620004e0565b179392505050565b600690565b6001600160a01b03811681146200029157600080fd5b50565b60008060008060008060c08789031215620002ae57600080fd5b8651620002bb816200027b565b6020880151909650620002ce816200027b565b604088015160608901519196509450620002e8816200027b565b6080880151909350620002fb816200027b565b60a08801519092506001600160801b03811681146200031957600080fd5b809150509295509295509295565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000353576200035362000327565b92915050565b6000602082840312156200036c57600080fd5b815160ff811681146200037e57600080fd5b9392505050565b600181815b80851115620003c6578160001904821115620003aa57620003aa62000327565b80851615620003b857918102915b93841c93908002906200038a565b509250929050565b600082620003df5750600162000353565b81620003ee5750600062000353565b8160018114620004075760028114620004125762000432565b600191505062000353565b60ff84111562000426576200042662000327565b50506001821b62000353565b5060208310610133831016604e8410600b841016171562000457575081810a62000353565b62000463838362000385565b80600019048211156200047a576200047a62000327565b029392505050565b60006200037e8383620003ce565b600060208083528351808285015260005b81811015620004bf57858101830151858201604001528201620004a1565b506000604082860101526040601f19601f8301168501019250505092915050565b8051602080830151919081101562000502576000198160200360031b1b821691505b50919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051610200516102205161527e62000627600039600081816107f701528181610d30015281816110d80152611149015260008181610934015261283f0152600081816106de01526123100152600081816109760152818161281d015261306d01526000818161066401528181610dd9015281816111db01528181611d610152818161254c01528181613043015261326001526000612ead01526000612f0d01526000612c3501526000612c0d01526000612b6801526000612b9201526000612bbc015260008181610aba0152611a7a01526000818161090d015281816140440152818161408001526140ad015261527e6000f3fe608060405234801561001057600080fd5b50600436106104755760003560e01c80637b5b115711610257578063ab406fe611610146578063dc937e1c116100c3578063ecd9ba8211610087578063ecd9ba8214610b6e578063f036bc6814610b81578063f11b818814610b95578063f34d96da14610bf7578063fde9eb6914610bff57600080fd5b8063dc937e1c14610af7578063dd62ed3e14610b0a578063dde43cba14610b43578063e6aa216c14610b4a578063eab5231814610b5b57600080fd5b8063b9844d8d1161010a578063b9844d8d14610a82578063c18f539a14610aa2578063cbcbb50714610ab5578063d505accf14610adc578063dbc0ed8a14610aef57600080fd5b8063ab406fe614610a2e578063adc9772e14610a41578063aff05aa914610a54578063b2a5dbfa14610a5c578063b2f4201d14610a6f57600080fd5b806395d89b41116101d4578063a095ac1911610198578063a095ac19146109c6578063a457c2d7146109d9578063a9059cbb146109ec578063aa9fbe02146109ff578063aaf5eb6814610a2657600080fd5b806395d89b411461096957806399248ea7146109715780639a99b4f0146109985780639c9b5154146109ab5780639e3ffce0146109be57600080fd5b80638dbefee21161021b5780638dbefee2146108e65780638e9b2ca4146108f9578063919cd40f14610908578063946776cd1461092f578063955e18af1461095657600080fd5b80637b5b1157146108885780637e90d7ef1461089b5780638129fc1c146108bb57806384b0196e146108c35780638c9a281d146108de57600080fd5b80633644e51511610373578063616e0bf9116102f0578063727a5d57116102b4578063727a5d571461085257806372b49d63146107ea57806374011f56146108655780637816037614610878578063787a08a61461088057600080fd5b8063616e0bf9146107ea5780636198e135146107f2578063657f0cde146108195780636f50458d1461082c57806370a082311461083f57600080fd5b80634998fffd116103375780634998fffd1461077e5780634cdad50614610791578063570a9714146107a457806358146d17146107b05780635c19a95c146107d757600080fd5b80633644e51514610700578063395093511461070857806341cbf54a1461071b57806345755dd6146107425780634575e69b1461075557600080fd5b80631e9a69501161040157806330adf81f116103c557806330adf81f14610638578063312f6b831461065f578063313ce567146106865780633373ee4c1461069b578063359c4a96146106d957600080fd5b80631e9a6950146105c457806320fb80b5146105d757806323b872dd146105ea578063250201db146105fd5780632a8b36681461061057600080fd5b8063111fd88b11610448578063111fd88b14610536578063112d037c14610561578063169db77d14610576578063174ed542146105a957806318160ddd146105bc57600080fd5b806302fb4d851461047a57806306fdde03146104a0578063091030c3146104b5578063095ea7b314610513575b600080fd5b61048d610488366004614867565b610c12565b6040519081526020015b60405180910390f35b6104a8610e50565b60405161049791906148e3565b6104ee6104c33660046148f6565b603e6020526000908152604090205464ffffffffff811690600160281b90046001600160d81b031682565b6040805164ffffffffff90931683526001600160d81b03909116602083015201610497565b610526610521366004614867565b610ee2565b6040519015158152602001610497565b610549610544366004614913565b610efa565b6040516001600160a01b039091168152602001610497565b61057461056f36600461492c565b610f15565b005b6105896105843660046148f6565b610f67565b604080516001600160a01b03938416815292909116602083015201610497565b605354610549906001600160a01b031681565b60025461048d565b6105746105d2366004614867565b610f99565b61048d6105e536600461492c565b610fab565b6105266105f836600461492c565b610ffc565b61057461060b3660046148f6565b611020565b61062361061e3660046148f6565b611066565b60408051928352602083019190915201610497565b61048d7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b60125b60405160ff9091168152602001610497565b61048d6106a936600461496d565b6001600160a01b038082166000908152603c60209081526040808320938616835260029093019052205492915050565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b61048d611088565b610526610716366004614867565b611097565b61048d7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e81565b610574610750366004614913565b6110d6565b610549610763366004614913565b6000908152604660205260409020546001600160a01b031690565b61057461078c3660046148f6565b61123b565b61048d61079f366004614913565b6112a5565b61048d6402540be40081565b6107bf670de0b6b3a764000081565b6040516001600160d81b039091168152602001610497565b6105746107e53660046148f6565b6112d0565b604f5461048d565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b6105746108273660046149cb565b6112e8565b61054961083a366004614a40565b611424565b61048d61084d3660046148f6565b611439565b61048d610860366004614913565b61145d565b610574610873366004614913565b611480565b6104a86114c3565b6105746114cd565b610574610896366004614913565b6114d8565b61048d6108a93660046148f6565b603d6020526000908152604090205481565b61057461154b565b6108cb6115bb565b6040516104979796959493929190614a75565b61048d600081565b61048d6108f43660046148f6565b611601565b61048d670de0b6b3a764000081565b61048d7f000000000000000000000000000000000000000000000000000000000000000081565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b61048d610964366004614867565b6116dc565b6104a86116e9565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b6105746109a6366004614867565b6116f8565b6105746109b9366004614b0b565b611703565b61048d600181565b6105746109d4366004614b51565b61175d565b6105266109e7366004614867565b61188f565b6105266109fa366004614867565b611921565b61048d7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a0381565b610689601281565b610574610a3c366004614bb4565b61192f565b610574610a4f366004614867565b6119f2565b6105746119fd565b610574610a6a366004614c49565b611a6f565b61048d610a7d366004614a40565b611b2a565b61048d610a903660046148f6565b60446020526000908152604090205481565b61048d610ab036600461492c565b611b6e565b6105497f000000000000000000000000000000000000000000000000000000000000000081565b610574610aea366004614d30565b611bb5565b61048d600281565b610574610b05366004614a40565b611cfc565b61048d610b1836600461496d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600661048d565b6051546001600160d81b03166107bf565b610574610b69366004614d82565b611d07565b610574610b7c366004614db7565b611d21565b60515461052690600160d81b900460ff1681565b610bd1610ba33660046148f6565b603c60205260009081526040902080546001909101546001600160801b0380831692600160801b9004169083565b604080516001600160801b03948516815293909216602084015290820152606001610497565b60505461048d565b610574610c0d366004614913565b611e06565b6000610c1e6000610efa565b6001600160a01b0316336001600160a01b031614610c575760405162461bcd60e51b8152600401610c4e90614dfe565b60405180910390fd5b605154600160d81b900460ff1615610cb15760405162461bcd60e51b815260206004820152601d60248201527f50524556494f55535f534c415348494e475f4e4f545f534554544c45440000006044820152606401610c4e565b60008211610cef5760405162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b6044820152606401610c4e565b6000610cfa60025490565b90506000610d07826112a5565b90506000610d2060505483611ed790919063ffffffff16565b905080851115610d2e578094505b7f0000000000000000000000000000000000000000000000000000000000000000610d598684614e4b565b1015610d9e5760405162461bcd60e51b815260206004820152601460248201527352454d41494e494e475f4c545f4d494e494d554d60601b6044820152606401610c4e565b6051805460ff60d81b1916600160d81b179055610dcc610dc7610dc18785614e4b565b85611f59565b611f97565b610e006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016878761203a565b856001600160a01b03167f4ed05e9673c26d2ed44f7ef6a7f2942df0ee3b5e1e17db4b99f9dcd261a339cd86604051610e3b91815260200190565b60405180910390a28493505050505b92915050565b606060038054610e5f90614e5e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8b90614e5e565b8015610ed85780601f10610ead57610100808354040283529160200191610ed8565b820191906000526020600020905b815481529060010190602001808311610ebb57829003601f168201915b5050505050905090565b600033610ef081858561209d565b5060019392505050565b6000908152604560205260409020546001600160a01b031690565b610f1f6002610efa565b6001600160a01b0316336001600160a01b031614610f4f5760405162461bcd60e51b8152600401610c4e90614e98565b610f628383610f5d846121c2565b61222f565b505050565b6000806000610f75846125d3565b9050610f83848260006126d6565b610f8f858360016126d6565b9250925050915091565b610fa73383610f5d846121c2565b5050565b6000610fb76002610efa565b6001600160a01b0316336001600160a01b031614610fe75760405162461bcd60e51b8152600401610c4e90614e98565b610ff2848484612783565b90505b9392505050565b60003361100a8582856128bb565b611015858585612947565b506001949350505050565b61102a6002610efa565b6001600160a01b0316336001600160a01b03161461105a5760405162461bcd60e51b8152600401610c4e90614e98565b61106381612a78565b50565b600080611074836000611b2a565b61107f846001611b2a565b91509150915091565b6000611092612b5b565b905090565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610ef090829086906110d1908790614ecf565b61209d565b7f000000000000000000000000000000000000000000000000000000000000000081101561113a5760405162461bcd60e51b8152602060048201526011602482015270414d4f554e545f4c545f4d494e494d554d60781b6044820152606401610c4e565b600061114560025490565b90507f00000000000000000000000000000000000000000000000000000000000000008110156111ab5760405162461bcd60e51b81526020600482015260116024820152705348415245535f4c545f4d494e494d554d60781b6044820152606401610c4e565b60006111b6826112a5565b90506111ce610dc76111c88584614ecf565b84611f59565b6112036001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086612c86565b6040518381527f278e51d3323fbf18b9fb8df3f8b97e31b145bc1146c52e764cf4aa1bfc4ba17d9060200160405180910390a1505050565b73ee56e2b3d491590b5b31738cc34d5232f378a8d5331461125b57600080fd5b605380546001600160a01b0319166001600160a01b0383169081179091556040517f62bbced765bccc9ed93d0bae1b2a8c86e13b4663f8bf27d5936d9d619194c8a990600090a250565b6051546000906001600160d81b03166112c683670de0b6b3a7640000614ee2565b610e4a9190614ef9565b6112dc33826000612cbe565b61106333826001612cbe565b6001600160a01b03871661130e5760405162461bcd60e51b8152600401610c4e90614f1b565b8342111561132e5760405162461bcd60e51b8152600401610c4e90614f42565b60006113d161133b612de6565b7f6e77642f8f60cdece0498bfeeb2f06ccfef0e8f86d28a1b6255c5e48f1d72a038a8a8a6113868e6001600160a01b0316600090815260446020526040902080546001810190915590565b8b60405160200161139c96959493929190614fa6565b6040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b90506113df81858585612df0565b6001600160a01b0316886001600160a01b03161461140f5760405162461bcd60e51b8152600401610c4e90614fe5565b61141a888888612cbe565b5050505050505050565b6000610ff583611433856125d3565b846126d6565b6001600160a01b03166000908152602081905260409020546001600160681b031690565b605154600090670de0b6b3a7640000906112c6906001600160d81b031684614ee2565b61148a6000610efa565b6001600160a01b0316336001600160a01b0316146114ba5760405162461bcd60e51b8152600401610c4e90614dfe565b61106381612e20565b6060611092612ea6565b6114d633612a78565b565b6114e26001610efa565b6001600160a01b0316336001600160a01b0316146115425760405162461bcd60e51b815260206004820152601960248201527f43414c4c45525f4e4f545f434f4f4c444f574e5f41444d494e000000000000006044820152606401610c4e565b61106381612ed1565b60095460069081116115b65760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b6064820152608401610c4e565b600955565b6000606080600080600060606115cf612f06565b6115d7612ea6565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b604080516001808252818301909252600091829190816020015b611648604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b81526020019060019003908161161b5790505090506040518060600160405280306001600160a01b0316815260200161168085611439565b815260200161168e60025490565b815250816000815181106116a4576116a4615010565b60200260200101819052506116b98382612f31565b6001600160a01b0384166000908152603d6020526040902054610ff59190614ecf565b6000610ff533848461303f565b606060048054610e5f90614e5e565b610f62338383612783565b61170d6002610efa565b6001600160a01b0316336001600160a01b03161461173d5760405162461bcd60e51b8152600401610c4e90614e98565b611748848484612783565b506117578484610f5d846121c2565b50505050565b6001600160a01b0386166117835760405162461bcd60e51b8152600401610c4e90614f1b565b834211156117a35760405162461bcd60e51b8152600401610c4e90614f42565b60006118306117b0612de6565b7fd46e8b93b5190df6403875402a5c13897b72d2a576da5d1bfea20a63638d216e89896117fa8c6001600160a01b0316600090815260446020526040902080546001810190915590565b6040805160208101959095526001600160a01b039384169085015291166060830152608082015260a0810188905260c00161139c565b905061183e81858585612df0565b6001600160a01b0316876001600160a01b03161461186e5760405162461bcd60e51b8152600401610c4e90614fe5565b61187a87876000612cbe565b61188687876001612cbe565b50505050505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156119145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c4e565b611015828686840361209d565b600033610ef0818585612947565b60008281526045602052604090205482906001600160a01b0316331461198f5760405162461bcd60e51b815260206004820152601560248201527421a0a62622a92fa727aa2fa927a622afa0a226a4a760591b6044820152606401610c4e565b60008381526046602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591518581527fc3d1bf52795a20771ee6de3e59948fd83e10db956122d4709a3b86c512963855910160405180910390a2505050565b610fa7338383613133565b611a076000610efa565b6001600160a01b0316336001600160a01b031614611a375760405162461bcd60e51b8152600401610c4e90614dfe565b6051805460ff60d81b191690556040517fcdee157e87ba915be681d4fa3f3d511afe7348eca06448a3accd6ac227fa40af90600090a1565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611adf5760405162461bcd60e51b815260206004820152601560248201527427a7262cafa2a6a4a9a9a4a7a72fa6a0a720a3a2a960591b6044820152606401610c4e565b60005b8151811015611b2057600254828281518110611b0057611b00615010565b602090810291909101810151015280611b1881615026565b915050611ae2565b50611063816132f8565b6000611b3e6051546001600160d81b031690565b6001600160d81b0316670de0b6b3a7640000611b5a8585613466565b611b649190614ee2565b610ff59190614ef9565b6000611b7a6002610efa565b6001600160a01b0316336001600160a01b031614611baa5760405162461bcd60e51b8152600401610c4e90614e98565b610ff284848461303f565b6001600160a01b038716611bdb5760405162461bcd60e51b8152600401610c4e90614f1b565b83421115611bfb5760405162461bcd60e51b8152600401610c4e90614f42565b6001600160a01b0387811660008181526044602090815260408083205481517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9938101939093529082019390935292891660608401526080830188905260a0830182905260c083018790529091611c8a9060e001604051602081830303815290604052805190602001206134e8565b9050611c9881868686612df0565b6001600160a01b0316896001600160a01b031614611cc85760405162461bcd60e51b8152600401610c4e90614fe5565b6001600160a01b0389166000908152604460205260409020600183019055611cf189898961209d565b505050505050505050565b610fa7338383612cbe565b611d12338484612783565b50610f623384610f5d846121c2565b60405163d505accf60e01b8152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015611dad57600080fd5b505af1925050508015611dbe575060015b611df4573d808015611dec576040519150601f19603f3d011682016040523d82523d6000602084013e611df1565b606091505b50505b611dff333387613133565b5050505050565b60008181526046602052604090205481906001600160a01b03163314611e6e5760405162461bcd60e51b815260206004820152601d60248201527f43414c4c45525f4e4f545f50454e44494e475f524f4c455f41444d494e0000006044820152606401610c4e565b60008281526045602090815260408083208054336001600160a01b0319918216811790925560468452938290208054909416909355518481527f83a9ddad961dcb7c6894c9585a16ff7792c2ec8281256a3cc7303ae830152dcf91015b60405180910390a25050565b6000821580611ee4575081155b15611ef157506000610e4a565b611efd82600019614ef9565b831115611f4c5760405162461bcd60e51b815260206004820152601c60248201527f4d4154485f4d554c5449504c49434154494f4e5f4f564552464c4f57000000006044820152606401610c4e565b612710611b648385614ee2565b6000610ff583600181611f74670de0b6b3a764000087614ee2565b611f7e9190614ecf565b611f889190614e4b565b611f929190614ef9565b613515565b806001600160d81b0316600003611fe55760405162461bcd60e51b81526020600482015260126024820152715a45524f5f45584348414e47455f5241544560701b6044820152606401610c4e565b605180546001600160d81b0319166001600160d81b0383169081179091556040519081527fa9c433f9734baa3cf48b209454bb0ace054e191f677ba50e74b696c0d35ef262906020015b60405180910390a150565b6040516001600160a01b038316602482015260448101829052610f6290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261357e565b6001600160a01b0383166120ff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c4e565b6001600160a01b0382166121605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c4e565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006001600160681b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663034206269747360c81b6064820152608401610c4e565b5090565b806001600160681b03166000036122585760405162461bcd60e51b8152600401610c4e9061503f565b6001600160a01b0383166000908152603e602090815260409182902082518084019093525464ffffffffff81168352600160281b90046001600160d81b031690820152605154600160d81b900460ff1661239857604f5481516122c2919064ffffffffff16614ecf565b4210156123095760405162461bcd60e51b815260206004820152601560248201527424a729aaa32324a1a4a2a72a2fa1a7a7a62227aba760591b6044820152606401610c4e565b604f5481517f0000000000000000000000000000000000000000000000000000000000000000916123409164ffffffffff16614ecf565b61234a9042614e4b565b11156123985760405162461bcd60e51b815260206004820152601760248201527f554e5354414b455f57494e444f575f46494e49534845440000000000000000006044820152606401610c4e565b60006123a385611439565b605154909150600090600160d81b900460ff166123cd5782602001516001600160d81b03166123cf565b815b9050806000036124215760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f5a45524f5f4d41585f52454445454d41424c4500000000006044820152606401610c4e565b600081856001600160681b03161161244257846001600160681b0316612444565b815b905061245287846001613650565b50600061245e826112a5565b90506124728861246d846121c2565b6136ff565b845164ffffffffff161561253f578185602001516001600160d81b03166124999190614e4b565b6000036124be576001600160a01b0388166000908152603e602052604081205561253f565b6124c78261387b565b6001600160a01b0389166000908152603e6020526040902054612503916001600160b81b031690600160281b90046001600160d81b031661506c565b6001600160a01b0389166000908152603e6020526040902080546001600160d81b0392909216600160281b0264ffffffffff9092169190911790555b6125736001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016888361203a565b866001600160a01b0316886001600160a01b03167f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc83856040516125c1929190918252602082015260400190565b60405180910390a35050505050505050565b6125f460408051606081018252600080825260208201819052909182015290565b6001600160a01b038216600090815260208181526040808320815160808101835281546001600160681b03811682526001600160481b03600160681b8204811695830195909552600160b01b8104909416928101929092529091606083019060ff600160f81b90910416600381111561266f5761266f614f6e565b600381111561268057612680614f6e565b815250509050604051806060016040528082602001516001600160481b0316815260200182604001516001600160481b03168152602001826060015160038111156126cd576126cd614f6e565b90529392505050565b6000808260018111156126eb576126eb614f6e565b0361273d5760018360400151600381111561270857612708614f6e565b1660ff1660000361271a576000612736565b6001600160a01b03808516600090815260476020526040902054165b9050610ff5565b60028360400151600381111561275557612755614f6e565b1015612762576000610ff2565b5050506001600160a01b039081166000908152604860205260409020541690565b6000816000036127a55760405162461bcd60e51b8152600401610c4e9061503f565b60006127bb856127b487611439565b6000613650565b905060008184116127cc57836127ce565b815b9050806000036127f05760405162461bcd60e51b8152600401610c4e9061503f565b6127fa8183614e4b565b6001600160a01b038088166000908152603d6020526040902091909155612865907f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000008784612c86565b846001600160a01b0316866001600160a01b03167f9310ccfcb8de723f578a9e4282ea9f521f05ae40dc08f3068dfad528a65ee3c7836040516128aa91815260200190565b60405180910390a395945050505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611757578181101561293a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610c4e565b611757848484840361209d565b600061295284611439565b905061296084826001613650565b50826001600160a01b0316846001600160a01b031614612a6d57600061298584611439565b905061299384826001613650565b506001600160a01b0385166000908152603e602090815260409182902082518084019093525464ffffffffff8116808452600160281b9091046001600160d81b03169183019190915215612a6a57838303612a06576001600160a01b0386166000908152603e6020526040812055612a6a565b60208101516001600160d81b0316612a1e8585614e4b565b1015612a6a57612a2e8484614e4b565b6001600160a01b0387166000908152603e6020526040902080546001600160d81b0392909216600160281b0264ffffffffff9092169190911790555b50505b6117578484846138e4565b6000612a8382611439565b905080600003612ad55760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f42414c414e43455f4f4e5f434f4f4c444f574e00000000006044820152606401610c4e565b60408051808201825264ffffffffff42811682526001600160d81b0380851660208085019182526001600160a01b0388166000818152603e9092529086902094519151909216600160281b0292169190911790915590517f8a05f911d8ab7fc50fec37ef4ba7f9bfcb1a3c191c81dcd824ad0946c4e20d6590611ecb9084815260200190565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612bb457507f000000000000000000000000000000000000000000000000000000000000000046145b15612bde57507f000000000000000000000000000000000000000000000000000000000000000090565b611092604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6040516001600160a01b03808516602483015283166044820152606481018290526117579085906323b872dd60e01b90608401612066565b6000836001600160a01b0316836001600160a01b031614612cdf5782612ce2565b60005b90506000612cef856125d3565b90506000612cfe8683866126d6565b9050806001600160a01b0316836001600160a01b031603612d2157505050505050565b6001600160a01b03818116151590841615156000612d3e89613b1d565b90508215612d5357612d53816000868a613b28565b8115612d6657612d66600082888a613b28565b612d71898888613bf2565b82151582151514612d9057612d9089612d8b878a86613c95565b613db5565b856001600160a01b0316896001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd89604051612dd39190615093565b60405180910390a3505050505050505050565b6000611092611088565b600080600080612e0288888888613e55565b925092509250612e128282613f24565b50909150505b949350505050565b6127108110612e715760405162461bcd60e51b815260206004820152601b60248201527f494e56414c49445f534c415348494e475f50455243454e5441474500000000006044820152606401610c4e565b60508190556040518181527fb79c2d6c7f5c95eec9dc05affc0ed002620a4ec6d72b7b0744cc8638168c600a9060200161202f565b60606110927f0000000000000000000000000000000000000000000000000000000000000000613fdd565b604f8190556040518181527fbbf67247b5c97564e30ffc0a355e71c006836de7b9149e09e3d5d6054cb033559060200161202f565b60606110927f0000000000000000000000000000000000000000000000000000000000000000613fdd565b600080805b8351811015613037576000603c6000868481518110612f5757612f57615010565b602090810291909101810151516001600160a01b031682528101919091526040016000908120600181015481548851929450612fc5926001600160801b0380831692600160801b900416908a9088908110612fb457612fb4615010565b60200260200101516040015161401c565b9050613016868481518110612fdc57612fdc615010565b602002602001015160200151828460020160008b6001600160a01b03166001600160a01b0316815260200190815260200160002054614127565b6130209085614ecf565b93505050808061302f90615026565b915050612f36565b509392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146130e25760405162461bcd60e51b815260206004820181905260248201527f5245574152445f544f4b454e5f49535f4e4f545f5354414b45445f544f4b454e6044820152606401610c4e565b60006130f8856130f187611439565b6001613650565b90506000818411613109578361310b565b815b9050801561312a5761311e863083612783565b5061312a308683613133565b95945050505050565b605154600160d81b900460ff16156131805760405162461bcd60e51b815260206004820152601060248201526f534c415348494e475f4f4e474f494e4760801b6044820152606401610c4e565b806000036131a05760405162461bcd60e51b8152600401610c4e9061503f565b60006131ab83611439565b905060006131c38430846131be60025490565b614153565b90508015613246576001600160a01b0384166000908152603d60205260409020546131ef908290614ecf565b6001600160a01b0385166000818152603d60209081526040918290209390935580519182529181018390527f2468f9268c60ad90e2d49edb0032c8a001e733ae888b3ab8e982edf535be1a76910160405180910390a15b60006132518461145d565b90506132886001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873087612c86565b61329a85613295836121c2565b614214565b846001600160a01b0316866001600160a01b03167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc86846040516132e8929190918252602082015260400190565b60405180910390a3505050505050565b60005b8151811015610fa7576000603c600084848151811061331c5761331c615010565b6020026020010151604001516001600160a01b03166001600160a01b03168152602001908152602001600020905061338f83838151811061335f5761335f615010565b6020026020010151604001518285858151811061337e5761337e615010565b602002602001015160200151614379565b508282815181106133a2576133a2615010565b60209081029190910101515181546fffffffffffffffffffffffffffffffff19166001600160801b0390911617815582518390839081106133e5576133e5615010565b6020026020010151604001516001600160a01b03167f87fa03892a0556cb6b8f97e6d533a150d4d55fcbf275fff5fa003fa636bcc7fa84848151811061342d5761342d615010565b602090810291909101810151516040516001600160801b0390911681520160405180910390a2508061345e81615026565b9150506132fb565b600080613472846125d3565b9050600083600181111561348857613488614f6e565b6134939060016150a1565b826040015160038111156134a9576134a9614f6e565b1660ff166000146134bb5760006134c4565b6134c485613b1d565b905060006134d28386614431565b90506134de8183614ecf565b9695505050505050565b6000610e4a6134f5612b5b565b8360405161190160f01b8152600281019290925260228201526042902090565b60006001600160d81b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663136206269747360c81b6064820152608401610c4e565b60006135d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166144709092919063ffffffff16565b805190915015610f6257808060200190518101906135f191906150ba565b610f625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c4e565b6000806136628530866131be60025490565b6001600160a01b0386166000908152603d60205260408120549192509061368a908390614ecf565b9050811561312a5783156136b4576001600160a01b0386166000908152603d602052604090208190555b604080516001600160a01b0388168152602081018490527f2468f9268c60ad90e2d49edb0032c8a001e733ae888b3ab8e982edf535be1a76910160405180910390a195945050505050565b6001600160a01b03821661375f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610c4e565b6001600160a01b0382166000908152602081905260409020546001600160681b039081169082168110156137e05760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610c4e565b6001600160a01b03831660008181526020818152604080832080546001600160681b0319168787036001600160681b03908116919091179091556002805491881691829003905590519081529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610f62836000836001600160681b03166000866001600160681b031661447f565b60006001600160b81b0382111561222b5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663834206269747360c81b6064820152608401610c4e565b6001600160a01b0383166139485760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c4e565b6001600160a01b0382166139aa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c4e565b816001600160a01b0316836001600160a01b031614613ad8576001600160a01b038084166000908152602081905260408082205492851682529020546001600160681b03918216911682821015613a525760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610c4e565b6001600160a01b038516600090815260208190526040902080546001600160681b0319168484036001600160681b0316179055613a8f83826150dc565b6001600160a01b038516600090815260208190526040902080546001600160681b0319166001600160681b03928316179055613ad590869086908581169085168761447f565b50505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516121b591815260200190565b6000610e4a82611439565b6001600160a01b0382161561175757838314611757576000613b57613b526402540be40087614ef9565b614545565b90506000613b6d613b526402540be40087614ef9565b90506000613b7a856125d3565b90506000846001811115613b9057613b90614f6e565b03613bc35781838260200151613ba691906150fc565b613bb0919061511c565b6001600160481b03166020820152613be8565b80518290613bd29085906150fc565b613bdc919061511c565b6001600160481b031681525b6118868582613db5565b6000836001600160a01b0316826001600160a01b031614613c135781613c16565b60005b90506000836001811115613c2c57613c2c614f6e565b03613c64576001600160a01b03848116600090815260476020526040902080546001600160a01b031916918316919091179055611757565b6001600160a01b03938416600090815260486020526040902080546001600160a01b03191691909416179092555050565b613cb660408051606081018252600080825260208201819052909182015290565b8115613d3557826001811115613cce57613cce614f6e565b613cd99060016150a1565b84604001516003811115613cef57613cef614f6e565b1760ff166003811115613d0457613d04614f6e565b84604001906003811115613d1a57613d1a614f6e565b90816003811115613d2d57613d2d614f6e565b905250613dad565b6003836001811115613d4957613d49614f6e565b613d549060016150a1565b1884604001516003811115613d6b57613d6b614f6e565b1660ff166003811115613d8057613d80614f6e565b84604001906003811115613d9657613d96614f6e565b90816003811115613da957613da9614f6e565b9052505b509192915050565b6001600160a01b03821660009081526020818152604091829020835181549285015171ffffffffffffffffffffffffffffffffffff60681b19909316600160681b6001600160481b039283160268ffffffffffffffffff60b01b191617600160b01b91909316029190911780825591830151909182906001600160f81b0316600160f81b836003811115613e4b57613e4b614f6e565b0217905550505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115613e905750600091506003905082613f1a565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613ee4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613f1057506000925060019150829050613f1a565b9250600091508190505b9450945094915050565b6000826003811115613f3857613f38614f6e565b03613f41575050565b6001826003811115613f5557613f55614f6e565b03613f735760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115613f8757613f87614f6e565b03613fa85760405163fce698f760e01b815260048101829052602401610c4e565b6003826003811115613fbc57613fbc614f6e565b03610fa7576040516335e2f38360e21b815260048101829052602401610c4e565b60606000613fea836145ad565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000831580614029575081155b8061403c575042836001600160801b0316145b8061407057507f0000000000000000000000000000000000000000000000000000000000000000836001600160801b031610155b1561407c575083612e18565b60007f000000000000000000000000000000000000000000000000000000000000000042116140ab57426140cd565b7f00000000000000000000000000000000000000000000000000000000000000005b905060006140e46001600160801b03861683614e4b565b905086846140f46012600a615220565b6140fe848a614ee2565b6141089190614ee2565b6141129190614ef9565b61411c9190614ecf565b979650505050505050565b60006141356012600a615220565b61413f8385614e4b565b6141499086614ee2565b610ff29190614ef9565b6001600160a01b038084166000908152603c60209081526040808320938816835260028401909152812054909190828061418e888588614379565b90508083146142085786156141ab576141a8878285614127565b91505b6001600160a01b03808a1660008181526002870160205260409081902084905551918a16917fbb123b5c06d5408bbea3c4fef481578175cfb432e3b482c6186f02ed9086585b906141ff9085815260200190565b60405180910390a35b50979650505050505050565b6001600160a01b03821661426a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610c4e565b6001600160a01b038216600090815260208190526040812054600280546001600160681b039283169392851692906142a3908490614ecf565b90915550506001600160a01b038316600090815260208190526040812080548492906142d99084906001600160681b03166150dc565b92506101000a8154816001600160681b0302191690836001600160681b03160217905550826001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161435091906001600160681b0391909116815260200190565b60405180910390a3610f626000846000846001600160681b0316866001600160681b031661447f565b6001820154825460009190600160801b90046001600160801b0316428190036143a457509050610ff5565b84546000906143bf9084906001600160801b0316848861401c565b905082811461440e57600186018190556040518181526001600160a01b038816907f5777ca300dfe5bead41006fbce4389794dbc0ed8d6cccebfaf94630aa04184bc9060200160405180910390a25b85546001600160801b03428116600160801b029116178655925050509392505050565b60008082600181111561444657614446614f6e565b14614452578251614458565b82602001515b610ff5906001600160481b03166402540be400614ee2565b6060610ff284846000856145d5565b61448c85858585856146a5565b6053546001600160a01b0316801561453d57604051635b9c4cf160e01b81526001600160a01b0387811660048301528681166024830152604482018690526064820185905260848201849052821690635b9c4cf19060a401600060405180830381600087803b1580156144fe57600080fd5b505af192505050801561450f575060015b61453d573d80801561141a576040519150601f19603f3d011682016040523d82523d6000602084013e61141a565b505050505050565b60006001600160481b0382111561222b5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201526532206269747360d01b6064820152608401610c4e565b600060ff8216601f811115610e4a57604051632cd44ac360e21b815260040160405180910390fd5b6060824710156146365760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c4e565b600080866001600160a01b03168587604051614652919061522c565b60006040518083038185875af1925050503d806000811461468f576040519150601f19603f3d011682016040523d82523d6000602084013e614694565b606091505b509150915061411c878383876146b2565b611dff858585858561472b565b6060831561472157825160000361471a576001600160a01b0385163b61471a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c4e565b5081612e18565b612e188383614828565b836001600160a01b0316856001600160a01b03160315611dff576001600160a01b038516156147bf57600061475f866125d3565b9050600061476d8386614e4b565b905060008260400151600381111561478757614787614f6e565b146147bc576147a4858261479d8a8660006126d6565b6000613b28565b6147bc85826147b58a8660016126d6565b6001613b28565b50505b6001600160a01b03841615611dff5760006147d9856125d3565b905060006147e78385614ecf565b905060008260400151600381111561480157614801614f6e565b1461188657614817848261479d898660006126d6565b61188684826147b5898660016126d6565b8151156148385781518083602001fd5b8060405162461bcd60e51b8152600401610c4e91906148e3565b6001600160a01b038116811461106357600080fd5b6000806040838503121561487a57600080fd5b823561488581614852565b946020939093013593505050565b60005b838110156148ae578181015183820152602001614896565b50506000910152565b600081518084526148cf816020860160208601614893565b601f01601f19169290920160200192915050565b602081526000610ff560208301846148b7565b60006020828403121561490857600080fd5b8135610ff581614852565b60006020828403121561492557600080fd5b5035919050565b60008060006060848603121561494157600080fd5b833561494c81614852565b9250602084013561495c81614852565b929592945050506040919091013590565b6000806040838503121561498057600080fd5b823561498b81614852565b9150602083013561499b81614852565b809150509250929050565b8035600281106149b557600080fd5b919050565b803560ff811681146149b557600080fd5b600080600080600080600060e0888a0312156149e657600080fd5b87356149f181614852565b96506020880135614a0181614852565b9550614a0f604089016149a6565b945060608801359350614a24608089016149ba565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215614a5357600080fd5b8235614a5e81614852565b9150614a6c602084016149a6565b90509250929050565b60ff60f81b881681526000602060e081840152614a9560e084018a6148b7565b8381036040850152614aa7818a6148b7565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015614af957835183529284019291840191600101614add565b50909c9b505050505050505050505050565b60008060008060808587031215614b2157600080fd5b8435614b2c81614852565b93506020850135614b3c81614852565b93969395505050506040820135916060013590565b60008060008060008060c08789031215614b6a57600080fd5b8635614b7581614852565b95506020870135614b8581614852565b945060408701359350614b9a606088016149ba565b92506080870135915060a087013590509295509295509295565b60008060408385031215614bc757600080fd5b82359150602083013561499b81614852565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715614c1257614c12614bd9565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715614c4157614c41614bd9565b604052919050565b60006020808385031215614c5c57600080fd5b823567ffffffffffffffff80821115614c7457600080fd5b818501915085601f830112614c8857600080fd5b813581811115614c9a57614c9a614bd9565b614ca8848260051b01614c18565b81815284810192506060918202840185019188831115614cc757600080fd5b938501935b828510156142085780858a031215614ce45760008081fd5b614cec614bef565b85356001600160801b0381168114614d045760008081fd5b81528587013587820152604080870135614d1d81614852565b9082015284529384019392850192614ccc565b600080600080600080600060e0888a031215614d4b57600080fd5b8735614d5681614852565b96506020880135614d6681614852565b95506040880135945060608801359350614a24608089016149ba565b600080600060608486031215614d9757600080fd5b8335614da281614852565b95602085013595506040909401359392505050565b600080600080600060a08688031215614dcf57600080fd5b8535945060208601359350614de6604087016149ba565b94979396509394606081013594506080013592915050565b60208082526019908201527f43414c4c45525f4e4f545f534c415348494e475f41444d494e00000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e4a57610e4a614e35565b600181811c90821680614e7257607f821691505b602082108103614e9257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526017908201527f43414c4c45525f4e4f545f434c41494d5f48454c504552000000000000000000604082015260600190565b80820180821115610e4a57610e4a614e35565b8082028115828204841417610e4a57610e4a614e35565b600082614f1657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60028110614fa257634e487b7160e01b600052602160045260246000fd5b9052565b8681526001600160a01b0386811660208301528516604082015260c08101614fd16060830186614f84565b608082019390935260a00152949350505050565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161503857615038614e35565b5060010190565b6020808252601390820152721253959053125117d6915493d7d05353d55395606a1b604082015260600190565b6001600160d81b0382811682821603908082111561508c5761508c614e35565b5092915050565b60208101610e4a8284614f84565b60ff8181168382160190811115610e4a57610e4a614e35565b6000602082840312156150cc57600080fd5b81518015158114610ff557600080fd5b6001600160681b0381811683821601908082111561508c5761508c614e35565b6001600160481b0382811682821603908082111561508c5761508c614e35565b6001600160481b0381811683821601908082111561508c5761508c614e35565b600181815b8085111561517757816000190482111561515d5761515d614e35565b8085161561516a57918102915b93841c9390800290615141565b509250929050565b60008261518e57506001610e4a565b8161519b57506000610e4a565b81600181146151b157600281146151bb576151d7565b6001915050610e4a565b60ff8411156151cc576151cc614e35565b50506001821b610e4a565b5060208310610133831016604e8410600b84101617156151fa575081810a610e4a565b615204838361513c565b806000190482111561521857615218614e35565b029392505050565b6000610ff5838361517f565b6000825161523e818460208701614893565b919091019291505056fea2646970667358221220be3d771064e3a0027aba2c79bae3548c5f3ac357436fd2fbac6a583d43ad28f264736f6c63430008140033'; - -type StakedAaveV3ConstructorParams = - | [signer?: Signer] - | ConstructorParameters; - -const isSuperArgs = ( - xs: StakedAaveV3ConstructorParams, -): xs is ConstructorParameters => xs.length > 1; - -export class StakedAaveV3__factory extends ContractFactory { - constructor(...args: StakedAaveV3ConstructorParams) { - if (isSuperArgs(args)) { - super(...args); - } else { - super(_abi, _bytecode, args[0]); - } - } - - override deploy( - stakedToken: string, - rewardToken: string, - unstakeWindow: BigNumberish, - rewardsVault: string, - emissionManager: string, - distributionDuration: BigNumberish, - overrides?: Overrides & { from?: string }, - ): Promise { - return super.deploy( - stakedToken, - rewardToken, - unstakeWindow, - rewardsVault, - emissionManager, - distributionDuration, - overrides || {}, - ) as Promise; - } - override getDeployTransaction( - stakedToken: string, - rewardToken: string, - unstakeWindow: BigNumberish, - rewardsVault: string, - emissionManager: string, - distributionDuration: BigNumberish, - overrides?: Overrides & { from?: string }, - ): TransactionRequest { - return super.getDeployTransaction( - stakedToken, - rewardToken, - unstakeWindow, - rewardsVault, - emissionManager, - distributionDuration, - overrides || {}, - ); - } - override attach(address: string): StakedAaveV3 { - return super.attach(address) as StakedAaveV3; - } - override connect(signer: Signer): StakedAaveV3__factory { - return super.connect(signer) as StakedAaveV3__factory; - } - - static readonly bytecode = _bytecode; +export class StakedAaveV3__factory { static readonly abi = _abi; static createInterface(): StakedAaveV3Interface { return new utils.Interface(_abi) as StakedAaveV3Interface; From b6faacd3ecb3b4899692f4f68afe94e3822aeaf2 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 13:09:38 -0600 Subject: [PATCH 30/41] fix: domain --- .../contract-helpers/src/staking-contract/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index 0e00e7ac..b716a02d 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -20,6 +20,7 @@ import { } from '../commons/validators/paramValidators'; import { ERC20_2612Interface, ERC20_2612Service } from '../erc20-2612'; import { ERC20Service, IERC20ServiceInterface } from '../erc20-contract'; +import { AaveTokenV3Service } from '../governance-v3/aave-token-v3'; import { StakedAaveV3 } from './typechain/IStakedAaveV3'; import { StakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; @@ -71,6 +72,8 @@ export class StakingService readonly erc20_2612Service: ERC20_2612Interface; + readonly aaveTokenV3Service: AaveTokenV3Service; + constructor( provider: providers.Provider, stakingServiceConfig: StakingServiceConfig, @@ -81,6 +84,11 @@ export class StakingService this.erc20_2612Service = new ERC20_2612Service(provider); + this.aaveTokenV3Service = new AaveTokenV3Service( + stakingServiceConfig.TOKEN_STAKING_ADDRESS, + provider, + ); + this.stakingContractAddress = stakingServiceConfig.TOKEN_STAKING_ADDRESS; } @@ -96,9 +104,10 @@ export class StakingService ); // eslint-disable-next-line new-cap const stakedToken: string = await stakingContract.STAKED_TOKEN(); - const { name, decimals } = await getTokenData(stakedToken); + const { decimals } = await getTokenData(stakedToken); const convertedAmount: string = valueToWei(amount, decimals); const { chainId } = await this.provider.getNetwork(); + const { name, version } = await this.aaveTokenV3Service.getEip712Domain(); const nonce = await this.erc20_2612Service.getNonce({ token: stakedToken, @@ -128,7 +137,7 @@ export class StakingService primaryType: 'Permit', domain: { name, - version: '1', + version, chainId, verifyingContract: stakedToken, }, From 40ce9552a8df44f564d3508db12e5652e4d9c8f2 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 13:26:54 -0600 Subject: [PATCH 31/41] fix: domain --- .../src/staking-contract/index.ts | 14 ++++++-------- .../src/staking-contract/staking.test.ts | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index b716a02d..44091840 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -72,8 +72,6 @@ export class StakingService readonly erc20_2612Service: ERC20_2612Interface; - readonly aaveTokenV3Service: AaveTokenV3Service; - constructor( provider: providers.Provider, stakingServiceConfig: StakingServiceConfig, @@ -84,11 +82,6 @@ export class StakingService this.erc20_2612Service = new ERC20_2612Service(provider); - this.aaveTokenV3Service = new AaveTokenV3Service( - stakingServiceConfig.TOKEN_STAKING_ADDRESS, - provider, - ); - this.stakingContractAddress = stakingServiceConfig.TOKEN_STAKING_ADDRESS; } @@ -107,7 +100,12 @@ export class StakingService const { decimals } = await getTokenData(stakedToken); const convertedAmount: string = valueToWei(amount, decimals); const { chainId } = await this.provider.getNetwork(); - const { name, version } = await this.aaveTokenV3Service.getEip712Domain(); + + const aaveTokenV3Service = new AaveTokenV3Service( + this.stakingContractAddress, + this.provider, + ); + const { name, version } = await aaveTokenV3Service.getEip712Domain(); const nonce = await this.erc20_2612Service.getNonce({ token: stakedToken, diff --git a/packages/contract-helpers/src/staking-contract/staking.test.ts b/packages/contract-helpers/src/staking-contract/staking.test.ts index 0ef10792..5b86cb55 100644 --- a/packages/contract-helpers/src/staking-contract/staking.test.ts +++ b/packages/contract-helpers/src/staking-contract/staking.test.ts @@ -6,6 +6,8 @@ import { transactionType, } from '../commons/types'; import { gasLimitRecommendations, valueToWei } from '../commons/utils'; +import { AaveTokenV3 } from '../governance-v3/typechain/AaveTokenV3'; +import { AaveTokenV3__factory } from '../governance-v3/typechain/factories/AaveTokenV3__factory'; import { StakedAaveV3 } from './typechain/IStakedAaveV3'; import { StakedAaveV3__factory } from './typechain/IStakedAaveV3__factory'; import { StakingService } from './index'; @@ -75,6 +77,20 @@ describe('StakingService', () => { Promise.resolve('0x0000000000000000000000000000000000000006'), } as unknown as StakedAaveV3); + const aaveV3TokenSpy = jest + .spyOn(AaveTokenV3__factory, 'connect') + .mockReturnValue({ + functions: { + eip712Domain: async () => + Promise.resolve({ + name: 'mockToken', + version: '2', + chainId: BigNumber.from(1), + verifyingContract: TOKEN_STAKING_ADDRESS, + }), + }, + } as unknown as AaveTokenV3); + const nonce = 1; jest @@ -88,6 +104,7 @@ describe('StakingService', () => { ); expect(spy).toHaveBeenCalled(); + expect(aaveV3TokenSpy).toHaveBeenCalled(); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const { primaryType, domain, message } = await JSON.parse(signature); From 5cb07835e99e8055be46acc7cff0b0689e206fce Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 13:53:53 -0600 Subject: [PATCH 32/41] fix: domain --- packages/contract-helpers/src/staking-contract/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index 44091840..f9ce6697 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -137,7 +137,7 @@ export class StakingService name, version, chainId, - verifyingContract: stakedToken, + verifyingContract: this.stakingContractAddress, }, message: { owner: user, From 3a3b9e48024acc02ea467a75b5b4850978c844a0 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 14:16:33 -0600 Subject: [PATCH 33/41] fix: message --- packages/contract-helpers/src/staking-contract/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index f9ce6697..c27677cc 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -128,7 +128,6 @@ export class StakingService { name: 'owner', type: 'address' }, { name: 'spender', type: 'address' }, { name: 'value', type: 'uint256' }, - { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], }, @@ -143,7 +142,6 @@ export class StakingService owner: user, spender: this.stakingContractAddress, value: convertedAmount, - nonce, deadline, }, }; From 297f7e8c9304319df6b6e6e031ea2d2a300c85bf Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 14:18:03 -0600 Subject: [PATCH 34/41] fix: test --- packages/contract-helpers/src/staking-contract/staking.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/staking-contract/staking.test.ts b/packages/contract-helpers/src/staking-contract/staking.test.ts index 5b86cb55..181212f3 100644 --- a/packages/contract-helpers/src/staking-contract/staking.test.ts +++ b/packages/contract-helpers/src/staking-contract/staking.test.ts @@ -114,7 +114,7 @@ describe('StakingService', () => { expect(message.owner).toEqual(user); expect(message.spender).toEqual(TOKEN_STAKING_ADDRESS); - expect(message.nonce).toEqual(nonce); + // expect(message.nonce).toEqual(nonce); expect(message.value).toEqual(valueToWei(amount, decimals)); expect(message.deadline).toEqual(deadline); }); From d705d88c3c6fbbe52ce3b76e8802ca2375dd15e8 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 14:32:07 -0600 Subject: [PATCH 35/41] fix: sig --- packages/contract-helpers/src/staking-contract/index.ts | 4 +++- .../contract-helpers/src/staking-contract/staking.test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index c27677cc..44091840 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -128,6 +128,7 @@ export class StakingService { name: 'owner', type: 'address' }, { name: 'spender', type: 'address' }, { name: 'value', type: 'uint256' }, + { name: 'nonce', type: 'uint256' }, { name: 'deadline', type: 'uint256' }, ], }, @@ -136,12 +137,13 @@ export class StakingService name, version, chainId, - verifyingContract: this.stakingContractAddress, + verifyingContract: stakedToken, }, message: { owner: user, spender: this.stakingContractAddress, value: convertedAmount, + nonce, deadline, }, }; diff --git a/packages/contract-helpers/src/staking-contract/staking.test.ts b/packages/contract-helpers/src/staking-contract/staking.test.ts index 181212f3..5b86cb55 100644 --- a/packages/contract-helpers/src/staking-contract/staking.test.ts +++ b/packages/contract-helpers/src/staking-contract/staking.test.ts @@ -114,7 +114,7 @@ describe('StakingService', () => { expect(message.owner).toEqual(user); expect(message.spender).toEqual(TOKEN_STAKING_ADDRESS); - // expect(message.nonce).toEqual(nonce); + expect(message.nonce).toEqual(nonce); expect(message.value).toEqual(valueToWei(amount, decimals)); expect(message.deadline).toEqual(deadline); }); From c91f1f034c8e6dfff57be00123b8fda579f5182f Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 14:38:00 -0600 Subject: [PATCH 36/41] fix: sig --- packages/contract-helpers/src/staking-contract/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contract-helpers/src/staking-contract/index.ts b/packages/contract-helpers/src/staking-contract/index.ts index 44091840..8c974692 100644 --- a/packages/contract-helpers/src/staking-contract/index.ts +++ b/packages/contract-helpers/src/staking-contract/index.ts @@ -102,7 +102,7 @@ export class StakingService const { chainId } = await this.provider.getNetwork(); const aaveTokenV3Service = new AaveTokenV3Service( - this.stakingContractAddress, + stakedToken, this.provider, ); const { name, version } = await aaveTokenV3Service.getEip712Domain(); From 81a235baab615fb5b7bdfb5cc2e75cbe5e30b08e Mon Sep 17 00:00:00 2001 From: Mark Hinschberger Date: Wed, 3 Jan 2024 16:25:36 -0500 Subject: [PATCH 37/41] feat: Feat/gov v3 cleanup (#567) * fix: sig func * fix: sig func * feat: updates * feat: update types * feat: update types * feat: update gov delegation v3 * fix: gas limit --------- Co-authored-by: Mark Grothe --- .../contract-helpers/src/commons/types.ts | 1 + .../contract-helpers/src/commons/utils.ts | 4 + .../governance-v3/delegate-helper/index.ts | 144 +++++++++++++++--- 3 files changed, 126 insertions(+), 23 deletions(-) diff --git a/packages/contract-helpers/src/commons/types.ts b/packages/contract-helpers/src/commons/types.ts index 0c12eff7..2801c443 100644 --- a/packages/contract-helpers/src/commons/types.ts +++ b/packages/contract-helpers/src/commons/types.ts @@ -143,6 +143,7 @@ export enum ProtocolAction { claimRewardsAndStake = 'claimRewardsAndStake', setUsageAsCollateral = 'setUsageAsCollateral', withdrawAndSwitch = 'withdrawAndSwitch', + batchMetaDelegate = 'batchMetaDelegate', } export enum GovernanceVote { diff --git a/packages/contract-helpers/src/commons/utils.ts b/packages/contract-helpers/src/commons/utils.ts index e711ac9b..6982abb4 100644 --- a/packages/contract-helpers/src/commons/utils.ts +++ b/packages/contract-helpers/src/commons/utils.ts @@ -138,6 +138,10 @@ export const gasLimitRecommendations: GasRecommendationType = { limit: '1000000', recommended: '1000000', }, + [ProtocolAction.batchMetaDelegate]: { + limit: '200000', + recommended: '200000', + }, }; export const mintAmountsPerToken: Record = { diff --git a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts index 3a02c3aa..5b230f1e 100644 --- a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts @@ -1,8 +1,8 @@ -import { SignatureLike } from '@ethersproject/bytes'; -import { BigNumber, PopulatedTransaction, Signature, utils } from 'ethers'; -import { MetaDelegateHelperInterface } from '../typechain/MetaDelegateHelper'; +import { gasLimitRecommendations } from 'contract-helpers/src/commons/utils'; +import { BigNumber, PopulatedTransaction, providers } from 'ethers'; +import { tEthereumAddress, ENS, ProtocolAction } from '../../commons/types'; +import { MetaDelegateHelper } from '../typechain/MetaDelegateHelper'; import { MetaDelegateHelper__factory } from '../typechain/factories/MetaDelegateHelper__factory'; - export enum DelegationType { VOTING, PROPOSITION, @@ -10,43 +10,141 @@ export enum DelegationType { } export type MetaDelegateParams = { - underlyingAsset: string; - delegationType: DelegationType; delegator: string; delegatee: string; + underlyingAsset: string; + deadline: string; + v: number; + r: string; + s: string; + delegationType: number; +}; + +export type DelegateMetaSigParams = { + underlyingAsset: tEthereumAddress; + delegatee: tEthereumAddress | ENS; + delegationType: DelegationType; + delegator: tEthereumAddress; + increaseNonce: boolean; + governanceTokenName: string; + nonce: string; + connectedChainId: number; deadline: string; - signature: SignatureLike; }; export class MetaDelegateHelperService { - private readonly _contractInterface: MetaDelegateHelperInterface; + readonly _contract: MetaDelegateHelper; + + readonly _contractInterface = MetaDelegateHelper__factory.createInterface(); + private readonly metaDelegateHelperContractAddress: string; - constructor(private readonly metaDelegateHelperContracAddress: string) { - this._contractInterface = MetaDelegateHelper__factory.createInterface(); + constructor( + metaDelegateHelperContractAddress: string, + provider: providers.Provider, + ) { + this.metaDelegateHelperContractAddress = metaDelegateHelperContractAddress; // Assign the contract address + + this._contract = MetaDelegateHelper__factory.connect( + metaDelegateHelperContractAddress, + provider, + ); } public batchMetaDelegate( user: string, delegateParams: MetaDelegateParams[], ): PopulatedTransaction { - const params = delegateParams.map(p => { - const sig: Signature = utils.splitSignature(p.signature); - return { - ...p, - v: sig.v, - r: sig.r, - s: sig.s, - }; - }); - const tx: PopulatedTransaction = { data: this._contractInterface.encodeFunctionData('batchMetaDelegate', [ - params, + delegateParams, ]), - to: this.metaDelegateHelperContracAddress, + to: this.metaDelegateHelperContractAddress, from: user, - gasLimit: BigNumber.from('1000000'), + gasLimit: BigNumber.from( + gasLimitRecommendations[ProtocolAction.batchMetaDelegate], + ), }; return tx; } + + public async prepareV3DelegateByTypeSignature({ + underlyingAsset, + delegatee, + delegationType, + delegator, + increaseNonce, + governanceTokenName, + nonce, + connectedChainId, + deadline, + }: DelegateMetaSigParams): Promise { + const isAllDelegate = delegationType === DelegationType.ALL; + + const sigBaseType = [ + { name: 'nonce', type: 'uint256' }, + { name: 'deadline', type: 'uint256' }, + ]; + const sigParametersType = [ + { name: 'delegator', type: 'address' }, + { name: 'delegatee', type: 'address' }, + ]; + const sigDelegationTypeType = [{ name: 'delegationType', type: 'uint8' }]; + + const typesData = { + delegator, + delegatee, + nonce: BigInt(increaseNonce ? Number(nonce) + 1 : nonce).toString(), + deadline, + }; + + const eIP712DomainType = { + EIP712Domain: [ + { + name: 'name', + type: 'string', + }, + { + name: 'version', + type: 'string', + }, + { + name: 'chainId', + type: 'uint256', + }, + { + name: 'verifyingContract', + type: 'address', + }, + ], + }; + + const typeData = { + domain: { + name: governanceTokenName, + version: '2', + chainId: connectedChainId, + verifyingContract: underlyingAsset, + }, + types: isAllDelegate + ? { + ...eIP712DomainType, + Delegate: [...sigParametersType, ...sigBaseType], + } + : { + ...eIP712DomainType, + + DelegateByType: [ + ...sigParametersType, + ...sigDelegationTypeType, + ...sigBaseType, + ], + }, + primaryType: isAllDelegate ? 'Delegate' : 'DelegateByType', + message: isAllDelegate + ? { ...typesData } + : { ...typesData, delegationType }, + }; + + return JSON.stringify(typeData); + } } From 26b82bfceaf450eb29195fcb85444dba5de78570 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 15:50:08 -0600 Subject: [PATCH 38/41] fix: gas limits --- packages/contract-helpers/src/commons/types.ts | 1 + packages/contract-helpers/src/commons/utils.ts | 4 ++++ .../src/governance-v3/governance-core/index.ts | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/commons/types.ts b/packages/contract-helpers/src/commons/types.ts index 2801c443..ec8e3d0b 100644 --- a/packages/contract-helpers/src/commons/types.ts +++ b/packages/contract-helpers/src/commons/types.ts @@ -144,6 +144,7 @@ export enum ProtocolAction { setUsageAsCollateral = 'setUsageAsCollateral', withdrawAndSwitch = 'withdrawAndSwitch', batchMetaDelegate = 'batchMetaDelegate', + updateRepresentatives = 'updateRepresentatives', } export enum GovernanceVote { diff --git a/packages/contract-helpers/src/commons/utils.ts b/packages/contract-helpers/src/commons/utils.ts index 6982abb4..2b9db750 100644 --- a/packages/contract-helpers/src/commons/utils.ts +++ b/packages/contract-helpers/src/commons/utils.ts @@ -142,6 +142,10 @@ export const gasLimitRecommendations: GasRecommendationType = { limit: '200000', recommended: '200000', }, + [ProtocolAction.updateRepresentatives]: { + limit: '60000', + recommended: '60000', + }, }; export const mintAmountsPerToken: Record = { diff --git a/packages/contract-helpers/src/governance-v3/governance-core/index.ts b/packages/contract-helpers/src/governance-v3/governance-core/index.ts index 3e5a8aca..ff04cf02 100644 --- a/packages/contract-helpers/src/governance-v3/governance-core/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-core/index.ts @@ -1,4 +1,5 @@ -import { ChainId } from 'contract-helpers/src/commons/types'; +import { ChainId, ProtocolAction } from 'contract-helpers/src/commons/types'; +import { gasLimitRecommendations } from 'contract-helpers/src/commons/utils'; import { BigNumber, PopulatedTransaction, providers } from 'ethers'; import { GovernanceCore, @@ -44,7 +45,9 @@ export class GovernanceCoreService implements GovernanceCoreServiceInterface { ), to: this._contractInstance.address, from: user, - gasLimit: BigNumber.from('1000000'), + gasLimit: BigNumber.from( + gasLimitRecommendations[ProtocolAction.updateRepresentatives].limit, + ), }; return actionTx; From 680837d57e966d4ed93744e8faae4dc953aa6ec2 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Wed, 3 Jan 2024 16:37:28 -0600 Subject: [PATCH 39/41] fix: imports --- .../src/governance-v3/delegate-helper/index.ts | 2 +- .../src/governance-v3/governance-core/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts index 5b230f1e..7c5b1e66 100644 --- a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts @@ -1,6 +1,6 @@ -import { gasLimitRecommendations } from 'contract-helpers/src/commons/utils'; import { BigNumber, PopulatedTransaction, providers } from 'ethers'; import { tEthereumAddress, ENS, ProtocolAction } from '../../commons/types'; +import { gasLimitRecommendations } from '../../commons/utils'; import { MetaDelegateHelper } from '../typechain/MetaDelegateHelper'; import { MetaDelegateHelper__factory } from '../typechain/factories/MetaDelegateHelper__factory'; export enum DelegationType { diff --git a/packages/contract-helpers/src/governance-v3/governance-core/index.ts b/packages/contract-helpers/src/governance-v3/governance-core/index.ts index ff04cf02..46c45dc6 100644 --- a/packages/contract-helpers/src/governance-v3/governance-core/index.ts +++ b/packages/contract-helpers/src/governance-v3/governance-core/index.ts @@ -1,6 +1,6 @@ -import { ChainId, ProtocolAction } from 'contract-helpers/src/commons/types'; -import { gasLimitRecommendations } from 'contract-helpers/src/commons/utils'; import { BigNumber, PopulatedTransaction, providers } from 'ethers'; +import { ChainId, ProtocolAction } from '../../commons/types'; +import { gasLimitRecommendations } from '../../commons/utils'; import { GovernanceCore, GovernanceCoreInterface, From 706cc817933783a45aa7368e28912371e5ccaa7b Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Thu, 4 Jan 2024 08:54:27 -0600 Subject: [PATCH 40/41] fix: gas limits --- .../contract-helpers/src/governance-v3/aave-token-v3/index.ts | 2 +- .../contract-helpers/src/governance-v3/delegate-helper/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts index 396aac38..10d970da 100644 --- a/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts +++ b/packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts @@ -74,7 +74,7 @@ export class AaveTokenV3Service { ...tx, to: this._contract.address, from: user, - gasLimit: BigNumber.from('1000000'), + gasLimit: BigNumber.from('100000'), }; } diff --git a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts index 7c5b1e66..94e01c2f 100644 --- a/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts +++ b/packages/contract-helpers/src/governance-v3/delegate-helper/index.ts @@ -61,7 +61,7 @@ export class MetaDelegateHelperService { to: this.metaDelegateHelperContractAddress, from: user, gasLimit: BigNumber.from( - gasLimitRecommendations[ProtocolAction.batchMetaDelegate], + gasLimitRecommendations[ProtocolAction.batchMetaDelegate].limit, ), }; return tx; From d4472ca4e630d9ac434517cad0f2b3d3350fadb6 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 5 Jan 2024 11:25:08 -0600 Subject: [PATCH 41/41] fix: remove empty file --- .../contract-helpers/src/governance-v3/voting-machine/index.ts | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 packages/contract-helpers/src/governance-v3/voting-machine/index.ts diff --git a/packages/contract-helpers/src/governance-v3/voting-machine/index.ts b/packages/contract-helpers/src/governance-v3/voting-machine/index.ts deleted file mode 100644 index 6696eeaa..00000000 --- a/packages/contract-helpers/src/governance-v3/voting-machine/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export class VotingMachineService { -} \ No newline at end of file