UNPKG

@cartesi/staking-pool

Version:
303 lines 14.2 kB
{ "contractName": "FlatRateCommission", "sourceName": "contracts/FlatRateCommission.sol", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "_rate", "type": "uint256" }, { "internalType": "uint256", "name": "_feeRaiseTimeout", "type": "uint256" }, { "internalType": "uint256", "name": "_maxRaise", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "newRate", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timeout", "type": "uint256" } ], "name": "FlatRateChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "commission", "type": "uint256" } ], "name": "FlatRateCommissionCreated", "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" }, { "inputs": [], "name": "BASE", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeRaiseTimeout", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" } ], "name": "getCommission", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxRaise", "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": "rate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "newRate", "type": "uint256" } ], "name": "setRate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "timeoutTimestamp", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x60c060405234801561001057600080fd5b5060405161074f38038061074f83398101604081905261002f916100dc565b6100383361008c565b6001839055608082905260a08190526002546040805185815260208101929092527f8a36c5a730a168f010484976acd9da00019dde58dcdaa557ec1035ade3805c92910160405180910390a150505061010a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000606084860312156100f157600080fd5b8351925060208401519150604084015190509250925092565b60805160a05161061361013c60003960008181610108015261023401526000818160a801526102f101526106136000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b1461012a578063b1fc8ad414610145578063c2ce5e8614610158578063ec342ad014610161578063f2fde38b1461016a57600080fd5b8063112cde6a146100a35780632c4e722e146100dd57806334fcf437146100e6578063715018a6146100fb578063719ec6b114610103575b600080fd5b6100ca7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100ca60015481565b6100f96100f43660046104e7565b61017d565b005b6100f961035f565b6100ca7f000000000000000000000000000000000000000000000000000000000000000081565b6000546040516001600160a01b0390911681526020016100d4565b6100ca610153366004610500565b610395565b6100ca60025481565b6100ca61271081565b6100f96101783660046104b7565b6103cc565b6000546001600160a01b031633146101b05760405162461bcd60e51b81526004016101a790610522565b60405180910390fd5b60015481111561031a574260025411156102325760405162461bcd60e51b815260206004820152603c60248201527f466c617452617465436f6d6d697373696f6e3a2074686520666565207261697360448201527f652074696d656f7574206973206e6f742065787069726564207965740000000060648201526084016101a7565b7f00000000000000000000000000000000000000000000000000000000000000006001548261026191906105b0565b11156102ec5760405162461bcd60e51b815260206004820152604e60248201527f466c617452617465436f6d6d697373696f6e3a2074686520666565207261697360448201527f65206973206f76657220746865206d6178696d756d20616c6c6f77656420706560648201526d7263656e746167652076616c756560901b608482015260a4016101a7565b6103167f000000000000000000000000000000000000000000000000000000000000000042610557565b6002555b60018190556002546040805183815260208101929092527f8a36c5a730a168f010484976acd9da00019dde58dcdaa557ec1035ade3805c92910160405180910390a150565b6000546001600160a01b031633146103895760405162461bcd60e51b81526004016101a790610522565b6103936000610467565b565b600080612710600154846103a99190610591565b6103b3919061056f565b90508281116103c257806103c4565b825b949350505050565b6000546001600160a01b031633146103f65760405162461bcd60e51b81526004016101a790610522565b6001600160a01b03811661045b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a7565b61046481610467565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104c957600080fd5b81356001600160a01b03811681146104e057600080fd5b9392505050565b6000602082840312156104f957600080fd5b5035919050565b6000806040838503121561051357600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561056a5761056a6105c7565b500190565b60008261058c57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156105ab576105ab6105c7565b500290565b6000828210156105c2576105c26105c7565b500390565b634e487b7160e01b600052601160045260246000fdfea264697066735822122085d5e30b0c1c3dd32e67b134dcbea33c284a9d2d18b3b24dc7185d78620b356664736f6c63430008070033", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b1461012a578063b1fc8ad414610145578063c2ce5e8614610158578063ec342ad014610161578063f2fde38b1461016a57600080fd5b8063112cde6a146100a35780632c4e722e146100dd57806334fcf437146100e6578063715018a6146100fb578063719ec6b114610103575b600080fd5b6100ca7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100ca60015481565b6100f96100f43660046104e7565b61017d565b005b6100f961035f565b6100ca7f000000000000000000000000000000000000000000000000000000000000000081565b6000546040516001600160a01b0390911681526020016100d4565b6100ca610153366004610500565b610395565b6100ca60025481565b6100ca61271081565b6100f96101783660046104b7565b6103cc565b6000546001600160a01b031633146101b05760405162461bcd60e51b81526004016101a790610522565b60405180910390fd5b60015481111561031a574260025411156102325760405162461bcd60e51b815260206004820152603c60248201527f466c617452617465436f6d6d697373696f6e3a2074686520666565207261697360448201527f652074696d656f7574206973206e6f742065787069726564207965740000000060648201526084016101a7565b7f00000000000000000000000000000000000000000000000000000000000000006001548261026191906105b0565b11156102ec5760405162461bcd60e51b815260206004820152604e60248201527f466c617452617465436f6d6d697373696f6e3a2074686520666565207261697360448201527f65206973206f76657220746865206d6178696d756d20616c6c6f77656420706560648201526d7263656e746167652076616c756560901b608482015260a4016101a7565b6103167f000000000000000000000000000000000000000000000000000000000000000042610557565b6002555b60018190556002546040805183815260208101929092527f8a36c5a730a168f010484976acd9da00019dde58dcdaa557ec1035ade3805c92910160405180910390a150565b6000546001600160a01b031633146103895760405162461bcd60e51b81526004016101a790610522565b6103936000610467565b565b600080612710600154846103a99190610591565b6103b3919061056f565b90508281116103c257806103c4565b825b949350505050565b6000546001600160a01b031633146103f65760405162461bcd60e51b81526004016101a790610522565b6001600160a01b03811661045b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a7565b61046481610467565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104c957600080fd5b81356001600160a01b03811681146104e057600080fd5b9392505050565b6000602082840312156104f957600080fd5b5035919050565b6000806040838503121561051357600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561056a5761056a6105c7565b500190565b60008261058c57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156105ab576105ab6105c7565b500290565b6000828210156105c2576105c26105c7565b500390565b634e487b7160e01b600052601160045260246000fdfea264697066735822122085d5e30b0c1c3dd32e67b134dcbea33c284a9d2d18b3b24dc7185d78620b356664736f6c63430008070033", "linkReferences": {}, "deployedLinkReferences": {}, "devdoc": { "events": { "FlatRateChanged(uint256,uint256)": { "params": { "newRate": "commission charged by the pool effective immediatly", "timeout": "timestamp for a new change if raising the fee" } }, "FlatRateCommissionCreated(uint256)": { "params": { "commission": "commission charged by the pool" } } }, "kind": "dev", "methods": { "getCommission(uint256,uint256)": { "returns": { "_0": "commissionTotal is the amount subtracted from the rewardAmount" } }, "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." }, "transferOwnership(address)": { "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } }, "version": 1 }, "userdoc": { "events": { "FlatRateChanged(uint256,uint256)": { "notice": "event fired when setRate function is called and successful" }, "FlatRateCommissionCreated(uint256)": { "notice": "Event emmited when a contract is created" } }, "kind": "user", "methods": { "getCommission(uint256,uint256)": { "notice": "calculates the total amount of the reward that will be directed to the PoolManager" }, "setRate(uint256)": { "notice": "allows for the poolManager to reduce how much they want to charge for the block production tx" } }, "version": 1 }, "evm": { "gasEstimates": { "creation": { "codeDepositCost": "311000", "executionCost": "infinite", "totalCost": "infinite" }, "external": { "BASE()": "250", "feeRaiseTimeout()": "infinite", "getCommission(uint256,uint256)": "2635", "maxRaise()": "infinite", "owner()": "2301", "rate()": "2307", "renounceOwnership()": "28181", "setRate(uint256)": "infinite", "timeoutTimestamp()": "2328", "transferOwnership(address)": "28362" } }, "methodIdentifiers": { "BASE()": "ec342ad0", "feeRaiseTimeout()": "112cde6a", "getCommission(uint256,uint256)": "b1fc8ad4", "maxRaise()": "719ec6b1", "owner()": "8da5cb5b", "rate()": "2c4e722e", "renounceOwnership()": "715018a6", "setRate(uint256)": "34fcf437", "timeoutTimestamp()": "c2ce5e86", "transferOwnership(address)": "f2fde38b" } } }