Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
OneCTUtility
Compiler Version
v0.8.16+commit.07a7930e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // File: @openzeppelin/[email protected]/utils/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^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 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) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/[email protected]/access/Ownable.sol // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: OneCTUtility.sol pragma solidity ^0.8.0; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address to, uint amount) external; function transferFrom(address from, address to, uint amount) external; } contract OneCTUtility is Ownable { receive() external payable { revert(); } fallback() external payable { revert(); } function Sweep(address _token) external onlyOwner { IERC20 token = IERC20(_token); token.transfer(address(this), token.balanceOf(msg.sender)); } function Deposit(address account, address _token, uint amount) external payable { if(amount > 0){ IERC20 token = IERC20(_token); token.transferFrom(msg.sender, account, amount); } if(msg.value > 0){ (bool sent, ) = account.call{value: msg.value}(""); require(sent, "Failed to send Ether"); } } function Withdraw(address[] memory _tokens, uint[] memory _amounts, address _to, bool allAmounts) external payable { for(uint i = 0; i < _tokens.length; i++){ IERC20 token = IERC20(_tokens[i]); if(allAmounts){ token.transferFrom(msg.sender, _to, token.balanceOf(msg.sender)); } else { token.transferFrom(msg.sender, _to, _amounts[i]); } } if(msg.value > 0){ (bool sent, ) = _to.call{value: msg.value}(""); require(sent, "Failed to send Ether"); } } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
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"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"Sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"bool","name":"allAmounts","type":"bool"}],"name":"Withdraw","outputs":[],"stateMutability":"payable","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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6109748061007e6000396000f3fe6080604052600436106100595760003560e01c80635548c837146100685780635a4dd4d41461007d578063715018a614610090578063807273ef146100a55780638da5cb5b146100c5578063f2fde38b146100f157600080fd5b3661006357600080fd5b600080fd5b61007b6100763660046106c3565b610111565b005b61007b61008b3660046107e5565b610230565b34801561009c57600080fd5b5061007b610492565b3480156100b157600080fd5b5061007b6100c03660046108c6565b6104a6565b3480156100d157600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b3480156100fd57600080fd5b5061007b61010c3660046108c6565b610584565b8015610184576040516323b872dd60e01b81523360048201526001600160a01b038481166024830152604482018390528391908216906323b872dd90606401600060405180830381600087803b15801561016a57600080fd5b505af115801561017e573d6000803e3d6000fd5b50505050505b341561022b576000836001600160a01b03163460405160006040518083038185875af1925050503d80600081146101d7576040519150601f19603f3d011682016040523d82523d6000602084013e6101dc565b606091505b50509050806102295760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b505b505050565b60005b84518110156103ea576000858281518110610250576102506108e8565b602002602001015190508215610341576040516370a0823160e01b815233600482018190526001600160a01b038316916323b872dd9190879084906370a0823190602401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d591906108fe565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561032457600080fd5b505af1158015610338573d6000803e3d6000fd5b505050506103d7565b806001600160a01b03166323b872dd3386888681518110610364576103646108e8565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b1580156103be57600080fd5b505af11580156103d2573d6000803e3d6000fd5b505050505b50806103e281610917565b915050610233565b503415610229576000826001600160a01b03163460405160006040518083038185875af1925050503d806000811461043e576040519150601f19603f3d011682016040523d82523d6000602084013e610443565b606091505b505090508061048b5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610220565b5050505050565b61049a6105fd565b6104a46000610657565b565b6104ae6105fd565b6040516370a0823160e01b815233600482015281906001600160a01b0382169063a9059cbb90309083906370a0823190602401602060405180830381865afa1580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052291906108fe565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b505050505050565b61058c6105fd565b6001600160a01b0381166105f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610220565b6105fa81610657565b50565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610220565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146106be57600080fd5b919050565b6000806000606084860312156106d857600080fd5b6106e1846106a7565b92506106ef602085016106a7565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561073e5761073e6106ff565b604052919050565b600067ffffffffffffffff821115610760576107606106ff565b5060051b60200190565b600082601f83011261077b57600080fd5b8135602061079061078b83610746565b610715565b82815260059290921b840181019181810190868411156107af57600080fd5b8286015b848110156107ca57803583529183019183016107b3565b509695505050505050565b803580151581146106be57600080fd5b600080600080608085870312156107fb57600080fd5b843567ffffffffffffffff8082111561081357600080fd5b818701915087601f83011261082757600080fd5b8135602061083761078b83610746565b82815260059290921b8401810191818101908b84111561085657600080fd5b948201945b8386101561087b5761086c866106a7565b8252948201949082019061085b565b9850508801359250508082111561089157600080fd5b5061089e8782880161076a565b9350506108ad604086016106a7565b91506108bb606086016107d5565b905092959194509250565b6000602082840312156108d857600080fd5b6108e1826106a7565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561091057600080fd5b5051919050565b60006001820161093757634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220b69648972f9aeef1b2fd116e2267d3e07c12f0bdda755ee962387a4149e4398a64736f6c63430008100033
Deployed Bytecode
0x6080604052600436106100595760003560e01c80635548c837146100685780635a4dd4d41461007d578063715018a614610090578063807273ef146100a55780638da5cb5b146100c5578063f2fde38b146100f157600080fd5b3661006357600080fd5b600080fd5b61007b6100763660046106c3565b610111565b005b61007b61008b3660046107e5565b610230565b34801561009c57600080fd5b5061007b610492565b3480156100b157600080fd5b5061007b6100c03660046108c6565b6104a6565b3480156100d157600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b3480156100fd57600080fd5b5061007b61010c3660046108c6565b610584565b8015610184576040516323b872dd60e01b81523360048201526001600160a01b038481166024830152604482018390528391908216906323b872dd90606401600060405180830381600087803b15801561016a57600080fd5b505af115801561017e573d6000803e3d6000fd5b50505050505b341561022b576000836001600160a01b03163460405160006040518083038185875af1925050503d80600081146101d7576040519150601f19603f3d011682016040523d82523d6000602084013e6101dc565b606091505b50509050806102295760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b505b505050565b60005b84518110156103ea576000858281518110610250576102506108e8565b602002602001015190508215610341576040516370a0823160e01b815233600482018190526001600160a01b038316916323b872dd9190879084906370a0823190602401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d591906108fe565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561032457600080fd5b505af1158015610338573d6000803e3d6000fd5b505050506103d7565b806001600160a01b03166323b872dd3386888681518110610364576103646108e8565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b1580156103be57600080fd5b505af11580156103d2573d6000803e3d6000fd5b505050505b50806103e281610917565b915050610233565b503415610229576000826001600160a01b03163460405160006040518083038185875af1925050503d806000811461043e576040519150601f19603f3d011682016040523d82523d6000602084013e610443565b606091505b505090508061048b5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610220565b5050505050565b61049a6105fd565b6104a46000610657565b565b6104ae6105fd565b6040516370a0823160e01b815233600482015281906001600160a01b0382169063a9059cbb90309083906370a0823190602401602060405180830381865afa1580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052291906108fe565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b505050505050565b61058c6105fd565b6001600160a01b0381166105f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610220565b6105fa81610657565b50565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610220565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146106be57600080fd5b919050565b6000806000606084860312156106d857600080fd5b6106e1846106a7565b92506106ef602085016106a7565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561073e5761073e6106ff565b604052919050565b600067ffffffffffffffff821115610760576107606106ff565b5060051b60200190565b600082601f83011261077b57600080fd5b8135602061079061078b83610746565b610715565b82815260059290921b840181019181810190868411156107af57600080fd5b8286015b848110156107ca57803583529183019183016107b3565b509695505050505050565b803580151581146106be57600080fd5b600080600080608085870312156107fb57600080fd5b843567ffffffffffffffff8082111561081357600080fd5b818701915087601f83011261082757600080fd5b8135602061083761078b83610746565b82815260059290921b8401810191818101908b84111561085657600080fd5b948201945b8386101561087b5761086c866106a7565b8252948201949082019061085b565b9850508801359250508082111561089157600080fd5b5061089e8782880161076a565b9350506108ad604086016106a7565b91506108bb606086016107d5565b905092959194509250565b6000602082840312156108d857600080fd5b6108e1826106a7565b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561091057600080fd5b5051919050565b60006001820161093757634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220b69648972f9aeef1b2fd116e2267d3e07c12f0bdda755ee962387a4149e4398a64736f6c63430008100033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.