Overview
MNT Balance
MNT Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Init | 21130071 | 803 days ago | IN | 0 MNT | 0.43669589 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {IERC20} from "../intf/IERC20.sol";
import {SafeERC20} from "../lib/SafeERC20.sol";
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
/**
* @title DODOApprove
* @author DODO Breeder
*
* @notice Handle authorizations in DODO platform
*/
contract DODOApprove is InitializableOwnable {
using SafeERC20 for IERC20;
// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
uint256 private constant _TIMELOCK_EMERGENCY_DURATION_ = 24 hours;
uint256 public _TIMELOCK_;
address public _PENDING_DODO_PROXY_;
address public _DODO_PROXY_;
// ============ Events ============
event SetDODOProxy(address indexed oldProxy, address indexed newProxy);
// ============ Modifiers ============
modifier notLocked() {
require(
_TIMELOCK_ <= block.timestamp,
"SetProxy is timelocked"
);
_;
}
function init(address owner, address initProxyAddress) external {
initOwner(owner);
_DODO_PROXY_ = initProxyAddress;
}
function unlockSetProxy(address newDodoProxy) public onlyOwner {
if(_DODO_PROXY_ == address(0))
_TIMELOCK_ = block.timestamp + _TIMELOCK_EMERGENCY_DURATION_;
else
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
_PENDING_DODO_PROXY_ = newDodoProxy;
}
function lockSetProxy() public onlyOwner {
_PENDING_DODO_PROXY_ = address(0);
_TIMELOCK_ = 0;
}
function setDODOProxy() external onlyOwner notLocked() {
emit SetDODOProxy(_DODO_PROXY_, _PENDING_DODO_PROXY_);
_DODO_PROXY_ = _PENDING_DODO_PROXY_;
lockSetProxy();
}
function claimTokens(
address token,
address who,
address dest,
uint256 amount
) external {
require(msg.sender == _DODO_PROXY_, "DODOApprove:Access restricted");
if (amount > 0) {
IERC20(token).safeTransferFrom(who, dest, amount);
}
}
function getDODOProxy() public view returns (address) {
return _DODO_PROXY_;
}
}// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @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);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @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);
}/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
This is a simplified version of OpenZepplin's SafeERC20 library
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {IERC20} from "../intf/IERC20.sol";
import {SafeMath} from "./SafeMath.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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}{
"evmVersion": "istanbul",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferPrepared","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":true,"internalType":"address","name":"oldProxy","type":"address"},{"indexed":true,"internalType":"address","name":"newProxy","type":"address"}],"name":"SetDODOProxy","type":"event"},{"inputs":[],"name":"_DODO_PROXY_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_NEW_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_PENDING_DODO_PROXY_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_TIMELOCK_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"who","type":"address"},{"internalType":"address","name":"dest","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDODOProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"initProxyAddress","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"initOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockSetProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setDODOProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDodoProxy","type":"address"}],"name":"unlockSetProxy","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061092e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638456db151161008c578063b75dbf6811610066578063b75dbf68146101cd578063e54c8033146101e7578063f09a4016146101ef578063f2fde38b1461021d576100ea565b80638456db15146101b55780638cdb6574146101bd57806393773aec146101c5576100ea565b806331fa1319116100c857806331fa13191461017757806341c256c11461017f5780634e71e0c8146101a55780634f3cef84146101ad576100ea565b80630a5ea466146100ef5780630d0092971461012d57806316048bc414610153575b600080fd5b61012b6004803603608081101561010557600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610243565b005b61012b6004803603602081101561014357600080fd5b50356001600160a01b03166102c9565b61015b610351565b604080516001600160a01b039092168252519081900360200190f35b61015b610360565b61012b6004803603602081101561019557600080fd5b50356001600160a01b031661036f565b61012b610404565b61012b6104b7565b61015b610519565b61012b610528565b61015b61062e565b6101d561063d565b60408051918252519081900360200190f35b61015b610643565b61012b6004803603604081101561020557600080fd5b506001600160a01b0381358116916020013516610652565b61012b6004803603602081101561023357600080fd5b50356001600160a01b031661067e565b6004546001600160a01b031633146102a2576040805162461bcd60e51b815260206004820152601d60248201527f444f444f417070726f76653a4163636573732072657374726963746564000000604482015290519081900360640190fd5b80156102c3576102c36001600160a01b03851684848463ffffffff61072416565b50505050565b600154600160a01b900460ff161561031b576040805162461bcd60e51b815260206004820152601060248201526f1113d113d7d25392551250531256915160821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b6004546001600160a01b031690565b6000546001600160a01b031633146103ba576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b6004546001600160a01b03166103d8574262015180016002556103e2565b426203f480016002555b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314610453576040805162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f434c41494d60981b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610502576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600380546001600160a01b03191690556000600255565b6001546001600160a01b031681565b6000546001600160a01b03163314610573576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b4260025411156105c3576040805162461bcd60e51b815260206004820152601660248201527514d95d141c9bde1e481a5cc81d1a5b595b1bd8dad95960521b604482015290519081900360640190fd5b6003546004546040516001600160a01b0392831692909116907fd356351ffbb32d7a93878d5fbbd5c39435bbae136f428b0d574242f63bb803cb90600090a3600354600480546001600160a01b0319166001600160a01b0390921691909117905561062c6104b7565b565b6003546001600160a01b031681565b60025481565b6004546001600160a01b031681565b61065b826102c9565b600480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146106c9576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526102c390859060006060836001600160a01b0316836040518082805190602001908083835b602083106107b75780518252601f199092019160209182019101610798565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610819576040519150601f19603f3d011682016040523d82523d6000602084013e61081e565b606091505b509150915081610875576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156102c35780806020019051602081101561089157600080fd5b50516102c35760405162461bcd60e51b815260040180806020018281038252602a8152602001806108cf602a913960400191505060405180910390fdfe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122049721d62a55c7a5ee7404a34397eff02652be51799fffbbcfd797744bc56f18e64736f6c63430006090033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638456db151161008c578063b75dbf6811610066578063b75dbf68146101cd578063e54c8033146101e7578063f09a4016146101ef578063f2fde38b1461021d576100ea565b80638456db15146101b55780638cdb6574146101bd57806393773aec146101c5576100ea565b806331fa1319116100c857806331fa13191461017757806341c256c11461017f5780634e71e0c8146101a55780634f3cef84146101ad576100ea565b80630a5ea466146100ef5780630d0092971461012d57806316048bc414610153575b600080fd5b61012b6004803603608081101561010557600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610243565b005b61012b6004803603602081101561014357600080fd5b50356001600160a01b03166102c9565b61015b610351565b604080516001600160a01b039092168252519081900360200190f35b61015b610360565b61012b6004803603602081101561019557600080fd5b50356001600160a01b031661036f565b61012b610404565b61012b6104b7565b61015b610519565b61012b610528565b61015b61062e565b6101d561063d565b60408051918252519081900360200190f35b61015b610643565b61012b6004803603604081101561020557600080fd5b506001600160a01b0381358116916020013516610652565b61012b6004803603602081101561023357600080fd5b50356001600160a01b031661067e565b6004546001600160a01b031633146102a2576040805162461bcd60e51b815260206004820152601d60248201527f444f444f417070726f76653a4163636573732072657374726963746564000000604482015290519081900360640190fd5b80156102c3576102c36001600160a01b03851684848463ffffffff61072416565b50505050565b600154600160a01b900460ff161561031b576040805162461bcd60e51b815260206004820152601060248201526f1113d113d7d25392551250531256915160821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b6004546001600160a01b031690565b6000546001600160a01b031633146103ba576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b6004546001600160a01b03166103d8574262015180016002556103e2565b426203f480016002555b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314610453576040805162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f434c41494d60981b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610502576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600380546001600160a01b03191690556000600255565b6001546001600160a01b031681565b6000546001600160a01b03163314610573576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b4260025411156105c3576040805162461bcd60e51b815260206004820152601660248201527514d95d141c9bde1e481a5cc81d1a5b595b1bd8dad95960521b604482015290519081900360640190fd5b6003546004546040516001600160a01b0392831692909116907fd356351ffbb32d7a93878d5fbbd5c39435bbae136f428b0d574242f63bb803cb90600090a3600354600480546001600160a01b0319166001600160a01b0390921691909117905561062c6104b7565b565b6003546001600160a01b031681565b60025481565b6004546001600160a01b031681565b61065b826102c9565b600480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146106c9576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526102c390859060006060836001600160a01b0316836040518082805190602001908083835b602083106107b75780518252601f199092019160209182019101610798565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610819576040519150601f19603f3d011682016040523d82523d6000602084013e61081e565b606091505b509150915081610875576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156102c35780806020019051602081101561089157600080fd5b50516102c35760405162461bcd60e51b815260040180806020018281038252602a8152602001806108cf602a913960400191505060405180910390fdfe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122049721d62a55c7a5ee7404a34397eff02652be51799fffbbcfd797744bc56f18e64736f6c63430006090033
Net Worth in USD
Net Worth in MNT
Multichain Portfolio | 35 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.