Polygon Sponsored slots available. Book your slot here!
Contract Overview
My Name Tag:
Not Available, login to update
Txn Hash |
Method
|
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x83bf07834f77e4354fdd648a6c90a075ea1e880918498aca225bc2ec8dc221b9 | Set Owner | 27996075 | 272 days 1 hr ago | TETU Reward: Deployer | IN | 0xbd51042d3a9ef62d4d93013315ae96a0c1760d7e | 0 MATIC | 0.005673035302 | |
0x16cc6bdf6deacf52d48a6b14730a746fc03b178298d6e9773b99cc99db7624cf | 0x60806040 | 27986212 | 272 days 8 hrs ago | TETU Reward: Deployer | IN | Create: GovernanceTreasury | 0 MATIC | 0.028467127838 |
[ Download CSV Export ]
Contract Name:
GovernanceTreasury
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "../../interface/IERC20.sol"; import "../../lib/SafeERC20.sol"; contract GovernanceTreasury { using SafeERC20 for IERC20; address public owner; address public pendingOwner; event Claimed(address receipent, address token, uint amount); constructor() { owner = msg.sender; } function setOwner(address _owner) external { require(msg.sender == owner, "Not owner"); pendingOwner = _owner; } function acceptOwner() external { require(msg.sender == pendingOwner, "Not pending owner"); owner = pendingOwner; } function claim(address[] memory tokens) external { require(msg.sender == owner, "Not owner"); for (uint i; i < tokens.length; i++) { address token = tokens[i]; uint balance = IERC20(token).balanceOf(address(this)); require(balance != 0, "Zero balance"); IERC20(token).safeTransfer(msg.sender, balance); emit Claimed(msg.sender, token, balance); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.13; import "../interface/IERC20.sol"; import "./Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint value ) internal { uint newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.13; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receipent","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"inputs":[],"name":"acceptOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b031916331790556107b6806100326000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806313af40351461005c578063318d9e5d146100715780638da5cb5b14610084578063e30c3978146100b3578063ebbc4965146100c6575b600080fd5b61006f61006a366004610593565b6100ce565b005b61006f61007f3660046105c4565b61013b565b600054610097906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b600154610097906001600160a01b031681565b61006f6102d1565b6000546001600160a01b031633146101195760405162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b60448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146101815760405162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b6044820152606401610110565b60005b81518110156102cd5760008282815181106101a1576101a1610689565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a919061069f565b90508060000361025b5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f2062616c616e636560a01b6044820152606401610110565b61026f6001600160a01b0383163383610343565b604080513381526001600160a01b03841660208201529081018290527ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd39926839060600160405180910390a1505080806102c5906106b8565b915050610184565b5050565b6001546001600160a01b0316331461031f5760405162461bcd60e51b81526020600482015260116024820152702737ba103832b73234b7339037bbb732b960791b6044820152606401610110565b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261039590849061039a565b505050565b60006103ef826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661046c9092919063ffffffff16565b805190915015610395578080602001905181019061040d91906106df565b6103955760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610110565b60606001600160a01b0384163b6104c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610110565b600080856001600160a01b0316856040516104e09190610731565b6000604051808303816000865af19150503d806000811461051d576040519150601f19603f3d011682016040523d82523d6000602084013e610522565b606091505b509150915061053282828661053e565b925050505b9392505050565b6060831561054d575081610537565b82511561055d5782518084602001fd5b8160405162461bcd60e51b8152600401610110919061074d565b80356001600160a01b038116811461058e57600080fd5b919050565b6000602082840312156105a557600080fd5b61053782610577565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156105d757600080fd5b823567ffffffffffffffff808211156105ef57600080fd5b818501915085601f83011261060357600080fd5b813581811115610615576106156105ae565b8060051b604051601f19603f8301168101818110858211171561063a5761063a6105ae565b60405291825284820192508381018501918883111561065857600080fd5b938501935b8285101561067d5761066e85610577565b8452938501939285019261065d565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156106b157600080fd5b5051919050565b6000600182016106d857634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156106f157600080fd5b8151801515811461053757600080fd5b60005b8381101561071c578181015183820152602001610704565b8381111561072b576000848401525b50505050565b60008251610743818460208701610701565b9190910192915050565b602081526000825180602084015261076c816040850160208701610701565b601f01601f1916919091016040019291505056fea26469706673582212206f879d31edf17967b93ae702a110ebe139edc292b5ad769bb5cf8c92d1ec754e64736f6c634300080d0033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.