UNPKG

@cartesi/staking-pool

Version:
690 lines 165 kB
{ "address": "0x3F9A0B1A0B81473e051a26a039F730b28f02018B", "abi": [ { "inputs": [ { "internalType": "address", "name": "_ctsi", "type": "address" }, { "internalType": "address", "name": "_staking", "type": "address" }, { "internalType": "address", "name": "_workerManager", "type": "address" }, { "internalType": "address", "name": "_ens", "type": "address" }, { "internalType": "uint256", "name": "_stakeLock", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "commission", "type": "uint256" } ], "name": "BlockProduced", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "stakeTimestamp", "type": "uint256" } ], "name": "Deposit", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } ], "name": "Stake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "name", "type": "string" } ], "name": "StakingPoolRenamed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } ], "name": "Unstake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Withdraw", "type": "event" }, { "inputs": [], "name": "amount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "amountToShares", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "amounts", "outputs": [ { "internalType": "uint256", "name": "stake", "type": "uint256" }, { "internalType": "uint256", "name": "unstake", "type": "uint256" }, { "internalType": "uint256", "name": "withdraw", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "workerAddress", "type": "address" } ], "name": "cancelHire", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "ctsi", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "deposit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "ens", "outputs": [ { "internalType": "contract ENS", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "factory", "outputs": [ { "internalType": "contract StakingPoolFactory", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fee", "outputs": [ { "internalType": "contract Fee", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getWithdrawBalance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address payable", "name": "workerAddress", "type": "address" } ], "name": "hire", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_fee", "type": "address" }, { "internalType": "address", "name": "_pos", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "lockTime", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pos", "outputs": [ { "internalType": "contract IPoS", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_index", "type": "uint256" } ], "name": "produceBlock", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rebalance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "requiredLiquidity", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address payable", "name": "workerAddress", "type": "address" } ], "name": "retire", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "selfhire", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" } ], "name": "setName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "shares", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_shares", "type": "uint256" } ], "name": "sharesToAmount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "stake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_shares", "type": "uint256" } ], "name": "unstake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "update", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "userBalance", "outputs": [ { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "shares", "type": "uint256" }, { "internalType": "uint256", "name": "depositTimestamp", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ], "transactionHash": "0x2c492c7567233e92cb7df65b2f0ed5cadd813772f7f3dac5c4587b0e6094ec48", "receipt": { "to": null, "from": "0x0e28A8f88C6266dF0FE274c15c1d4b27f8B373C0", "contractAddress": "0x3F9A0B1A0B81473e051a26a039F730b28f02018B", "transactionIndex": 165, "gasUsed": "2444069", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000040000000010000000000000000000000000000000000000000000008000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0xa15277f1d7dbcd684cca8a0cc13a42ef3ac97264e80d920e5c9bbabe4919323f", "transactionHash": "0x2c492c7567233e92cb7df65b2f0ed5cadd813772f7f3dac5c4587b0e6094ec48", "logs": [ { "transactionIndex": 165, "blockNumber": 13305578, "transactionHash": "0x2c492c7567233e92cb7df65b2f0ed5cadd813772f7f3dac5c4587b0e6094ec48", "address": "0x3F9A0B1A0B81473e051a26a039F730b28f02018B", "topics": [ "0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258" ], "data": "0x0000000000000000000000000e28a8f88c6266df0fe274c15c1d4b27f8b373c0", "logIndex": 321, "blockHash": "0xa15277f1d7dbcd684cca8a0cc13a42ef3ac97264e80d920e5c9bbabe4919323f" } ], "blockNumber": 13305578, "cumulativeGasUsed": "20003740", "status": 1, "byzantium": true }, "args": [ "0x491604c0FDF08347Dd1fa4Ee062a822A5DD06B5D", "0x9EdEAdFDE65BCfD0907db3AcdB3445229c764A69", "0x832D9f06970ddAc7BA49Be5a2cCad8f89Df74C13", "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", 21600 ], "solcInputHash": "105bbd2ef4c634ab753137e634875bc4", "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ctsi\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_staking\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_workerManager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ens\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_stakeLock\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"commission\",\"type\":\"uint256\"}],\"name\":\"BlockProduced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeTimestamp\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Stake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"StakingPoolRenamed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Unstake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"amountToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdraw\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"cancelHire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ctsi\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"contract StakingPoolFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"contract Fee\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"hire\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_fee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_pos\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pos\",\"outputs\":[{\"internalType\":\"contract IPoS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"produceBlock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requiredLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"workerAddress\",\"type\":\"address\"}],\"name\":\"retire\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"selfhire\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"shares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_shares\",\"type\":\"uint256\"}],\"name\":\"sharesToAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_shares\",\"type\":\"uint256\"}],\"name\":\"unstake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"update\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"amounts()\":{\"returns\":{\"stake\":\"amount of tokens that can be staked\",\"unstake\":\"amount of tokens that must be unstaked to add liquidity\",\"withdraw\":\"amount of tokens that can be withdrawn to add liquidity\"}},\"cancelHire(address)\":{\"params\":{\"workerAddress\":\"address of the worker node\"}},\"getWithdrawBalance()\":{\"details\":\"there is no way to know the exact time in the future the requested tokens will be available\",\"returns\":{\"_0\":\"the amount of tokens that can be immediately withdrawn by the calling user\"}},\"hire(address)\":{\"params\":{\"workerAddress\":\"address of the worker\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"produceBlock(uint256)\":{\"returns\":{\"_0\":\"true when everything went fine\"}},\"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.\"},\"retire(address)\":{\"details\":\"this also removes all authorizations in place\",\"params\":{\"workerAddress\":\"address of the worker to be retired\"}},\"stake(uint256)\":{\"params\":{\"_amount\":\"amount of tokens to convert from user's balance\"}},\"withdraw(uint256)\":{\"details\":\"this will transfer all free tokens for the calling user\"}},\"version\":1},\"userdoc\":{\"events\":{\"BlockProduced(uint256,uint256)\":{\"notice\":\"this event is emitted at every produceBlock call reward is the block reward commission is how much CTSI is directed to the pool owner\"},\"Deposit(address,uint256,uint256)\":{\"notice\":\"Tokens were deposited, available for staking or withdrawal\"},\"Stake(address,uint256,uint256)\":{\"notice\":\"Tokens were deposited, they count as shares immediatly\"},\"StakingPoolRenamed(string)\":{\"notice\":\"Event emmited when a pool is rename\"},\"Unstake(address,uint256,uint256)\":{\"notice\":\"Request to unstake tokens. Additional liquidity requested for the pool\"},\"Withdraw(address,uint256)\":{\"notice\":\"Withdraw performed by a user\"}},\"kind\":\"user\",\"methods\":{\"amounts()\":{\"notice\":\"provide information for offchain about the amount for each staking operation on the main Staking contract\"},\"cancelHire(address)\":{\"notice\":\"Called by the user to cancel a job offer\"},\"getWithdrawBalance()\":{\"notice\":\"Returns the amount of tokens that can be immediately withdrawn by the calling user\"},\"hire(address)\":{\"notice\":\"Asks the worker to work for the sender. Sender needs to pay something.\"},\"pause()\":{\"notice\":\"pauses new staking on the pool\"},\"produceBlock(uint256)\":{\"notice\":\"routes produceBlock to POS contract and updates internal states of the pool\"},\"rebalance()\":{\"notice\":\"Move tokens from pool to staking or vice-versa, according to required liquidity. If the pool has more liquidity then necessary, it stakes tokens. If the pool has less liquidity then necessary, and has not started an unstake, it unstakes. If the pool has less liquity than necessary, and has started an unstake, it withdraws if possible.\"},\"retire(address)\":{\"notice\":\"Called by the user to retire his worker.\"},\"selfhire()\":{\"notice\":\"allows for the pool to act on its own behalf when producing blocks.\"},\"setName(string)\":{\"notice\":\"sets a name for the pool using ENS service\"},\"stake(uint256)\":{\"notice\":\"Stake an amount of tokens, immediately earning pool shares in returns\"},\"unpause()\":{\"notice\":\"unpauses new staking on the pool\"},\"unstake(uint256)\":{\"notice\":\"allow for users to defined exactly how many shares they want to unstake. Estimated value is then emitted on Unstake event\"},\"update()\":{\"notice\":\"updates the internal settings for important pieces of the Cartesi PoS system\"},\"withdraw(uint256)\":{\"notice\":\"Transfer tokens back to calling user wallet\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/StakingPoolImpl.sol\":\"StakingPoolImpl\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@cartesi/pos/contracts/IPoS.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Interface PoS\\npragma solidity >=0.7.0 <0.9.0;\\n\\ninterface IPoS {\\n /// @notice Produce a block\\n /// @param _index the index of the instance of pos you want to interact with\\n /// @dev this function can only be called by a worker, user never calls it directly\\n function produceBlock(uint256 _index) external returns (bool);\\n\\n /// @notice Get reward manager address\\n /// @param _index index of instance\\n /// @return address of instance's RewardManager\\n function getRewardManagerAddress(uint256 _index)\\n external\\n view\\n returns (address);\\n\\n /// @notice Get block selector address\\n /// @param _index index of instance\\n /// @return address of instance's block selector\\n function getBlockSelectorAddress(uint256 _index)\\n external\\n view\\n returns (address);\\n\\n /// @notice Get block selector index\\n /// @param _index index of instance\\n /// @return index of instance's block selector\\n function getBlockSelectorIndex(uint256 _index)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Get staking address\\n /// @param _index index of instance\\n /// @return address of instance's staking contract\\n function getStakingAddress(uint256 _index) external view returns (address);\\n\\n /// @notice Get state of a particular instance\\n /// @param _index index of instance\\n /// @param _user address of user\\n /// @return bool if user is eligible to produce next block\\n /// @return address of user that was chosen to build the block\\n /// @return current reward paid by the network for that block\\n function getState(uint256 _index, address _user)\\n external\\n view\\n returns (\\n bool,\\n address,\\n uint256\\n );\\n\\n function terminate(uint256 _index) external;\\n}\\n\",\"keccak256\":\"0xf22d440f723b8d80ef60a20bf38f5a3ea16fd604a2c485e1c969bec0b24e8889\",\"license\":\"Apache-2.0\"},\"@cartesi/pos/contracts/IRewardManager.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Interface RewardManager\\npragma solidity >=0.7.0 <0.9.0;\\n\\ninterface IRewardManager {\\n /// @notice Rewards address\\n /// @param _address address be rewarded\\n /// @param _amount reward\\n /// @dev only the pos contract can call this\\n function reward(address _address, uint256 _amount) external;\\n\\n /// @notice Get RewardManager's balance\\n function getBalance() external view returns (uint256);\\n\\n /// @notice Get current reward amount\\n function getCurrentReward() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf3d3fb9853d55c0658f45dfd072032291c975138e99cd8cedb0d6550848e2813\",\"license\":\"Apache-2.0\"},\"@cartesi/pos/contracts/IStaking.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Interface Staking\\npragma solidity >=0.7.0 <0.9.0;\\n\\ninterface IStaking {\\n /// @notice Returns total amount of tokens counted as stake\\n /// @param _userAddress user to retrieve staked balance from\\n /// @return finalized staked of _userAddress\\n function getStakedBalance(address _userAddress)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns the timestamp when next deposit can be finalized\\n /// @return timestamp of when finalizeStakes() is callable\\n function getMaturingTimestamp(address _userAddress)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns the timestamp when next withdraw can be finalized\\n /// @return timestamp of when finalizeWithdraw() is callable\\n function getReleasingTimestamp(address _userAddress)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns the balance waiting/ready to be matured\\n /// @return amount that will get staked after finalization\\n function getMaturingBalance(address _userAddress)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns the balance waiting/ready to be released\\n /// @return amount that will get withdrew after finalization\\n function getReleasingBalance(address _userAddress)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Deposit CTSI to be staked. The money will turn into staked\\n /// balance after timeToStake days\\n /// @param _amount The amount of tokens that are gonna be deposited.\\n function stake(uint256 _amount) external;\\n\\n /// @notice Remove tokens from staked balance. The money can\\n /// be released after timeToRelease seconds, if the\\n /// function withdraw is called.\\n /// @param _amount The amount of tokens that are gonna be unstaked.\\n function unstake(uint256 _amount) external;\\n\\n /// @notice Transfer tokens to user's wallet.\\n /// @param _amount The amount of tokens that are gonna be transferred.\\n function withdraw(uint256 _amount) external;\\n\\n // events\\n /// @notice CTSI tokens were deposited, they count as stake after _maturationDate\\n /// @param user address of msg.sender\\n /// @param amount amount deposited for staking\\n /// @param maturationDate date when the stake can be finalized\\n event Stake(address indexed user, uint256 amount, uint256 maturationDate);\\n\\n /// @notice Unstake tokens, moving them to releasing structure\\n /// @param user address of msg.sender\\n /// @param amount amount of tokens to be released\\n /// @param maturationDate date when the tokens can be withdrew\\n event Unstake(address indexed user, uint256 amount, uint256 maturationDate);\\n\\n /// @notice Withdraw process was finalized\\n /// @param user address of msg.sender\\n /// @param amount amount of tokens withdrawn\\n event Withdraw(address indexed user, uint256 amount);\\n}\\n\",\"keccak256\":\"0xda69ecab096249069100cd857133f717045d19422061ea06d87eca606ac62dd3\",\"license\":\"Apache-2.0\"},\"@cartesi/pos/contracts/IWorkerManagerAuthManager.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Interface WorkerManager\\n/// @author Danilo Tuler\\npragma solidity >=0.7.0 <0.9.0;\\n\\ninterface IWorkerManagerAuthManager {\\n /// @notice Asks the worker to work for the sender. Sender needs to pay something.\\n /// @param workerAddress address of the worker\\n function hire(address payable workerAddress) external payable;\\n\\n /// @notice Called by the user to cancel a job offer\\n /// @param workerAddress address of the worker node\\n function cancelHire(address workerAddress) external;\\n\\n /// @notice Called by the user to retire his worker.\\n /// @param workerAddress address of the worker to be retired\\n /// @dev this also removes all authorizations in place\\n function retire(address payable workerAddress) external;\\n\\n /// @notice Gives worker permission to act on a DApp\\n /// @param _workerAddress address of the worker node to given permission\\n /// @param _dappAddress address of the dapp that permission will be given to\\n function authorize(address _workerAddress, address _dappAddress) external;\\n\\n /// @notice Called by the worker to accept the job\\n function acceptJob() external;\\n\\n /// @notice Called by the worker to reject a job offer\\n function rejectJob() external payable;\\n}\\n\",\"keccak256\":\"0x81c78ff7141cedf3cb3c70537b557baf88070a4d374a5967c5a65e0b865e9b46\",\"license\":\"Apache-2.0\"},\"@ensdomains/ens-contracts/contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n function setRecord(bytes32 node, address owner, address resolver, uint64 ttl) external virtual;\\n function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external virtual;\\n function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external virtual returns(bytes32);\\n function setResolver(bytes32 node, address resolver) external virtual;\\n function setOwner(bytes32 node, address owner) external virtual;\\n function setTTL(bytes32 node, uint64 ttl) external virtual;\\n function setApprovalForAll(address operator, bool approved) external virtual;\\n function owner(bytes32 node) external virtual view returns (address);\\n function resolver(bytes32 node) external virtual view returns (address);\\n function ttl(bytes32 node) external virtual view returns (uint64);\\n function recordExists(bytes32 node) external virtual view returns (bool);\\n function isApprovedForAll(address owner, address operator) external virtual view returns (bool);\\n}\\n\",\"keccak256\":\"0x942ef29bd7c0f62228aeb91879ddd1ba101f52a2162970d3e48adffa498f4483\"},\"@ensdomains/ens-contracts/contracts/registry/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"./ENS.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../root/Controllable.sol\\\";\\n\\nabstract contract NameResolver {\\n function setName(bytes32 node, string memory name) public virtual;\\n}\\n\\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\\n\\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n// namehash('addr.reverse')\\n\\ncontract ReverseRegistrar is Ownable, Controllable {\\n ENS public ens;\\n NameResolver public defaultResolver;\\n\\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\\n\\n /**\\n * @dev Constructor\\n * @param ensAddr The address of the ENS registry.\\n * @param resolverAddr The address of the default reverse resolver.\\n */\\n constructor(ENS ensAddr, NameResolver resolverAddr) {\\n ens = ensAddr;\\n defaultResolver = resolverAddr;\\n\\n // Assign ownership of the reverse record to our deployer\\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\\n ens.owner(ADDR_REVERSE_NODE)\\n );\\n if (address(oldRegistrar) != address(0x0)) {\\n oldRegistrar.claim(msg.sender);\\n }\\n }\\n\\n modifier authorised(address addr) {\\n require(\\n addr == msg.sender ||\\n controllers[msg.sender] ||\\n ens.isApprovedForAll(addr, msg.sender) ||\\n ownsContract(addr),\\n \\\"Caller is not a controller or authorised by address or the address itself\\\"\\n );\\n _;\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claim(address owner) public returns (bytes32) {\\n return _claimWithResolver(msg.sender, owner, address(0x0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param addr The reverse record to set\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimForAddr(address addr, address owner)\\n public\\n authorised(addr)\\n returns (bytes32)\\n {\\n return _claimWithResolver(addr, owner, address(0x0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimWithResolver(address owner, address resolver)\\n public\\n returns (bytes32)\\n {\\n return _claimWithResolver(msg.sender, owner, resolver);\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record specified with the\\n * address provided\\n * @param addr The reverse record to set\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimWithResolverForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) public authorised(addr) returns (bytes32) {\\n return _claimWithResolver(addr, owner, resolver);\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the calling account. First updates the resolver to the default reverse\\n * resolver if necessary.\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setName(string memory name) public returns (bytes32) {\\n bytes32 node = _claimWithResolver(\\n msg.sender,\\n address(this),\\n address(defaultResolver)\\n );\\n defaultResolver.setName(node, name);\\n return node;\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the account provided. First updates the resolver to the default reverse\\n * resolver if necessary.\\n * Only callable by controllers and authorised users\\n * @param addr The reverse record to set\\n * @param owner The owner of the reverse node\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setNameForAddr(\\n address addr,\\n address owner,\\n string memory name\\n ) public authorised(addr) returns (bytes32) {\\n bytes32 node = _claimWithResolver(\\n addr,\\n address(this),\\n address(defaultResolver)\\n );\\n defaultResolver.setName(node, name);\\n ens.setSubnodeOwner(ADDR_REVERSE_NODE, sha3HexAddress(addr), owner);\\n return node;\\n }\\n\\n /**\\n * @dev Returns the node hash for a given account's reverse records.\\n * @param addr The address to hash\\n * @return The ENS node hash.\\n */\\n function node(address addr) public pure returns (bytes32) {\\n return\\n keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\\n );\\n }\\n\\n /**\\n * @dev An optimised function to compute the sha3 of the lower-case\\n * hexadecimal representation of an Ethereum address.\\n * @param addr The address to hash\\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\\n * input address.\\n */\\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\\n assembly {\\n for {\\n let i := 40\\n } gt(i, 0) {\\n\\n } {\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n }\\n\\n ret := keccak256(0, 40)\\n }\\n }\\n\\n /* Internal functions */\\n\\n function _claimWithResolver(\\n address addr,\\n address owner,\\n address resolver\\n ) internal returns (bytes32) {\\n bytes32 label = sha3HexAddress(addr);\\n bytes32 node = keccak256(abi.encodePacked(ADDR_REVERSE_NODE, label));\\n address currentResolver = ens.resolver(node);\\n bool shouldUpdateResolver = (resolver != address(0x0) &&\\n resolver != currentResolver);\\n address newResolver = shouldUpdateResolver ? resolver : currentResolver;\\n\\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, label, owner, newResolver, 0);\\n\\n emit ReverseClaimed(addr, node);\\n\\n return node;\\n }\\n\\n function ownsContract(address addr) internal view returns (bool) {\\n try Ownable(addr).owner() returns (address owner) {\\n return owner == msg.sender;\\n } catch {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6151b50f057afe5e32f9ef2f05b3c5c3ac8719b5900aead76d60be4356997ef6\"},\"@ensdomains/ens-contracts/contracts/root/Controllable.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool enabled);\\n\\n modifier onlyController {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n\\n function setController(address controller, bool enabled) public onlyOwner {\\n controllers[controller] = enabled;\\n emit ControllerChanged(controller, enabled);\\n }\\n}\\n\",\"keccak256\":\"0x0c364a5b65b6fff279adbe1fd6498c488feabeec781599cd60a5844e80ee7d88\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\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\\