From 7c6980584814b0dd27dcf45bd6ec2d4c1a3b5d36 Mon Sep 17 00:00:00 2001 From: bbenligiray Date: Sat, 12 Nov 2022 18:26:36 +0300 Subject: [PATCH] Add deployment --- .../deployments-4/mainnet/.chainId | 1 + .../mainnet/TimelockManagerReversible.json | 623 ++++++++++++++++++ ...8b34b388e3ca7ba372a08c7bd867efe952c62.json | 90 +++ 3 files changed, 714 insertions(+) create mode 100644 packages/timelock-manager/deployments-4/mainnet/.chainId create mode 100644 packages/timelock-manager/deployments-4/mainnet/TimelockManagerReversible.json create mode 100644 packages/timelock-manager/deployments-4/mainnet/solcInputs/0xf753db30cd7679f70b713efd93b8b34b388e3ca7ba372a08c7bd867efe952c62.json diff --git a/packages/timelock-manager/deployments-4/mainnet/.chainId b/packages/timelock-manager/deployments-4/mainnet/.chainId new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/packages/timelock-manager/deployments-4/mainnet/.chainId @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/packages/timelock-manager/deployments-4/mainnet/TimelockManagerReversible.json b/packages/timelock-manager/deployments-4/mainnet/TimelockManagerReversible.json new file mode 100644 index 0000000..d58a47b --- /dev/null +++ b/packages/timelock-manager/deployments-4/mainnet/TimelockManagerReversible.json @@ -0,0 +1,623 @@ +{ + "address": "0x0DfE2c661d50Ab2424A53297c679eAeB57DbB944", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "api3TokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "timelockManagerOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StoppedVesting", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStart", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseEnd", + "type": "uint256" + } + ], + "name": "TransferredAndLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "api3Token", + "outputs": [ + { + "internalType": "contract IApi3Token", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getRemainingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "remainingAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getTimelock", + "outputs": [ + { + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "remainingAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseEnd", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "getWithdrawable", + "outputs": [ + { + "internalType": "uint256", + "name": "withdrawable", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "stopVesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "timelocks", + "outputs": [ + { + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "remainingAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseEnd", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releaseEnd", + "type": "uint256" + } + ], + "name": "transferAndLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "address[]", + "name": "recipients", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "releaseStarts", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "releaseEnds", + "type": "uint256[]" + } + ], + "name": "transferAndLockMultiple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x134a498a9791dee1c8e65452825aa87642a1ff59fb418bacfeeacda4546194e9", + "receipt": { + "to": null, + "from": "0x47adCDcaA250C257C6e4db6dD091C6A6739333C9", + "contractAddress": "0x0DfE2c661d50Ab2424A53297c679eAeB57DbB944", + "transactionIndex": 122, + "gasUsed": "1642581", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000020000000000000000000000000000008000000000000004000000000000000000000000000100000000000000001000000020000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000088000000000000000000100000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x70fd1ee056d281cf3f5f798e2c764bd754337fb67e34f3b227999fab899d4ee4", + "transactionHash": "0x134a498a9791dee1c8e65452825aa87642a1ff59fb418bacfeeacda4546194e9", + "logs": [ + { + "transactionIndex": 122, + "blockNumber": 15954791, + "transactionHash": "0x134a498a9791dee1c8e65452825aa87642a1ff59fb418bacfeeacda4546194e9", + "address": "0x0DfE2c661d50Ab2424A53297c679eAeB57DbB944", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000047adcdcaa250c257c6e4db6dd091c6a6739333c9" + ], + "data": "0x", + "logIndex": 282, + "blockHash": "0x70fd1ee056d281cf3f5f798e2c764bd754337fb67e34f3b227999fab899d4ee4" + }, + { + "transactionIndex": 122, + "blockNumber": 15954791, + "transactionHash": "0x134a498a9791dee1c8e65452825aa87642a1ff59fb418bacfeeacda4546194e9", + "address": "0x0DfE2c661d50Ab2424A53297c679eAeB57DbB944", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x00000000000000000000000047adcdcaa250c257c6e4db6dd091c6a6739333c9", + "0x000000000000000000000000f26304d6cd67dfa199b17c9e850149bf77285611" + ], + "data": "0x", + "logIndex": 283, + "blockHash": "0x70fd1ee056d281cf3f5f798e2c764bd754337fb67e34f3b227999fab899d4ee4" + } + ], + "blockNumber": 15954791, + "cumulativeGasUsed": "13850045", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0b38210ea11411557c13457D4dA7dC6ea731B88a", + "0xf26304D6Cd67DFA199b17c9E850149bF77285611" + ], + "solcInputHash": "0xf753db30cd7679f70b713efd93b8b34b388e3ca7ba372a08c7bd867efe952c62", + "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"api3TokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"timelockManagerOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StoppedVesting\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseEnd\",\"type\":\"uint256\"}],\"name\":\"TransferredAndLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"api3Token\",\"outputs\":[{\"internalType\":\"contract IApi3Token\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"getRemainingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"remainingAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"getTimelock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"remainingAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseEnd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"getWithdrawable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawable\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"stopVesting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"timelocks\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"remainingAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseEnd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"releaseEnd\",\"type\":\"uint256\"}],\"name\":\"transferAndLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"releaseStarts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"releaseEnds\",\"type\":\"uint256[]\"}],\"name\":\"transferAndLockMultiple\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"api3TokenAddress\":\"Address of the API3 token contract\",\"timelockManagerOwner\":\"Address that will receive the ownership of the TimelockManager contract\"}},\"getRemainingAmount(address)\":{\"details\":\"Provided separately to be used with Etherscan's \\\"Read\\\" functionality, in case getTimelock() output is too complicated for the user.\",\"params\":{\"recipient\":\"Recipient of tokens\"},\"returns\":{\"remainingAmount\":\"Remaining amount of tokens to be withdrawn\"}},\"getTimelock(address)\":{\"params\":{\"recipient\":\"Recipient of tokens\"},\"returns\":{\"releaseEnd\":\"Release end time\",\"releaseStart\":\"Release start time\",\"remainingAmount\":\"Remaining amount of tokens to be withdrawn\",\"totalAmount\":\"Total amount of tokens\"}},\"getWithdrawable(address)\":{\"params\":{\"recipient\":\"Address of the recipient\"},\"returns\":{\"withdrawable\":\"Amount of tokens withdrawable by the recipient\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"stopVesting(address,address)\":{\"params\":{\"destination\":\"Destination of the excess tokens vested to the addresss\",\"recipient\":\"Original recipient of tokens\"}},\"transferAndLock(address,address,uint256,uint256,uint256)\":{\"details\":\"source needs to approve() this contract to transfer amount number of tokens beforehand. A recipient cannot have multiple timelocks.\",\"params\":{\"amount\":\"Amount of tokens\",\"recipient\":\"Recipient of tokens\",\"releaseEnd\":\"End of release time\",\"releaseStart\":\"Start of release time\",\"source\":\"Source of tokens\"}},\"transferAndLockMultiple(address,address[],uint256[],uint256[],uint256[])\":{\"details\":\"source is expected to be a single address. source needs to approve() this contract to transfer the sum of the amounts of tokens to be transferred and locked.\",\"params\":{\"amounts\":\"Array of amounts of tokens\",\"recipients\":\"Array of recipients of tokens\",\"releaseEnds\":\"Array of ends of release times\",\"releaseStarts\":\"Array of starts of release times\",\"source\":\"Source of tokens\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Contract that the TimeLockManager Contract Owner uses to timelock API3 tokens\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getRemainingAmount(address)\":{\"notice\":\"Returns remaining amount of a timelock\"},\"getTimelock(address)\":{\"notice\":\"Returns the details of a timelock\"},\"getWithdrawable(address)\":{\"notice\":\"Returns the amount of tokens a recipient can currently withdraw\"},\"stopVesting(address,address)\":{\"notice\":\"Called by the ContractOwner to stop the vesting of a recipient\"},\"transferAndLock(address,address,uint256,uint256,uint256)\":{\"notice\":\"Transfers API3 tokens to this contract and timelocks them\"},\"transferAndLockMultiple(address,address[],uint256[],uint256[],uint256[])\":{\"notice\":\"Convenience function that calls transferAndLock() multiple times\"},\"withdraw()\":{\"notice\":\"Used by the recipient to withdraw tokens\"}},\"notice\":\"The owner of TimelockManager can send tokens to TimelockManager to timelock them. These tokens will then be vested to their recipient linearly, starting from releaseStart and ending at releaseEnd of the respective timelock.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TimeLockManagerReversible.sol\":\"TimelockManagerReversible\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@api3-contracts/api3-token/contracts/interfaces/IApi3Token.sol\":{\"keccak256\":\"0x889a988ac7671641cc5e26a9280bebbc4741f7e6204cc13d5ddf51ecf0090d96\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5d5c25d8ae8e4ee515eacfe2bded473c0623ec80969d8d5c9aadadf10d44ea1c\",\"dweb:/ipfs/Qmc3i2zJNnPRD1qruCLweBR7m93H1MFbfQueiefuLEXWTB\"]},\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://90faf5851c02f9bd42c5bfb54d4f0421a2612f50ab80b2c4fa24fa3792071cc2\",\"dweb:/ipfs/QmRGM4F2PcGVF85aTfaA9YBhCHHDqrMhRjyp6fGeBTtirb\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://526dc85e1f9b9b45830e202568d267d93dde7a4fcccf4ad7798dadcd92304d3c\",\"dweb:/ipfs/QmaoXMB972J3cSDLtBq3xBo4jLwqD2uzXTwujtSPqkYVhR\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://24427744bd3e6cb73c17010119af12a318289c0253a4d9acb8576c9fb3797b08\",\"dweb:/ipfs/QmTLDqpKRBuxGxRAmjgXt9AkXyACW3MtKzi7PYjm5iMfGC\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ded47ec7c96750f9bd04bbbc84f659992d4ba901cb7b532a52cd468272cf378f\",\"dweb:/ipfs/QmfBrGtQP7rZEqEg6Wz6jh2N2Kukpj1z5v3CGWmAqrzm96\"]},\"contracts/TimeLockManagerReversible.sol\":{\"keccak256\":\"0xcb656b2bd3032a6ac9ea249d9e361246cb48d1293724475c1b4437e2d759f7a6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5da83bc40f12b8c905060db9cc1c56e12cec0ecee5306aa2cdb9b3a00afefd67\",\"dweb:/ipfs/QmTrRj4uf1FEqUj4jFUCUxNCn9Dks1HMERB8qfu85xhtDN\"]},\"contracts/interfaces/ITimelockManagerReversible.sol\":{\"keccak256\":\"0x2301c149acb05b7b1bb7723ff911ee4be83092aec353720b55945fec366fbc40\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c22a90a8e3dece3aa178d499bc06a6a2bc352175fff8741b68fc9c2fb13a7bfe\",\"dweb:/ipfs/QmUg8YMP1yjvWu5JgGRQ4r6HfGqscZdpGFn37erLkbzptq\"]}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b506040516200200438038062002004833981810160405260408110156200003757600080fd5b8101908080519060200190929190805190602001909291905050506000620000646200015260201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250506200014a816200015a60201b60201c565b505062000388565b600033905090565b6200016a6200015260201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001906200035f60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200021a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018062001fde6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60805160601c611c29620003b5600039806108745280610ca1528061108a52806114f15250611c296000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063715018a611610071578063715018a6146103d65780638da5cb5b146103e0578063bf1e799b14610414578063ef1e1e3c14610481578063f2fde38b146104e5578063faf7eba614610529576100b4565b80631369a927146100b957806324dcb3851461012657806332cc6ae6146101a85780633ccfd60b146102005780635af602531461020a578063613d517d146103a2575b600080fd5b6100fb600480360360208110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610581565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6101a6600480360360a081101561013c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506105b1565b005b6101ea600480360360208110156101be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a51565b6040518082815260200191505060405180910390f35b610208610ade565b005b6103a0600480360360a081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561025d57600080fd5b82018360208201111561026f57600080fd5b8035906020019184602083028401116401000000008311171561029157600080fd5b9091929391929390803590602001906401000000008111156102b257600080fd5b8201836020820111156102c457600080fd5b803590602001918460208302840111640100000000831117156102e657600080fd5b90919293919293908035906020019064010000000081111561030757600080fd5b82018360208201111561031957600080fd5b8035906020019184602083028401116401000000008311171561033b57600080fd5b90919293919293908035906020019064010000000081111561035c57600080fd5b82018360208201111561036e57600080fd5b8035906020019184602083028401116401000000008311171561039057600080fd5b9091929391929390505050610e30565b005b6103aa611088565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de6110ac565b005b6103e8611219565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104566004803603602081101561042a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611242565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6104e36004803603604081101561049757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112af565b005b610527600480360360208110156104fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116a7565b005b61056b6004803603602081101561053f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611899565b6040518082815260200191505060405180910390f35b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6105b96118e5565b73ffffffffffffffffffffffffffffffffffffffff166105d7611219565b73ffffffffffffffffffffffffffffffffffffffff1614610660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f526563697069656e74206861732072656d61696e696e6720746f6b656e73000081525060200191505060405180910390fd5b600083141561078f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f416d6f756e742063616e6e6f742062652030000000000000000000000000000081525060200191505060405180910390fd5b8181116107e7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611bac6027913960400191505060405180910390fd5b604051806080016040528084815260200184815260200183815260200182815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301559050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd8630866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b505050506040513d602081101561094b57600080fd5b81019080805190602001909291905050506109ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4150493320746f6b656e207472616e7366657246726f6d206661696c6564000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff167fd1f652d80d5c06196c1cc9329a51edb16e16aa626e4a7715de03fb8a98547ef686858585604051808573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a25050505050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000610aa0846118ed565b90506000610abf836001015484600001546119cb90919063ffffffff16565b9050610ad481836119cb90919063ffffffff16565b9350505050919050565b336000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541415610b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611b846028913960400191505060405180910390fd5b60003390506000610b8b82610a51565b90506000811415610c04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e6f20776974686472617761626c6520746f6b656e732079657400000000000081525060200191505060405180910390fd5b610c5981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546119cb90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d3057600080fd5b505af1158015610d44573d6000803e3d6000fd5b505050506040513d6020811015610d5a57600080fd5b8101908080519060200190929190505050610ddd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4150493320746f6b656e207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2505050565b610e386118e5565b73ffffffffffffffffffffffffffffffffffffffff16610e56611219565b73ffffffffffffffffffffffffffffffffffffffff1614610edf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8585905088889050148015610ef957508383905088889050145b8015610f0a57508181905088889050145b610f7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f506172616d657465727320617265206f6620756e657175616c206c656e67746881525060200191505060405180910390fd5b601e888890501115610ff6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f506172616d657465727320617265206c6f6e676572207468616e20333000000081525060200191505060405180910390fd5b60005b8888905081101561107c5761106f8a8a8a8481811061101457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1689898581811061103d57fe5b9050602002013588888681811061105057fe5b9050602002013587878781811061106357fe5b905060200201356105b1565b8080600101915050610ff9565b50505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6110b46118e5565b73ffffffffffffffffffffffffffffffffffffffff166110d2611219565b73ffffffffffffffffffffffffffffffffffffffff161461115b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000806000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600001549450806001015493508060020154925080600301549150509193509193565b6112b76118e5565b73ffffffffffffffffffffffffffffffffffffffff166112d5611219565b73ffffffffffffffffffffffffffffffffffffffff161461135e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414156113fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611b846028913960400191505060405180910390fd5b600061140684610a51565b9050600061145f82600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546119cb90919063ffffffff16565b905081600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555042600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561158057600080fd5b505af1158015611594573d6000803e3d6000fd5b505050506040513d60208110156115aa57600080fd5b810190808051906020019092919050505061162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4150493320746f6b656e207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b7f8ae90027281d04f34ca2e7dc8c1c20d126ee8dd017d3f896c0e59d424c264c6d858583604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050505050565b6116af6118e5565b73ffffffffffffffffffffffffffffffffffffffff166116cd611219565b73ffffffffffffffffffffffffffffffffffffffff1614611756576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117dc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611b5e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b600033905090565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060020154421161194557600091506119c5565b8060030154421061195c57806000015491506119c4565b60006119758260020154426119cb90919063ffffffff16565b90506000611994836002015484600301546119cb90919063ffffffff16565b90506119bf816119b1848660000154611a4e90919063ffffffff16565b611ad490919063ffffffff16565b935050505b5b50919050565b600082821115611a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080831415611a615760009050611ace565b6000828402905082848281611a7257fe5b0414611ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611bd36021913960400191505060405180910390fd5b809150505b92915050565b6000808211611b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381611b5457fe5b0490509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373526563697069656e7420646f6573206e6f7420686176652072656d61696e696e6720746f6b656e7372656c65617365456e64206e6f74206c6172676572207468616e2072656c656173655374617274536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cf8e99542a0e388d3227287372063e7feeed054e50013c7585563e4637ccc07e64736f6c634300060c00334f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063715018a611610071578063715018a6146103d65780638da5cb5b146103e0578063bf1e799b14610414578063ef1e1e3c14610481578063f2fde38b146104e5578063faf7eba614610529576100b4565b80631369a927146100b957806324dcb3851461012657806332cc6ae6146101a85780633ccfd60b146102005780635af602531461020a578063613d517d146103a2575b600080fd5b6100fb600480360360208110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610581565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6101a6600480360360a081101561013c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506105b1565b005b6101ea600480360360208110156101be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a51565b6040518082815260200191505060405180910390f35b610208610ade565b005b6103a0600480360360a081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561025d57600080fd5b82018360208201111561026f57600080fd5b8035906020019184602083028401116401000000008311171561029157600080fd5b9091929391929390803590602001906401000000008111156102b257600080fd5b8201836020820111156102c457600080fd5b803590602001918460208302840111640100000000831117156102e657600080fd5b90919293919293908035906020019064010000000081111561030757600080fd5b82018360208201111561031957600080fd5b8035906020019184602083028401116401000000008311171561033b57600080fd5b90919293919293908035906020019064010000000081111561035c57600080fd5b82018360208201111561036e57600080fd5b8035906020019184602083028401116401000000008311171561039057600080fd5b9091929391929390505050610e30565b005b6103aa611088565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de6110ac565b005b6103e8611219565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104566004803603602081101561042a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611242565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6104e36004803603604081101561049757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112af565b005b610527600480360360208110156104fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116a7565b005b61056b6004803603602081101561053f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611899565b6040518082815260200191505060405180910390f35b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6105b96118e5565b73ffffffffffffffffffffffffffffffffffffffff166105d7611219565b73ffffffffffffffffffffffffffffffffffffffff1614610660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f526563697069656e74206861732072656d61696e696e6720746f6b656e73000081525060200191505060405180910390fd5b600083141561078f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f416d6f756e742063616e6e6f742062652030000000000000000000000000000081525060200191505060405180910390fd5b8181116107e7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611bac6027913960400191505060405180910390fd5b604051806080016040528084815260200184815260200183815260200182815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301559050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd8630866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b505050506040513d602081101561094b57600080fd5b81019080805190602001909291905050506109ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4150493320746f6b656e207472616e7366657246726f6d206661696c6564000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff167fd1f652d80d5c06196c1cc9329a51edb16e16aa626e4a7715de03fb8a98547ef686858585604051808573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a25050505050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000610aa0846118ed565b90506000610abf836001015484600001546119cb90919063ffffffff16565b9050610ad481836119cb90919063ffffffff16565b9350505050919050565b336000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541415610b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611b846028913960400191505060405180910390fd5b60003390506000610b8b82610a51565b90506000811415610c04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e6f20776974686472617761626c6520746f6b656e732079657400000000000081525060200191505060405180910390fd5b610c5981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546119cb90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d3057600080fd5b505af1158015610d44573d6000803e3d6000fd5b505050506040513d6020811015610d5a57600080fd5b8101908080519060200190929190505050610ddd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4150493320746f6b656e207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2505050565b610e386118e5565b73ffffffffffffffffffffffffffffffffffffffff16610e56611219565b73ffffffffffffffffffffffffffffffffffffffff1614610edf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8585905088889050148015610ef957508383905088889050145b8015610f0a57508181905088889050145b610f7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f506172616d657465727320617265206f6620756e657175616c206c656e67746881525060200191505060405180910390fd5b601e888890501115610ff6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f506172616d657465727320617265206c6f6e676572207468616e20333000000081525060200191505060405180910390fd5b60005b8888905081101561107c5761106f8a8a8a8481811061101457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1689898581811061103d57fe5b9050602002013588888681811061105057fe5b9050602002013587878781811061106357fe5b905060200201356105b1565b8080600101915050610ff9565b50505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6110b46118e5565b73ffffffffffffffffffffffffffffffffffffffff166110d2611219565b73ffffffffffffffffffffffffffffffffffffffff161461115b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000806000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600001549450806001015493508060020154925080600301549150509193509193565b6112b76118e5565b73ffffffffffffffffffffffffffffffffffffffff166112d5611219565b73ffffffffffffffffffffffffffffffffffffffff161461135e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414156113fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611b846028913960400191505060405180910390fd5b600061140684610a51565b9050600061145f82600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546119cb90919063ffffffff16565b905081600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555042600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561158057600080fd5b505af1158015611594573d6000803e3d6000fd5b505050506040513d60208110156115aa57600080fd5b810190808051906020019092919050505061162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4150493320746f6b656e207472616e73666572206661696c656400000000000081525060200191505060405180910390fd5b7f8ae90027281d04f34ca2e7dc8c1c20d126ee8dd017d3f896c0e59d424c264c6d858583604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050505050565b6116af6118e5565b73ffffffffffffffffffffffffffffffffffffffff166116cd611219565b73ffffffffffffffffffffffffffffffffffffffff1614611756576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117dc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611b5e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b600033905090565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060020154421161194557600091506119c5565b8060030154421061195c57806000015491506119c4565b60006119758260020154426119cb90919063ffffffff16565b90506000611994836002015484600301546119cb90919063ffffffff16565b90506119bf816119b1848660000154611a4e90919063ffffffff16565b611ad490919063ffffffff16565b935050505b5b50919050565b600082821115611a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080831415611a615760009050611ace565b6000828402905082848281611a7257fe5b0414611ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611bd36021913960400191505060405180910390fd5b809150505b92915050565b6000808211611b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381611b5457fe5b0490509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373526563697069656e7420646f6573206e6f7420686176652072656d61696e696e6720746f6b656e7372656c65617365456e64206e6f74206c6172676572207468616e2072656c656173655374617274536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cf8e99542a0e388d3227287372063e7feeed054e50013c7585563e4637ccc07e64736f6c634300060c0033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "api3TokenAddress": "Address of the API3 token contract", + "timelockManagerOwner": "Address that will receive the ownership of the TimelockManager contract" + } + }, + "getRemainingAmount(address)": { + "details": "Provided separately to be used with Etherscan's \"Read\" functionality, in case getTimelock() output is too complicated for the user.", + "params": { + "recipient": "Recipient of tokens" + }, + "returns": { + "remainingAmount": "Remaining amount of tokens to be withdrawn" + } + }, + "getTimelock(address)": { + "params": { + "recipient": "Recipient of tokens" + }, + "returns": { + "releaseEnd": "Release end time", + "releaseStart": "Release start time", + "remainingAmount": "Remaining amount of tokens to be withdrawn", + "totalAmount": "Total amount of tokens" + } + }, + "getWithdrawable(address)": { + "params": { + "recipient": "Address of the recipient" + }, + "returns": { + "withdrawable": "Amount of tokens withdrawable by the recipient" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "stopVesting(address,address)": { + "params": { + "destination": "Destination of the excess tokens vested to the addresss", + "recipient": "Original recipient of tokens" + } + }, + "transferAndLock(address,address,uint256,uint256,uint256)": { + "details": "source needs to approve() this contract to transfer amount number of tokens beforehand. A recipient cannot have multiple timelocks.", + "params": { + "amount": "Amount of tokens", + "recipient": "Recipient of tokens", + "releaseEnd": "End of release time", + "releaseStart": "Start of release time", + "source": "Source of tokens" + } + }, + "transferAndLockMultiple(address,address[],uint256[],uint256[],uint256[])": { + "details": "source is expected to be a single address. source needs to approve() this contract to transfer the sum of the amounts of tokens to be transferred and locked.", + "params": { + "amounts": "Array of amounts of tokens", + "recipients": "Array of recipients of tokens", + "releaseEnds": "Array of ends of release times", + "releaseStarts": "Array of starts of release times", + "source": "Source of tokens" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Contract that the TimeLockManager Contract Owner uses to timelock API3 tokens", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "getRemainingAmount(address)": { + "notice": "Returns remaining amount of a timelock" + }, + "getTimelock(address)": { + "notice": "Returns the details of a timelock" + }, + "getWithdrawable(address)": { + "notice": "Returns the amount of tokens a recipient can currently withdraw" + }, + "stopVesting(address,address)": { + "notice": "Called by the ContractOwner to stop the vesting of a recipient" + }, + "transferAndLock(address,address,uint256,uint256,uint256)": { + "notice": "Transfers API3 tokens to this contract and timelocks them" + }, + "transferAndLockMultiple(address,address[],uint256[],uint256[],uint256[])": { + "notice": "Convenience function that calls transferAndLock() multiple times" + }, + "withdraw()": { + "notice": "Used by the recipient to withdraw tokens" + } + }, + "notice": "The owner of TimelockManager can send tokens to TimelockManager to timelock them. These tokens will then be vested to their recipient linearly, starting from releaseStart and ending at releaseEnd of the respective timelock.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 565, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 1152, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "timelocks", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_struct(Timelock)1146_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_struct(Timelock)1146_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct TimelockManagerReversible.Timelock)", + "numberOfBytes": "32", + "value": "t_struct(Timelock)1146_storage" + }, + "t_struct(Timelock)1146_storage": { + "encoding": "inplace", + "label": "struct TimelockManagerReversible.Timelock", + "members": [ + { + "astId": 1139, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "totalAmount", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 1141, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "remainingAmount", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 1143, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "releaseStart", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 1145, + "contract": "contracts/TimeLockManagerReversible.sol:TimelockManagerReversible", + "label": "releaseEnd", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "1441800", + "executionCost": "infinite", + "totalCost": "infinite" + }, + "external": { + "api3Token()": "infinite", + "getRemainingAmount(address)": "1312", + "getTimelock(address)": "3776", + "getWithdrawable(address)": "infinite", + "owner()": "1077", + "renounceOwnership()": "24329", + "stopVesting(address,address)": "infinite", + "timelocks(address)": "3680", + "transferAndLock(address,address,uint256,uint256,uint256)": "infinite", + "transferAndLockMultiple(address,address[],uint256[],uint256[],uint256[])": "infinite", + "transferOwnership(address)": "infinite", + "withdraw()": "infinite" + }, + "internal": { + "getUnlocked(address)": "infinite" + } + } +} \ No newline at end of file diff --git a/packages/timelock-manager/deployments-4/mainnet/solcInputs/0xf753db30cd7679f70b713efd93b8b34b388e3ca7ba372a08c7bd867efe952c62.json b/packages/timelock-manager/deployments-4/mainnet/solcInputs/0xf753db30cd7679f70b713efd93b8b34b388e3ca7ba372a08c7bd867efe952c62.json new file mode 100644 index 0000000..ae3cb2f --- /dev/null +++ b/packages/timelock-manager/deployments-4/mainnet/solcInputs/0xf753db30cd7679f70b713efd93b8b34b388e3ca7ba372a08c7bd867efe952c62.json @@ -0,0 +1,90 @@ +{ + "language": "Solidity", + "sources": { + "contracts/interfaces/ITimelockManager.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\n\ninterface ITimelockManager {\n event Api3PoolUpdated(address api3PoolAddress);\n\n event RevertedTimelock(\n address indexed recipient,\n address destination,\n uint256 amount\n );\n\n event PermittedTimelockToBeReverted(address recipient);\n\n event TransferredAndLocked(\n address source,\n address indexed recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n );\n\n event Withdrawn(\n address indexed recipient,\n uint256 amount\n );\n\n event WithdrawnToPool(\n address indexed recipient,\n address api3PoolAddress,\n address beneficiary\n );\n\n function updateApi3Pool(address api3PoolAddress)\n external;\n\n function revertTimelock(\n address recipient,\n address destination\n )\n external;\n\n function permitTimelockToBeReverted()\n external;\n\n function transferAndLock(\n address source,\n address recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n )\n external;\n\n function transferAndLockMultiple(\n address source,\n address[] calldata recipients,\n uint256[] calldata amounts,\n uint256[] calldata releaseStarts,\n uint256[] calldata releaseEnds\n )\n external;\n\n function withdraw()\n external;\n\n function withdrawToPool(\n address api3PoolAddress,\n address beneficiary\n )\n external;\n\n function getWithdrawable(address recipient)\n external\n view\n returns(uint256 withdrawable);\n\n function getTimelock(address recipient)\n external\n view\n returns (\n uint256 totalAmount,\n uint256 remainingAmount,\n uint256 releaseStart,\n uint256 releaseEnd\n );\n\n function getRemainingAmount(address recipient)\n external\n view\n returns (uint256 remainingAmount);\n\n function getIfTimelockIsRevertible(address recipient)\n external\n view\n returns (bool revertStatus);\n}\n" + }, + "contracts/interfaces/ITimelockManagerReversible.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\ninterface ITimelockManagerReversible {\n\n event StoppedVesting(\n address recipient, \n address destination, \n uint256 amount\n );\n\n event TransferredAndLocked(\n address source,\n address indexed recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n );\n\n event Withdrawn(\n address indexed recipient, \n uint256 amount\n );\n\n function stopVesting(\n address recipient, \n address destination\n ) external;\n\n function transferAndLock(\n address source,\n address recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n ) external;\n\n function transferAndLockMultiple(\n address source,\n address[] calldata recipients,\n uint256[] calldata amounts,\n uint256[] calldata releaseStarts,\n uint256[] calldata releaseEnds\n ) external;\n\n function withdraw() external;\n\n function getWithdrawable(address recipient)\n external\n view\n returns (\n uint256 withdrawable\n );\n\n function getTimelock(address recipient)\n external\n view\n returns (\n uint256 totalAmount,\n uint256 remainingAmount,\n uint256 releaseStart,\n uint256 releaseEnd\n );\n\n function getRemainingAmount(address recipient)\n external\n view\n returns (\n uint256 remainingAmount\n );\n}\n" + }, + "contracts/TimelockManager.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@api3-contracts/api3-token/contracts/interfaces/IApi3Token.sol\";\nimport \"@api3-contracts/api3-pool/contracts/interfaces/IApi3Pool.sol\";\nimport \"./interfaces/ITimelockManager.sol\";\n\n\n/// @title Contract that the API3 DAO uses to timelock API3 tokens\n/// @notice The owner of TimelockManager (i.e., API3 DAO) can send tokens to\n/// TimelockManager to timelock them. These tokens will then be vested to their\n/// recipient linearly, starting from releaseStart and ending at releaseEnd of\n/// the respective timelock.\n/// Alternatively, if the owner of TimelockManager (i.e., API3 DAO) sets the\n/// api3Pool address, the token recipients can transfer their locked tokens\n/// from TimelockManager to api3Pool. These tokens will remain timelocked\n/// (i.e., will not be withdrawable) at api3Pool until they are vested\n/// according to their respective schedule.\ncontract TimelockManager is Ownable, ITimelockManager {\n using SafeMath for uint256;\n\n /// @dev If an address has permitted the owner of this contract (i.e., the\n /// API3 DAO) to revert (i.e., cancel and withdraw the tokens) their\n /// timelock\n mapping(address => bool) private permittedTimelockToBeReverted;\n\n struct Timelock {\n uint256 totalAmount;\n uint256 remainingAmount;\n uint256 releaseStart;\n uint256 releaseEnd;\n }\n\n IApi3Token public immutable api3Token;\n IApi3Pool public api3Pool;\n mapping(address => Timelock) public timelocks;\n\n /// @dev api3Pool is not initialized in the constructor because this\n /// contract will be deployed before api3Pool\n /// @param api3TokenAddress Address of the API3 token contract\n /// @param timelockManagerOwner Address that will receive the ownership of\n /// the TimelockManager contract (i.e., the API3 DAO)\n constructor(\n address api3TokenAddress,\n address timelockManagerOwner\n )\n public\n {\n api3Token = IApi3Token(api3TokenAddress);\n transferOwnership(timelockManagerOwner);\n }\n\n /// @notice Called by the owner (i.e., API3 DAO) to set the address of\n /// api3Pool, which token recipients can transfer their tokens to\n /// @param api3PoolAddress Address of the API3 pool contract\n function updateApi3Pool(address api3PoolAddress)\n external\n override\n onlyOwner\n {\n require(\n address(api3Pool) != api3PoolAddress,\n \"Input will not update state\"\n );\n api3Pool = IApi3Pool(api3PoolAddress);\n emit Api3PoolUpdated(api3PoolAddress);\n }\n\n /// @notice Called by the owner (i.e., API3 DAO) to revert the timelock of\n /// a recipient, given that they have given permission beforehand\n /// @param recipient Original recipient of tokens\n /// @param destination Destination of the tokens locked by the reverted\n /// timelock\n function revertTimelock(\n address recipient,\n address destination\n )\n external\n override\n onlyOwner\n onlyIfRecipientHasRemainingTokens(recipient)\n {\n require(\n destination != address(0),\n \"Invalid destination\"\n );\n require(\n permittedTimelockToBeReverted[recipient],\n \"Not permitted to revert timelock\"\n );\n // Reset permission automatically\n permittedTimelockToBeReverted[recipient] = false;\n uint256 remaining = timelocks[recipient].remainingAmount;\n timelocks[recipient].remainingAmount = 0;\n require(\n api3Token.transfer(destination, remaining),\n \"API3 token transfer failed\"\n );\n emit RevertedTimelock(recipient, destination, remaining);\n }\n\n /// @notice Permit the owner (i.e., API3 DAO) to revert the caller's\n /// timelock\n /// @dev To be used when the timelock has been created with incorrect\n /// parameters (for example with releaseEnd at infinity)\n function permitTimelockToBeReverted()\n external\n override\n onlyIfRecipientHasRemainingTokens(msg.sender)\n {\n require(\n !permittedTimelockToBeReverted[msg.sender],\n \"Input will not update state\"\n );\n permittedTimelockToBeReverted[msg.sender] = true;\n emit PermittedTimelockToBeReverted(msg.sender);\n }\n\n /// @notice Transfers API3 tokens to this contract and timelocks them\n /// @dev source needs to approve() this contract to transfer amount number\n /// of tokens beforehand.\n /// A recipient cannot have multiple timelocks.\n /// @param source Source of tokens\n /// @param recipient Recipient of tokens\n /// @param amount Amount of tokens\n /// @param releaseStart Start of release time\n /// @param releaseEnd End of release time\n function transferAndLock(\n address source,\n address recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n )\n public\n override\n onlyOwner\n {\n require(\n timelocks[recipient].remainingAmount == 0,\n \"Recipient has remaining tokens\"\n );\n require(amount != 0, \"Amount cannot be 0\");\n require(\n releaseEnd > releaseStart,\n \"releaseEnd not larger than releaseStart\"\n );\n require(\n releaseStart > now,\n \"releaseStart not in the future\"\n );\n timelocks[recipient] = Timelock({\n totalAmount: amount,\n remainingAmount: amount,\n releaseStart: releaseStart,\n releaseEnd: releaseEnd\n });\n require(\n api3Token.transferFrom(source, address(this), amount),\n \"API3 token transferFrom failed\"\n );\n emit TransferredAndLocked(\n source,\n recipient,\n amount,\n releaseStart,\n releaseEnd\n );\n }\n\n /// @notice Convenience function that calls transferAndLock() multiple times\n /// @dev source is expected to be a single address, i.e., the API3 DAO.\n /// source needs to approve() this contract to transfer the sum of the\n /// amounts of tokens to be transferred and locked.\n /// @param source Source of tokens\n /// @param recipients Array of recipients of tokens\n /// @param amounts Array of amounts of tokens\n /// @param releaseStarts Array of starts of release times\n /// @param releaseEnds Array of ends of release times\n function transferAndLockMultiple(\n address source,\n address[] calldata recipients,\n uint256[] calldata amounts,\n uint256[] calldata releaseStarts,\n uint256[] calldata releaseEnds\n )\n external\n override\n onlyOwner\n {\n require(\n recipients.length == amounts.length\n && recipients.length == releaseStarts.length\n && recipients.length == releaseEnds.length,\n \"Parameters are of unequal length\"\n );\n require(\n recipients.length <= 30,\n \"Parameters are longer than 30\"\n );\n for (uint256 ind = 0; ind < recipients.length; ind++)\n {\n transferAndLock(\n source,\n recipients[ind],\n amounts[ind],\n releaseStarts[ind],\n releaseEnds[ind]\n );\n }\n }\n\n /// @notice Used by the recipient to withdraw tokens\n function withdraw()\n external\n override\n onlyIfRecipientHasRemainingTokens(msg.sender)\n {\n address recipient = msg.sender;\n uint256 withdrawable = getWithdrawable(recipient);\n require(\n withdrawable != 0,\n \"No withdrawable tokens yet\"\n );\n timelocks[recipient].remainingAmount = timelocks[recipient].remainingAmount.sub(withdrawable);\n require(\n api3Token.transfer(recipient, withdrawable),\n \"API3 token transfer failed\"\n );\n emit Withdrawn(\n recipient,\n withdrawable\n );\n }\n\n /// @notice Used by the recipient to withdraw their tokens to the API3 pool\n /// @dev We ask the recipient to provide api3PoolAddress as a form of\n /// validation, i.e., the recipient confirms that the API3 pool address set\n /// at this contract is correct\n /// @param api3PoolAddress Address of the API3 pool contract\n /// @param beneficiary Address that the tokens will be deposited to the\n /// pool contract on behalf of\n function withdrawToPool(\n address api3PoolAddress,\n address beneficiary\n )\n external\n override\n onlyIfRecipientHasRemainingTokens(msg.sender)\n {\n require(\n beneficiary != address(0),\n \"beneficiary cannot be 0\"\n );\n require(address(api3Pool) != address(0), \"API3 pool not set yet\");\n require(\n address(api3Pool) == api3PoolAddress,\n \"API3 pool addresses do not match\"\n );\n address recipient = msg.sender;\n uint256 withdrawable = getWithdrawable(recipient);\n uint256 remaining = timelocks[recipient].remainingAmount;\n uint256 timelocked = remaining.sub(withdrawable);\n timelocks[recipient].remainingAmount = 0;\n // Approve the total amount\n api3Token.approve(address(api3Pool), remaining);\n // Deposit the funds that are withdrawable without vesting\n if (withdrawable != 0)\n {\n api3Pool.deposit(\n address(this),\n withdrawable,\n beneficiary\n );\n }\n // Deposit the funds that are still timelocked with vesting.\n // The vesting will continue the same way at the pool, released\n // linearly.\n if (timelocked != 0)\n {\n api3Pool.depositWithVesting(\n address(this),\n timelocked,\n beneficiary,\n now > timelocks[recipient].releaseStart ? now : timelocks[recipient].releaseStart,\n timelocks[recipient].releaseEnd\n );\n }\n emit WithdrawnToPool(\n recipient,\n api3PoolAddress,\n beneficiary\n );\n }\n\n /// @notice Returns the amount of tokens a recipient can currently withdraw\n /// @param recipient Address of the recipient\n /// @return withdrawable Amount of tokens withdrawable by the recipient\n function getWithdrawable(address recipient)\n public\n view\n override\n returns(uint256 withdrawable)\n {\n Timelock storage timelock = timelocks[recipient];\n uint256 unlocked = getUnlocked(recipient);\n uint256 withdrawn = timelock.totalAmount.sub(timelock.remainingAmount);\n withdrawable = unlocked.sub(withdrawn);\n }\n\n /// @notice Returns the amount of tokens that was unlocked for the\n /// recipient to date. Includes both withdrawn and non-withdrawn tokens.\n /// @param recipient Address of the recipient\n /// @return unlocked Amount of tokens unlocked for the recipient\n function getUnlocked(address recipient)\n private\n view\n returns(uint256 unlocked)\n {\n Timelock storage timelock = timelocks[recipient];\n if (now <= timelock.releaseStart)\n {\n unlocked = 0;\n }\n else if (now >= timelock.releaseEnd)\n {\n unlocked = timelock.totalAmount;\n }\n else\n {\n uint256 passedTime = now.sub(timelock.releaseStart);\n uint256 totalTime = timelock.releaseEnd.sub(timelock.releaseStart);\n unlocked = timelock.totalAmount.mul(passedTime).div(totalTime);\n }\n }\n\n /// @notice Returns the details of a timelock\n /// @param recipient Recipient of tokens\n /// @return totalAmount Total amount of tokens\n /// @return remainingAmount Remaining amount of tokens to be withdrawn\n /// @return releaseStart Release start time\n /// @return releaseEnd Release end time\n function getTimelock(address recipient)\n external\n view\n override\n returns (\n uint256 totalAmount,\n uint256 remainingAmount,\n uint256 releaseStart,\n uint256 releaseEnd\n )\n {\n Timelock storage timelock = timelocks[recipient];\n totalAmount = timelock.totalAmount;\n remainingAmount = timelock.remainingAmount;\n releaseStart = timelock.releaseStart;\n releaseEnd = timelock.releaseEnd;\n }\n\n /// @notice Returns remaining amount of a timelock\n /// @dev Provided separately to be used with Etherscan's \"Read\"\n /// functionality, in case getTimelock() output is too complicated for the\n /// user.\n /// @param recipient Recipient of tokens\n /// @return remainingAmount Remaining amount of tokens to be withdrawn\n function getRemainingAmount(address recipient)\n external\n view\n override\n returns (uint256 remainingAmount)\n {\n remainingAmount = timelocks[recipient].remainingAmount;\n }\n\n /// @notice Returns if the recipient's timelock is revertible\n /// @param recipient Recipient of tokens\n /// @return revertStatus If the recipient's timelock is revertible\n function getIfTimelockIsRevertible(address recipient)\n external\n view\n override\n returns (bool revertStatus)\n {\n revertStatus = permittedTimelockToBeReverted[recipient];\n }\n\n /// @dev Reverts if the recipient does not have remaining tokens\n modifier onlyIfRecipientHasRemainingTokens(address recipient)\n {\n require(\n timelocks[recipient].remainingAmount != 0,\n \"Recipient does not have remaining tokens\"\n );\n _;\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@api3-contracts/api3-token/contracts/interfaces/IApi3Token.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n\ninterface IApi3Token is IERC20 {\n event MinterStatusUpdated(\n address indexed minterAddress,\n bool minterStatus\n );\n\n event BurnerStatusUpdated(\n address indexed burnerAddress,\n bool burnerStatus\n );\n\n function updateMinterStatus(\n address minterAddress,\n bool minterStatus\n )\n external;\n\n function updateBurnerStatus(bool burnerStatus)\n external;\n\n function mint(\n address account,\n uint256 amount\n )\n external;\n\n function burn(uint256 amount)\n external;\n\n function getMinterStatus(address minterAddress)\n external\n view\n returns(bool minterStatus);\n\n function getBurnerStatus(address burnerAddress)\n external\n view\n returns(bool burnerStatus);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IApi3Pool.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./ITransferUtils.sol\";\n\n\ninterface IApi3Pool is ITransferUtils {}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/ITransferUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IPoolUtils.sol\";\n\n\ninterface ITransferUtils is IPoolUtils {\n event Deposited(\n address indexed sourceAddress,\n uint256 amount,\n address indexed userAddress\n );\n \n event DepositedWithVesting(\n address indexed sourceAddress,\n uint256 amount,\n address indexed userAddress,\n uint256 vestingEpoch\n );\n \n event Withdrawn(\n address indexed userAddress,\n address destinationAddress,\n uint256 amount\n );\n \n event AddedVestedRewards(\n address indexed sourceAddress,\n uint256 amount,\n uint256 indexed epochIndex\n );\n \n event AddedInstantRewards(\n address indexed sourceAddress,\n uint256 amount,\n uint256 indexed epochIndex\n );\n\n function deposit(\n address sourceAddress,\n uint256 amount,\n address userAddress\n )\n external;\n\n function depositWithVesting(\n address sourceAddress,\n uint256 amount,\n address userAddress,\n uint256 vestingStart,\n uint256 vestingEnd\n )\n external;\n\n function withdraw(\n address destinationAddress,\n uint256 amount\n )\n external;\n\n function addVestedRewards(\n address sourceAddress,\n uint256 amount\n )\n external;\n\n function addInstantRewards(\n address sourceAddress,\n uint256 amount\n )\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IPoolUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IStakeUtils.sol\";\n\n\ninterface IPoolUtils is IStakeUtils {\n event Pooled(\n address indexed userAddress,\n uint256 amount,\n uint256 amountInShares\n );\n \n event RequestedToUnpool(address indexed userAddress);\n\n event Unpooled(\n address indexed userAddress,\n uint256 amount,\n uint256 amountInShares\n );\n\n function pool(uint256 amount)\n external;\n\n function requestToUnpool()\n external;\n\n function unpool(uint256 amountInShares)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IStakeUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IVestingUtils.sol\";\n\n\ninterface IStakeUtils is IVestingUtils {\n event Staked(\n address indexed userAddress,\n uint256 amountInShares\n );\n \n event UpdatedDelegate(\n address indexed userAddress,\n address indexed delegate\n );\n\n event Collected(\n address indexed userAddress,\n uint256 vestedRewards,\n uint256 instantRewards\n );\n\n function stake(address userAddress)\n external;\n\n function updateDelegate(address delegate)\n external;\n\n function collect(address userAddress)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IVestingUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IIouUtils.sol\";\n\n\ninterface IVestingUtils is IIouUtils {\n event VestingCreated(\n bytes32 indexed vestingId,\n address indexed userAddress,\n uint256 amount,\n uint256 vestingEpoch\n );\n\n event VestingResolved(bytes32 indexed vestingId);\n\n function vest(bytes32 vestingId)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IIouUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IApi3State.sol\";\nimport \"./IClaimUtils.sol\";\n\n\ninterface IIouUtils is IClaimUtils {\n event IouCreated(\n bytes32 indexed iouId,\n address indexed userAddress,\n uint256 amountInShares,\n bytes32 indexed claimId,\n IApi3State.ClaimStatus redemptionCondition\n );\n\n event IouRedeemed(bytes32 indexed iouId, uint256 amount);\n\n event IouDeleted(bytes32 indexed iouId);\n\n function redeem(bytes32 iouId)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IApi3State.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n\ninterface IApi3State {\n enum ClaimStatus { Pending, Accepted, Denied }\n\n event InflationManagerUpdated(address inflationManagerAddress);\n event ClaimsManagerUpdated(address claimsManagerAddress);\n event RewardVestingPeriodUpdated(uint256 rewardVestingPeriod);\n event UnpoolRequestCooldownUpdated(uint256 unpoolRequestCooldown);\n event UnpoolWaitingPeriodUpdated(uint256 unpoolWaitingPeriod);\n\n function updateInflationManager(address inflationManagerAddress)\n external;\n\n function updateClaimsManager(address claimsManagerAddress)\n external;\n\n function updateRewardVestingPeriod(uint256 _rewardVestingPeriod)\n external;\n\n function updateUnpoolRequestCooldown(uint256 _unpoolRequestCooldown)\n external;\n\n function updateUnpoolWaitingPeriod(uint256 _unpoolWaitingPeriod)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IClaimUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IGetterUtils.sol\";\n\n\ninterface IClaimUtils is IGetterUtils {\n event ClaimCreated(\n bytes32 indexed claimId,\n address indexed beneficiary,\n uint256 amount\n );\n\n event ClaimAccepted(bytes32 indexed claimId);\n\n event ClaimDenied(bytes32 indexed claimId);\n\n function createClaim(\n address beneficiary,\n uint256 amount\n )\n external;\n\n function acceptClaim(bytes32 claimId)\n external;\n\n function denyClaim(bytes32 claimId)\n external;\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IGetterUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IEpochUtils.sol\";\n\n\ninterface IGetterUtils is IEpochUtils {\n function getPooled(address userAddress)\n external\n view\n returns(uint256 pooled);\n\n function getVotingPower(\n address delegate,\n uint256 timestamp\n )\n external\n view\n returns(uint256 votingPower);\n\n function getTotalRealPooled()\n external\n view\n returns(uint256 totalRealPooled);\n\n function getBalance(address userAddress)\n external\n view\n returns(uint256 balance);\n\n function getShare(address userAddress)\n external\n view\n returns(uint256 share);\n\n function getUnpoolRequestEpoch(address userAddress)\n external\n view\n returns(uint256 unpoolRequestEpoch);\n\n function getTotalStaked(uint256 epochIndex)\n external\n view\n returns(uint256 totalStaked);\n\n function getStaked(\n address userAddress,\n uint256 epochIndex\n )\n external\n view\n returns(uint256 staked);\n\n function getDelegate(address userAddress)\n external\n view\n returns(address delegate);\n\n function getDelegated(\n address delegate,\n uint256 epochIndex\n )\n external\n view\n returns(uint256 delegated);\n\n function getVestedRewards(uint256 epochIndex)\n external\n view\n returns(uint256 vestedRewards);\n\n function getUnpaidVestedRewards(uint256 epochIndex)\n external\n view\n returns(uint256 unpaidVestedRewards);\n\n function getInstantRewards(uint256 epochIndex)\n external\n view\n returns(uint256 instantRewards);\n\n function getUnpaidInstantRewards(uint256 epochIndex)\n external\n view\n returns(uint256 unpaidInstantRewards);\n\n function getVesting(bytes32 vestingId)\n external\n view\n returns(\n address userAddress,\n uint256 amount,\n uint256 epoch\n );\n\n function getUnvestedFund(address userAddress)\n external\n view\n returns(uint256 unvestedFund);\n\n function getClaim(bytes32 claimId)\n external\n view\n returns(\n address beneficiary,\n uint256 amount,\n IApi3State.ClaimStatus status\n );\n\n function getActiveClaims()\n external\n view\n returns(bytes32[] memory _activeClaims);\n\n function getIou(bytes32 iouId)\n external\n view\n returns(\n address userAddress,\n uint256 amountInShares,\n bytes32 claimId,\n IApi3State.ClaimStatus redemptionCondition\n );\n}\n" + }, + "@api3-contracts/api3-pool/contracts/interfaces/IEpochUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"./IApi3State.sol\";\n\n\ninterface IEpochUtils is IApi3State {\n function getCurrentEpochIndex()\n external\n view\n returns(uint256 currentEpochIndex);\n\n function getEpochIndex(uint256 timestamp)\n external\n view\n returns(uint256 epochIndex);\n}\n" + }, + "contracts/TimeLockManagerReversible.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@api3-contracts/api3-token/contracts/interfaces/IApi3Token.sol\";\nimport \"./interfaces/ITimelockManagerReversible.sol\";\n\n/// @title Contract that the TimeLockManager Contract Owner uses to timelock API3 tokens\n/// @notice The owner of TimelockManager can send tokens to\n/// TimelockManager to timelock them. These tokens will then be vested to their\n/// recipient linearly, starting from releaseStart and ending at releaseEnd of\n/// the respective timelock.\n\ncontract TimelockManagerReversible is Ownable, ITimelockManagerReversible {\n using SafeMath for uint256;\n\n struct Timelock {\n uint256 totalAmount;\n uint256 remainingAmount;\n uint256 releaseStart;\n uint256 releaseEnd;\n }\n\n IApi3Token public immutable api3Token;\n mapping(address => Timelock) public timelocks;\n\n /// @param api3TokenAddress Address of the API3 token contract\n /// @param timelockManagerOwner Address that will receive the ownership of\n /// the TimelockManager contract\n constructor(\n address api3TokenAddress, \n address timelockManagerOwner\n ) \n public \n {\n api3Token = IApi3Token(api3TokenAddress);\n transferOwnership(timelockManagerOwner);\n }\n\n /// @notice Called by the ContractOwner to stop the vesting of\n /// a recipient\n /// @param recipient Original recipient of tokens\n /// @param destination Destination of the excess tokens vested to the addresss\n function stopVesting(\n address recipient, \n address destination\n )\n external\n override\n onlyOwner\n onlyIfRecipientHasRemainingTokens(recipient)\n {\n uint256 withdrawable = getWithdrawable(recipient);\n uint256 reclaimedTokens =\n timelocks[recipient].remainingAmount.sub(withdrawable);\n timelocks[recipient].remainingAmount = withdrawable;\n timelocks[recipient].releaseEnd = now;\n require(\n api3Token.transfer(destination, reclaimedTokens),\n \"API3 token transfer failed\"\n );\n emit StoppedVesting(recipient, destination, reclaimedTokens);\n }\n\n /// @notice Transfers API3 tokens to this contract and timelocks them\n /// @dev source needs to approve() this contract to transfer amount number\n /// of tokens beforehand.\n /// A recipient cannot have multiple timelocks.\n /// @param source Source of tokens\n /// @param recipient Recipient of tokens\n /// @param amount Amount of tokens\n /// @param releaseStart Start of release time\n /// @param releaseEnd End of release time\n function transferAndLock(\n address source,\n address recipient,\n uint256 amount,\n uint256 releaseStart,\n uint256 releaseEnd\n ) \n public \n override \n onlyOwner\n {\n require(\n timelocks[recipient].remainingAmount == 0,\n \"Recipient has remaining tokens\"\n );\n require(amount != 0, \"Amount cannot be 0\");\n require(\n releaseEnd > releaseStart,\n \"releaseEnd not larger than releaseStart\"\n );\n timelocks[recipient] = Timelock({\n totalAmount: amount,\n remainingAmount: amount,\n releaseStart: releaseStart,\n releaseEnd: releaseEnd\n });\n require(\n api3Token.transferFrom(source, address(this), amount),\n \"API3 token transferFrom failed\"\n );\n emit TransferredAndLocked(\n source,\n recipient,\n amount,\n releaseStart,\n releaseEnd\n );\n }\n\n /// @notice Convenience function that calls transferAndLock() multiple times\n /// @dev source is expected to be a single address.\n /// source needs to approve() this contract to transfer the sum of the\n /// amounts of tokens to be transferred and locked.\n /// @param source Source of tokens\n /// @param recipients Array of recipients of tokens\n /// @param amounts Array of amounts of tokens\n /// @param releaseStarts Array of starts of release times\n /// @param releaseEnds Array of ends of release times\n function transferAndLockMultiple(\n address source,\n address[] calldata recipients,\n uint256[] calldata amounts,\n uint256[] calldata releaseStarts,\n uint256[] calldata releaseEnds\n ) \n external \n override \n onlyOwner \n {\n require(\n recipients.length == amounts.length &&\n recipients.length == releaseStarts.length &&\n recipients.length == releaseEnds.length,\n \"Parameters are of unequal length\"\n );\n require(recipients.length <= 30, \"Parameters are longer than 30\");\n for (uint256 ind = 0; ind < recipients.length; ind++) {\n transferAndLock(\n source,\n recipients[ind],\n amounts[ind],\n releaseStarts[ind],\n releaseEnds[ind]\n );\n }\n }\n\n /// @notice Used by the recipient to withdraw tokens\n function withdraw()\n external\n override\n onlyIfRecipientHasRemainingTokens(msg.sender)\n {\n address recipient = msg.sender;\n uint256 withdrawable = getWithdrawable(recipient);\n require(withdrawable != 0, \"No withdrawable tokens yet\");\n timelocks[recipient].remainingAmount = timelocks[recipient]\n .remainingAmount\n .sub(withdrawable);\n require(\n api3Token.transfer(recipient, withdrawable),\n \"API3 token transfer failed\"\n );\n emit Withdrawn(recipient, withdrawable);\n }\n\n /// @notice Returns the amount of tokens a recipient can currently withdraw\n /// @param recipient Address of the recipient\n /// @return withdrawable Amount of tokens withdrawable by the recipient\n function getWithdrawable(address recipient)\n public\n view\n override\n returns (uint256 withdrawable)\n {\n Timelock storage timelock = timelocks[recipient];\n uint256 unlocked = getUnlocked(recipient);\n uint256 withdrawn = timelock.totalAmount.sub(timelock.remainingAmount);\n withdrawable = unlocked.sub(withdrawn);\n }\n\n /// @notice Returns the amount of tokens that was unlocked for the\n /// recipient to date. Includes both withdrawn and non-withdrawn tokens.\n /// @param recipient Address of the recipient\n /// @return unlocked Amount of tokens unlocked for the recipient\n function getUnlocked(address recipient)\n private\n view\n returns (uint256 unlocked)\n {\n Timelock storage timelock = timelocks[recipient];\n if (now <= timelock.releaseStart) {\n unlocked = 0;\n } else if (now >= timelock.releaseEnd) {\n unlocked = timelock.totalAmount;\n } else {\n uint256 passedTime = now.sub(timelock.releaseStart);\n uint256 totalTime = timelock.releaseEnd.sub(timelock.releaseStart);\n unlocked = timelock.totalAmount.mul(passedTime).div(totalTime);\n }\n }\n\n /// @notice Returns the details of a timelock\n /// @param recipient Recipient of tokens\n /// @return totalAmount Total amount of tokens\n /// @return remainingAmount Remaining amount of tokens to be withdrawn\n /// @return releaseStart Release start time\n /// @return releaseEnd Release end time\n function getTimelock(address recipient)\n external\n view\n override\n returns (\n uint256 totalAmount,\n uint256 remainingAmount,\n uint256 releaseStart,\n uint256 releaseEnd\n )\n {\n Timelock storage timelock = timelocks[recipient];\n totalAmount = timelock.totalAmount;\n remainingAmount = timelock.remainingAmount;\n releaseStart = timelock.releaseStart;\n releaseEnd = timelock.releaseEnd;\n }\n\n /// @notice Returns remaining amount of a timelock\n /// @dev Provided separately to be used with Etherscan's \"Read\"\n /// functionality, in case getTimelock() output is too complicated for the\n /// user.\n /// @param recipient Recipient of tokens\n /// @return remainingAmount Remaining amount of tokens to be withdrawn\n function getRemainingAmount(address recipient)\n external\n view\n override\n returns (uint256 remainingAmount)\n {\n remainingAmount = timelocks[recipient].remainingAmount;\n }\n\n /// @dev Reverts if the recipient does not have remaining tokens\n modifier onlyIfRecipientHasRemainingTokens(address recipient) {\n require(\n timelocks[recipient].remainingAmount != 0,\n \"Recipient does not have remaining tokens\"\n );\n _;\n }\n}\n" + } + }, + "settings": { + "metadata": { + "useLiteralContent": false + }, + "optimizer": { + "enabled": false, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "id", + "ast" + ] + } + } + } +} \ No newline at end of file