More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Treasurer
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; // pragma experimental SMTChecker; import {TokenManager} from "./TokenManager.sol"; contract Treasurer is TokenManager { }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; // pragma experimental SMTChecker; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {TransferHelper} from "@uniswap/lib/contracts/libraries/TransferHelper.sol"; contract TokenManager is Ownable { /* receive function */ receive() external payable {} /* admin functions */ function transferERC20( address token, address to, uint256 value ) external onlyOwner { TransferHelper.safeTransfer(token, to, value); } function transferFromERC20( address token, address from, address to, uint256 value ) external onlyOwner { TransferHelper.safeTransferFrom(token, from, to, value); } function approveERC20( address token, address to, uint256 value ) external onlyOwner { TransferHelper.safeApprove(token, to, value); } function transferETH(address to, uint256 value) external onlyOwner { TransferHelper.safeTransferETH(to, value); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approveERC20","outputs":[],"stateMutability":"nonpayable","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":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFromERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b610c5f8061007d6000396000f3fe6080604052600436106100745760003560e01c80639db5dbe41161004e5780639db5dbe414610101578063a8e5e4aa14610144578063dd71105d14610187578063f2fde38b146101d05761007b565b8063715018a6146100805780637b1a4909146100975780638da5cb5b146100d05761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b50610095610203565b005b3480156100a357600080fd5b50610095600480360360408110156100ba57600080fd5b506001600160a01b0381351690602001356102ce565b3480156100dc57600080fd5b506100e5610350565b604080516001600160a01b039092168252519081900360200190f35b34801561010d57600080fd5b506100956004803603606081101561012457600080fd5b506001600160a01b0381358116916020810135909116906040013561035f565b34801561015057600080fd5b506100956004803603606081101561016757600080fd5b506001600160a01b038135811691602081013590911690604001356103e3565b34801561019357600080fd5b50610095600480360360808110156101aa57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610462565b3480156101dc57600080fd5b50610095600480360360208110156101f357600080fd5b50356001600160a01b03166104e8565b61020b610609565b6001600160a01b031661021c610350565b6001600160a01b031614610277576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6102d6610609565b6001600160a01b03166102e7610350565b6001600160a01b031614610342576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61034c828261060d565b5050565b6000546001600160a01b031690565b610367610609565b6001600160a01b0316610378610350565b6001600160a01b0316146103d3576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103de838383610700565b505050565b6103eb610609565b6001600160a01b03166103fc610350565b6001600160a01b031614610457576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103de83838361086c565b61046a610609565b6001600160a01b031661047b610350565b6001600160a01b0316146104d6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104e2848484846109d1565b50505050565b6104f0610609565b6001600160a01b0316610501610350565b6001600160a01b03161461055c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166105a15760405162461bcd60e51b8152600401808060200182810382526026815260200180610b476026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b3390565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106106595780518252601f19909201916020918201910161063a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146106bb576040519150601f19603f3d011682016040523d82523d6000602084013e6106c0565b606091505b50509050806103de5760405162461bcd60e51b8152600401808060200182810382526034815260200180610b9e6034913960400191505060405180910390fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485949389169392918291908083835b602083106107955780518252601f199092019160209182019101610776565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146107f7576040519150601f19603f3d011682016040523d82523d6000602084013e6107fc565b606091505b509150915081801561082a57508051158061082a575080806020019051602081101561082757600080fd5b50515b6108655760405162461bcd60e51b815260040180806020018281038252602d815260200180610bfd602d913960400191505060405180910390fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167f095ea7b3000000000000000000000000000000000000000000000000000000001781529251825160009485949389169392918291908083835b602083106109015780518252601f1990920191602091820191016108e2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610963576040519150601f19603f3d011682016040523d82523d6000602084013e610968565b606091505b5091509150818015610996575080511580610996575080806020019051602081101561099357600080fd5b50515b6108655760405162461bcd60e51b815260040180806020018281038252602b815260200180610bd2602b913960400191505060405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03167f23b872dd00000000000000000000000000000000000000000000000000000000178152925182516000948594938a169392918291908083835b60208310610a6e5780518252601f199092019160209182019101610a4f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610ad0576040519150601f19603f3d011682016040523d82523d6000602084013e610ad5565b606091505b5091509150818015610b03575080511580610b035750808060200190516020811015610b0057600080fd5b50515b610b3e5760405162461bcd60e51b8152600401808060200182810382526031815260200180610b6d6031913960400191505060405180910390fd5b50505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c65645472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c65645472616e7366657248656c7065723a3a73616665417070726f76653a20617070726f7665206661696c65645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220e6eb01d56b94e3bff098c2dfec3bdf4a4d38652f57f3f15fb82dca5a7d3f872464736f6c63430007060033
Deployed Bytecode
0x6080604052600436106100745760003560e01c80639db5dbe41161004e5780639db5dbe414610101578063a8e5e4aa14610144578063dd71105d14610187578063f2fde38b146101d05761007b565b8063715018a6146100805780637b1a4909146100975780638da5cb5b146100d05761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b50610095610203565b005b3480156100a357600080fd5b50610095600480360360408110156100ba57600080fd5b506001600160a01b0381351690602001356102ce565b3480156100dc57600080fd5b506100e5610350565b604080516001600160a01b039092168252519081900360200190f35b34801561010d57600080fd5b506100956004803603606081101561012457600080fd5b506001600160a01b0381358116916020810135909116906040013561035f565b34801561015057600080fd5b506100956004803603606081101561016757600080fd5b506001600160a01b038135811691602081013590911690604001356103e3565b34801561019357600080fd5b50610095600480360360808110156101aa57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610462565b3480156101dc57600080fd5b50610095600480360360208110156101f357600080fd5b50356001600160a01b03166104e8565b61020b610609565b6001600160a01b031661021c610350565b6001600160a01b031614610277576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6102d6610609565b6001600160a01b03166102e7610350565b6001600160a01b031614610342576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61034c828261060d565b5050565b6000546001600160a01b031690565b610367610609565b6001600160a01b0316610378610350565b6001600160a01b0316146103d3576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103de838383610700565b505050565b6103eb610609565b6001600160a01b03166103fc610350565b6001600160a01b031614610457576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6103de83838361086c565b61046a610609565b6001600160a01b031661047b610350565b6001600160a01b0316146104d6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104e2848484846109d1565b50505050565b6104f0610609565b6001600160a01b0316610501610350565b6001600160a01b03161461055c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166105a15760405162461bcd60e51b8152600401808060200182810382526026815260200180610b476026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b3390565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106106595780518252601f19909201916020918201910161063a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146106bb576040519150601f19603f3d011682016040523d82523d6000602084013e6106c0565b606091505b50509050806103de5760405162461bcd60e51b8152600401808060200182810382526034815260200180610b9e6034913960400191505060405180910390fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251825160009485949389169392918291908083835b602083106107955780518252601f199092019160209182019101610776565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146107f7576040519150601f19603f3d011682016040523d82523d6000602084013e6107fc565b606091505b509150915081801561082a57508051158061082a575080806020019051602081101561082757600080fd5b50515b6108655760405162461bcd60e51b815260040180806020018281038252602d815260200180610bfd602d913960400191505060405180910390fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b03167f095ea7b3000000000000000000000000000000000000000000000000000000001781529251825160009485949389169392918291908083835b602083106109015780518252601f1990920191602091820191016108e2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610963576040519150601f19603f3d011682016040523d82523d6000602084013e610968565b606091505b5091509150818015610996575080511580610996575080806020019051602081101561099357600080fd5b50515b6108655760405162461bcd60e51b815260040180806020018281038252602b815260200180610bd2602b913960400191505060405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03167f23b872dd00000000000000000000000000000000000000000000000000000000178152925182516000948594938a169392918291908083835b60208310610a6e5780518252601f199092019160209182019101610a4f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610ad0576040519150601f19603f3d011682016040523d82523d6000602084013e610ad5565b606091505b5091509150818015610b03575080511580610b035750808060200190516020811015610b0057600080fd5b50515b610b3e5760405162461bcd60e51b8152600401808060200182810382526031815260200180610b6d6031913960400191505060405180910390fd5b50505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c65645472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c65645472616e7366657248656c7065723a3a73616665417070726f76653a20617070726f7665206661696c65645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220e6eb01d56b94e3bff098c2dfec3bdf4a4d38652f57f3f15fb82dca5a7d3f872464736f6c63430007060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.