├── .mocharc.json ├── src ├── util.ts ├── constants.ts ├── ethers-contracts │ ├── index.ts │ ├── commons.ts │ ├── factories │ │ ├── SimpleStorage__factory.ts │ │ └── Timelock__factory.ts │ ├── SimpleStorage.d.ts │ ├── Timelock.d.ts │ ├── TimelockTest.d.ts │ ├── Comp.d.ts │ └── VotingToken.d.ts ├── proposals │ ├── types.ts │ ├── proposal.ts │ └── compound-alpha.ts ├── type-extensions.ts └── index.ts ├── .editorconfig ├── artifacts ├── simpleStorage.json ├── timelock.json ├── timelock__test.json └── votingToken.json ├── test ├── fixture-projects │ └── hardhat-project │ │ └── hardhat.config.ts ├── helpers.ts ├── proposals.test.ts └── fixtures.ts ├── tsconfig.json ├── LICENSE ├── tslint.json ├── .github └── workflows │ └── node.js.yml ├── .gitignore ├── package.json └── README.md /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": "ts-node/register/files", 3 | "ignore": ["test/fixture-projects/**/*"], 4 | "timeout": 60000 5 | } 6 | -------------------------------------------------------------------------------- /src/util.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber } from "ethers"; 2 | import { JsonRpcProvider } from "@ethersproject/providers"; 3 | 4 | 5 | export function toBigNumber(x: any): BigNumber {return BigNumber.from(x.toString())} 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /artifacts/simpleStorage.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"type":"function"}], 3 | "bytecode": "0x6060604052603b8060106000396000f3606060405260e060020a600035046360fe47b1811460245780636d4ce63c14602e575b005b6004356000556022565b6000546060908152602090f3" 4 | } 5 | -------------------------------------------------------------------------------- /test/fixture-projects/hardhat-project/hardhat.config.ts: -------------------------------------------------------------------------------- 1 | // We load the plugin here. 2 | // tslint:disable-next-line no-implicit-dependencies 3 | import "@nomiclabs/hardhat-ethers"; 4 | import "@nomiclabs/hardhat-waffle" 5 | import { HardhatUserConfig } from "hardhat/types"; 6 | 7 | import "../../../src/index"; 8 | 9 | const config: HardhatUserConfig = { 10 | solidity: "0.7.3", 11 | defaultNetwork: "hardhat" 12 | }; 13 | 14 | export default config; 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "sourceMap": true, 8 | "outDir": "./dist", 9 | "strict": true, 10 | "rootDirs": ["./src", "./test"], 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true 13 | }, 14 | "exclude": ["dist", "node_modules"], 15 | "include": [ 16 | "./test", 17 | "./src", 18 | "./src/bytecode/*.json" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | export const PACKAGE_NAME = "hardhat-proposals-plugin" 2 | 3 | export const errors = { 4 | ALREADY_SIMULATED: "Proposal has already been simulated", 5 | PROPOSAL_NOT_SUBMITTED: "Proposal has not been submitted yet", 6 | TOO_MANY_ACTIONS: "Proposal has too many actions", 7 | NOT_ENOUGH_VOTES: "Signer does not have enough votes to reach quorem", 8 | NO_SIGNER: "No signer", 9 | NO_PROPOSER: "Proposal has no proposer", 10 | NO_GOVERNOR: "Proposal has no governor", 11 | NO_VOTING_TOKEN: "Proposal has no voting token" 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Idle Finance Dev League 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /test/helpers.ts: -------------------------------------------------------------------------------- 1 | import { resetHardhatContext } from "hardhat/plugins-testing"; 2 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 3 | import path from "path"; 4 | 5 | declare module "mocha" { 6 | interface Context { 7 | hre: HardhatRuntimeEnvironment; 8 | } 9 | } 10 | 11 | export function useEnvironment(fixtureProjectName: string) { 12 | beforeEach("Loading hardhat environment", function () { 13 | process.chdir(path.join(__dirname, "fixture-projects", fixtureProjectName)); 14 | 15 | this.hre = require("hardhat"); 16 | }); 17 | 18 | afterEach("Resetting hardhat", function () { 19 | resetHardhatContext(); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /src/ethers-contracts/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { GovernorAlpha } from "./GovernorAlpha"; 5 | export type { SimpleStorage } from "./SimpleStorage"; 6 | export type { Timelock } from "./Timelock"; 7 | export type { TimelockTest } from "./TimelockTest"; 8 | export type { VotingToken } from "./VotingToken"; 9 | 10 | export { GovernorAlpha__factory } from "./factories/GovernorAlpha__factory"; 11 | export { SimpleStorage__factory } from "./factories/SimpleStorage__factory"; 12 | export { Timelock__factory } from "./factories/Timelock__factory"; 13 | export { TimelockTest__factory } from "./factories/TimelockTest__factory"; 14 | export { VotingToken__factory } from "./factories/VotingToken__factory"; 15 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "tslint:latest", 4 | "tslint-plugin-prettier", 5 | "tslint-config-prettier" 6 | ], 7 | "rules": { 8 | "prettier": true, 9 | "object-literal-sort-keys": false, 10 | "no-submodule-imports": false, 11 | "interface-name": false, 12 | "max-classes-per-file": false, 13 | "no-empty": false, 14 | "no-console": false, 15 | "only-arrow-functions": false, 16 | "variable-name": [ 17 | true, 18 | "check-format", 19 | "allow-leading-underscore", 20 | "allow-pascal-case" 21 | ], 22 | "ordered-imports": [ 23 | true, 24 | { 25 | "grouped-imports": true, 26 | "import-sources-order": "case-insensitive" 27 | } 28 | ], 29 | "no-floating-promises": true, 30 | "prefer-conditional-expression": false, 31 | "no-implicit-dependencies": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/proposals/types.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber, BigNumberish, BytesLike, Contract, Signer } from "ethers"; 2 | import { Result } from "ethers/lib/utils"; 3 | import { EthereumProvider, HardhatRuntimeEnvironment } from "hardhat/types"; 4 | 5 | export type ContractLike = Contract | string 6 | 7 | export type ContractOptional = Contract | null 8 | 9 | export interface IAction { 10 | target: string; 11 | value: BigNumber; 12 | signature: string; 13 | calldata: BytesLike; 14 | } 15 | 16 | export interface IProposal { 17 | simulate(fullSimulation: boolean, force?: boolean): Promise; 18 | 19 | addAction(action: IAction): void; 20 | } 21 | 22 | export interface IAlphaProposal extends IProposal { 23 | contracts: (Contract | null)[]; 24 | args: (Result)[]; 25 | } 26 | 27 | export interface IProposalBuilder { 28 | addAction(target: string, value: BigNumberish, signature: string, calldata: BytesLike): IProposalBuilder; 29 | build(): IProposal 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [12.x, 14.x, 16.x] 20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 21 | 22 | steps: 23 | - uses: actions/checkout@v2 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v2 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | - run: npm ci 29 | - run: npm run build --if-present 30 | - run: npm test 31 | -------------------------------------------------------------------------------- /src/ethers-contracts/commons.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { EventFilter, Event } from "ethers"; 6 | import { Result } from "@ethersproject/abi"; 7 | 8 | export interface TypedEventFilter<_EventArgsArray, _EventArgsObject> 9 | extends EventFilter {} 10 | 11 | export interface TypedEvent extends Event { 12 | args: EventArgs; 13 | } 14 | 15 | export type TypedListener< 16 | EventArgsArray extends Array, 17 | EventArgsObject 18 | > = ( 19 | ...listenerArg: [ 20 | ...EventArgsArray, 21 | TypedEvent 22 | ] 23 | ) => void; 24 | 25 | export type MinEthersFactory = { 26 | deploy(...a: ARGS[]): Promise; 27 | }; 28 | export type GetContractTypeFromFactory = F extends MinEthersFactory< 29 | infer C, 30 | any 31 | > 32 | ? C 33 | : never; 34 | export type GetARGsTypeFromFactory = F extends MinEthersFactory 35 | ? Parameters 36 | : never; 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # next.js build output 60 | .next 61 | 62 | # environment variables 63 | .env 64 | 65 | # IDE files 66 | .vscode/ 67 | -------------------------------------------------------------------------------- /src/type-extensions.ts: -------------------------------------------------------------------------------- 1 | // If your plugin extends types from another plugin, you should import the plugin here. 2 | 3 | // To extend one of Hardhat's types, you need to import the module where it has been defined, and redeclare it. 4 | // import "hardhat/types/config"; 5 | import "hardhat/types/runtime"; 6 | 7 | // import { ExampleHardhatRuntimeEnvironmentField } from "./ExampleHardhatRuntimeEnvironmentField"; 8 | import { AlphaProposal, AlphaProposalBuilder } from "./proposals/compound-alpha"; 9 | 10 | declare module "hardhat/types/config" { 11 | // This is an example of an extension to one of the Hardhat config values. 12 | 13 | // We extendr the UserConfig type, which represents the config as writen 14 | // by the users. Things are normally optional here. 15 | export interface ProposalsUserConfig { 16 | governor?: string; 17 | votingToken?: string; 18 | } 19 | 20 | // // We also extend the Config type, which represents the configuration 21 | // // after it has been resolved. This is the type used during the execution 22 | // // of tasks, tests and scripts. 23 | // // Normally, you don't want things to be optional here. As you can apply 24 | // // default values using the extendConfig function. 25 | export interface ProposalsConfig { 26 | governor: string; 27 | votingToken: string; 28 | } 29 | 30 | export interface HardhatUserConfig { 31 | proposals?: ProposalsUserConfig 32 | } 33 | 34 | export interface HardhatConfig { 35 | proposals: ProposalsConfig 36 | } 37 | } 38 | 39 | export interface ProposalsHardHatRunTimeEnvironmentField { 40 | builders: { 41 | alpha: () => AlphaProposalBuilder 42 | } 43 | proposals: { 44 | alpha: () => AlphaProposal 45 | } 46 | } 47 | 48 | declare module "hardhat/types/runtime" { 49 | // This is an example of an extension to the Hardhat Runtime Environment. 50 | // This new field will be available in tasks' actions, scripts, and tests. 51 | export interface HardhatRuntimeEnvironment { 52 | proposals: ProposalsHardHatRunTimeEnvironmentField 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/ethers-contracts/factories/SimpleStorage__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; 6 | import { Provider, TransactionRequest } from "@ethersproject/providers"; 7 | import type { SimpleStorage, SimpleStorageInterface } from "../SimpleStorage"; 8 | 9 | const _abi = [ 10 | { 11 | constant: false, 12 | inputs: [ 13 | { 14 | name: "x", 15 | type: "uint256", 16 | }, 17 | ], 18 | name: "set", 19 | outputs: [], 20 | type: "function", 21 | }, 22 | { 23 | constant: true, 24 | inputs: [], 25 | name: "get", 26 | outputs: [ 27 | { 28 | name: "retVal", 29 | type: "uint256", 30 | }, 31 | ], 32 | type: "function", 33 | }, 34 | ]; 35 | 36 | const _bytecode = 37 | "0x6060604052603b8060106000396000f3606060405260e060020a600035046360fe47b1811460245780636d4ce63c14602e575b005b6004356000556022565b6000546060908152602090f3"; 38 | 39 | export class SimpleStorage__factory extends ContractFactory { 40 | constructor(signer?: Signer) { 41 | super(_abi, _bytecode, signer); 42 | } 43 | 44 | deploy( 45 | overrides?: Overrides & { from?: string | Promise } 46 | ): Promise { 47 | return super.deploy(overrides || {}) as Promise; 48 | } 49 | getDeployTransaction( 50 | overrides?: Overrides & { from?: string | Promise } 51 | ): TransactionRequest { 52 | return super.getDeployTransaction(overrides || {}); 53 | } 54 | attach(address: string): SimpleStorage { 55 | return super.attach(address) as SimpleStorage; 56 | } 57 | connect(signer: Signer): SimpleStorage__factory { 58 | return super.connect(signer) as SimpleStorage__factory; 59 | } 60 | static readonly bytecode = _bytecode; 61 | static readonly abi = _abi; 62 | static createInterface(): SimpleStorageInterface { 63 | return new utils.Interface(_abi) as SimpleStorageInterface; 64 | } 65 | static connect( 66 | address: string, 67 | signerOrProvider: Signer | Provider 68 | ): SimpleStorage { 69 | return new Contract(address, _abi, signerOrProvider) as SimpleStorage; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@idle-finance/hardhat-proposals-plugin", 3 | "publishConfig": { 4 | "access": "public" 5 | }, 6 | "version": "0.2.4", 7 | "description": "Hardhat plugin for governance proposals", 8 | "author": "Asaf Silman", 9 | "license": "Apache-2.0", 10 | "main": "dist/src/index.js", 11 | "types": "dist/src/index.d.ts", 12 | "keywords": [ 13 | "idle", 14 | "etheruem", 15 | "smart-contracts", 16 | "hardhat", 17 | "hardhat-plugin" 18 | ], 19 | "scripts": { 20 | "lint:fix": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}' && tslint --fix --config tslint.json --project tsconfig.json", 21 | "lint": "tslint --config tslint.json --project tsconfig.json", 22 | "test": "mocha --exit --recursive 'test/**/*.test.ts'", 23 | "build": "npm run build:types && npm run build:typescript", 24 | "build:typescript": "tsc", 25 | "build:types": "typechain --target ethers-v5 --out-dir src/ethers-contracts ./artifacts/*", 26 | "watch": "tsc -w", 27 | "publish": "npm run build && npm publish" 28 | }, 29 | "repository": { 30 | "type": "git", 31 | "url": "git+https://github.com/Idle-Finance/hardhat-proposals-plugin.git" 32 | }, 33 | "files": [ 34 | "dist/src/", 35 | "src/", 36 | "LICENSE", 37 | "README.md" 38 | ], 39 | "bugs": { 40 | "url": "https://github.com/Idle-Finance/hardhat-proposals-plugin/issues" 41 | }, 42 | "homepage": "https://github.com/Idle-Finance/hardhat-proposals-plugin#readme", 43 | "peerDependencies": { 44 | "@nomiclabs/hardhat-ethers": "^2.0.0", 45 | "ethers": "^5.0.0", 46 | "hardhat": "^2.0.0" 47 | }, 48 | "devDependencies": { 49 | "@nomiclabs/hardhat-ethers": "^2.0.2", 50 | "@nomiclabs/hardhat-waffle": "^2.0.1", 51 | "@typechain/ethers-v5": "^7.0.1", 52 | "@types/chai": "^4.2.19", 53 | "@types/fs-extra": "^9.0.11", 54 | "@types/mocha": "^8.2.2", 55 | "@types/node": "^15.12.4", 56 | "chai": "^4.3.4", 57 | "ethereum-waffle": "^3.4.0", 58 | "ethers": "^5.3.1", 59 | "hardhat": "^2.4.0", 60 | "mocha": "^7.2.0", 61 | "prettier": "^2.3.1", 62 | "ts-node": "^10.0.0", 63 | "tslint": "^6.1.3", 64 | "tslint-config-prettier": "^1.18.0", 65 | "tslint-plugin-prettier": "^2.3.0", 66 | "typechain": "^5.1.1", 67 | "typescript": "^4.3.4" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /test/proposals.test.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable-next-line no-implicit-dependencies 2 | import { createFixtureLoader } from "@ethereum-waffle/provider"; 3 | import { assert, expect } from "chai"; 4 | import { BigNumber } from "ethers"; 5 | import { JsonRpcProvider } from "@ethersproject/providers"; 6 | 7 | import { alphaProposalFixture } from "./fixtures"; 8 | import { useEnvironment } from "./helpers"; 9 | 10 | describe("AlphaProposalBuilder", function () { 11 | useEnvironment("hardhat-project") 12 | 13 | it("builds proposal", async function() { 14 | 15 | const loadFixture = this.hre.waffle.createFixtureLoader( 16 | this.hre.waffle.provider.getWallets(), 17 | this.hre.waffle.provider 18 | ); 19 | 20 | const { governor, votingToken, proposer, voter2, simpleStorage } = await loadFixture(alphaProposalFixture); 21 | 22 | let proposal = this.hre.proposals.builders.alpha() 23 | .setGovernor(governor) 24 | .setVotingToken(votingToken) 25 | .setProposer(voter2) 26 | .addContractAction(simpleStorage, "set", [BigNumber.from("1")]) 27 | .addContractAction(simpleStorage, "set", [BigNumber.from("2")]) 28 | .addContractAction(simpleStorage, "set", [BigNumber.from("3")]) 29 | .addContractAction(simpleStorage, "set", [BigNumber.from("4")]) 30 | .addContractAction(simpleStorage, "set", [BigNumber.from("5")]) 31 | .addContractAction(simpleStorage, "set", [BigNumber.from("6")]) 32 | // .addContractAction(governor, "castVote", [BigNumber.from("1"), true]) 33 | .addContractAction(simpleStorage, "set", [BigNumber.from("8")]) 34 | .addContractAction(simpleStorage, "set", [BigNumber.from("9")]) 35 | .addContractAction(simpleStorage, "set", [BigNumber.from("10")]) 36 | .setDescription("Test Proposal") 37 | .build(); 38 | 39 | // await proposal.propose(); 40 | 41 | await proposal.simulate() 42 | 43 | let storageValue = await simpleStorage.get() 44 | expect(storageValue).to.equal(BigNumber.from("10")) 45 | }); 46 | 47 | it("loads proposal via task", async function() { 48 | const loadFixture = this.hre.waffle.createFixtureLoader( 49 | this.hre.waffle.provider.getWallets(), 50 | this.hre.waffle.provider 51 | ); 52 | 53 | const { provider, governor, votingToken, proposer, simpleStorage, voter2 } = await loadFixture(alphaProposalFixture); 54 | 55 | let proposal = this.hre.proposals.builders.alpha() 56 | .setGovernor(governor) 57 | .setVotingToken(votingToken) 58 | .setProposer(proposer) 59 | .addContractAction(simpleStorage, "set", [BigNumber.from("1")]) 60 | .addContractAction(simpleStorage, "set", [BigNumber.from("2")]) 61 | .addContractAction(simpleStorage, "set", [BigNumber.from("3")]) 62 | .setDescription("Test Proposal") 63 | .build(); 64 | 65 | await proposal.propose(); 66 | await provider.send("evm_mine", []) 67 | await provider.send("evm_mine", []) 68 | await proposal.vote(proposer); 69 | await proposal.vote(voter2, false); 70 | 71 | await this.hre.run("proposal", { governor: governor.address, votingToken: votingToken.address, id: proposal.id.toNumber()}) 72 | }) 73 | }); 74 | -------------------------------------------------------------------------------- /test/fixtures.ts: -------------------------------------------------------------------------------- 1 | import { deployContract, Fixture, MockProvider } from "ethereum-waffle"; 2 | import { utils, Wallet } from "ethers"; 3 | 4 | import { 5 | GovernorAlpha, 6 | Timelock, 7 | TimelockTest, 8 | VotingToken, 9 | SimpleStorage 10 | } from "./ethers-contracts"; 11 | 12 | interface BaseFixture { 13 | provider: MockProvider, 14 | wallets: Wallet[] 15 | } 16 | 17 | interface AlphaContracts { 18 | governor: GovernorAlpha; 19 | timelock: Timelock; 20 | votingToken: VotingToken; 21 | } 22 | 23 | interface Actors { 24 | deployer: Wallet; 25 | guardian: Wallet; 26 | proposer: Wallet; 27 | voter1: Wallet; 28 | voter2: Wallet; 29 | voter3: Wallet; 30 | } 31 | 32 | type AlphaContractsAndActorFixture = AlphaContracts & Actors & BaseFixture; 33 | 34 | interface AlphaProposalsFixture extends AlphaContractsAndActorFixture { 35 | simpleStorage: SimpleStorage 36 | } // can be extended in the future 37 | 38 | export const alphaProposalFixture: Fixture = 39 | async function (wallets: Wallet[], provider): Promise { 40 | const [deployer, guardian, proposer, voter1, voter2, voter3] = wallets; 41 | 42 | const votingToken = (await deployContract( 43 | deployer, 44 | require("../artifacts/votingToken.json"), 45 | [deployer.address] 46 | )) as VotingToken; 47 | const harnessTimelock = (await deployContract( 48 | deployer, 49 | require("../artifacts/timelock__test.json"), 50 | [deployer.address, "172800"] 51 | )) as TimelockTest; 52 | 53 | const governor = (await deployContract( 54 | deployer, 55 | require("../artifacts/governorAlpha.json"), 56 | [harnessTimelock.address, votingToken.address, guardian.address] 57 | )) as GovernorAlpha; 58 | 59 | const simpleStorage = (await deployContract(deployer, require("../artifacts/simpleStorage.json"))) as SimpleStorage 60 | 61 | // transfer timelock to governor 62 | await harnessTimelock.connect(deployer).harnessSetAdmin(governor.address) 63 | const timelock: Timelock = harnessTimelock as Timelock 64 | 65 | // transfer tokens 66 | await votingToken 67 | .connect(deployer) 68 | .transfer(proposer.address, utils.parseUnits("100001")); 69 | await votingToken 70 | .connect(deployer) 71 | .transfer(voter1.address, utils.parseUnits("1000000")); 72 | await votingToken 73 | .connect(deployer) 74 | .transfer(voter2.address, utils.parseUnits("500000")); 75 | await votingToken 76 | .connect(deployer) 77 | .transfer(voter3.address, utils.parseUnits("1000")); 78 | 79 | 80 | // self delegate 81 | await votingToken.connect(proposer).delegate(proposer.address); 82 | await votingToken.connect(voter1).delegate(voter1.address); 83 | await votingToken.connect(voter2).delegate(voter2.address); 84 | await votingToken.connect(voter3).delegate(voter3.address); 85 | 86 | return { 87 | governor, 88 | timelock, 89 | votingToken, 90 | deployer, 91 | guardian, 92 | proposer, // distribute 100,001 tokens (proposal threshold) 93 | voter1, // distribute 1,000,000 tokens 94 | voter2, // distribute 500,000 tokens 95 | voter3, // distribute 1,000 tokens 96 | provider, 97 | wallets, 98 | simpleStorage: simpleStorage 99 | }; 100 | }; 101 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { extendEnvironment , extendConfig, task, types } from "hardhat/config"; 2 | import { lazyObject } from "hardhat/plugins"; 3 | import { HardhatConfig, HardhatUserConfig } from "hardhat/types"; 4 | 5 | import { AlphaProposal, AlphaProposalBuilder } from "./proposals/compound-alpha"; 6 | // import { ExampleHardhatRuntimeEnvironmentField } from "./ExampleHardhatRuntimeEnvironmentField"; 7 | // This import is needed to let the TypeScript compiler know that it should include your type 8 | // extensions in your npm package's types file. 9 | import "./type-extensions"; 10 | import { GovernorAlpha__factory, VotingToken__factory } from "./ethers-contracts/index" 11 | 12 | extendConfig( 13 | (config: HardhatConfig, userConfig: Readonly) => { 14 | // We apply our default config here. Any other kind of config resolution 15 | // or normalization should be placed here. 16 | // 17 | // `config` is the resolved config, which will be used during runtime and 18 | // you should modify. 19 | // `userConfig` is the config as provided by the user. You should not modify 20 | // it. 21 | // 22 | // If you extended the `HardhatConfig` type, you need to make sure that 23 | // executing this function ensures that the `config` object is in a valid 24 | // state for its type, including its extentions. For example, you may 25 | // need to apply a default value, like in this example. 26 | const userGovernor = userConfig.proposals?.governor 27 | const userVotingToken = userConfig.proposals?.votingToken 28 | 29 | config.proposals = { 30 | governor: userGovernor ? userGovernor : "", 31 | votingToken: userVotingToken ? userVotingToken : "" 32 | } 33 | } 34 | ); 35 | 36 | task("proposal", "Interact with proposals using hardhat") 37 | .addParam("action", "What type of action to perform from options (info) (default: \"info\")", "info", types.string) 38 | .addOptionalParam("governor", "The governor address", undefined, types.string) 39 | .addOptionalParam("votingToken", "The voting token registered with the governor", undefined, types.string) 40 | .addPositionalParam("id", "The proposal id", undefined, types.int) 41 | .setAction(async (args, hre) => { 42 | const {action, governor, votingToken, id} = args 43 | 44 | const governorContract = GovernorAlpha__factory.connect(governor || hre.config.proposals.governor, hre.ethers.provider) 45 | const votingTokenContract = VotingToken__factory.connect(votingToken || hre.config.proposals.votingToken, hre.ethers.provider) 46 | 47 | switch (action) { 48 | case "info": 49 | { 50 | let proposal = hre.proposals.proposals.alpha() 51 | 52 | proposal.setGovernor(governorContract) 53 | proposal.setVotingToken(votingTokenContract) 54 | 55 | let loadedProposal = await proposal.loadProposal(id) 56 | await loadedProposal.printProposalInfo() 57 | } 58 | break; 59 | } 60 | }) 61 | 62 | 63 | extendEnvironment((hre) => { 64 | // We add a field to the Hardhat Runtime Environment here. 65 | // We use lazyObject to avoid initializing things until they are actually 66 | // needed. 67 | hre.proposals = lazyObject(() => { 68 | return { 69 | builders: { 70 | alpha: () => new AlphaProposalBuilder(hre, hre.config.proposals.governor, hre.config.proposals.votingToken) 71 | }, 72 | proposals: { 73 | alpha: () => new AlphaProposal(hre) 74 | } 75 | } 76 | }); 77 | }); 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Node.js CI](https://github.com/Idle-Finance/hardhat-proposals-plugin/actions/workflows/node.js.yml/badge.svg)](https://github.com/Idle-Finance/hardhat-proposals-plugin/actions/workflows/node.js.yml) 2 | 3 | # hardhat-proposals-plugin 4 | 5 | _A Hardhat plugin for working with on-chain proposals_ 6 | 7 | ## What 8 | 9 | A helper plugin for developing and testing on-chain proposals 10 | 11 | This plugin will assist in simulating proposals in a Hardhat environment for testing and debugging proposals before they are submitted on-chain. 12 | 13 | ## Installation 14 | 15 | 16 | ```bash 17 | npm install --save-dev @idle-finance/hardhat-proposals-plugin @nomiclabs/hardhat-ethers ethers 18 | ``` 19 | 20 | Import the plugin in your `hardhat.config.js`: 21 | 22 | ```js 23 | require("@idle-finance/hardhat-proposals-plugin"); 24 | ``` 25 | 26 | Or if you are using TypeScript, in your `hardhat.config.ts`: 27 | 28 | ```ts 29 | import "@idle-finance/hardhat-proposals-plugin"; 30 | ``` 31 | 32 | 33 | ## Required plugins 34 | 35 | - [@nomiclabs/hardhat-ethers](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-ethers) 36 | 37 | ## Tasks 38 | 39 | This plugin adds the _proposal_ task to Hardhat: 40 | ``` 41 | Usage: hardhat [GLOBAL OPTIONS] proposal [--action ] --governor --voting-token id 42 | 43 | OPTIONS: 44 | 45 | --action What type of action to perform from options (info) (default: "info") (default: "info") 46 | --governor The governor address 47 | --voting-token The voting token registered with the governor 48 | 49 | POSITIONAL ARGUMENTS: 50 | 51 | id The proposal id 52 | 53 | proposal: Interact with proposals using hardhat 54 | ``` 55 | 56 | ## Environment extensions 57 | 58 | This plugin extends the Hardhat Runtime Environment by adding the `proposal` field whose type is `ProposalsHardHatRunTimeEnvironmentField` 59 | 60 | ## Configuration 61 | 62 | This plugin extends the `HardhatUserConfig` by adding the `proposals` field whose type is `ProposalsUserConfig` 63 | 64 | This is an example of how to set it: 65 | 66 | ```js 67 | module.exports = { 68 | proposals: { 69 | governor: "0x2256b25CFC8E35c3135664FD03E77595042fe31B", 70 | votingToken: "0x875773784Af8135eA0ef43b5a374AaD105c5D39e" 71 | } 72 | }; 73 | ``` 74 | 75 | ## Usage 76 | 77 | There are no additional steps you need to take for this plugin to work. 78 | 79 | Install it and access proposals through the Hardhat Runtime Environment anywhere 80 | you need it (tasks, scripts, tests, etc). 81 | 82 | ## Example 83 | 84 | The following example illustrates how to use the plugin. 85 | 86 | This example will create a proposal for a `GovernorAlpha` like proposal. 87 | 88 | ```js 89 | ... 90 | export default task(..., async(args, hre) => { 91 | ... 92 | let proposer = await hre.ethers.getSigner(PROPOSER) 93 | 94 | let proposal = hre.proposals.builders.alpha() 95 | .setProposer(proposer) 96 | .addContractAction( 97 | DAIInterestRateModelV2, // Contract we are interacting with 98 | "_setInterestRateModel(address)", // Contract signature 99 | ['0'] // Method args 100 | ) 101 | .setDescription("CIP #2 ...") // Set proposal description 102 | .build() 103 | 104 | await proposal.simulate() // Simulate the execution of the proposal. 105 | }) 106 | 107 | ``` 108 | 109 | A full project implementation using this plugin can be found [here](https://github.com/Idle-Finance/idle-proposals) 110 | -------------------------------------------------------------------------------- /src/ethers-contracts/SimpleStorage.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | CallOverrides, 16 | } from "ethers"; 17 | import { BytesLike } from "@ethersproject/bytes"; 18 | import { Listener, Provider } from "@ethersproject/providers"; 19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 20 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; 21 | 22 | interface SimpleStorageInterface extends ethers.utils.Interface { 23 | functions: { 24 | "set(uint256)": FunctionFragment; 25 | "get()": FunctionFragment; 26 | }; 27 | 28 | encodeFunctionData(functionFragment: "set", values: [BigNumberish]): string; 29 | encodeFunctionData(functionFragment: "get", values?: undefined): string; 30 | 31 | decodeFunctionResult(functionFragment: "set", data: BytesLike): Result; 32 | decodeFunctionResult(functionFragment: "get", data: BytesLike): Result; 33 | 34 | events: {}; 35 | } 36 | 37 | export class SimpleStorage extends BaseContract { 38 | connect(signerOrProvider: Signer | Provider | string): this; 39 | attach(addressOrName: string): this; 40 | deployed(): Promise; 41 | 42 | listeners, EventArgsObject>( 43 | eventFilter?: TypedEventFilter 44 | ): Array>; 45 | off, EventArgsObject>( 46 | eventFilter: TypedEventFilter, 47 | listener: TypedListener 48 | ): this; 49 | on, EventArgsObject>( 50 | eventFilter: TypedEventFilter, 51 | listener: TypedListener 52 | ): this; 53 | once, EventArgsObject>( 54 | eventFilter: TypedEventFilter, 55 | listener: TypedListener 56 | ): this; 57 | removeListener, EventArgsObject>( 58 | eventFilter: TypedEventFilter, 59 | listener: TypedListener 60 | ): this; 61 | removeAllListeners, EventArgsObject>( 62 | eventFilter: TypedEventFilter 63 | ): this; 64 | 65 | listeners(eventName?: string): Array; 66 | off(eventName: string, listener: Listener): this; 67 | on(eventName: string, listener: Listener): this; 68 | once(eventName: string, listener: Listener): this; 69 | removeListener(eventName: string, listener: Listener): this; 70 | removeAllListeners(eventName?: string): this; 71 | 72 | queryFilter, EventArgsObject>( 73 | event: TypedEventFilter, 74 | fromBlockOrBlockhash?: string | number | undefined, 75 | toBlock?: string | number | undefined 76 | ): Promise>>; 77 | 78 | interface: SimpleStorageInterface; 79 | 80 | functions: { 81 | set( 82 | x: BigNumberish, 83 | overrides?: Overrides & { from?: string | Promise } 84 | ): Promise; 85 | 86 | get( 87 | overrides?: CallOverrides 88 | ): Promise<[BigNumber] & { retVal: BigNumber }>; 89 | }; 90 | 91 | set( 92 | x: BigNumberish, 93 | overrides?: Overrides & { from?: string | Promise } 94 | ): Promise; 95 | 96 | get(overrides?: CallOverrides): Promise; 97 | 98 | callStatic: { 99 | set(x: BigNumberish, overrides?: CallOverrides): Promise; 100 | 101 | get(overrides?: CallOverrides): Promise; 102 | }; 103 | 104 | filters: {}; 105 | 106 | estimateGas: { 107 | set( 108 | x: BigNumberish, 109 | overrides?: Overrides & { from?: string | Promise } 110 | ): Promise; 111 | 112 | get(overrides?: CallOverrides): Promise; 113 | }; 114 | 115 | populateTransaction: { 116 | set( 117 | x: BigNumberish, 118 | overrides?: Overrides & { from?: string | Promise } 119 | ): Promise; 120 | 121 | get(overrides?: CallOverrides): Promise; 122 | }; 123 | } 124 | -------------------------------------------------------------------------------- /src/proposals/proposal.ts: -------------------------------------------------------------------------------- 1 | import { BigNumberish, BigNumber, BytesLike, Signer } from "ethers"; 2 | import { HardhatPluginError } from "hardhat/plugins"; 3 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 4 | 5 | import { toBigNumber } from "../util"; 6 | import { IProposal, IAction, IProposalBuilder } from "./types"; 7 | import { PACKAGE_NAME, errors } from "../constants"; 8 | 9 | /** 10 | * This is an internal state of the proposal which is used to keep track of a proposal. 11 | */ 12 | export enum InternalProposalState { 13 | UNSUBMITTED, 14 | SIMULATED, 15 | SUBMITTED 16 | } 17 | 18 | /** 19 | * Abstract implementation of a proposal 20 | * 21 | * This implementation only contains a subset of the actions required for a proposal 22 | */ 23 | export abstract class Proposal implements IProposal { 24 | protected readonly hre: HardhatRuntimeEnvironment; 25 | protected internalState: InternalProposalState; 26 | 27 | proposer?: Signer; 28 | 29 | targets: string[] = [] 30 | values: BigNumber[] = [] 31 | signatures: string[] = [] 32 | calldatas: BytesLike[] = [] 33 | 34 | constructor(hre: HardhatRuntimeEnvironment) { 35 | this.hre = hre; 36 | 37 | this.internalState = InternalProposalState.UNSUBMITTED; 38 | } 39 | 40 | protected markAsSubmitted() { 41 | this.internalState = InternalProposalState.SUBMITTED 42 | } 43 | 44 | /** 45 | * Run a simulation of the proposal 46 | * 47 | * This method will not update the propsal id. 48 | * 49 | * If the proposal has already been simulated, an exception will be thrown to the called. 50 | * This can be disabled by using the flag `simulate(force=true)` 51 | * 52 | * Each proposal type will have its own implmenentation for simulating the proposal, 53 | * therefore refer to the relavent proposal for details on how the simulate method method works. 54 | * 55 | * There may be some nuance the the implementation to pay attention to in particular. 56 | * 57 | * For example 58 | * - Each action may be exected as distinct transactions instead of one 59 | * - The timestamps for each action may be slightly different. 60 | * - The gas costs from this method should not be relied upon for executing a proposal. 61 | * 62 | * If you want a more accurate (but significantly slower) simulation of the proposal 63 | * run this method with the flag `simulate(fullSimulation=true)` 64 | * 65 | * @param fullSimulation Whether to run a full simulation of the proposal (default: false) 66 | * @param force Re-execute the proposal even if it has already been simulated before (default: false) 67 | */ 68 | async simulate(fullSimulation: boolean = false, force?: boolean) { 69 | if (this.internalState != InternalProposalState.UNSUBMITTED && !force) { 70 | throw new HardhatPluginError(PACKAGE_NAME, errors.ALREADY_SIMULATED); 71 | } 72 | 73 | if (fullSimulation) await this._fullSimulate(); 74 | else await this._simulate(); 75 | 76 | this.internalState = InternalProposalState.SIMULATED 77 | } 78 | 79 | /** 80 | * Implementation for running a proposal simulation. 81 | */ 82 | protected abstract _simulate(): Promise; 83 | 84 | /** 85 | * Implenentation for running a full proposal simulation 86 | */ 87 | protected abstract _fullSimulate(): Promise; 88 | 89 | addAction(action: IAction): void { 90 | this.targets.push(action.target) 91 | this.values.push(BigNumber.from(action.value)) 92 | this.signatures.push(action.signature) 93 | this.calldatas.push(action.calldata) 94 | } 95 | 96 | /** 97 | * Fetch a proposal from the block chain and return that new proposal 98 | * 99 | * @param data Any data required to load the proposal. Determined by the implementation 100 | */ 101 | abstract loadProposal(data: any): Promise 102 | 103 | protected getProvider() {return this.hre.network.provider} 104 | protected getEthersProvider() {return this.hre.ethers.provider} 105 | 106 | protected async mineBlocks(blocks: any) { 107 | let blocksToMine = toBigNumber(blocks).toNumber() 108 | 109 | for (let i = 0; i < blocksToMine; i++) { 110 | await this.mineBlock() 111 | } 112 | } 113 | 114 | protected async mineBlock(timestamp?: number) { 115 | let provider = this.getEthersProvider() 116 | 117 | if (timestamp) { 118 | await provider.send("evm_mine", [timestamp]) 119 | } else { 120 | await provider.send("evm_mine", []) 121 | } 122 | } 123 | } 124 | 125 | export abstract class ProposalBuilder implements IProposalBuilder { 126 | private readonly hre: HardhatRuntimeEnvironment; 127 | abstract proposal: Proposal 128 | 129 | constructor(hre: HardhatRuntimeEnvironment) { 130 | this.hre = hre 131 | } 132 | /** 133 | * Build and return the proposal 134 | * 135 | * @returns The built proposal 136 | */ 137 | abstract build(): Proposal; 138 | 139 | /** 140 | * Add an action to the proposal 141 | * 142 | * @param target Target contract address 143 | * @param value tx value to send 144 | * @param signature Contract function signature to call 145 | * @param calldata Call data to pass to function 146 | */ 147 | abstract addAction(target: string, value: BigNumberish, signature: string, calldata: BytesLike): ProposalBuilder 148 | } 149 | -------------------------------------------------------------------------------- /artifacts/timelock.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"value","type":"uint256"},{"name":"signature","type":"string"},{"name":"data","type":"bytes"},{"name":"eta","type":"uint256"}],"name":"executeTransaction","outputs":[{"name":"","type":"bytes"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"acceptAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"value","type":"uint256"},{"name":"signature","type":"string"},{"name":"data","type":"bytes"},{"name":"eta","type":"uint256"}],"name":"queueTransaction","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pendingAdmin_","type":"address"}],"name":"setPendingAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"value","type":"uint256"},{"name":"signature","type":"string"},{"name":"data","type":"bytes"},{"name":"eta","type":"uint256"}],"name":"cancelTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"delay","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAXIMUM_DELAY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_DELAY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"GRACE_PERIOD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"delay_","type":"uint256"}],"name":"setDelay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"queuedTransactions","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"admin_","type":"address"},{"name":"delay_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"newDelay","type":"uint256"}],"name":"NewDelay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"txHash","type":"bytes32"},{"indexed":true,"name":"target","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"signature","type":"string"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"eta","type":"uint256"}],"name":"CancelTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"txHash","type":"bytes32"},{"indexed":true,"name":"target","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"signature","type":"string"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"eta","type":"uint256"}],"name":"ExecuteTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"txHash","type":"bytes32"},{"indexed":true,"name":"target","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"signature","type":"string"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"eta","type":"uint256"}],"name":"QueueTransaction","type":"event"}], 3 | "bytecode": "608060405234801561001057600080fd5b506040516040806118f88339810180604052604081101561003057600080fd5b5080516020909101516202a300811015610095576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118896037913960400191505060405180910390fd5b62278d008111156100f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118c06038913960400191505060405180910390fd5b600080546001600160a01b039093166001600160a01b031990931692909217909155600255611764806101256000396000f3fe6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b97565b34801561029a57600080fd5b506102a3610c36565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c45915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f5c565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fed915050565b3480156105aa57600080fd5b5061040c6112a6565b3480156105bf57600080fd5b5061040c6112ac565b3480156105d457600080fd5b5061040c6112b3565b3480156105e957600080fd5b5061040c6112ba565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112c1565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b50356113bf565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113d4565b6000546060906001600160a01b031633146106be57604051600160e51b62461bcd02815260040180806020018281038252603881526020018061144c6038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072d578181015183820152602001610715565b50505050905090810190601f16801561075a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078d578181015183820152602001610775565b50505050905090810190601f1680156107ba5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082e965050505050505057604051600160e51b62461bcd02815260040180806020018281038252603d81526020018061159f603d913960400191505060405180910390fd5b826108376113e3565b101561087757604051600160e51b62461bcd0281526004018080602001828103825260458152602001806114ee6045913960600191505060405180910390fd5b61088a836212750063ffffffff6113e716565b6108926113e3565b11156108d257604051600160e51b62461bcd0281526004018080602001828103825260338152602001806114bb6033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108f8575083610985565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b6020831061094d5780518252601f19909201916020918201910161092e565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109c45780518252601f1990920191602091820191016109a5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a26576040519150601f19603f3d011682016040523d82523d6000602084013e610a2b565b606091505b509150915081610a6f57604051600160e51b62461bcd02815260040180806020018281038252603d815260200180611682603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b4c578181015183820152602001610b34565b50505050905090810190601f168015610b795780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610be357604051600160e51b62461bcd0281526004018080602001828103825260388152602001806115dc6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c9257604051600160e51b62461bcd02815260040180806020018281038252603681526020018061164c6036913960400191505060405180910390fd5b610cac600254610ca06113e3565b9063ffffffff6113e716565b821015610ced57604051600160e51b62461bcd0281526004018080602001828103825260498152602001806116bf6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f9d57604051600160e51b62461bcd0281526004018080602001828103825260388152602001806116146038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461103957604051600160e51b62461bcd0281526004018080602001828103825260378152602001806114846037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110a8578181015183820152602001611090565b50505050905090810190601f1680156110d55780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156111085781810151838201526020016110f0565b50505050905090810190601f1680156111355780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112005781810151838201526020016111e8565b50505050905090810190601f16801561122d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611260578181015183820152602001611248565b50505050905090810190601f16801561128d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b33301461130257604051600160e51b62461bcd0281526004018080602001828103825260318152602001806117086031913960400191505060405180910390fd5b6202a30081101561134757604051600160e51b62461bcd0281526004018080602001828103825260348152602001806115336034913960400191505060405180910390fd5b62278d0081111561138c57604051600160e51b62461bcd0281526004018080602001828103825260388152602001806115676038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b6000828201838110156114445760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea165627a7a7230582066c588fea727d4a4b3eb2554087a21c0403f86249bc84e2b3d386fdbfdd7056c002954696d656c6f636b3a3a636f6e7374727563746f723a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e"} 4 | -------------------------------------------------------------------------------- /artifacts/timelock__test.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"inputs":[{"internalType":"address","name":"admin_","type":"address"},{"internalType":"uint256","name":"delay_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"txHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"string","name":"signature","type":"string"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"eta","type":"uint256"}],"name":"CancelTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"txHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"string","name":"signature","type":"string"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"eta","type":"uint256"}],"name":"ExecuteTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"NewDelay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"txHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"string","name":"signature","type":"string"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"eta","type":"uint256"}],"name":"QueueTransaction","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAXIMUM_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"string","name":"signature","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"eta","type":"uint256"}],"name":"cancelTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"delay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"string","name":"signature","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"eta","type":"uint256"}],"name":"executeTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract Administered","name":"administered","type":"address"}],"name":"harnessAcceptAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"admin_","type":"address"}],"name":"harnessSetAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"string","name":"signature","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"eta","type":"uint256"}],"name":"queueTransaction","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"queuedTransactions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"delay_","type":"uint256"}],"name":"setDelay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"pendingAdmin_","type":"address"}],"name":"setPendingAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}], 3 | "bytecode": "608060405234801561001057600080fd5b506040516118e03803806118e08339818101604052604081101561003357600080fd5b508051602090910151600080546001600160a01b0319166001600160a01b0390931692909217825560025561187290819061006e90396000f3fe6080604052600436106100e85760003560e01c806372b812b41161008a578063e177246e11610059578063e177246e1461064b578063f2b0653714610675578063f79efaf1146106b3578063f851a440146106e6576100e8565b806372b812b4146105d95780637d645fab1461060c578063b1b43ae514610621578063c1a287e214610636576100e8565b80633a66f901116100c65780633a66f901146102e55780634dd18bf514610444578063591fcdfe146104775780636a42b8f8146105c4576100e8565b80630825f38f146100ea5780630e18b6811461029f57806326782247146102b4575b005b61022a600480360360a081101561010057600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561012f57600080fd5b82018360208201111561014157600080fd5b803590602001918460018302840111600160201b8311171561016257600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b457600080fd5b8201836020820111156101c657600080fd5b803590602001918460018302840111600160201b831117156101e757600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106fb915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026457818101518382015260200161024c565b50505050905090810190601f1680156102915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ab57600080fd5b506100e8610c14565b3480156102c057600080fd5b506102c9610cb0565b604080516001600160a01b039092168252519081900360200190f35b3480156102f157600080fd5b50610432600480360360a081101561030857600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561033757600080fd5b82018360208201111561034957600080fd5b803590602001918460018302840111600160201b8311171561036a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103bc57600080fd5b8201836020820111156103ce57600080fd5b803590602001918460018302840111600160201b831117156103ef57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610cbf915050565b60408051918252519081900360200190f35b34801561045057600080fd5b506100e86004803603602081101561046757600080fd5b50356001600160a01b0316610fd0565b34801561048357600080fd5b506100e8600480360360a081101561049a57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104c957600080fd5b8201836020820111156104db57600080fd5b803590602001918460018302840111600160201b831117156104fc57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561054e57600080fd5b82018360208201111561056057600080fd5b803590602001918460018302840111600160201b8311171561058157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061105e915050565b3480156105d057600080fd5b50610432611314565b3480156105e557600080fd5b506100e8600480360360208110156105fc57600080fd5b50356001600160a01b031661131a565b34801561061857600080fd5b50610432611353565b34801561062d57600080fd5b5061043261135a565b34801561064257600080fd5b50610432611361565b34801561065757600080fd5b506100e86004803603602081101561066e57600080fd5b5035611368565b34801561068157600080fd5b5061069f6004803603602081101561069857600080fd5b503561145d565b604080519115158252519081900360200190f35b3480156106bf57600080fd5b506100e8600480360360208110156106d657600080fd5b50356001600160a01b0316611472565b3480156106f257600080fd5b506102c96114dc565b6000546060906001600160a01b031633146107475760405162461bcd60e51b81526004018080602001828103825260388152602001806115516038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156107b657818101518382015260200161079e565b50505050905090810190601f1680156107e35780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156108165781810151838201526020016107fe565b50505050905090810190601f1680156108435780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff1697506108b496505050505050505760405162461bcd60e51b815260040180806020018281038252603d8152602001806116a4603d913960400191505060405180910390fd5b826108bd6114eb565b10156108fa5760405162461bcd60e51b81526004018080602001828103825260458152602001806115f36045913960600191505060405180910390fd5b61090d836212750063ffffffff6114ef16565b6109156114eb565b11156109525760405162461bcd60e51b81526004018080602001828103825260338152602001806115c06033913960400191505060405180910390fd5b6000818152600360205260409020805460ff191690558451606090610978575083610a05565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109cd5780518252601f1990920191602091820191016109ae565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b60208310610a445780518252601f199092019160209182019101610a25565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610aa6576040519150601f19603f3d011682016040523d82523d6000602084013e610aab565b606091505b509150915081610aec5760405162461bcd60e51b815260040180806020018281038252603d815260200180611787603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b69578181015183820152602001610b51565b50505050905090810190601f168015610b965780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610bc9578181015183820152602001610bb1565b50505050905090810190601f168015610bf65780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610c5d5760405162461bcd60e51b81526004018080602001828103825260388152602001806116e16038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610d095760405162461bcd60e51b81526004018080602001828103825260368152602001806117516036913960400191505060405180910390fd5b610d23600254610d176114eb565b9063ffffffff6114ef16565b821015610d615760405162461bcd60e51b81526004018080602001828103825260498152602001806117c46049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610dd0578181015183820152602001610db8565b50505050905090810190601f168015610dfd5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610e30578181015183820152602001610e18565b50505050905090810190601f168015610e5d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610f28578181015183820152602001610f10565b50505050905090810190601f168015610f555780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f88578181015183820152602001610f70565b50505050905090810190601f168015610fb55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b33301461100e5760405162461bcd60e51b81526004018080602001828103825260388152602001806117196038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b031633146110a75760405162461bcd60e51b81526004018080602001828103825260378152602001806115896037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111165781810151838201526020016110fe565b50505050905090810190601f1680156111435780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561117657818101518382015260200161115e565b50505050905090810190601f1680156111a35780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561126e578181015183820152602001611256565b50505050905090810190601f16801561129b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112ce5781810151838201526020016112b6565b50505050905090810190601f1680156112fb5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b6000546001600160a01b0316331461133157600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b62278d0081565b6202a30081565b6212750081565b3330146113a65760405162461bcd60e51b815260040180806020018281038252603181526020018061180d6031913960400191505060405180910390fd5b6202a3008110156113e85760405162461bcd60e51b81526004018080602001828103825260348152602001806116386034913960400191505060405180910390fd5b62278d0081111561142a5760405162461bcd60e51b815260040180806020018281038252603881526020018061166c6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b806001600160a01b031663e9c714f26040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156114ad57600080fd5b505af11580156114c1573d6000803e3d6000fd5b505050506040513d60208110156114d757600080fd5b505050565b6000546001600160a01b031681565b4290565b600082820183811015611549576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a7231582068ec5321074ec8daa9f039e745afff22458b2457a3dfb05d84331a522870a7a764736f6c63430005100032" 4 | } 5 | -------------------------------------------------------------------------------- /src/proposals/compound-alpha.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber, BytesLike, Contract, Signer, utils, ContractReceipt, ContractTransaction, BigNumberish } from "ethers"; 2 | import { FormatTypes, FunctionFragment, hexDataSlice } from "ethers/lib/utils"; 3 | import { Provider } from "@ethersproject/providers"; 4 | import { Result, defaultAbiCoder } from "ethers/lib/utils"; 5 | import { HardhatRuntimeEnvironment } from "hardhat/types"; 6 | import { HardhatPluginError } from "hardhat/plugins"; 7 | 8 | import { GovernorAlpha, GovernorAlpha__factory, VotingToken, VotingToken__factory } from "../ethers-contracts/index" 9 | import { Timelock__factory } from "../ethers-contracts/factories/Timelock__factory"; 10 | 11 | import { PACKAGE_NAME, errors } from "../constants" 12 | import { InternalProposalState, Proposal, ProposalBuilder } from "./proposal" 13 | import { ContractLike, ContractOptional, IAction } from "./types" 14 | import { toBigNumber } from "../util" 15 | 16 | // ---------- Helper Functions ---------- 17 | 18 | function loadGovernor(contract: ContractLike, provider: Provider) : GovernorAlpha { 19 | // If `contract` is already a type contract 20 | if (contract instanceof Contract) { 21 | return contract as GovernorAlpha 22 | } 23 | return GovernorAlpha__factory.connect(contract, provider) 24 | } 25 | 26 | function loadVotingToken(contract: ContractLike, provider: Provider) : VotingToken { 27 | // If `contract` is already a type contract 28 | if (contract instanceof Contract) { 29 | return contract as VotingToken 30 | } 31 | return VotingToken__factory.connect(contract, provider) 32 | } 33 | 34 | // -------------------- Define proposal states -------------------- 35 | 36 | export enum AlphaProposalState { 37 | PENDING, 38 | ACTIVE, 39 | CANCELED, 40 | DEFEATED, 41 | SUCCEDED, 42 | QUEUED, 43 | EXPIRED, 44 | EXECUTED, 45 | } 46 | 47 | // -------------------- Define proposal actions -------------------- 48 | 49 | export interface IAlphaProposalAction extends IAction { 50 | contract: ContractOptional 51 | args: Result 52 | } 53 | 54 | // -------------------- Define proposal -------------------- 55 | 56 | export class AlphaProposal extends Proposal { 57 | state: AlphaProposalState = AlphaProposalState.PENDING 58 | 59 | votingToken?: VotingToken; 60 | governor?: GovernorAlpha; 61 | 62 | proposer?: Signer; 63 | id: BigNumber = BigNumber.from("0"); 64 | description: string = ""; 65 | 66 | contracts: ContractOptional[] = [] 67 | args: Result[] = [] 68 | 69 | constructor(hre: HardhatRuntimeEnvironment, governor?: ContractLike, votingToken?: ContractLike) { 70 | super(hre) // call constructor on Proposal 71 | 72 | this.governor = governor ? loadGovernor(governor, this.getEthersProvider()) : undefined 73 | this.votingToken = votingToken ? loadVotingToken(votingToken, this.getEthersProvider()) : undefined 74 | } 75 | 76 | addAction(action: IAlphaProposalAction) { 77 | super.addAction(action) 78 | 79 | this.contracts.push(action.contract) 80 | this.args.push(action.args) 81 | } 82 | 83 | setProposer(proposer: Signer) {this.proposer = proposer} 84 | 85 | setGovernor(governor: ContractLike) {this.governor = loadGovernor(governor, this.getEthersProvider())} 86 | setVotingToken(votingToken: ContractLike) { 87 | this.votingToken = loadVotingToken(votingToken, this.getEthersProvider()) 88 | } 89 | 90 | public async propose(proposer?: Signer) { 91 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 92 | 93 | proposer = proposer ? proposer : this.proposer 94 | if (!proposer) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_PROPOSER); 95 | 96 | const governorAsProposer = this.governor.connect(proposer) 97 | 98 | const proposalId = await governorAsProposer 99 | .callStatic 100 | .propose(this.targets, this.values, this.signatures, this.calldatas, this.description); 101 | 102 | await governorAsProposer.propose( 103 | this.targets, 104 | this.values, 105 | this.signatures, 106 | this.calldatas, 107 | this.description) 108 | 109 | this.id = proposalId; 110 | 111 | this.markAsSubmitted() 112 | } 113 | 114 | public async loadProposal(data: BigNumberish): Promise { 115 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 116 | if (!this.votingToken) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_VOTING_TOKEN) 117 | 118 | let id = data; 119 | let proposal = new AlphaProposal(this.hre, this.governor, this.votingToken) 120 | proposal.markAsSubmitted() 121 | 122 | proposal.id = BigNumber.from(id); 123 | let proposalInfo = await this.governor.proposals(id) 124 | let actionsInfo = await this.governor.getActions(id) 125 | 126 | proposal.proposer = new this.hre.ethers.VoidSigner(proposalInfo.proposer) 127 | proposal.targets = actionsInfo.targets 128 | proposal.values = actionsInfo[1] // `values` gets overwrittn by array.values 129 | proposal.signatures = actionsInfo.signatures 130 | proposal.calldatas = actionsInfo.calldatas 131 | 132 | proposal.description = "" 133 | 134 | let args = [] 135 | 136 | for (let i = 0; i < proposal.targets.length; i++) { 137 | proposal.contracts.push(null) // push null to contracts. 138 | const signature = proposal.signatures[i]; 139 | const calldata = proposal.calldatas[i]; 140 | 141 | const arg = defaultAbiCoder.decode([ signature ], calldata); 142 | args.push(arg) 143 | } 144 | 145 | proposal.args = args 146 | 147 | return proposal 148 | } 149 | 150 | private async getProposalState(): Promise { 151 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 152 | if (this.internalState != InternalProposalState.SUBMITTED) { 153 | throw new HardhatPluginError(PACKAGE_NAME, errors.PROPOSAL_NOT_SUBMITTED) 154 | } 155 | const proposalState = await this.governor.state(this.id) 156 | 157 | return proposalState as AlphaProposalState 158 | } 159 | 160 | public async vote(signer: Signer, support: boolean=true) { 161 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 162 | 163 | if (this.internalState != InternalProposalState.SUBMITTED) { 164 | throw new HardhatPluginError(PACKAGE_NAME, errors.PROPOSAL_NOT_SUBMITTED) 165 | } 166 | 167 | let currentState = await this.getProposalState() 168 | if (currentState == AlphaProposalState.ACTIVE) { 169 | await this.governor.connect(signer).castVote(this.id, support) 170 | } else { 171 | throw new HardhatPluginError(PACKAGE_NAME, `Proposal is not in an active state, received ${currentState}`) 172 | } 173 | } 174 | 175 | public async queue(signer?: Signer) { 176 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 177 | 178 | if (this.internalState != InternalProposalState.SUBMITTED) { 179 | throw new HardhatPluginError(PACKAGE_NAME, errors.PROPOSAL_NOT_SUBMITTED) 180 | } 181 | 182 | signer = signer ? signer : this.proposer 183 | if (!signer) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_SIGNER); 184 | 185 | await this.governor.connect(signer).queue(this.id) 186 | } 187 | 188 | public async execute(signer?: Signer) { 189 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 190 | 191 | if (this.internalState != InternalProposalState.SUBMITTED) { 192 | throw new HardhatPluginError(PACKAGE_NAME, errors.PROPOSAL_NOT_SUBMITTED) 193 | } 194 | 195 | signer = signer ? signer : this.proposer 196 | if (!signer) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_SIGNER); 197 | 198 | await this.governor.connect(signer).execute(this.id) 199 | } 200 | 201 | /** 202 | * This method will simulate the proposal using the full on-chain process. 203 | * This may take significant time depending on the hardware you are using. 204 | * 205 | * @notice For this method to work the proposal must have a proposer with enough votes to reach quorem 206 | */ 207 | public async _fullSimulate() { 208 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 209 | if (!this.votingToken) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_VOTING_TOKEN) 210 | if (!this.proposer) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_PROPOSER) 211 | 212 | let provider = this.getEthersProvider() 213 | 214 | let proposerAddress = await this.proposer.getAddress() 215 | let quoremVotes = await this.governor.quorumVotes(); 216 | let proposerVotes = await this.votingToken.getCurrentVotes(proposerAddress) 217 | 218 | if (proposerVotes < quoremVotes) throw new HardhatPluginError(PACKAGE_NAME, errors.NOT_ENOUGH_VOTES) 219 | 220 | let timelock = Timelock__factory.connect(await this.governor.timelock(), provider) 221 | 222 | await this.propose() 223 | let votingDelay = await (await this.governor.votingDelay()).add(1) 224 | await this.mineBlocks(votingDelay) 225 | 226 | await this.vote(this.proposer, true) 227 | let votingPeriod = await this.governor.votingPeriod() 228 | await this.mineBlocks(votingPeriod) 229 | 230 | await this.queue() 231 | let delay = await timelock.delay() 232 | let blockInfo = await provider.getBlock("latest") 233 | let endTimeStamp = delay.add(blockInfo.timestamp).add("50").toNumber() 234 | await this.mineBlock(endTimeStamp) 235 | 236 | await this.execute() 237 | } 238 | 239 | // queues the action to the timelock by impersonating the governor 240 | // advances time in order to execute proposal 241 | // analyses errors 242 | public async _simulate() { 243 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 244 | 245 | let provider = this.getEthersProvider() 246 | 247 | await provider.send("hardhat_impersonateAccount", [this.governor.address]) 248 | await provider.send("hardhat_setBalance", [this.governor.address, "0xffffffffffffffff"]) 249 | let governorSigner = await this.hre.ethers.getSigner(this.governor.address) 250 | 251 | let timelock = Timelock__factory.connect(await this.governor.timelock(), governorSigner) 252 | 253 | await provider.send("hardhat_impersonateAccount", [timelock.address]) 254 | await provider.send("hardhat_setBalance", [timelock.address, "0xffffffffffffffff"]) 255 | let timelockSigner = provider.getSigner(timelock.address) 256 | 257 | let blockInfo = await provider.getBlock("latest") 258 | let delay = await timelock.delay() 259 | 260 | let eta = delay.add(blockInfo.timestamp).add("50") 261 | 262 | await provider.send("evm_setAutomine", [false]) 263 | for (let i = 0; i < this.targets.length; i++) { 264 | await timelock.queueTransaction(this.targets[i], this.values[i], this.signatures[i], this.calldatas[i], eta) 265 | } 266 | await this.mineBlocks(1) 267 | await this.mineBlock(eta.toNumber()) 268 | 269 | let receipts = new Array(); 270 | for (let i = 0; i < this.targets.length; i++) { 271 | await timelock.executeTransaction(this.targets[i], this.values[i], this.signatures[i], this.calldatas[i], eta).then( 272 | receipt => {receipts.push(receipt)}, 273 | async (timelockError) => { 274 | // analyse error 275 | let timelockErrorMessage = timelockError.error.message.match(/^[\w\s:]+'(.*)'$/m)[1] 276 | let contractErrorMesage 277 | 278 | // call the method on the contract as if it was the timelock 279 | // this will produce a more relavent message as to the failure of the action 280 | let contract = await this.contracts[i]?.connect(timelockSigner) 281 | if (contract) { 282 | await contract.callStatic[this.signatures[i]](...this.args[i]).catch(contractError => { 283 | contractErrorMesage = contractError.message.match(/^[\w\s:]+'(.*)'$/m)[1] 284 | }) 285 | } 286 | 287 | throw new HardhatPluginError(PACKAGE_NAME, 288 | `Proposal action ${i} failed. 289 | Target: ${this.targets[i]} 290 | Signature: ${this.signatures[i]} 291 | Args: ${this.args[i]}\n 292 | Timelock revert message: ${timelockErrorMessage} 293 | Contract revert message: ${contractErrorMesage}`) 294 | } 295 | ) 296 | } 297 | 298 | await this.mineBlock() 299 | for (let i = 0; i < this.targets.length; i++) { 300 | let r = await receipts[i].wait().catch(r => {return r.receipt as ContractReceipt}) 301 | if (r.status != 1) { 302 | throw new HardhatPluginError(PACKAGE_NAME, `Action ${i} failed`) 303 | } 304 | } 305 | await provider.send("evm_setAutomine", [true]) 306 | await provider.send("hardhat_stopImpersonatingAccount", [this.governor.address]) 307 | await provider.send("hardhat_stopImpersonatingAccount", [timelock.address]) 308 | } 309 | 310 | public async printProposalInfo() { 311 | if (!this.governor) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_GOVERNOR) 312 | if (!this.votingToken) throw new HardhatPluginError(PACKAGE_NAME, errors.NO_VOTING_TOKEN) 313 | 314 | console.log('--------------------------------------------------------') 315 | if (this.internalState == InternalProposalState.SUBMITTED) { 316 | const proposalInfo = await this.governor.proposals(this.id) 317 | const state = await this.getProposalState() 318 | 319 | let votingTokenName = await this.votingToken!.name(); 320 | let votingTokenDecimals = BigNumber.from("10").pow(await this.votingToken.decimals()); 321 | 322 | console.log(`Id: ${this.id.toString()}`) 323 | console.log(`Description: ${this.description}`) 324 | console.log(`For Votes: ${proposalInfo.forVotes.div(votingTokenDecimals)} ${votingTokenName} Votes`) 325 | console.log(`Agasint Votes: ${proposalInfo.againstVotes.div(votingTokenDecimals)} ${votingTokenName} Votes`) 326 | 327 | console.log(`Vote End: ${proposalInfo.endBlock}`) 328 | 329 | console.log(`State: ${state.toString()}`) 330 | } else { 331 | console.log("Unsubmitted proposal") 332 | console.log(`Description: ${this.description}`) 333 | } 334 | 335 | 336 | for (let i = 0; i < this.targets.length; i++) { 337 | const contract = this.contracts[i] 338 | const target = this.targets[i] 339 | const signature = this.signatures[i] 340 | const value = this.values[i] 341 | const args = this.args[i] 342 | 343 | let name = "" 344 | if (contract?.functions['name()'] != null) { 345 | name = (await contract.functions['name()']()).toString() 346 | } 347 | 348 | console.log(`Action ${i}`) 349 | if (name == "") { 350 | console.log(` ├─ target ───── ${target}`) 351 | } 352 | else { 353 | console.log(` ├─ target ───── ${target} (name: ${name})`) 354 | } 355 | if (!value.isZero()) { 356 | console.log(` ├─ value ────── ${utils.formatEther(value.toString())} ETH`) 357 | } 358 | console.log(` ├─ signature ── ${signature}`) 359 | for (let j = 0; j < args.length-1; j++) { 360 | const arg = args[j]; 361 | console.log(` ├─ args [ ${j} ] ─ ${arg}`) 362 | } 363 | console.log(` └─ args [ ${args.length-1} ] ─ ${args[args.length-1]}`) 364 | } 365 | } 366 | } 367 | 368 | // -------------------- Define proposal builder -------------------- 369 | 370 | export class AlphaProposalBuilder extends ProposalBuilder { 371 | maxActions: number; 372 | proposal: AlphaProposal 373 | 374 | constructor(hre: HardhatRuntimeEnvironment, governor?: ContractLike, votingToken?: ContractLike, maxActions=15) { 375 | super(hre) 376 | 377 | this.maxActions = maxActions; 378 | this.proposal = new AlphaProposal(hre, governor, votingToken) 379 | } 380 | setGovernor(governor: ContractLike): AlphaProposalBuilder { 381 | this.proposal.setGovernor(governor) 382 | 383 | return this; 384 | } 385 | 386 | setVotingToken(votingToken: ContractLike): AlphaProposalBuilder { 387 | this.proposal.setVotingToken(votingToken) 388 | 389 | return this; 390 | } 391 | 392 | 393 | addAction(target: string, value: BigNumberish, signature: string, calldata: BytesLike): AlphaProposalBuilder { 394 | if (this.proposal.targets.length >= this.maxActions) { 395 | throw new HardhatPluginError(PACKAGE_NAME, errors.TOO_MANY_ACTIONS); 396 | } 397 | 398 | value = toBigNumber(value) 399 | const contract = null 400 | const args = defaultAbiCoder.decode([ signature ], calldata); 401 | 402 | this.proposal.addAction({target, value, signature, calldata, contract, args}) 403 | return this; 404 | } 405 | 406 | addContractAction(contract: Contract, method: string, functionArgs: any[], value?: BigNumberish): AlphaProposalBuilder { 407 | if (this.proposal.targets.length >= this.maxActions) { 408 | throw new HardhatPluginError(PACKAGE_NAME, errors.TOO_MANY_ACTIONS); 409 | } 410 | 411 | value = value ? toBigNumber(value) : toBigNumber("0") 412 | const target = contract.address 413 | const functionFragment: FunctionFragment = contract.interface.getFunction(method); 414 | const signature = functionFragment.format(FormatTypes.sighash); 415 | 416 | if (functionFragment.inputs.length != functionArgs.length) { 417 | throw new HardhatPluginError(PACKAGE_NAME, "arguments length do not match signature") 418 | } 419 | 420 | // encode function call data 421 | const functionData = contract.interface.encodeFunctionData(functionFragment, functionArgs); 422 | const args = contract.interface.decodeFunctionData( 423 | functionFragment, 424 | functionData 425 | ); 426 | const calldata = hexDataSlice(functionData, 4); // Remove the sighash from the function data 427 | 428 | this.proposal.addAction({target, value, signature, calldata, contract, args}) 429 | return this; 430 | } 431 | 432 | setProposer(proposer: Signer): AlphaProposalBuilder { 433 | this.proposal.setProposer(proposer) 434 | 435 | return this; 436 | } 437 | 438 | /** 439 | * Set the description for the proposal 440 | * 441 | * Some UI interfaces for proposals require a newline `\n` 442 | * be added in the description to partition the proposal 443 | * title and the proposal description. It is at the users 444 | * descresion whether to add this or not. 445 | * 446 | * @param description The description field to set for the proposal 447 | */ 448 | setDescription(description: string): AlphaProposalBuilder { 449 | this.proposal.description = description; 450 | 451 | return this; 452 | } 453 | 454 | build() {return this.proposal} 455 | } 456 | -------------------------------------------------------------------------------- /src/ethers-contracts/Timelock.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | PayableOverrides, 16 | CallOverrides, 17 | } from "ethers"; 18 | import { BytesLike } from "@ethersproject/bytes"; 19 | import { Listener, Provider } from "@ethersproject/providers"; 20 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 21 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; 22 | 23 | interface TimelockInterface extends ethers.utils.Interface { 24 | functions: { 25 | "executeTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 26 | "acceptAdmin()": FunctionFragment; 27 | "pendingAdmin()": FunctionFragment; 28 | "queueTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 29 | "setPendingAdmin(address)": FunctionFragment; 30 | "cancelTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 31 | "delay()": FunctionFragment; 32 | "MAXIMUM_DELAY()": FunctionFragment; 33 | "MINIMUM_DELAY()": FunctionFragment; 34 | "GRACE_PERIOD()": FunctionFragment; 35 | "setDelay(uint256)": FunctionFragment; 36 | "queuedTransactions(bytes32)": FunctionFragment; 37 | "admin()": FunctionFragment; 38 | }; 39 | 40 | encodeFunctionData( 41 | functionFragment: "executeTransaction", 42 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 43 | ): string; 44 | encodeFunctionData( 45 | functionFragment: "acceptAdmin", 46 | values?: undefined 47 | ): string; 48 | encodeFunctionData( 49 | functionFragment: "pendingAdmin", 50 | values?: undefined 51 | ): string; 52 | encodeFunctionData( 53 | functionFragment: "queueTransaction", 54 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 55 | ): string; 56 | encodeFunctionData( 57 | functionFragment: "setPendingAdmin", 58 | values: [string] 59 | ): string; 60 | encodeFunctionData( 61 | functionFragment: "cancelTransaction", 62 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 63 | ): string; 64 | encodeFunctionData(functionFragment: "delay", values?: undefined): string; 65 | encodeFunctionData( 66 | functionFragment: "MAXIMUM_DELAY", 67 | values?: undefined 68 | ): string; 69 | encodeFunctionData( 70 | functionFragment: "MINIMUM_DELAY", 71 | values?: undefined 72 | ): string; 73 | encodeFunctionData( 74 | functionFragment: "GRACE_PERIOD", 75 | values?: undefined 76 | ): string; 77 | encodeFunctionData( 78 | functionFragment: "setDelay", 79 | values: [BigNumberish] 80 | ): string; 81 | encodeFunctionData( 82 | functionFragment: "queuedTransactions", 83 | values: [BytesLike] 84 | ): string; 85 | encodeFunctionData(functionFragment: "admin", values?: undefined): string; 86 | 87 | decodeFunctionResult( 88 | functionFragment: "executeTransaction", 89 | data: BytesLike 90 | ): Result; 91 | decodeFunctionResult( 92 | functionFragment: "acceptAdmin", 93 | data: BytesLike 94 | ): Result; 95 | decodeFunctionResult( 96 | functionFragment: "pendingAdmin", 97 | data: BytesLike 98 | ): Result; 99 | decodeFunctionResult( 100 | functionFragment: "queueTransaction", 101 | data: BytesLike 102 | ): Result; 103 | decodeFunctionResult( 104 | functionFragment: "setPendingAdmin", 105 | data: BytesLike 106 | ): Result; 107 | decodeFunctionResult( 108 | functionFragment: "cancelTransaction", 109 | data: BytesLike 110 | ): Result; 111 | decodeFunctionResult(functionFragment: "delay", data: BytesLike): Result; 112 | decodeFunctionResult( 113 | functionFragment: "MAXIMUM_DELAY", 114 | data: BytesLike 115 | ): Result; 116 | decodeFunctionResult( 117 | functionFragment: "MINIMUM_DELAY", 118 | data: BytesLike 119 | ): Result; 120 | decodeFunctionResult( 121 | functionFragment: "GRACE_PERIOD", 122 | data: BytesLike 123 | ): Result; 124 | decodeFunctionResult(functionFragment: "setDelay", data: BytesLike): Result; 125 | decodeFunctionResult( 126 | functionFragment: "queuedTransactions", 127 | data: BytesLike 128 | ): Result; 129 | decodeFunctionResult(functionFragment: "admin", data: BytesLike): Result; 130 | 131 | events: { 132 | "NewAdmin(address)": EventFragment; 133 | "NewPendingAdmin(address)": EventFragment; 134 | "NewDelay(uint256)": EventFragment; 135 | "CancelTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 136 | "ExecuteTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 137 | "QueueTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 138 | }; 139 | 140 | getEvent(nameOrSignatureOrTopic: "NewAdmin"): EventFragment; 141 | getEvent(nameOrSignatureOrTopic: "NewPendingAdmin"): EventFragment; 142 | getEvent(nameOrSignatureOrTopic: "NewDelay"): EventFragment; 143 | getEvent(nameOrSignatureOrTopic: "CancelTransaction"): EventFragment; 144 | getEvent(nameOrSignatureOrTopic: "ExecuteTransaction"): EventFragment; 145 | getEvent(nameOrSignatureOrTopic: "QueueTransaction"): EventFragment; 146 | } 147 | 148 | export class Timelock extends BaseContract { 149 | connect(signerOrProvider: Signer | Provider | string): this; 150 | attach(addressOrName: string): this; 151 | deployed(): Promise; 152 | 153 | listeners, EventArgsObject>( 154 | eventFilter?: TypedEventFilter 155 | ): Array>; 156 | off, EventArgsObject>( 157 | eventFilter: TypedEventFilter, 158 | listener: TypedListener 159 | ): this; 160 | on, EventArgsObject>( 161 | eventFilter: TypedEventFilter, 162 | listener: TypedListener 163 | ): this; 164 | once, EventArgsObject>( 165 | eventFilter: TypedEventFilter, 166 | listener: TypedListener 167 | ): this; 168 | removeListener, EventArgsObject>( 169 | eventFilter: TypedEventFilter, 170 | listener: TypedListener 171 | ): this; 172 | removeAllListeners, EventArgsObject>( 173 | eventFilter: TypedEventFilter 174 | ): this; 175 | 176 | listeners(eventName?: string): Array; 177 | off(eventName: string, listener: Listener): this; 178 | on(eventName: string, listener: Listener): this; 179 | once(eventName: string, listener: Listener): this; 180 | removeListener(eventName: string, listener: Listener): this; 181 | removeAllListeners(eventName?: string): this; 182 | 183 | queryFilter, EventArgsObject>( 184 | event: TypedEventFilter, 185 | fromBlockOrBlockhash?: string | number | undefined, 186 | toBlock?: string | number | undefined 187 | ): Promise>>; 188 | 189 | interface: TimelockInterface; 190 | 191 | functions: { 192 | executeTransaction( 193 | target: string, 194 | value: BigNumberish, 195 | signature: string, 196 | data: BytesLike, 197 | eta: BigNumberish, 198 | overrides?: PayableOverrides & { from?: string | Promise } 199 | ): Promise; 200 | 201 | acceptAdmin( 202 | overrides?: Overrides & { from?: string | Promise } 203 | ): Promise; 204 | 205 | pendingAdmin(overrides?: CallOverrides): Promise<[string]>; 206 | 207 | queueTransaction( 208 | target: string, 209 | value: BigNumberish, 210 | signature: string, 211 | data: BytesLike, 212 | eta: BigNumberish, 213 | overrides?: Overrides & { from?: string | Promise } 214 | ): Promise; 215 | 216 | setPendingAdmin( 217 | pendingAdmin_: string, 218 | overrides?: Overrides & { from?: string | Promise } 219 | ): Promise; 220 | 221 | cancelTransaction( 222 | target: string, 223 | value: BigNumberish, 224 | signature: string, 225 | data: BytesLike, 226 | eta: BigNumberish, 227 | overrides?: Overrides & { from?: string | Promise } 228 | ): Promise; 229 | 230 | delay(overrides?: CallOverrides): Promise<[BigNumber]>; 231 | 232 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise<[BigNumber]>; 233 | 234 | MINIMUM_DELAY(overrides?: CallOverrides): Promise<[BigNumber]>; 235 | 236 | GRACE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]>; 237 | 238 | setDelay( 239 | delay_: BigNumberish, 240 | overrides?: Overrides & { from?: string | Promise } 241 | ): Promise; 242 | 243 | queuedTransactions( 244 | arg0: BytesLike, 245 | overrides?: CallOverrides 246 | ): Promise<[boolean]>; 247 | 248 | admin(overrides?: CallOverrides): Promise<[string]>; 249 | }; 250 | 251 | executeTransaction( 252 | target: string, 253 | value: BigNumberish, 254 | signature: string, 255 | data: BytesLike, 256 | eta: BigNumberish, 257 | overrides?: PayableOverrides & { from?: string | Promise } 258 | ): Promise; 259 | 260 | acceptAdmin( 261 | overrides?: Overrides & { from?: string | Promise } 262 | ): Promise; 263 | 264 | pendingAdmin(overrides?: CallOverrides): Promise; 265 | 266 | queueTransaction( 267 | target: string, 268 | value: BigNumberish, 269 | signature: string, 270 | data: BytesLike, 271 | eta: BigNumberish, 272 | overrides?: Overrides & { from?: string | Promise } 273 | ): Promise; 274 | 275 | setPendingAdmin( 276 | pendingAdmin_: string, 277 | overrides?: Overrides & { from?: string | Promise } 278 | ): Promise; 279 | 280 | cancelTransaction( 281 | target: string, 282 | value: BigNumberish, 283 | signature: string, 284 | data: BytesLike, 285 | eta: BigNumberish, 286 | overrides?: Overrides & { from?: string | Promise } 287 | ): Promise; 288 | 289 | delay(overrides?: CallOverrides): Promise; 290 | 291 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 292 | 293 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 294 | 295 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 296 | 297 | setDelay( 298 | delay_: BigNumberish, 299 | overrides?: Overrides & { from?: string | Promise } 300 | ): Promise; 301 | 302 | queuedTransactions( 303 | arg0: BytesLike, 304 | overrides?: CallOverrides 305 | ): Promise; 306 | 307 | admin(overrides?: CallOverrides): Promise; 308 | 309 | callStatic: { 310 | executeTransaction( 311 | target: string, 312 | value: BigNumberish, 313 | signature: string, 314 | data: BytesLike, 315 | eta: BigNumberish, 316 | overrides?: CallOverrides 317 | ): Promise; 318 | 319 | acceptAdmin(overrides?: CallOverrides): Promise; 320 | 321 | pendingAdmin(overrides?: CallOverrides): Promise; 322 | 323 | queueTransaction( 324 | target: string, 325 | value: BigNumberish, 326 | signature: string, 327 | data: BytesLike, 328 | eta: BigNumberish, 329 | overrides?: CallOverrides 330 | ): Promise; 331 | 332 | setPendingAdmin( 333 | pendingAdmin_: string, 334 | overrides?: CallOverrides 335 | ): Promise; 336 | 337 | cancelTransaction( 338 | target: string, 339 | value: BigNumberish, 340 | signature: string, 341 | data: BytesLike, 342 | eta: BigNumberish, 343 | overrides?: CallOverrides 344 | ): Promise; 345 | 346 | delay(overrides?: CallOverrides): Promise; 347 | 348 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 349 | 350 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 351 | 352 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 353 | 354 | setDelay(delay_: BigNumberish, overrides?: CallOverrides): Promise; 355 | 356 | queuedTransactions( 357 | arg0: BytesLike, 358 | overrides?: CallOverrides 359 | ): Promise; 360 | 361 | admin(overrides?: CallOverrides): Promise; 362 | }; 363 | 364 | filters: { 365 | NewAdmin( 366 | newAdmin?: string | null 367 | ): TypedEventFilter<[string], { newAdmin: string }>; 368 | 369 | NewPendingAdmin( 370 | newPendingAdmin?: string | null 371 | ): TypedEventFilter<[string], { newPendingAdmin: string }>; 372 | 373 | NewDelay( 374 | newDelay?: BigNumberish | null 375 | ): TypedEventFilter<[BigNumber], { newDelay: BigNumber }>; 376 | 377 | CancelTransaction( 378 | txHash?: BytesLike | null, 379 | target?: string | null, 380 | value?: null, 381 | signature?: null, 382 | data?: null, 383 | eta?: null 384 | ): TypedEventFilter< 385 | [string, string, BigNumber, string, string, BigNumber], 386 | { 387 | txHash: string; 388 | target: string; 389 | value: BigNumber; 390 | signature: string; 391 | data: string; 392 | eta: BigNumber; 393 | } 394 | >; 395 | 396 | ExecuteTransaction( 397 | txHash?: BytesLike | null, 398 | target?: string | null, 399 | value?: null, 400 | signature?: null, 401 | data?: null, 402 | eta?: null 403 | ): TypedEventFilter< 404 | [string, string, BigNumber, string, string, BigNumber], 405 | { 406 | txHash: string; 407 | target: string; 408 | value: BigNumber; 409 | signature: string; 410 | data: string; 411 | eta: BigNumber; 412 | } 413 | >; 414 | 415 | QueueTransaction( 416 | txHash?: BytesLike | null, 417 | target?: string | null, 418 | value?: null, 419 | signature?: null, 420 | data?: null, 421 | eta?: null 422 | ): TypedEventFilter< 423 | [string, string, BigNumber, string, string, BigNumber], 424 | { 425 | txHash: string; 426 | target: string; 427 | value: BigNumber; 428 | signature: string; 429 | data: string; 430 | eta: BigNumber; 431 | } 432 | >; 433 | }; 434 | 435 | estimateGas: { 436 | executeTransaction( 437 | target: string, 438 | value: BigNumberish, 439 | signature: string, 440 | data: BytesLike, 441 | eta: BigNumberish, 442 | overrides?: PayableOverrides & { from?: string | Promise } 443 | ): Promise; 444 | 445 | acceptAdmin( 446 | overrides?: Overrides & { from?: string | Promise } 447 | ): Promise; 448 | 449 | pendingAdmin(overrides?: CallOverrides): Promise; 450 | 451 | queueTransaction( 452 | target: string, 453 | value: BigNumberish, 454 | signature: string, 455 | data: BytesLike, 456 | eta: BigNumberish, 457 | overrides?: Overrides & { from?: string | Promise } 458 | ): Promise; 459 | 460 | setPendingAdmin( 461 | pendingAdmin_: string, 462 | overrides?: Overrides & { from?: string | Promise } 463 | ): Promise; 464 | 465 | cancelTransaction( 466 | target: string, 467 | value: BigNumberish, 468 | signature: string, 469 | data: BytesLike, 470 | eta: BigNumberish, 471 | overrides?: Overrides & { from?: string | Promise } 472 | ): Promise; 473 | 474 | delay(overrides?: CallOverrides): Promise; 475 | 476 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 477 | 478 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 479 | 480 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 481 | 482 | setDelay( 483 | delay_: BigNumberish, 484 | overrides?: Overrides & { from?: string | Promise } 485 | ): Promise; 486 | 487 | queuedTransactions( 488 | arg0: BytesLike, 489 | overrides?: CallOverrides 490 | ): Promise; 491 | 492 | admin(overrides?: CallOverrides): Promise; 493 | }; 494 | 495 | populateTransaction: { 496 | executeTransaction( 497 | target: string, 498 | value: BigNumberish, 499 | signature: string, 500 | data: BytesLike, 501 | eta: BigNumberish, 502 | overrides?: PayableOverrides & { from?: string | Promise } 503 | ): Promise; 504 | 505 | acceptAdmin( 506 | overrides?: Overrides & { from?: string | Promise } 507 | ): Promise; 508 | 509 | pendingAdmin(overrides?: CallOverrides): Promise; 510 | 511 | queueTransaction( 512 | target: string, 513 | value: BigNumberish, 514 | signature: string, 515 | data: BytesLike, 516 | eta: BigNumberish, 517 | overrides?: Overrides & { from?: string | Promise } 518 | ): Promise; 519 | 520 | setPendingAdmin( 521 | pendingAdmin_: string, 522 | overrides?: Overrides & { from?: string | Promise } 523 | ): Promise; 524 | 525 | cancelTransaction( 526 | target: string, 527 | value: BigNumberish, 528 | signature: string, 529 | data: BytesLike, 530 | eta: BigNumberish, 531 | overrides?: Overrides & { from?: string | Promise } 532 | ): Promise; 533 | 534 | delay(overrides?: CallOverrides): Promise; 535 | 536 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 537 | 538 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 539 | 540 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 541 | 542 | setDelay( 543 | delay_: BigNumberish, 544 | overrides?: Overrides & { from?: string | Promise } 545 | ): Promise; 546 | 547 | queuedTransactions( 548 | arg0: BytesLike, 549 | overrides?: CallOverrides 550 | ): Promise; 551 | 552 | admin(overrides?: CallOverrides): Promise; 553 | }; 554 | } 555 | -------------------------------------------------------------------------------- /artifacts/votingToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"inputs":[{"internalType":"address","name":"account","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","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":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}], 3 | "bytecode": "60806040523480156200001157600080fd5b5060405162001bd038038062001bd08339810160408190526200003491620000bc565b6001600160a01b03811660008181526001602052604080822080546001600160601b0319166a084595161401484a00000090811790915590517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef916200009a91620000f6565b60405180910390a35062000135565b8051620000b6816200011b565b92915050565b600060208284031215620000cf57600080fd5b6000620000dd8484620000a9565b949350505050565b620000f08162000118565b82525050565b60208101620000b68284620000e5565b60006001600160a01b038216620000b6565b90565b620001268162000106565b81146200013257600080fd5b50565b611a8b80620001456000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b919061173c565b60405180910390f35b610157610152366004611205565b6102e5565b60405161013b9190611692565b61016c6103a2565b60405161013b91906116a0565b61016c6103b1565b61015761018f3660046111b8565b6103c8565b61019c61050d565b60405161013b91906117d6565b6101bc6101b7366004611158565b610512565b60405161013b9190611684565b6101dc6101d7366004611158565b61052d565b005b6101f16101ec366004611158565b61053a565b60405161013b91906117ad565b61016c61020c366004611158565b610552565b61022461021f366004611205565b610576565b60405161013b91906117f2565b61016c61023f366004611158565b61078d565b61012e61079f565b61015761025a366004611205565b6107bf565b61022461026d366004611158565b6107fb565b6101dc610280366004611235565b61086b565b61016c61029336600461117e565b610a55565b61016c610a87565b6102b36102ae3660046112bc565b610a93565b60405161013b9291906117bb565b6040518060400160405280600881526020016710dbdb5c1bdd5b9960c21b81525081565b6000806000198314156102fb5750600019610320565b61031d8360405180606001604052806025815260200161190e60259139610ac8565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061038e9085906117e4565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b6040516103bd9061166e565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261041e928892919061190e90830139610ac8565b9050866001600160a01b0316836001600160a01b03161415801561044b57506001600160601b0382811614155b156104f357600061047583836040518060600160405280603d81526020016119e5603d9139610af7565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104e99085906117e4565b60405180910390a3505b6104fe878783610b36565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105373382610ce1565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105a05760405162461bcd60e51b81526004016105979061176d565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105ce57600091505061039c565b6001600160a01b038416600090815260036020908152604080832063ffffffff60001986018116855292529091205416831061064a576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061039c565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068557600091505061039c565b600060001982015b8163ffffffff168163ffffffff16111561074857600282820363ffffffff160481036106b7611115565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152908714156107235760200151945061039c9350505050565b805163ffffffff1687111561073a57819350610741565b6001820392505b505061068d565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060048152602001630434f4d560e41b81525081565b6000806107e48360405180606001604052806026815260200161193360269139610ac8565b90506107f1338583610b36565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610826576000610506565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108799061166e565b60408051918290038220828201909152600882526710dbdb5c1bdd5b9960c21b6020909201919091527f561ca898cce9f021c15a441ef41899706e923541cee724530075d1a1144761c76108cb610d6b565b306040516020016108df94939291906116ec565b604051602081830303815290604052805190602001209050600060405161090590611679565b604051908190038120610920918a908a908a906020016116ae565b6040516020818303038152906040528051906020012090506000828260405160200161094d92919061163d565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161098a9493929190611721565b6020604051602081039080840390855afa1580156109ac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109df5760405162461bcd60e51b81526004016105979061174d565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a1e5760405162461bcd60e51b81526004016105979061177d565b87421115610a3e5760405162461bcd60e51b81526004016105979061175d565b610a48818b610ce1565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103bd90611679565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610aef5760405162461bcd60e51b8152600401610597919061173c565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b2e5760405162461bcd60e51b8152600401610597919061173c565b505050900390565b6001600160a01b038316610b5c5760405162461bcd60e51b81526004016105979061179d565b6001600160a01b038216610b825760405162461bcd60e51b81526004016105979061178d565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bcd936001600160601b0390921692859291906118d890830139610af7565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c3594919091169285929091906119b590830139610d6f565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ca29085906117e4565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610cdc92918216911683610dab565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d65828483610dab565b50505050565b4690565b6000838301826001600160601b038087169083161015610da25760405162461bcd60e51b8152600401610597919061173c565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610dd657506000816001600160601b0316115b15610cdc576001600160a01b03831615610e8e576001600160a01b03831660009081526004602052604081205463ffffffff169081610e16576000610e55565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e7c828560405180606001604052806028815260200161198d60289139610af7565b9050610e8a86848484610f39565b5050505b6001600160a01b03821615610cdc576001600160a01b03821660009081526004602052604081205463ffffffff169081610ec9576000610f08565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f2f8285604051806060016040528060278152602001611a2260279139610d6f565b9050610a4d858484845b6000610f5d43604051806060016040528060348152602001611959603491396110ee565b905060008463ffffffff16118015610fa657506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611005576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110a4565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110df929190611800565b60405180910390a25050505050565b600081600160201b8410610aef5760405162461bcd60e51b8152600401610597919061173c565b604080518082019091526000808252602082015290565b803561039c816118a8565b803561039c816118bc565b803561039c816118c5565b803561039c816118ce565b60006020828403121561116a57600080fd5b6000611176848461112c565b949350505050565b6000806040838503121561119157600080fd5b600061119d858561112c565b92505060206111ae8582860161112c565b9150509250929050565b6000806000606084860312156111cd57600080fd5b60006111d9868661112c565b93505060206111ea8682870161112c565b92505060406111fb86828701611137565b9150509250925092565b6000806040838503121561121857600080fd5b6000611224858561112c565b92505060206111ae85828601611137565b60008060008060008060c0878903121561124e57600080fd5b600061125a898961112c565b965050602061126b89828a01611137565b955050604061127c89828a01611137565b945050606061128d89828a0161114d565b935050608061129e89828a01611137565b92505060a06112af89828a01611137565b9150509295509295509295565b600080604083850312156112cf57600080fd5b60006112db858561112c565b92505060206111ae85828601611142565b6112f58161182d565b82525050565b6112f581611838565b6112f58161183d565b6112f56113198261183d565b61183d565b60006113298261181b565b611333818561181f565b9350611343818560208601611872565b61134c8161189e565b9093019392505050565b600061136360268361181f565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b60006113ab60268361181f565b7f436f6d703a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b60006113f3600283611828565b61190160f01b815260020192915050565b600061141160278361181f565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b600061145a60228361181f565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b600061149e603a8361181f565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b60006114fd604383611828565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611568603c8361181f565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006115c7603a83611828565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6112f58161184c565b6112f581611855565b6112f581611867565b6112f58161185b565b6000611648826113e6565b9150611654828561130d565b602082019150611664828461130d565b5060200192915050565b600061039c826114f0565b600061039c826115ba565b6020810161039c82846112ec565b6020810161039c82846112fb565b6020810161039c8284611304565b608081016116bc8287611304565b6116c960208301866112ec565b6116d66040830185611304565b6116e36060830184611304565b95945050505050565b608081016116fa8287611304565b6117076020830186611304565b6117146040830185611304565b6116e360608301846112ec565b6080810161172f8287611304565b6116c96020830186611622565b60208082528101610506818461131e565b6020808252810161039c81611356565b6020808252810161039c8161139e565b6020808252810161039c81611404565b6020808252810161039c8161144d565b6020808252810161039c81611491565b6020808252810161039c8161155b565b6020810161039c8284611619565b604081016117c98285611619565b6105066020830184611634565b6020810161039c8284611622565b6020810161039c828461162b565b6020810161039c8284611634565b6040810161180e828561162b565b610506602083018461162b565b5190565b90815260200190565b919050565b600061039c82611840565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061039c8261185b565b60005b8381101561188d578181015183820152602001611875565b83811115610d655750506000910152565b601f01601f191690565b6118b18161182d565b811461053757600080fd5b6118b18161183d565b6118b18161184c565b6118b18161185556fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a723158206589d4ace0383947c7f0391417a2336732243d255d673f763411bc1dfffc84c96c6578706572696d656e74616cf564736f6c63430005100040" 4 | } 5 | -------------------------------------------------------------------------------- /src/ethers-contracts/TimelockTest.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | PayableOverrides, 16 | CallOverrides, 17 | } from "ethers"; 18 | import { BytesLike } from "@ethersproject/bytes"; 19 | import { Listener, Provider } from "@ethersproject/providers"; 20 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 21 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; 22 | 23 | interface TimelockTestInterface extends ethers.utils.Interface { 24 | functions: { 25 | "GRACE_PERIOD()": FunctionFragment; 26 | "MAXIMUM_DELAY()": FunctionFragment; 27 | "MINIMUM_DELAY()": FunctionFragment; 28 | "acceptAdmin()": FunctionFragment; 29 | "admin()": FunctionFragment; 30 | "cancelTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 31 | "delay()": FunctionFragment; 32 | "executeTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 33 | "harnessAcceptAdmin(address)": FunctionFragment; 34 | "harnessSetAdmin(address)": FunctionFragment; 35 | "pendingAdmin()": FunctionFragment; 36 | "queueTransaction(address,uint256,string,bytes,uint256)": FunctionFragment; 37 | "queuedTransactions(bytes32)": FunctionFragment; 38 | "setDelay(uint256)": FunctionFragment; 39 | "setPendingAdmin(address)": FunctionFragment; 40 | }; 41 | 42 | encodeFunctionData( 43 | functionFragment: "GRACE_PERIOD", 44 | values?: undefined 45 | ): string; 46 | encodeFunctionData( 47 | functionFragment: "MAXIMUM_DELAY", 48 | values?: undefined 49 | ): string; 50 | encodeFunctionData( 51 | functionFragment: "MINIMUM_DELAY", 52 | values?: undefined 53 | ): string; 54 | encodeFunctionData( 55 | functionFragment: "acceptAdmin", 56 | values?: undefined 57 | ): string; 58 | encodeFunctionData(functionFragment: "admin", values?: undefined): string; 59 | encodeFunctionData( 60 | functionFragment: "cancelTransaction", 61 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 62 | ): string; 63 | encodeFunctionData(functionFragment: "delay", values?: undefined): string; 64 | encodeFunctionData( 65 | functionFragment: "executeTransaction", 66 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 67 | ): string; 68 | encodeFunctionData( 69 | functionFragment: "harnessAcceptAdmin", 70 | values: [string] 71 | ): string; 72 | encodeFunctionData( 73 | functionFragment: "harnessSetAdmin", 74 | values: [string] 75 | ): string; 76 | encodeFunctionData( 77 | functionFragment: "pendingAdmin", 78 | values?: undefined 79 | ): string; 80 | encodeFunctionData( 81 | functionFragment: "queueTransaction", 82 | values: [string, BigNumberish, string, BytesLike, BigNumberish] 83 | ): string; 84 | encodeFunctionData( 85 | functionFragment: "queuedTransactions", 86 | values: [BytesLike] 87 | ): string; 88 | encodeFunctionData( 89 | functionFragment: "setDelay", 90 | values: [BigNumberish] 91 | ): string; 92 | encodeFunctionData( 93 | functionFragment: "setPendingAdmin", 94 | values: [string] 95 | ): string; 96 | 97 | decodeFunctionResult( 98 | functionFragment: "GRACE_PERIOD", 99 | data: BytesLike 100 | ): Result; 101 | decodeFunctionResult( 102 | functionFragment: "MAXIMUM_DELAY", 103 | data: BytesLike 104 | ): Result; 105 | decodeFunctionResult( 106 | functionFragment: "MINIMUM_DELAY", 107 | data: BytesLike 108 | ): Result; 109 | decodeFunctionResult( 110 | functionFragment: "acceptAdmin", 111 | data: BytesLike 112 | ): Result; 113 | decodeFunctionResult(functionFragment: "admin", data: BytesLike): Result; 114 | decodeFunctionResult( 115 | functionFragment: "cancelTransaction", 116 | data: BytesLike 117 | ): Result; 118 | decodeFunctionResult(functionFragment: "delay", data: BytesLike): Result; 119 | decodeFunctionResult( 120 | functionFragment: "executeTransaction", 121 | data: BytesLike 122 | ): Result; 123 | decodeFunctionResult( 124 | functionFragment: "harnessAcceptAdmin", 125 | data: BytesLike 126 | ): Result; 127 | decodeFunctionResult( 128 | functionFragment: "harnessSetAdmin", 129 | data: BytesLike 130 | ): Result; 131 | decodeFunctionResult( 132 | functionFragment: "pendingAdmin", 133 | data: BytesLike 134 | ): Result; 135 | decodeFunctionResult( 136 | functionFragment: "queueTransaction", 137 | data: BytesLike 138 | ): Result; 139 | decodeFunctionResult( 140 | functionFragment: "queuedTransactions", 141 | data: BytesLike 142 | ): Result; 143 | decodeFunctionResult(functionFragment: "setDelay", data: BytesLike): Result; 144 | decodeFunctionResult( 145 | functionFragment: "setPendingAdmin", 146 | data: BytesLike 147 | ): Result; 148 | 149 | events: { 150 | "CancelTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 151 | "ExecuteTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 152 | "NewAdmin(address)": EventFragment; 153 | "NewDelay(uint256)": EventFragment; 154 | "NewPendingAdmin(address)": EventFragment; 155 | "QueueTransaction(bytes32,address,uint256,string,bytes,uint256)": EventFragment; 156 | }; 157 | 158 | getEvent(nameOrSignatureOrTopic: "CancelTransaction"): EventFragment; 159 | getEvent(nameOrSignatureOrTopic: "ExecuteTransaction"): EventFragment; 160 | getEvent(nameOrSignatureOrTopic: "NewAdmin"): EventFragment; 161 | getEvent(nameOrSignatureOrTopic: "NewDelay"): EventFragment; 162 | getEvent(nameOrSignatureOrTopic: "NewPendingAdmin"): EventFragment; 163 | getEvent(nameOrSignatureOrTopic: "QueueTransaction"): EventFragment; 164 | } 165 | 166 | export class TimelockTest extends BaseContract { 167 | connect(signerOrProvider: Signer | Provider | string): this; 168 | attach(addressOrName: string): this; 169 | deployed(): Promise; 170 | 171 | listeners, EventArgsObject>( 172 | eventFilter?: TypedEventFilter 173 | ): Array>; 174 | off, EventArgsObject>( 175 | eventFilter: TypedEventFilter, 176 | listener: TypedListener 177 | ): this; 178 | on, EventArgsObject>( 179 | eventFilter: TypedEventFilter, 180 | listener: TypedListener 181 | ): this; 182 | once, EventArgsObject>( 183 | eventFilter: TypedEventFilter, 184 | listener: TypedListener 185 | ): this; 186 | removeListener, EventArgsObject>( 187 | eventFilter: TypedEventFilter, 188 | listener: TypedListener 189 | ): this; 190 | removeAllListeners, EventArgsObject>( 191 | eventFilter: TypedEventFilter 192 | ): this; 193 | 194 | listeners(eventName?: string): Array; 195 | off(eventName: string, listener: Listener): this; 196 | on(eventName: string, listener: Listener): this; 197 | once(eventName: string, listener: Listener): this; 198 | removeListener(eventName: string, listener: Listener): this; 199 | removeAllListeners(eventName?: string): this; 200 | 201 | queryFilter, EventArgsObject>( 202 | event: TypedEventFilter, 203 | fromBlockOrBlockhash?: string | number | undefined, 204 | toBlock?: string | number | undefined 205 | ): Promise>>; 206 | 207 | interface: TimelockTestInterface; 208 | 209 | functions: { 210 | GRACE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]>; 211 | 212 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise<[BigNumber]>; 213 | 214 | MINIMUM_DELAY(overrides?: CallOverrides): Promise<[BigNumber]>; 215 | 216 | acceptAdmin( 217 | overrides?: Overrides & { from?: string | Promise } 218 | ): Promise; 219 | 220 | admin(overrides?: CallOverrides): Promise<[string]>; 221 | 222 | cancelTransaction( 223 | target: string, 224 | value: BigNumberish, 225 | signature: string, 226 | data: BytesLike, 227 | eta: BigNumberish, 228 | overrides?: Overrides & { from?: string | Promise } 229 | ): Promise; 230 | 231 | delay(overrides?: CallOverrides): Promise<[BigNumber]>; 232 | 233 | executeTransaction( 234 | target: string, 235 | value: BigNumberish, 236 | signature: string, 237 | data: BytesLike, 238 | eta: BigNumberish, 239 | overrides?: PayableOverrides & { from?: string | Promise } 240 | ): Promise; 241 | 242 | harnessAcceptAdmin( 243 | administered: string, 244 | overrides?: Overrides & { from?: string | Promise } 245 | ): Promise; 246 | 247 | harnessSetAdmin( 248 | admin_: string, 249 | overrides?: Overrides & { from?: string | Promise } 250 | ): Promise; 251 | 252 | pendingAdmin(overrides?: CallOverrides): Promise<[string]>; 253 | 254 | queueTransaction( 255 | target: string, 256 | value: BigNumberish, 257 | signature: string, 258 | data: BytesLike, 259 | eta: BigNumberish, 260 | overrides?: Overrides & { from?: string | Promise } 261 | ): Promise; 262 | 263 | queuedTransactions( 264 | arg0: BytesLike, 265 | overrides?: CallOverrides 266 | ): Promise<[boolean]>; 267 | 268 | setDelay( 269 | delay_: BigNumberish, 270 | overrides?: Overrides & { from?: string | Promise } 271 | ): Promise; 272 | 273 | setPendingAdmin( 274 | pendingAdmin_: string, 275 | overrides?: Overrides & { from?: string | Promise } 276 | ): Promise; 277 | }; 278 | 279 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 280 | 281 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 282 | 283 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 284 | 285 | acceptAdmin( 286 | overrides?: Overrides & { from?: string | Promise } 287 | ): Promise; 288 | 289 | admin(overrides?: CallOverrides): Promise; 290 | 291 | cancelTransaction( 292 | target: string, 293 | value: BigNumberish, 294 | signature: string, 295 | data: BytesLike, 296 | eta: BigNumberish, 297 | overrides?: Overrides & { from?: string | Promise } 298 | ): Promise; 299 | 300 | delay(overrides?: CallOverrides): Promise; 301 | 302 | executeTransaction( 303 | target: string, 304 | value: BigNumberish, 305 | signature: string, 306 | data: BytesLike, 307 | eta: BigNumberish, 308 | overrides?: PayableOverrides & { from?: string | Promise } 309 | ): Promise; 310 | 311 | harnessAcceptAdmin( 312 | administered: string, 313 | overrides?: Overrides & { from?: string | Promise } 314 | ): Promise; 315 | 316 | harnessSetAdmin( 317 | admin_: string, 318 | overrides?: Overrides & { from?: string | Promise } 319 | ): Promise; 320 | 321 | pendingAdmin(overrides?: CallOverrides): Promise; 322 | 323 | queueTransaction( 324 | target: string, 325 | value: BigNumberish, 326 | signature: string, 327 | data: BytesLike, 328 | eta: BigNumberish, 329 | overrides?: Overrides & { from?: string | Promise } 330 | ): Promise; 331 | 332 | queuedTransactions( 333 | arg0: BytesLike, 334 | overrides?: CallOverrides 335 | ): Promise; 336 | 337 | setDelay( 338 | delay_: BigNumberish, 339 | overrides?: Overrides & { from?: string | Promise } 340 | ): Promise; 341 | 342 | setPendingAdmin( 343 | pendingAdmin_: string, 344 | overrides?: Overrides & { from?: string | Promise } 345 | ): Promise; 346 | 347 | callStatic: { 348 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 349 | 350 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 351 | 352 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 353 | 354 | acceptAdmin(overrides?: CallOverrides): Promise; 355 | 356 | admin(overrides?: CallOverrides): Promise; 357 | 358 | cancelTransaction( 359 | target: string, 360 | value: BigNumberish, 361 | signature: string, 362 | data: BytesLike, 363 | eta: BigNumberish, 364 | overrides?: CallOverrides 365 | ): Promise; 366 | 367 | delay(overrides?: CallOverrides): Promise; 368 | 369 | executeTransaction( 370 | target: string, 371 | value: BigNumberish, 372 | signature: string, 373 | data: BytesLike, 374 | eta: BigNumberish, 375 | overrides?: CallOverrides 376 | ): Promise; 377 | 378 | harnessAcceptAdmin( 379 | administered: string, 380 | overrides?: CallOverrides 381 | ): Promise; 382 | 383 | harnessSetAdmin(admin_: string, overrides?: CallOverrides): Promise; 384 | 385 | pendingAdmin(overrides?: CallOverrides): Promise; 386 | 387 | queueTransaction( 388 | target: string, 389 | value: BigNumberish, 390 | signature: string, 391 | data: BytesLike, 392 | eta: BigNumberish, 393 | overrides?: CallOverrides 394 | ): Promise; 395 | 396 | queuedTransactions( 397 | arg0: BytesLike, 398 | overrides?: CallOverrides 399 | ): Promise; 400 | 401 | setDelay(delay_: BigNumberish, overrides?: CallOverrides): Promise; 402 | 403 | setPendingAdmin( 404 | pendingAdmin_: string, 405 | overrides?: CallOverrides 406 | ): Promise; 407 | }; 408 | 409 | filters: { 410 | CancelTransaction( 411 | txHash?: BytesLike | null, 412 | target?: string | null, 413 | value?: null, 414 | signature?: null, 415 | data?: null, 416 | eta?: null 417 | ): TypedEventFilter< 418 | [string, string, BigNumber, string, string, BigNumber], 419 | { 420 | txHash: string; 421 | target: string; 422 | value: BigNumber; 423 | signature: string; 424 | data: string; 425 | eta: BigNumber; 426 | } 427 | >; 428 | 429 | ExecuteTransaction( 430 | txHash?: BytesLike | null, 431 | target?: string | null, 432 | value?: null, 433 | signature?: null, 434 | data?: null, 435 | eta?: null 436 | ): TypedEventFilter< 437 | [string, string, BigNumber, string, string, BigNumber], 438 | { 439 | txHash: string; 440 | target: string; 441 | value: BigNumber; 442 | signature: string; 443 | data: string; 444 | eta: BigNumber; 445 | } 446 | >; 447 | 448 | NewAdmin( 449 | newAdmin?: string | null 450 | ): TypedEventFilter<[string], { newAdmin: string }>; 451 | 452 | NewDelay( 453 | newDelay?: BigNumberish | null 454 | ): TypedEventFilter<[BigNumber], { newDelay: BigNumber }>; 455 | 456 | NewPendingAdmin( 457 | newPendingAdmin?: string | null 458 | ): TypedEventFilter<[string], { newPendingAdmin: string }>; 459 | 460 | QueueTransaction( 461 | txHash?: BytesLike | null, 462 | target?: string | null, 463 | value?: null, 464 | signature?: null, 465 | data?: null, 466 | eta?: null 467 | ): TypedEventFilter< 468 | [string, string, BigNumber, string, string, BigNumber], 469 | { 470 | txHash: string; 471 | target: string; 472 | value: BigNumber; 473 | signature: string; 474 | data: string; 475 | eta: BigNumber; 476 | } 477 | >; 478 | }; 479 | 480 | estimateGas: { 481 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 482 | 483 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 484 | 485 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 486 | 487 | acceptAdmin( 488 | overrides?: Overrides & { from?: string | Promise } 489 | ): Promise; 490 | 491 | admin(overrides?: CallOverrides): Promise; 492 | 493 | cancelTransaction( 494 | target: string, 495 | value: BigNumberish, 496 | signature: string, 497 | data: BytesLike, 498 | eta: BigNumberish, 499 | overrides?: Overrides & { from?: string | Promise } 500 | ): Promise; 501 | 502 | delay(overrides?: CallOverrides): Promise; 503 | 504 | executeTransaction( 505 | target: string, 506 | value: BigNumberish, 507 | signature: string, 508 | data: BytesLike, 509 | eta: BigNumberish, 510 | overrides?: PayableOverrides & { from?: string | Promise } 511 | ): Promise; 512 | 513 | harnessAcceptAdmin( 514 | administered: string, 515 | overrides?: Overrides & { from?: string | Promise } 516 | ): Promise; 517 | 518 | harnessSetAdmin( 519 | admin_: string, 520 | overrides?: Overrides & { from?: string | Promise } 521 | ): Promise; 522 | 523 | pendingAdmin(overrides?: CallOverrides): Promise; 524 | 525 | queueTransaction( 526 | target: string, 527 | value: BigNumberish, 528 | signature: string, 529 | data: BytesLike, 530 | eta: BigNumberish, 531 | overrides?: Overrides & { from?: string | Promise } 532 | ): Promise; 533 | 534 | queuedTransactions( 535 | arg0: BytesLike, 536 | overrides?: CallOverrides 537 | ): Promise; 538 | 539 | setDelay( 540 | delay_: BigNumberish, 541 | overrides?: Overrides & { from?: string | Promise } 542 | ): Promise; 543 | 544 | setPendingAdmin( 545 | pendingAdmin_: string, 546 | overrides?: Overrides & { from?: string | Promise } 547 | ): Promise; 548 | }; 549 | 550 | populateTransaction: { 551 | GRACE_PERIOD(overrides?: CallOverrides): Promise; 552 | 553 | MAXIMUM_DELAY(overrides?: CallOverrides): Promise; 554 | 555 | MINIMUM_DELAY(overrides?: CallOverrides): Promise; 556 | 557 | acceptAdmin( 558 | overrides?: Overrides & { from?: string | Promise } 559 | ): Promise; 560 | 561 | admin(overrides?: CallOverrides): Promise; 562 | 563 | cancelTransaction( 564 | target: string, 565 | value: BigNumberish, 566 | signature: string, 567 | data: BytesLike, 568 | eta: BigNumberish, 569 | overrides?: Overrides & { from?: string | Promise } 570 | ): Promise; 571 | 572 | delay(overrides?: CallOverrides): Promise; 573 | 574 | executeTransaction( 575 | target: string, 576 | value: BigNumberish, 577 | signature: string, 578 | data: BytesLike, 579 | eta: BigNumberish, 580 | overrides?: PayableOverrides & { from?: string | Promise } 581 | ): Promise; 582 | 583 | harnessAcceptAdmin( 584 | administered: string, 585 | overrides?: Overrides & { from?: string | Promise } 586 | ): Promise; 587 | 588 | harnessSetAdmin( 589 | admin_: string, 590 | overrides?: Overrides & { from?: string | Promise } 591 | ): Promise; 592 | 593 | pendingAdmin(overrides?: CallOverrides): Promise; 594 | 595 | queueTransaction( 596 | target: string, 597 | value: BigNumberish, 598 | signature: string, 599 | data: BytesLike, 600 | eta: BigNumberish, 601 | overrides?: Overrides & { from?: string | Promise } 602 | ): Promise; 603 | 604 | queuedTransactions( 605 | arg0: BytesLike, 606 | overrides?: CallOverrides 607 | ): Promise; 608 | 609 | setDelay( 610 | delay_: BigNumberish, 611 | overrides?: Overrides & { from?: string | Promise } 612 | ): Promise; 613 | 614 | setPendingAdmin( 615 | pendingAdmin_: string, 616 | overrides?: Overrides & { from?: string | Promise } 617 | ): Promise; 618 | }; 619 | } 620 | -------------------------------------------------------------------------------- /src/ethers-contracts/Comp.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | CallOverrides, 16 | } from "ethers"; 17 | import { BytesLike } from "@ethersproject/bytes"; 18 | import { Listener, Provider } from "@ethersproject/providers"; 19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 20 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; 21 | 22 | interface CompInterface extends ethers.utils.Interface { 23 | functions: { 24 | "DELEGATION_TYPEHASH()": FunctionFragment; 25 | "DOMAIN_TYPEHASH()": FunctionFragment; 26 | "allowance(address,address)": FunctionFragment; 27 | "approve(address,uint256)": FunctionFragment; 28 | "balanceOf(address)": FunctionFragment; 29 | "checkpoints(address,uint32)": FunctionFragment; 30 | "decimals()": FunctionFragment; 31 | "delegate(address)": FunctionFragment; 32 | "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; 33 | "delegates(address)": FunctionFragment; 34 | "getCurrentVotes(address)": FunctionFragment; 35 | "getPriorVotes(address,uint256)": FunctionFragment; 36 | "name()": FunctionFragment; 37 | "nonces(address)": FunctionFragment; 38 | "numCheckpoints(address)": FunctionFragment; 39 | "symbol()": FunctionFragment; 40 | "totalSupply()": FunctionFragment; 41 | "transfer(address,uint256)": FunctionFragment; 42 | "transferFrom(address,address,uint256)": FunctionFragment; 43 | }; 44 | 45 | encodeFunctionData( 46 | functionFragment: "DELEGATION_TYPEHASH", 47 | values?: undefined 48 | ): string; 49 | encodeFunctionData( 50 | functionFragment: "DOMAIN_TYPEHASH", 51 | values?: undefined 52 | ): string; 53 | encodeFunctionData( 54 | functionFragment: "allowance", 55 | values: [string, string] 56 | ): string; 57 | encodeFunctionData( 58 | functionFragment: "approve", 59 | values: [string, BigNumberish] 60 | ): string; 61 | encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; 62 | encodeFunctionData( 63 | functionFragment: "checkpoints", 64 | values: [string, BigNumberish] 65 | ): string; 66 | encodeFunctionData(functionFragment: "decimals", values?: undefined): string; 67 | encodeFunctionData(functionFragment: "delegate", values: [string]): string; 68 | encodeFunctionData( 69 | functionFragment: "delegateBySig", 70 | values: [ 71 | string, 72 | BigNumberish, 73 | BigNumberish, 74 | BigNumberish, 75 | BytesLike, 76 | BytesLike 77 | ] 78 | ): string; 79 | encodeFunctionData(functionFragment: "delegates", values: [string]): string; 80 | encodeFunctionData( 81 | functionFragment: "getCurrentVotes", 82 | values: [string] 83 | ): string; 84 | encodeFunctionData( 85 | functionFragment: "getPriorVotes", 86 | values: [string, BigNumberish] 87 | ): string; 88 | encodeFunctionData(functionFragment: "name", values?: undefined): string; 89 | encodeFunctionData(functionFragment: "nonces", values: [string]): string; 90 | encodeFunctionData( 91 | functionFragment: "numCheckpoints", 92 | values: [string] 93 | ): string; 94 | encodeFunctionData(functionFragment: "symbol", values?: undefined): string; 95 | encodeFunctionData( 96 | functionFragment: "totalSupply", 97 | values?: undefined 98 | ): string; 99 | encodeFunctionData( 100 | functionFragment: "transfer", 101 | values: [string, BigNumberish] 102 | ): string; 103 | encodeFunctionData( 104 | functionFragment: "transferFrom", 105 | values: [string, string, BigNumberish] 106 | ): string; 107 | 108 | decodeFunctionResult( 109 | functionFragment: "DELEGATION_TYPEHASH", 110 | data: BytesLike 111 | ): Result; 112 | decodeFunctionResult( 113 | functionFragment: "DOMAIN_TYPEHASH", 114 | data: BytesLike 115 | ): Result; 116 | decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; 117 | decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; 118 | decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; 119 | decodeFunctionResult( 120 | functionFragment: "checkpoints", 121 | data: BytesLike 122 | ): Result; 123 | decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; 124 | decodeFunctionResult(functionFragment: "delegate", data: BytesLike): Result; 125 | decodeFunctionResult( 126 | functionFragment: "delegateBySig", 127 | data: BytesLike 128 | ): Result; 129 | decodeFunctionResult(functionFragment: "delegates", data: BytesLike): Result; 130 | decodeFunctionResult( 131 | functionFragment: "getCurrentVotes", 132 | data: BytesLike 133 | ): Result; 134 | decodeFunctionResult( 135 | functionFragment: "getPriorVotes", 136 | data: BytesLike 137 | ): Result; 138 | decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; 139 | decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; 140 | decodeFunctionResult( 141 | functionFragment: "numCheckpoints", 142 | data: BytesLike 143 | ): Result; 144 | decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; 145 | decodeFunctionResult( 146 | functionFragment: "totalSupply", 147 | data: BytesLike 148 | ): Result; 149 | decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; 150 | decodeFunctionResult( 151 | functionFragment: "transferFrom", 152 | data: BytesLike 153 | ): Result; 154 | 155 | events: { 156 | "Approval(address,address,uint256)": EventFragment; 157 | "DelegateChanged(address,address,address)": EventFragment; 158 | "DelegateVotesChanged(address,uint256,uint256)": EventFragment; 159 | "Transfer(address,address,uint256)": EventFragment; 160 | }; 161 | 162 | getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; 163 | getEvent(nameOrSignatureOrTopic: "DelegateChanged"): EventFragment; 164 | getEvent(nameOrSignatureOrTopic: "DelegateVotesChanged"): EventFragment; 165 | getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; 166 | } 167 | 168 | export class Comp extends BaseContract { 169 | connect(signerOrProvider: Signer | Provider | string): this; 170 | attach(addressOrName: string): this; 171 | deployed(): Promise; 172 | 173 | listeners, EventArgsObject>( 174 | eventFilter?: TypedEventFilter 175 | ): Array>; 176 | off, EventArgsObject>( 177 | eventFilter: TypedEventFilter, 178 | listener: TypedListener 179 | ): this; 180 | on, EventArgsObject>( 181 | eventFilter: TypedEventFilter, 182 | listener: TypedListener 183 | ): this; 184 | once, EventArgsObject>( 185 | eventFilter: TypedEventFilter, 186 | listener: TypedListener 187 | ): this; 188 | removeListener, EventArgsObject>( 189 | eventFilter: TypedEventFilter, 190 | listener: TypedListener 191 | ): this; 192 | removeAllListeners, EventArgsObject>( 193 | eventFilter: TypedEventFilter 194 | ): this; 195 | 196 | listeners(eventName?: string): Array; 197 | off(eventName: string, listener: Listener): this; 198 | on(eventName: string, listener: Listener): this; 199 | once(eventName: string, listener: Listener): this; 200 | removeListener(eventName: string, listener: Listener): this; 201 | removeAllListeners(eventName?: string): this; 202 | 203 | queryFilter, EventArgsObject>( 204 | event: TypedEventFilter, 205 | fromBlockOrBlockhash?: string | number | undefined, 206 | toBlock?: string | number | undefined 207 | ): Promise>>; 208 | 209 | interface: CompInterface; 210 | 211 | functions: { 212 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; 213 | 214 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; 215 | 216 | allowance( 217 | account: string, 218 | spender: string, 219 | overrides?: CallOverrides 220 | ): Promise<[BigNumber]>; 221 | 222 | approve( 223 | spender: string, 224 | rawAmount: BigNumberish, 225 | overrides?: Overrides & { from?: string | Promise } 226 | ): Promise; 227 | 228 | balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; 229 | 230 | checkpoints( 231 | arg0: string, 232 | arg1: BigNumberish, 233 | overrides?: CallOverrides 234 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 235 | 236 | decimals(overrides?: CallOverrides): Promise<[number]>; 237 | 238 | delegate( 239 | delegatee: string, 240 | overrides?: Overrides & { from?: string | Promise } 241 | ): Promise; 242 | 243 | delegateBySig( 244 | delegatee: string, 245 | nonce: BigNumberish, 246 | expiry: BigNumberish, 247 | v: BigNumberish, 248 | r: BytesLike, 249 | s: BytesLike, 250 | overrides?: Overrides & { from?: string | Promise } 251 | ): Promise; 252 | 253 | delegates(arg0: string, overrides?: CallOverrides): Promise<[string]>; 254 | 255 | getCurrentVotes( 256 | account: string, 257 | overrides?: CallOverrides 258 | ): Promise<[BigNumber]>; 259 | 260 | getPriorVotes( 261 | account: string, 262 | blockNumber: BigNumberish, 263 | overrides?: CallOverrides 264 | ): Promise<[BigNumber]>; 265 | 266 | name(overrides?: CallOverrides): Promise<[string]>; 267 | 268 | nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; 269 | 270 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise<[number]>; 271 | 272 | symbol(overrides?: CallOverrides): Promise<[string]>; 273 | 274 | totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; 275 | 276 | transfer( 277 | dst: string, 278 | rawAmount: BigNumberish, 279 | overrides?: Overrides & { from?: string | Promise } 280 | ): Promise; 281 | 282 | transferFrom( 283 | src: string, 284 | dst: string, 285 | rawAmount: BigNumberish, 286 | overrides?: Overrides & { from?: string | Promise } 287 | ): Promise; 288 | }; 289 | 290 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 291 | 292 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 293 | 294 | allowance( 295 | account: string, 296 | spender: string, 297 | overrides?: CallOverrides 298 | ): Promise; 299 | 300 | approve( 301 | spender: string, 302 | rawAmount: BigNumberish, 303 | overrides?: Overrides & { from?: string | Promise } 304 | ): Promise; 305 | 306 | balanceOf(account: string, overrides?: CallOverrides): Promise; 307 | 308 | checkpoints( 309 | arg0: string, 310 | arg1: BigNumberish, 311 | overrides?: CallOverrides 312 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 313 | 314 | decimals(overrides?: CallOverrides): Promise; 315 | 316 | delegate( 317 | delegatee: string, 318 | overrides?: Overrides & { from?: string | Promise } 319 | ): Promise; 320 | 321 | delegateBySig( 322 | delegatee: string, 323 | nonce: BigNumberish, 324 | expiry: BigNumberish, 325 | v: BigNumberish, 326 | r: BytesLike, 327 | s: BytesLike, 328 | overrides?: Overrides & { from?: string | Promise } 329 | ): Promise; 330 | 331 | delegates(arg0: string, overrides?: CallOverrides): Promise; 332 | 333 | getCurrentVotes( 334 | account: string, 335 | overrides?: CallOverrides 336 | ): Promise; 337 | 338 | getPriorVotes( 339 | account: string, 340 | blockNumber: BigNumberish, 341 | overrides?: CallOverrides 342 | ): Promise; 343 | 344 | name(overrides?: CallOverrides): Promise; 345 | 346 | nonces(arg0: string, overrides?: CallOverrides): Promise; 347 | 348 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 349 | 350 | symbol(overrides?: CallOverrides): Promise; 351 | 352 | totalSupply(overrides?: CallOverrides): Promise; 353 | 354 | transfer( 355 | dst: string, 356 | rawAmount: BigNumberish, 357 | overrides?: Overrides & { from?: string | Promise } 358 | ): Promise; 359 | 360 | transferFrom( 361 | src: string, 362 | dst: string, 363 | rawAmount: BigNumberish, 364 | overrides?: Overrides & { from?: string | Promise } 365 | ): Promise; 366 | 367 | callStatic: { 368 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 369 | 370 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 371 | 372 | allowance( 373 | account: string, 374 | spender: string, 375 | overrides?: CallOverrides 376 | ): Promise; 377 | 378 | approve( 379 | spender: string, 380 | rawAmount: BigNumberish, 381 | overrides?: CallOverrides 382 | ): Promise; 383 | 384 | balanceOf(account: string, overrides?: CallOverrides): Promise; 385 | 386 | checkpoints( 387 | arg0: string, 388 | arg1: BigNumberish, 389 | overrides?: CallOverrides 390 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 391 | 392 | decimals(overrides?: CallOverrides): Promise; 393 | 394 | delegate(delegatee: string, overrides?: CallOverrides): Promise; 395 | 396 | delegateBySig( 397 | delegatee: string, 398 | nonce: BigNumberish, 399 | expiry: BigNumberish, 400 | v: BigNumberish, 401 | r: BytesLike, 402 | s: BytesLike, 403 | overrides?: CallOverrides 404 | ): Promise; 405 | 406 | delegates(arg0: string, overrides?: CallOverrides): Promise; 407 | 408 | getCurrentVotes( 409 | account: string, 410 | overrides?: CallOverrides 411 | ): Promise; 412 | 413 | getPriorVotes( 414 | account: string, 415 | blockNumber: BigNumberish, 416 | overrides?: CallOverrides 417 | ): Promise; 418 | 419 | name(overrides?: CallOverrides): Promise; 420 | 421 | nonces(arg0: string, overrides?: CallOverrides): Promise; 422 | 423 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 424 | 425 | symbol(overrides?: CallOverrides): Promise; 426 | 427 | totalSupply(overrides?: CallOverrides): Promise; 428 | 429 | transfer( 430 | dst: string, 431 | rawAmount: BigNumberish, 432 | overrides?: CallOverrides 433 | ): Promise; 434 | 435 | transferFrom( 436 | src: string, 437 | dst: string, 438 | rawAmount: BigNumberish, 439 | overrides?: CallOverrides 440 | ): Promise; 441 | }; 442 | 443 | filters: { 444 | Approval( 445 | owner?: string | null, 446 | spender?: string | null, 447 | amount?: null 448 | ): TypedEventFilter< 449 | [string, string, BigNumber], 450 | { owner: string; spender: string; amount: BigNumber } 451 | >; 452 | 453 | DelegateChanged( 454 | delegator?: string | null, 455 | fromDelegate?: string | null, 456 | toDelegate?: string | null 457 | ): TypedEventFilter< 458 | [string, string, string], 459 | { delegator: string; fromDelegate: string; toDelegate: string } 460 | >; 461 | 462 | DelegateVotesChanged( 463 | delegate?: string | null, 464 | previousBalance?: null, 465 | newBalance?: null 466 | ): TypedEventFilter< 467 | [string, BigNumber, BigNumber], 468 | { delegate: string; previousBalance: BigNumber; newBalance: BigNumber } 469 | >; 470 | 471 | Transfer( 472 | from?: string | null, 473 | to?: string | null, 474 | amount?: null 475 | ): TypedEventFilter< 476 | [string, string, BigNumber], 477 | { from: string; to: string; amount: BigNumber } 478 | >; 479 | }; 480 | 481 | estimateGas: { 482 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 483 | 484 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 485 | 486 | allowance( 487 | account: string, 488 | spender: string, 489 | overrides?: CallOverrides 490 | ): Promise; 491 | 492 | approve( 493 | spender: string, 494 | rawAmount: BigNumberish, 495 | overrides?: Overrides & { from?: string | Promise } 496 | ): Promise; 497 | 498 | balanceOf(account: string, overrides?: CallOverrides): Promise; 499 | 500 | checkpoints( 501 | arg0: string, 502 | arg1: BigNumberish, 503 | overrides?: CallOverrides 504 | ): Promise; 505 | 506 | decimals(overrides?: CallOverrides): Promise; 507 | 508 | delegate( 509 | delegatee: string, 510 | overrides?: Overrides & { from?: string | Promise } 511 | ): Promise; 512 | 513 | delegateBySig( 514 | delegatee: string, 515 | nonce: BigNumberish, 516 | expiry: BigNumberish, 517 | v: BigNumberish, 518 | r: BytesLike, 519 | s: BytesLike, 520 | overrides?: Overrides & { from?: string | Promise } 521 | ): Promise; 522 | 523 | delegates(arg0: string, overrides?: CallOverrides): Promise; 524 | 525 | getCurrentVotes( 526 | account: string, 527 | overrides?: CallOverrides 528 | ): Promise; 529 | 530 | getPriorVotes( 531 | account: string, 532 | blockNumber: BigNumberish, 533 | overrides?: CallOverrides 534 | ): Promise; 535 | 536 | name(overrides?: CallOverrides): Promise; 537 | 538 | nonces(arg0: string, overrides?: CallOverrides): Promise; 539 | 540 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 541 | 542 | symbol(overrides?: CallOverrides): Promise; 543 | 544 | totalSupply(overrides?: CallOverrides): Promise; 545 | 546 | transfer( 547 | dst: string, 548 | rawAmount: BigNumberish, 549 | overrides?: Overrides & { from?: string | Promise } 550 | ): Promise; 551 | 552 | transferFrom( 553 | src: string, 554 | dst: string, 555 | rawAmount: BigNumberish, 556 | overrides?: Overrides & { from?: string | Promise } 557 | ): Promise; 558 | }; 559 | 560 | populateTransaction: { 561 | DELEGATION_TYPEHASH( 562 | overrides?: CallOverrides 563 | ): Promise; 564 | 565 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 566 | 567 | allowance( 568 | account: string, 569 | spender: string, 570 | overrides?: CallOverrides 571 | ): Promise; 572 | 573 | approve( 574 | spender: string, 575 | rawAmount: BigNumberish, 576 | overrides?: Overrides & { from?: string | Promise } 577 | ): Promise; 578 | 579 | balanceOf( 580 | account: string, 581 | overrides?: CallOverrides 582 | ): Promise; 583 | 584 | checkpoints( 585 | arg0: string, 586 | arg1: BigNumberish, 587 | overrides?: CallOverrides 588 | ): Promise; 589 | 590 | decimals(overrides?: CallOverrides): Promise; 591 | 592 | delegate( 593 | delegatee: string, 594 | overrides?: Overrides & { from?: string | Promise } 595 | ): Promise; 596 | 597 | delegateBySig( 598 | delegatee: string, 599 | nonce: BigNumberish, 600 | expiry: BigNumberish, 601 | v: BigNumberish, 602 | r: BytesLike, 603 | s: BytesLike, 604 | overrides?: Overrides & { from?: string | Promise } 605 | ): Promise; 606 | 607 | delegates( 608 | arg0: string, 609 | overrides?: CallOverrides 610 | ): Promise; 611 | 612 | getCurrentVotes( 613 | account: string, 614 | overrides?: CallOverrides 615 | ): Promise; 616 | 617 | getPriorVotes( 618 | account: string, 619 | blockNumber: BigNumberish, 620 | overrides?: CallOverrides 621 | ): Promise; 622 | 623 | name(overrides?: CallOverrides): Promise; 624 | 625 | nonces( 626 | arg0: string, 627 | overrides?: CallOverrides 628 | ): Promise; 629 | 630 | numCheckpoints( 631 | arg0: string, 632 | overrides?: CallOverrides 633 | ): Promise; 634 | 635 | symbol(overrides?: CallOverrides): Promise; 636 | 637 | totalSupply(overrides?: CallOverrides): Promise; 638 | 639 | transfer( 640 | dst: string, 641 | rawAmount: BigNumberish, 642 | overrides?: Overrides & { from?: string | Promise } 643 | ): Promise; 644 | 645 | transferFrom( 646 | src: string, 647 | dst: string, 648 | rawAmount: BigNumberish, 649 | overrides?: Overrides & { from?: string | Promise } 650 | ): Promise; 651 | }; 652 | } 653 | -------------------------------------------------------------------------------- /src/ethers-contracts/VotingToken.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | CallOverrides, 16 | } from "ethers"; 17 | import { BytesLike } from "@ethersproject/bytes"; 18 | import { Listener, Provider } from "@ethersproject/providers"; 19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 20 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; 21 | 22 | interface VotingTokenInterface extends ethers.utils.Interface { 23 | functions: { 24 | "DELEGATION_TYPEHASH()": FunctionFragment; 25 | "DOMAIN_TYPEHASH()": FunctionFragment; 26 | "allowance(address,address)": FunctionFragment; 27 | "approve(address,uint256)": FunctionFragment; 28 | "balanceOf(address)": FunctionFragment; 29 | "checkpoints(address,uint32)": FunctionFragment; 30 | "decimals()": FunctionFragment; 31 | "delegate(address)": FunctionFragment; 32 | "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; 33 | "delegates(address)": FunctionFragment; 34 | "getCurrentVotes(address)": FunctionFragment; 35 | "getPriorVotes(address,uint256)": FunctionFragment; 36 | "name()": FunctionFragment; 37 | "nonces(address)": FunctionFragment; 38 | "numCheckpoints(address)": FunctionFragment; 39 | "symbol()": FunctionFragment; 40 | "totalSupply()": FunctionFragment; 41 | "transfer(address,uint256)": FunctionFragment; 42 | "transferFrom(address,address,uint256)": FunctionFragment; 43 | }; 44 | 45 | encodeFunctionData( 46 | functionFragment: "DELEGATION_TYPEHASH", 47 | values?: undefined 48 | ): string; 49 | encodeFunctionData( 50 | functionFragment: "DOMAIN_TYPEHASH", 51 | values?: undefined 52 | ): string; 53 | encodeFunctionData( 54 | functionFragment: "allowance", 55 | values: [string, string] 56 | ): string; 57 | encodeFunctionData( 58 | functionFragment: "approve", 59 | values: [string, BigNumberish] 60 | ): string; 61 | encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; 62 | encodeFunctionData( 63 | functionFragment: "checkpoints", 64 | values: [string, BigNumberish] 65 | ): string; 66 | encodeFunctionData(functionFragment: "decimals", values?: undefined): string; 67 | encodeFunctionData(functionFragment: "delegate", values: [string]): string; 68 | encodeFunctionData( 69 | functionFragment: "delegateBySig", 70 | values: [ 71 | string, 72 | BigNumberish, 73 | BigNumberish, 74 | BigNumberish, 75 | BytesLike, 76 | BytesLike 77 | ] 78 | ): string; 79 | encodeFunctionData(functionFragment: "delegates", values: [string]): string; 80 | encodeFunctionData( 81 | functionFragment: "getCurrentVotes", 82 | values: [string] 83 | ): string; 84 | encodeFunctionData( 85 | functionFragment: "getPriorVotes", 86 | values: [string, BigNumberish] 87 | ): string; 88 | encodeFunctionData(functionFragment: "name", values?: undefined): string; 89 | encodeFunctionData(functionFragment: "nonces", values: [string]): string; 90 | encodeFunctionData( 91 | functionFragment: "numCheckpoints", 92 | values: [string] 93 | ): string; 94 | encodeFunctionData(functionFragment: "symbol", values?: undefined): string; 95 | encodeFunctionData( 96 | functionFragment: "totalSupply", 97 | values?: undefined 98 | ): string; 99 | encodeFunctionData( 100 | functionFragment: "transfer", 101 | values: [string, BigNumberish] 102 | ): string; 103 | encodeFunctionData( 104 | functionFragment: "transferFrom", 105 | values: [string, string, BigNumberish] 106 | ): string; 107 | 108 | decodeFunctionResult( 109 | functionFragment: "DELEGATION_TYPEHASH", 110 | data: BytesLike 111 | ): Result; 112 | decodeFunctionResult( 113 | functionFragment: "DOMAIN_TYPEHASH", 114 | data: BytesLike 115 | ): Result; 116 | decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; 117 | decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; 118 | decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; 119 | decodeFunctionResult( 120 | functionFragment: "checkpoints", 121 | data: BytesLike 122 | ): Result; 123 | decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; 124 | decodeFunctionResult(functionFragment: "delegate", data: BytesLike): Result; 125 | decodeFunctionResult( 126 | functionFragment: "delegateBySig", 127 | data: BytesLike 128 | ): Result; 129 | decodeFunctionResult(functionFragment: "delegates", data: BytesLike): Result; 130 | decodeFunctionResult( 131 | functionFragment: "getCurrentVotes", 132 | data: BytesLike 133 | ): Result; 134 | decodeFunctionResult( 135 | functionFragment: "getPriorVotes", 136 | data: BytesLike 137 | ): Result; 138 | decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; 139 | decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; 140 | decodeFunctionResult( 141 | functionFragment: "numCheckpoints", 142 | data: BytesLike 143 | ): Result; 144 | decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; 145 | decodeFunctionResult( 146 | functionFragment: "totalSupply", 147 | data: BytesLike 148 | ): Result; 149 | decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; 150 | decodeFunctionResult( 151 | functionFragment: "transferFrom", 152 | data: BytesLike 153 | ): Result; 154 | 155 | events: { 156 | "Approval(address,address,uint256)": EventFragment; 157 | "DelegateChanged(address,address,address)": EventFragment; 158 | "DelegateVotesChanged(address,uint256,uint256)": EventFragment; 159 | "Transfer(address,address,uint256)": EventFragment; 160 | }; 161 | 162 | getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; 163 | getEvent(nameOrSignatureOrTopic: "DelegateChanged"): EventFragment; 164 | getEvent(nameOrSignatureOrTopic: "DelegateVotesChanged"): EventFragment; 165 | getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; 166 | } 167 | 168 | export class VotingToken extends BaseContract { 169 | connect(signerOrProvider: Signer | Provider | string): this; 170 | attach(addressOrName: string): this; 171 | deployed(): Promise; 172 | 173 | listeners, EventArgsObject>( 174 | eventFilter?: TypedEventFilter 175 | ): Array>; 176 | off, EventArgsObject>( 177 | eventFilter: TypedEventFilter, 178 | listener: TypedListener 179 | ): this; 180 | on, EventArgsObject>( 181 | eventFilter: TypedEventFilter, 182 | listener: TypedListener 183 | ): this; 184 | once, EventArgsObject>( 185 | eventFilter: TypedEventFilter, 186 | listener: TypedListener 187 | ): this; 188 | removeListener, EventArgsObject>( 189 | eventFilter: TypedEventFilter, 190 | listener: TypedListener 191 | ): this; 192 | removeAllListeners, EventArgsObject>( 193 | eventFilter: TypedEventFilter 194 | ): this; 195 | 196 | listeners(eventName?: string): Array; 197 | off(eventName: string, listener: Listener): this; 198 | on(eventName: string, listener: Listener): this; 199 | once(eventName: string, listener: Listener): this; 200 | removeListener(eventName: string, listener: Listener): this; 201 | removeAllListeners(eventName?: string): this; 202 | 203 | queryFilter, EventArgsObject>( 204 | event: TypedEventFilter, 205 | fromBlockOrBlockhash?: string | number | undefined, 206 | toBlock?: string | number | undefined 207 | ): Promise>>; 208 | 209 | interface: VotingTokenInterface; 210 | 211 | functions: { 212 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; 213 | 214 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; 215 | 216 | allowance( 217 | account: string, 218 | spender: string, 219 | overrides?: CallOverrides 220 | ): Promise<[BigNumber]>; 221 | 222 | approve( 223 | spender: string, 224 | rawAmount: BigNumberish, 225 | overrides?: Overrides & { from?: string | Promise } 226 | ): Promise; 227 | 228 | balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; 229 | 230 | checkpoints( 231 | arg0: string, 232 | arg1: BigNumberish, 233 | overrides?: CallOverrides 234 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 235 | 236 | decimals(overrides?: CallOverrides): Promise<[number]>; 237 | 238 | delegate( 239 | delegatee: string, 240 | overrides?: Overrides & { from?: string | Promise } 241 | ): Promise; 242 | 243 | delegateBySig( 244 | delegatee: string, 245 | nonce: BigNumberish, 246 | expiry: BigNumberish, 247 | v: BigNumberish, 248 | r: BytesLike, 249 | s: BytesLike, 250 | overrides?: Overrides & { from?: string | Promise } 251 | ): Promise; 252 | 253 | delegates(arg0: string, overrides?: CallOverrides): Promise<[string]>; 254 | 255 | getCurrentVotes( 256 | account: string, 257 | overrides?: CallOverrides 258 | ): Promise<[BigNumber]>; 259 | 260 | getPriorVotes( 261 | account: string, 262 | blockNumber: BigNumberish, 263 | overrides?: CallOverrides 264 | ): Promise<[BigNumber]>; 265 | 266 | name(overrides?: CallOverrides): Promise<[string]>; 267 | 268 | nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; 269 | 270 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise<[number]>; 271 | 272 | symbol(overrides?: CallOverrides): Promise<[string]>; 273 | 274 | totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; 275 | 276 | transfer( 277 | dst: string, 278 | rawAmount: BigNumberish, 279 | overrides?: Overrides & { from?: string | Promise } 280 | ): Promise; 281 | 282 | transferFrom( 283 | src: string, 284 | dst: string, 285 | rawAmount: BigNumberish, 286 | overrides?: Overrides & { from?: string | Promise } 287 | ): Promise; 288 | }; 289 | 290 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 291 | 292 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 293 | 294 | allowance( 295 | account: string, 296 | spender: string, 297 | overrides?: CallOverrides 298 | ): Promise; 299 | 300 | approve( 301 | spender: string, 302 | rawAmount: BigNumberish, 303 | overrides?: Overrides & { from?: string | Promise } 304 | ): Promise; 305 | 306 | balanceOf(account: string, overrides?: CallOverrides): Promise; 307 | 308 | checkpoints( 309 | arg0: string, 310 | arg1: BigNumberish, 311 | overrides?: CallOverrides 312 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 313 | 314 | decimals(overrides?: CallOverrides): Promise; 315 | 316 | delegate( 317 | delegatee: string, 318 | overrides?: Overrides & { from?: string | Promise } 319 | ): Promise; 320 | 321 | delegateBySig( 322 | delegatee: string, 323 | nonce: BigNumberish, 324 | expiry: BigNumberish, 325 | v: BigNumberish, 326 | r: BytesLike, 327 | s: BytesLike, 328 | overrides?: Overrides & { from?: string | Promise } 329 | ): Promise; 330 | 331 | delegates(arg0: string, overrides?: CallOverrides): Promise; 332 | 333 | getCurrentVotes( 334 | account: string, 335 | overrides?: CallOverrides 336 | ): Promise; 337 | 338 | getPriorVotes( 339 | account: string, 340 | blockNumber: BigNumberish, 341 | overrides?: CallOverrides 342 | ): Promise; 343 | 344 | name(overrides?: CallOverrides): Promise; 345 | 346 | nonces(arg0: string, overrides?: CallOverrides): Promise; 347 | 348 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 349 | 350 | symbol(overrides?: CallOverrides): Promise; 351 | 352 | totalSupply(overrides?: CallOverrides): Promise; 353 | 354 | transfer( 355 | dst: string, 356 | rawAmount: BigNumberish, 357 | overrides?: Overrides & { from?: string | Promise } 358 | ): Promise; 359 | 360 | transferFrom( 361 | src: string, 362 | dst: string, 363 | rawAmount: BigNumberish, 364 | overrides?: Overrides & { from?: string | Promise } 365 | ): Promise; 366 | 367 | callStatic: { 368 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 369 | 370 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 371 | 372 | allowance( 373 | account: string, 374 | spender: string, 375 | overrides?: CallOverrides 376 | ): Promise; 377 | 378 | approve( 379 | spender: string, 380 | rawAmount: BigNumberish, 381 | overrides?: CallOverrides 382 | ): Promise; 383 | 384 | balanceOf(account: string, overrides?: CallOverrides): Promise; 385 | 386 | checkpoints( 387 | arg0: string, 388 | arg1: BigNumberish, 389 | overrides?: CallOverrides 390 | ): Promise<[number, BigNumber] & { fromBlock: number; votes: BigNumber }>; 391 | 392 | decimals(overrides?: CallOverrides): Promise; 393 | 394 | delegate(delegatee: string, overrides?: CallOverrides): Promise; 395 | 396 | delegateBySig( 397 | delegatee: string, 398 | nonce: BigNumberish, 399 | expiry: BigNumberish, 400 | v: BigNumberish, 401 | r: BytesLike, 402 | s: BytesLike, 403 | overrides?: CallOverrides 404 | ): Promise; 405 | 406 | delegates(arg0: string, overrides?: CallOverrides): Promise; 407 | 408 | getCurrentVotes( 409 | account: string, 410 | overrides?: CallOverrides 411 | ): Promise; 412 | 413 | getPriorVotes( 414 | account: string, 415 | blockNumber: BigNumberish, 416 | overrides?: CallOverrides 417 | ): Promise; 418 | 419 | name(overrides?: CallOverrides): Promise; 420 | 421 | nonces(arg0: string, overrides?: CallOverrides): Promise; 422 | 423 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 424 | 425 | symbol(overrides?: CallOverrides): Promise; 426 | 427 | totalSupply(overrides?: CallOverrides): Promise; 428 | 429 | transfer( 430 | dst: string, 431 | rawAmount: BigNumberish, 432 | overrides?: CallOverrides 433 | ): Promise; 434 | 435 | transferFrom( 436 | src: string, 437 | dst: string, 438 | rawAmount: BigNumberish, 439 | overrides?: CallOverrides 440 | ): Promise; 441 | }; 442 | 443 | filters: { 444 | Approval( 445 | owner?: string | null, 446 | spender?: string | null, 447 | amount?: null 448 | ): TypedEventFilter< 449 | [string, string, BigNumber], 450 | { owner: string; spender: string; amount: BigNumber } 451 | >; 452 | 453 | DelegateChanged( 454 | delegator?: string | null, 455 | fromDelegate?: string | null, 456 | toDelegate?: string | null 457 | ): TypedEventFilter< 458 | [string, string, string], 459 | { delegator: string; fromDelegate: string; toDelegate: string } 460 | >; 461 | 462 | DelegateVotesChanged( 463 | delegate?: string | null, 464 | previousBalance?: null, 465 | newBalance?: null 466 | ): TypedEventFilter< 467 | [string, BigNumber, BigNumber], 468 | { delegate: string; previousBalance: BigNumber; newBalance: BigNumber } 469 | >; 470 | 471 | Transfer( 472 | from?: string | null, 473 | to?: string | null, 474 | amount?: null 475 | ): TypedEventFilter< 476 | [string, string, BigNumber], 477 | { from: string; to: string; amount: BigNumber } 478 | >; 479 | }; 480 | 481 | estimateGas: { 482 | DELEGATION_TYPEHASH(overrides?: CallOverrides): Promise; 483 | 484 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 485 | 486 | allowance( 487 | account: string, 488 | spender: string, 489 | overrides?: CallOverrides 490 | ): Promise; 491 | 492 | approve( 493 | spender: string, 494 | rawAmount: BigNumberish, 495 | overrides?: Overrides & { from?: string | Promise } 496 | ): Promise; 497 | 498 | balanceOf(account: string, overrides?: CallOverrides): Promise; 499 | 500 | checkpoints( 501 | arg0: string, 502 | arg1: BigNumberish, 503 | overrides?: CallOverrides 504 | ): Promise; 505 | 506 | decimals(overrides?: CallOverrides): Promise; 507 | 508 | delegate( 509 | delegatee: string, 510 | overrides?: Overrides & { from?: string | Promise } 511 | ): Promise; 512 | 513 | delegateBySig( 514 | delegatee: string, 515 | nonce: BigNumberish, 516 | expiry: BigNumberish, 517 | v: BigNumberish, 518 | r: BytesLike, 519 | s: BytesLike, 520 | overrides?: Overrides & { from?: string | Promise } 521 | ): Promise; 522 | 523 | delegates(arg0: string, overrides?: CallOverrides): Promise; 524 | 525 | getCurrentVotes( 526 | account: string, 527 | overrides?: CallOverrides 528 | ): Promise; 529 | 530 | getPriorVotes( 531 | account: string, 532 | blockNumber: BigNumberish, 533 | overrides?: CallOverrides 534 | ): Promise; 535 | 536 | name(overrides?: CallOverrides): Promise; 537 | 538 | nonces(arg0: string, overrides?: CallOverrides): Promise; 539 | 540 | numCheckpoints(arg0: string, overrides?: CallOverrides): Promise; 541 | 542 | symbol(overrides?: CallOverrides): Promise; 543 | 544 | totalSupply(overrides?: CallOverrides): Promise; 545 | 546 | transfer( 547 | dst: string, 548 | rawAmount: BigNumberish, 549 | overrides?: Overrides & { from?: string | Promise } 550 | ): Promise; 551 | 552 | transferFrom( 553 | src: string, 554 | dst: string, 555 | rawAmount: BigNumberish, 556 | overrides?: Overrides & { from?: string | Promise } 557 | ): Promise; 558 | }; 559 | 560 | populateTransaction: { 561 | DELEGATION_TYPEHASH( 562 | overrides?: CallOverrides 563 | ): Promise; 564 | 565 | DOMAIN_TYPEHASH(overrides?: CallOverrides): Promise; 566 | 567 | allowance( 568 | account: string, 569 | spender: string, 570 | overrides?: CallOverrides 571 | ): Promise; 572 | 573 | approve( 574 | spender: string, 575 | rawAmount: BigNumberish, 576 | overrides?: Overrides & { from?: string | Promise } 577 | ): Promise; 578 | 579 | balanceOf( 580 | account: string, 581 | overrides?: CallOverrides 582 | ): Promise; 583 | 584 | checkpoints( 585 | arg0: string, 586 | arg1: BigNumberish, 587 | overrides?: CallOverrides 588 | ): Promise; 589 | 590 | decimals(overrides?: CallOverrides): Promise; 591 | 592 | delegate( 593 | delegatee: string, 594 | overrides?: Overrides & { from?: string | Promise } 595 | ): Promise; 596 | 597 | delegateBySig( 598 | delegatee: string, 599 | nonce: BigNumberish, 600 | expiry: BigNumberish, 601 | v: BigNumberish, 602 | r: BytesLike, 603 | s: BytesLike, 604 | overrides?: Overrides & { from?: string | Promise } 605 | ): Promise; 606 | 607 | delegates( 608 | arg0: string, 609 | overrides?: CallOverrides 610 | ): Promise; 611 | 612 | getCurrentVotes( 613 | account: string, 614 | overrides?: CallOverrides 615 | ): Promise; 616 | 617 | getPriorVotes( 618 | account: string, 619 | blockNumber: BigNumberish, 620 | overrides?: CallOverrides 621 | ): Promise; 622 | 623 | name(overrides?: CallOverrides): Promise; 624 | 625 | nonces( 626 | arg0: string, 627 | overrides?: CallOverrides 628 | ): Promise; 629 | 630 | numCheckpoints( 631 | arg0: string, 632 | overrides?: CallOverrides 633 | ): Promise; 634 | 635 | symbol(overrides?: CallOverrides): Promise; 636 | 637 | totalSupply(overrides?: CallOverrides): Promise; 638 | 639 | transfer( 640 | dst: string, 641 | rawAmount: BigNumberish, 642 | overrides?: Overrides & { from?: string | Promise } 643 | ): Promise; 644 | 645 | transferFrom( 646 | src: string, 647 | dst: string, 648 | rawAmount: BigNumberish, 649 | overrides?: Overrides & { from?: string | Promise } 650 | ): Promise; 651 | }; 652 | } 653 | -------------------------------------------------------------------------------- /src/ethers-contracts/factories/Timelock__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | Signer, 7 | utils, 8 | BigNumberish, 9 | Contract, 10 | ContractFactory, 11 | Overrides, 12 | } from "ethers"; 13 | import { Provider, TransactionRequest } from "@ethersproject/providers"; 14 | import type { Timelock, TimelockInterface } from "../Timelock"; 15 | 16 | const _abi = [ 17 | { 18 | constant: false, 19 | inputs: [ 20 | { 21 | name: "target", 22 | type: "address", 23 | }, 24 | { 25 | name: "value", 26 | type: "uint256", 27 | }, 28 | { 29 | name: "signature", 30 | type: "string", 31 | }, 32 | { 33 | name: "data", 34 | type: "bytes", 35 | }, 36 | { 37 | name: "eta", 38 | type: "uint256", 39 | }, 40 | ], 41 | name: "executeTransaction", 42 | outputs: [ 43 | { 44 | name: "", 45 | type: "bytes", 46 | }, 47 | ], 48 | payable: true, 49 | stateMutability: "payable", 50 | type: "function", 51 | }, 52 | { 53 | constant: false, 54 | inputs: [], 55 | name: "acceptAdmin", 56 | outputs: [], 57 | payable: false, 58 | stateMutability: "nonpayable", 59 | type: "function", 60 | }, 61 | { 62 | constant: true, 63 | inputs: [], 64 | name: "pendingAdmin", 65 | outputs: [ 66 | { 67 | name: "", 68 | type: "address", 69 | }, 70 | ], 71 | payable: false, 72 | stateMutability: "view", 73 | type: "function", 74 | }, 75 | { 76 | constant: false, 77 | inputs: [ 78 | { 79 | name: "target", 80 | type: "address", 81 | }, 82 | { 83 | name: "value", 84 | type: "uint256", 85 | }, 86 | { 87 | name: "signature", 88 | type: "string", 89 | }, 90 | { 91 | name: "data", 92 | type: "bytes", 93 | }, 94 | { 95 | name: "eta", 96 | type: "uint256", 97 | }, 98 | ], 99 | name: "queueTransaction", 100 | outputs: [ 101 | { 102 | name: "", 103 | type: "bytes32", 104 | }, 105 | ], 106 | payable: false, 107 | stateMutability: "nonpayable", 108 | type: "function", 109 | }, 110 | { 111 | constant: false, 112 | inputs: [ 113 | { 114 | name: "pendingAdmin_", 115 | type: "address", 116 | }, 117 | ], 118 | name: "setPendingAdmin", 119 | outputs: [], 120 | payable: false, 121 | stateMutability: "nonpayable", 122 | type: "function", 123 | }, 124 | { 125 | constant: false, 126 | inputs: [ 127 | { 128 | name: "target", 129 | type: "address", 130 | }, 131 | { 132 | name: "value", 133 | type: "uint256", 134 | }, 135 | { 136 | name: "signature", 137 | type: "string", 138 | }, 139 | { 140 | name: "data", 141 | type: "bytes", 142 | }, 143 | { 144 | name: "eta", 145 | type: "uint256", 146 | }, 147 | ], 148 | name: "cancelTransaction", 149 | outputs: [], 150 | payable: false, 151 | stateMutability: "nonpayable", 152 | type: "function", 153 | }, 154 | { 155 | constant: true, 156 | inputs: [], 157 | name: "delay", 158 | outputs: [ 159 | { 160 | name: "", 161 | type: "uint256", 162 | }, 163 | ], 164 | payable: false, 165 | stateMutability: "view", 166 | type: "function", 167 | }, 168 | { 169 | constant: true, 170 | inputs: [], 171 | name: "MAXIMUM_DELAY", 172 | outputs: [ 173 | { 174 | name: "", 175 | type: "uint256", 176 | }, 177 | ], 178 | payable: false, 179 | stateMutability: "view", 180 | type: "function", 181 | }, 182 | { 183 | constant: true, 184 | inputs: [], 185 | name: "MINIMUM_DELAY", 186 | outputs: [ 187 | { 188 | name: "", 189 | type: "uint256", 190 | }, 191 | ], 192 | payable: false, 193 | stateMutability: "view", 194 | type: "function", 195 | }, 196 | { 197 | constant: true, 198 | inputs: [], 199 | name: "GRACE_PERIOD", 200 | outputs: [ 201 | { 202 | name: "", 203 | type: "uint256", 204 | }, 205 | ], 206 | payable: false, 207 | stateMutability: "view", 208 | type: "function", 209 | }, 210 | { 211 | constant: false, 212 | inputs: [ 213 | { 214 | name: "delay_", 215 | type: "uint256", 216 | }, 217 | ], 218 | name: "setDelay", 219 | outputs: [], 220 | payable: false, 221 | stateMutability: "nonpayable", 222 | type: "function", 223 | }, 224 | { 225 | constant: true, 226 | inputs: [ 227 | { 228 | name: "", 229 | type: "bytes32", 230 | }, 231 | ], 232 | name: "queuedTransactions", 233 | outputs: [ 234 | { 235 | name: "", 236 | type: "bool", 237 | }, 238 | ], 239 | payable: false, 240 | stateMutability: "view", 241 | type: "function", 242 | }, 243 | { 244 | constant: true, 245 | inputs: [], 246 | name: "admin", 247 | outputs: [ 248 | { 249 | name: "", 250 | type: "address", 251 | }, 252 | ], 253 | payable: false, 254 | stateMutability: "view", 255 | type: "function", 256 | }, 257 | { 258 | inputs: [ 259 | { 260 | name: "admin_", 261 | type: "address", 262 | }, 263 | { 264 | name: "delay_", 265 | type: "uint256", 266 | }, 267 | ], 268 | payable: false, 269 | stateMutability: "nonpayable", 270 | type: "constructor", 271 | }, 272 | { 273 | payable: true, 274 | stateMutability: "payable", 275 | type: "fallback", 276 | }, 277 | { 278 | anonymous: false, 279 | inputs: [ 280 | { 281 | indexed: true, 282 | name: "newAdmin", 283 | type: "address", 284 | }, 285 | ], 286 | name: "NewAdmin", 287 | type: "event", 288 | }, 289 | { 290 | anonymous: false, 291 | inputs: [ 292 | { 293 | indexed: true, 294 | name: "newPendingAdmin", 295 | type: "address", 296 | }, 297 | ], 298 | name: "NewPendingAdmin", 299 | type: "event", 300 | }, 301 | { 302 | anonymous: false, 303 | inputs: [ 304 | { 305 | indexed: true, 306 | name: "newDelay", 307 | type: "uint256", 308 | }, 309 | ], 310 | name: "NewDelay", 311 | type: "event", 312 | }, 313 | { 314 | anonymous: false, 315 | inputs: [ 316 | { 317 | indexed: true, 318 | name: "txHash", 319 | type: "bytes32", 320 | }, 321 | { 322 | indexed: true, 323 | name: "target", 324 | type: "address", 325 | }, 326 | { 327 | indexed: false, 328 | name: "value", 329 | type: "uint256", 330 | }, 331 | { 332 | indexed: false, 333 | name: "signature", 334 | type: "string", 335 | }, 336 | { 337 | indexed: false, 338 | name: "data", 339 | type: "bytes", 340 | }, 341 | { 342 | indexed: false, 343 | name: "eta", 344 | type: "uint256", 345 | }, 346 | ], 347 | name: "CancelTransaction", 348 | type: "event", 349 | }, 350 | { 351 | anonymous: false, 352 | inputs: [ 353 | { 354 | indexed: true, 355 | name: "txHash", 356 | type: "bytes32", 357 | }, 358 | { 359 | indexed: true, 360 | name: "target", 361 | type: "address", 362 | }, 363 | { 364 | indexed: false, 365 | name: "value", 366 | type: "uint256", 367 | }, 368 | { 369 | indexed: false, 370 | name: "signature", 371 | type: "string", 372 | }, 373 | { 374 | indexed: false, 375 | name: "data", 376 | type: "bytes", 377 | }, 378 | { 379 | indexed: false, 380 | name: "eta", 381 | type: "uint256", 382 | }, 383 | ], 384 | name: "ExecuteTransaction", 385 | type: "event", 386 | }, 387 | { 388 | anonymous: false, 389 | inputs: [ 390 | { 391 | indexed: true, 392 | name: "txHash", 393 | type: "bytes32", 394 | }, 395 | { 396 | indexed: true, 397 | name: "target", 398 | type: "address", 399 | }, 400 | { 401 | indexed: false, 402 | name: "value", 403 | type: "uint256", 404 | }, 405 | { 406 | indexed: false, 407 | name: "signature", 408 | type: "string", 409 | }, 410 | { 411 | indexed: false, 412 | name: "data", 413 | type: "bytes", 414 | }, 415 | { 416 | indexed: false, 417 | name: "eta", 418 | type: "uint256", 419 | }, 420 | ], 421 | name: "QueueTransaction", 422 | type: "event", 423 | }, 424 | ]; 425 | 426 | const _bytecode = 427 | "0x608060405234801561001057600080fd5b506040516040806118f88339810180604052604081101561003057600080fd5b5080516020909101516202a300811015610095576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118896037913960400191505060405180910390fd5b62278d008111156100f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118c06038913960400191505060405180910390fd5b600080546001600160a01b039093166001600160a01b031990931692909217909155600255611764806101256000396000f3fe6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b97565b34801561029a57600080fd5b506102a3610c36565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c45915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f5c565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fed915050565b3480156105aa57600080fd5b5061040c6112a6565b3480156105bf57600080fd5b5061040c6112ac565b3480156105d457600080fd5b5061040c6112b3565b3480156105e957600080fd5b5061040c6112ba565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112c1565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b50356113bf565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113d4565b6000546060906001600160a01b031633146106be57604051600160e51b62461bcd02815260040180806020018281038252603881526020018061144c6038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072d578181015183820152602001610715565b50505050905090810190601f16801561075a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078d578181015183820152602001610775565b50505050905090810190601f1680156107ba5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082e965050505050505057604051600160e51b62461bcd02815260040180806020018281038252603d81526020018061159f603d913960400191505060405180910390fd5b826108376113e3565b101561087757604051600160e51b62461bcd0281526004018080602001828103825260458152602001806114ee6045913960600191505060405180910390fd5b61088a836212750063ffffffff6113e716565b6108926113e3565b11156108d257604051600160e51b62461bcd0281526004018080602001828103825260338152602001806114bb6033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108f8575083610985565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b6020831061094d5780518252601f19909201916020918201910161092e565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109c45780518252601f1990920191602091820191016109a5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a26576040519150601f19603f3d011682016040523d82523d6000602084013e610a2b565b606091505b509150915081610a6f57604051600160e51b62461bcd02815260040180806020018281038252603d815260200180611682603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b4c578181015183820152602001610b34565b50505050905090810190601f168015610b795780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610be357604051600160e51b62461bcd0281526004018080602001828103825260388152602001806115dc6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c9257604051600160e51b62461bcd02815260040180806020018281038252603681526020018061164c6036913960400191505060405180910390fd5b610cac600254610ca06113e3565b9063ffffffff6113e716565b821015610ced57604051600160e51b62461bcd0281526004018080602001828103825260498152602001806116bf6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f9d57604051600160e51b62461bcd0281526004018080602001828103825260388152602001806116146038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461103957604051600160e51b62461bcd0281526004018080602001828103825260378152602001806114846037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110a8578181015183820152602001611090565b50505050905090810190601f1680156110d55780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156111085781810151838201526020016110f0565b50505050905090810190601f1680156111355780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112005781810151838201526020016111e8565b50505050905090810190601f16801561122d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611260578181015183820152602001611248565b50505050905090810190601f16801561128d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b33301461130257604051600160e51b62461bcd0281526004018080602001828103825260318152602001806117086031913960400191505060405180910390fd5b6202a30081101561134757604051600160e51b62461bcd0281526004018080602001828103825260348152602001806115336034913960400191505060405180910390fd5b62278d0081111561138c57604051600160e51b62461bcd0281526004018080602001828103825260388152602001806115676038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b6000828201838110156114445760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea165627a7a7230582066c588fea727d4a4b3eb2554087a21c0403f86249bc84e2b3d386fdbfdd7056c002954696d656c6f636b3a3a636f6e7374727563746f723a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e"; 428 | 429 | export class Timelock__factory extends ContractFactory { 430 | constructor(signer?: Signer) { 431 | super(_abi, _bytecode, signer); 432 | } 433 | 434 | deploy( 435 | admin_: string, 436 | delay_: BigNumberish, 437 | overrides?: Overrides & { from?: string | Promise } 438 | ): Promise { 439 | return super.deploy(admin_, delay_, overrides || {}) as Promise; 440 | } 441 | getDeployTransaction( 442 | admin_: string, 443 | delay_: BigNumberish, 444 | overrides?: Overrides & { from?: string | Promise } 445 | ): TransactionRequest { 446 | return super.getDeployTransaction(admin_, delay_, overrides || {}); 447 | } 448 | attach(address: string): Timelock { 449 | return super.attach(address) as Timelock; 450 | } 451 | connect(signer: Signer): Timelock__factory { 452 | return super.connect(signer) as Timelock__factory; 453 | } 454 | static readonly bytecode = _bytecode; 455 | static readonly abi = _abi; 456 | static createInterface(): TimelockInterface { 457 | return new utils.Interface(_abi) as TimelockInterface; 458 | } 459 | static connect( 460 | address: string, 461 | signerOrProvider: Signer | Provider 462 | ): Timelock { 463 | return new Contract(address, _abi, signerOrProvider) as Timelock; 464 | } 465 | } 466 | --------------------------------------------------------------------------------