Contract Overview
Latest 3 from a total of 3 transactions
Txn Hash |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|
9435974cd2114d10d8555894fc629f6b835c3b0c87f9191c1a668f4dfcce2da1 | 20118929 | 2 years ago | io1qhwut90ax0tm92esy9puggxsulepkc32mezxku | IN | Contract: IoTeXSubmitTool | 0 IOTX | 0.022404 | |
62ca6039264f7987cd3efb82e49281d6efc753274f383f2afdd2fcacf29a22a6 | 20118495 | 2 years ago | io1qhwut90ax0tm92esy9puggxsulepkc32mezxku | IN | Contract: IoTeXSubmitTool | 0 IOTX | 1.338697 | |
6d7c2934880308f8a63172183514b10151e403fe3a387d060a029a63412ac8d6 | 20118476 | 2 years ago | io1qhwut90ax0tm92esy9puggxsulepkc32mezxku | IN | Contract: IoTeXSubmitTool | 0 IOTX | 1.372897 |
Contract Name:
IoTeXSubmitTool
Compiler Version
v0.8.10+commit.fc410830
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT // 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/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v4.7.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 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 { _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: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); } // File: contracts/interfaces/MultiSign.sol pragma solidity ^0.8.0; interface MultiSign { function submitTransaction(address destination, uint256 value, bytes memory data) external returns(uint256 transactionId); function confirmTransaction(uint256 transactionId) external; } // File: contracts/interfaces/TimeLock.sol pragma solidity ^0.8.0; interface TimeLock { function queueTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) external returns(bytes32); function executeTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) external returns(bytes memory); } // File: contracts/interfaces/CToken.sol pragma solidity ^0.8.0; interface CToken { function _reduceReserves(uint reduceAmount) external returns (uint); function isNativeToken() external pure returns (bool); function underlying() external view returns (address); } // File: contracts/IoTexSubmitTool.sol pragma solidity ^0.8.0; contract IoTeXSubmitTool is Ownable { MultiSign public multisign; address public timelock; uint256 public startTransactionId; uint256 public length; event QueueSubmitted(uint256 transactionId, uint256 length); event ExecuteSubmitted(uint256 transactionId, uint256 length); constructor(address _multisign, address _timelock) { require(_multisign != address(0) && _timelock != address(0), "invalid param"); multisign = MultiSign(_multisign); timelock = _timelock; } function submit(address[] memory ftokens, uint[] memory amounts, address receiver, uint256 eta) external onlyOwner returns(uint256 queueId, uint256 executeId) { require(ftokens.length == amounts.length, "Inconsistent length"); uint256 trasactionId; for (uint8 i = 0; i < ftokens.length; i++) { bytes memory ftokenAbi = abi.encodeWithSelector(CToken._reduceReserves.selector, amounts[i]); trasactionId = multisign.submitTransaction(ftokens[i], 0, ftokenAbi); if (i == 0) { startTransactionId = queueId = trasactionId; } } for (uint8 i = 0; i < ftokens.length; i++) { CToken cTokenInstance = CToken(ftokens[i]); if (cTokenInstance.isNativeToken()) { bytes memory timelockAbi = abi.encodeWithSelector(TimeLock.queueTransaction.selector, receiver, amounts[i], '', '', eta); multisign.submitTransaction(timelock, 0, timelockAbi); } else { bytes memory transferAbi = abi.encodeWithSelector(IERC20.transfer.selector, receiver, amounts[i]); bytes memory timelockAbi = abi.encodeWithSelector(TimeLock.queueTransaction.selector, cTokenInstance.underlying(), 0, '', transferAbi, eta); multisign.submitTransaction(timelock, 0, timelockAbi); } } emit QueueSubmitted(queueId, ftokens.length); for (uint8 i = 0; i < ftokens.length; i++) { CToken cTokenInstance = CToken(ftokens[i]); if (cTokenInstance.isNativeToken()) { bytes memory timelockAbi = abi.encodeWithSelector(TimeLock.executeTransaction.selector, receiver, amounts[i], '', '', eta); trasactionId = multisign.submitTransaction(timelock, 0, timelockAbi); } else { bytes memory transferAbi = abi.encodeWithSelector(IERC20.transfer.selector, receiver, amounts[i]); bytes memory timelockAbi = abi.encodeWithSelector(TimeLock.executeTransaction.selector, cTokenInstance.underlying(), 0, '', transferAbi, eta); trasactionId = multisign.submitTransaction(timelock, 0, timelockAbi); } if (i == 0) { executeId = trasactionId; } } emit ExecuteSubmitted(executeId, ftokens.length); length = ftokens.length; } }
[{"inputs":[{"internalType":"address","name":"_multisign","type":"address"},{"internalType":"address","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"transactionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"length","type":"uint256"}],"name":"ExecuteSubmitted","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":"uint256","name":"transactionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"length","type":"uint256"}],"name":"QueueSubmitted","type":"event"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multisign","outputs":[{"internalType":"contract MultiSign","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTransactionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"ftokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"eta","type":"uint256"}],"name":"submit","outputs":[{"internalType":"uint256","name":"queueId","type":"uint256"},{"internalType":"uint256","name":"executeId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600436106100785760003560e01c8063178e92831461007d5780631f7b6d321461009957806334976fa1146100a2578063715018a6146100cd5780638da5cb5b146100d7578063ceeb29f0146100df578063d33219b414610107578063f2fde38b1461011a575b600080fd5b61008660035481565b6040519081526020015b60405180910390f35b61008660045481565b6001546100b5906001600160a01b031681565b6040516001600160a01b039091168152602001610090565b6100d561012d565b005b6100b5610141565b6100f26100ed366004610c24565b610150565b60408051928352602083019190915201610090565b6002546100b5906001600160a01b031681565b6100d5610128366004610cfd565b610a03565b610135610a7c565b61013f6000610adb565b565b6000546001600160a01b031690565b60008061015b610a7c565b84518651146101a75760405162461bcd60e51b8152602060048201526013602482015272092dcc6dedce6d2e6e8cadce840d8cadccee8d606b1b60448201526064015b60405180910390fd5b6000805b87518160ff1610156102e357600063601a0bf160e01b888360ff16815181106101d6576101d6610d21565b60200260200101516040516024016101f091815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526001548a519192506001600160a01b03169063c6427474908b9060ff861690811061024f5761024f610d21565b60200260200101516000846040518463ffffffff1660e01b815260040161027893929190610d84565b6020604051808303816000875af1158015610297573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bb9190610db4565b925060ff82166102d057829450846003819055505b50806102db81610dcd565b9150506101ab565b5060005b87518160ff161015610629576000888260ff168151811061030a5761030a610d21565b60200260200101519050806001600160a01b0316639af4ee7e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610dfb565b1561046f576000633a66f90160e01b888a8560ff168151811061039b5761039b610d21565b6020026020010151896040516024016103b693929190610e1d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925260015460025492516331909d1d60e21b81529193506001600160a01b039081169263c6427474926104259291909116906000908690600401610d84565b6020604051808303816000875af1158015610444573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104689190610db4565b5050610616565b600063a9059cbb60e01b888a8560ff168151811061048f5761048f610d21565b60200260200101516040516024016104a8929190610e5b565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505090506000633a66f90160e01b836001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610525573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105499190610e74565b6000848b6040516024016105609493929190610e91565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925260015460025492516331909d1d60e21b81529193506001600160a01b039081169263c6427474926105cf9291909116906000908690600401610d84565b6020604051808303816000875af11580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190610db4565b5050505b508061062181610dcd565b9150506102e7565b5086516040805185815260208101929092527fd9872535698c3482a512ceb38a53a5a119c2ad4611f27091c1b9c9cbe4730bd8910160405180910390a160005b87518160ff1610156109b9576000888260ff168151811061068c5761068c610d21565b60200260200101519050806001600160a01b0316639af4ee7e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f89190610dfb565b156107f2576000630825f38f60e01b888a8560ff168151811061071d5761071d610d21565b60200260200101518960405160240161073893929190610e1d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925260015460025492516331909d1d60e21b81529193506001600160a01b039081169263c6427474926107a79291909116906000908690600401610d84565b6020604051808303816000875af11580156107c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ea9190610db4565b93505061099a565b600063a9059cbb60e01b888a8560ff168151811061081257610812610d21565b602002602001015160405160240161082b929190610e5b565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505090506000630825f38f60e01b836001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cc9190610e74565b6000848b6040516024016108e39493929190610e91565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925260015460025492516331909d1d60e21b81529193506001600160a01b039081169263c6427474926109529291909116906000908690600401610d84565b6020604051808303816000875af1158015610971573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109959190610db4565b945050505b60ff82166109a6578293505b50806109b181610dcd565b915050610669565b5086516040805184815260208101929092527f56fdd345e7a3145f9b67243772e3751a419b8450fbd6fc5cf66bae6a786fee5b910160405180910390a15094516004559492505050565b610a0b610a7c565b6001600160a01b038116610a705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161019e565b610a7981610adb565b50565b33610a85610141565b6001600160a01b03161461013f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161019e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610b6957610b69610b2b565b604052919050565b60006001600160401b03821115610b8a57610b8a610b2b565b5060051b60200190565b6001600160a01b0381168114610a7957600080fd5b8035610bb481610b94565b919050565b600082601f830112610bca57600080fd5b81356020610bdf610bda83610b71565b610b41565b82815260059290921b84018101918181019086841115610bfe57600080fd5b8286015b84811015610c195780358352918301918301610c02565b509695505050505050565b60008060008060808587031215610c3a57600080fd5b84356001600160401b0380821115610c5157600080fd5b818701915087601f830112610c6557600080fd5b81356020610c75610bda83610b71565b82815260059290921b8401810191818101908b841115610c9457600080fd5b948201945b83861015610cbb578535610cac81610b94565b82529482019490820190610c99565b98505088013592505080821115610cd157600080fd5b50610cde87828801610bb9565b935050610ced60408601610ba9565b9396929550929360600135925050565b600060208284031215610d0f57600080fd5b8135610d1a81610b94565b9392505050565b634e487b7160e01b600052603260045260246000fd5b6000815180845260005b81811015610d5d57602081850181015186830182015201610d41565b81811115610d6f576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0384168152826020820152606060408201526000610dab6060830184610d37565b95945050505050565b600060208284031215610dc657600080fd5b5051919050565b600060ff821660ff811415610df257634e487b7160e01b600052601160045260246000fd5b60010192915050565b600060208284031215610e0d57600080fd5b81518015158114610d1a57600080fd5b6001600160a01b03939093168352602083019190915260a060408301819052600090830181905260c060608401819052830152608082015260e00190565b6001600160a01b03929092168252602082015260400190565b600060208284031215610e8657600080fd5b8151610d1a81610b94565b60018060a01b038516815260ff8416602082015260a06040820152600060a082015260c060608201526000610ec960c0830185610d37565b90508260808301529594505050505056fea2646970667358221220144c753399aa0de1907c388a4c30959dc05aa257079bf85a6d2f0a5b2b98d27764736f6c634300080a0033
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.