Source Code
Overview
MNT Balance
MNT Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DepositAndWithdraw
Compiler Version
v0.8.18+commit.87f61d96
Contract Source Code (Solidity)
/** *Submitted for verification at mantlescan.xyz on 2024-11-21 */ // File: @openzeppelin/[email protected]/access/IAccessControl.sol // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; } // 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]/utils/math/Math.sol // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } } // File: @openzeppelin/[email protected]/utils/math/SignedMath.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } // File: @openzeppelin/[email protected]/utils/Strings.sol // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } } // File: @openzeppelin/[email protected]/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: @openzeppelin/[email protected]/utils/introspection/ERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: @openzeppelin/[email protected]/access/AccessControl.sol // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } // File: @openzeppelin/[email protected]/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.9.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: @openzeppelin/[email protected]/interfaces/IERC20.sol // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; // File: contracts/phantom/DepositAndWithdraw_New2.sol pragma solidity ^0.8.18; library TransferHelper { function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } } interface IBank { function withdrawToken(address to, address token, uint256 amount) external; } contract DepositAndWithdraw is AccessControl { address public receiveAddress = 0x2Aaf8f21B6323Bbefb3c1dF7f1c1bf09D815A53D; address public bank = 0xe11B07Bb5aecD1ef2E6F8332801C355aC722CAc5; mapping(uint256 => bool) public hasUsed; bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); event Deposit(address sender, address token, address to, uint256 amount); event WithdrawToken(address sender, address to, address token, uint256 amount, uint256 orderId); constructor() { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(MANAGER_ROLE, 0x49eF88ad51eFA70fFB6aE86EC623CC62afd0ac79); } function depositToken(address token, uint256 amount) public { require(token != address(0), "token empty"); require(amount > 0, "amount limit"); uint256 balanceBefore = IERC20(token).balanceOf(receiveAddress); TransferHelper.safeTransferFrom(token, msg.sender, receiveAddress, amount); uint256 increment = IERC20(token).balanceOf(receiveAddress) - balanceBefore; emit Deposit(msg.sender, token, receiveAddress, increment); } function depositETH() public payable { require(msg.value > 0, "msg.value limit"); payable(receiveAddress).transfer(msg.value); emit Deposit(msg.sender, address(0), receiveAddress, msg.value); } function withdrawToken(address to, address token, uint256 amount, uint256 orderId) public onlyRole(MANAGER_ROLE) { require(!hasUsed[orderId], "id has been used"); hasUsed[orderId] = true; IBank(bank).withdrawToken(to, token, amount); emit WithdrawToken(bank, to, token, amount, orderId); } function setAddress(address _receiveAddress) public onlyRole(MANAGER_ROLE) { receiveAddress = _receiveAddress; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"WithdrawToken","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bank","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"hasUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receiveAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiveAddress","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052600180546001600160a01b0319908116732aaf8f21b6323bbefb3c1df7f1c1bf09d815a53d179091556002805490911673e11b07bb5aecd1ef2e6f8332801c355ac722cac517905534801561005857600080fd5b506100646000336100a7565b6100a27f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b087349ef88ad51efa70ffb6ae86ec623cc62afd0ac796100a7565b610146565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610142576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556101013390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610ff1806101556000396000f3fe6080604052600436106100e85760003560e01c806391d148541161008a578063e30081a011610059578063e30081a01461029f578063ec87621c146102bf578063f6326fb3146102f3578063fffe42e9146102fb57600080fd5b806391d148541461021a578063a217fddf1461023a578063d547741f1461024f578063da4ea2ca1461026f57600080fd5b8063338b5dea116100c6578063338b5dea1461018257806336568abe146101a257806355eb2e96146101c257806376cdb03b146101e257600080fd5b806301ffc9a7146100ed578063248a9ca3146101225780632f2ff15d14610160575b600080fd5b3480156100f957600080fd5b5061010d610108366004610cf0565b61031b565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061015261013d366004610d1a565b60009081526020819052604090206001015490565b604051908152602001610119565b34801561016c57600080fd5b5061018061017b366004610d4f565b610352565b005b34801561018e57600080fd5b5061018061019d366004610d7b565b61037c565b3480156101ae57600080fd5b506101806101bd366004610d4f565b61056c565b3480156101ce57600080fd5b506101806101dd366004610da5565b6105ea565b3480156101ee57600080fd5b50600254610202906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b34801561022657600080fd5b5061010d610235366004610d4f565b610752565b34801561024657600080fd5b50610152600081565b34801561025b57600080fd5b5061018061026a366004610d4f565b61077b565b34801561027b57600080fd5b5061010d61028a366004610d1a565b60036020526000908152604090205460ff1681565b3480156102ab57600080fd5b506101806102ba366004610de7565b6107a0565b3480156102cb57600080fd5b506101527f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b6101806107ed565b34801561030757600080fd5b50600154610202906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061034c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461036d816108bc565b61037783836108c9565b505050565b6001600160a01b0382166103c55760405162461bcd60e51b815260206004820152600b60248201526a746f6b656e20656d70747960a81b60448201526064015b60405180910390fd5b600081116104045760405162461bcd60e51b815260206004820152600c60248201526b185b5bdd5b9d081b1a5b5a5d60a21b60448201526064016103bc565b6001546040516370a0823160e01b81526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610e02565b60015490915061049190849033906001600160a01b03168561094d565b6001546040516370a0823160e01b81526001600160a01b0391821660048201526000918391908616906370a0823190602401602060405180830381865afa1580156104e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105049190610e02565b61050e9190610e31565b600154604080513381526001600160a01b03808916602083015290921690820152606081018290529091507f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969060800160405180910390a150505050565b6001600160a01b03811633146105dc5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016103bc565b6105e68282610a7d565b5050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610614816108bc565b60008281526003602052604090205460ff16156106665760405162461bcd60e51b815260206004820152601060248201526f1a59081a185cc81899595b881d5cd95960821b60448201526064016103bc565b60008281526003602052604090819020805460ff1916600117905560025490516301e3366760e01b81526001600160a01b038781166004830152868116602483015260448201869052909116906301e3366790606401600060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b5050600254604080516001600160a01b0392831681528983166020820152918816828201526060820187905260808201869052517fc345e7657272a96e7e9a9a0fab5c10c3997f033cb3f35fc787b8c2a22b023e3c93509081900360a0019150a15050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600082815260208190526040902060010154610796816108bc565b6103778383610a7d565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086107ca816108bc565b50600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000341161082f5760405162461bcd60e51b815260206004820152600f60248201526e1b5cd9cb9d985b1d59481b1a5b5a5d608a1b60448201526064016103bc565b6001546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610868573d6000803e3d6000fd5b5060015460408051338152600060208201526001600160a01b0390921682820152346060830152517f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969181900360800190a1565b6108c68133610ae2565b50565b6108d38282610752565b6105e6576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556109093390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916109b19190610e68565b6000604051808303816000865af19150503d80600081146109ee576040519150601f19603f3d011682016040523d82523d6000602084013e6109f3565b606091505b5091509150818015610a1d575080511580610a1d575080806020019051810190610a1d9190610e84565b610a755760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016103bc565b505050505050565b610a878282610752565b156105e6576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610aec8282610752565b6105e657610af981610b3b565b610b04836020610b4d565b604051602001610b15929190610ea6565b60408051601f198184030181529082905262461bcd60e51b82526103bc91600401610f1b565b606061034c6001600160a01b03831660145b60606000610b5c836002610f4e565b610b67906002610f65565b67ffffffffffffffff811115610b7f57610b7f610f78565b6040519080825280601f01601f191660200182016040528015610ba9576020820181803683370190505b509050600360fc1b81600081518110610bc457610bc4610f8e565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bf357610bf3610f8e565b60200101906001600160f81b031916908160001a9053506000610c17846002610f4e565b610c22906001610f65565b90505b6001811115610c9a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c5657610c56610f8e565b1a60f81b828281518110610c6c57610c6c610f8e565b60200101906001600160f81b031916908160001a90535060049490941c93610c9381610fa4565b9050610c25565b508315610ce95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103bc565b9392505050565b600060208284031215610d0257600080fd5b81356001600160e01b031981168114610ce957600080fd5b600060208284031215610d2c57600080fd5b5035919050565b80356001600160a01b0381168114610d4a57600080fd5b919050565b60008060408385031215610d6257600080fd5b82359150610d7260208401610d33565b90509250929050565b60008060408385031215610d8e57600080fd5b610d9783610d33565b946020939093013593505050565b60008060008060808587031215610dbb57600080fd5b610dc485610d33565b9350610dd260208601610d33565b93969395505050506040820135916060013590565b600060208284031215610df957600080fd5b610ce982610d33565b600060208284031215610e1457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561034c5761034c610e1b565b60005b83811015610e5f578181015183820152602001610e47565b50506000910152565b60008251610e7a818460208701610e44565b9190910192915050565b600060208284031215610e9657600080fd5b81518015158114610ce957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610ede816017850160208801610e44565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610f0f816028840160208801610e44565b01602801949350505050565b6020815260008251806020840152610f3a816040850160208701610e44565b601f01601f19169190910160400192915050565b808202811582820484141761034c5761034c610e1b565b8082018082111561034c5761034c610e1b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610fb357610fb3610e1b565b50600019019056fea2646970667358221220562e94d12b7ab4027c95651bed9301964f69d2680177e44360e50036a2ad00c264736f6c63430008120033
Deployed Bytecode
0x6080604052600436106100e85760003560e01c806391d148541161008a578063e30081a011610059578063e30081a01461029f578063ec87621c146102bf578063f6326fb3146102f3578063fffe42e9146102fb57600080fd5b806391d148541461021a578063a217fddf1461023a578063d547741f1461024f578063da4ea2ca1461026f57600080fd5b8063338b5dea116100c6578063338b5dea1461018257806336568abe146101a257806355eb2e96146101c257806376cdb03b146101e257600080fd5b806301ffc9a7146100ed578063248a9ca3146101225780632f2ff15d14610160575b600080fd5b3480156100f957600080fd5b5061010d610108366004610cf0565b61031b565b60405190151581526020015b60405180910390f35b34801561012e57600080fd5b5061015261013d366004610d1a565b60009081526020819052604090206001015490565b604051908152602001610119565b34801561016c57600080fd5b5061018061017b366004610d4f565b610352565b005b34801561018e57600080fd5b5061018061019d366004610d7b565b61037c565b3480156101ae57600080fd5b506101806101bd366004610d4f565b61056c565b3480156101ce57600080fd5b506101806101dd366004610da5565b6105ea565b3480156101ee57600080fd5b50600254610202906001600160a01b031681565b6040516001600160a01b039091168152602001610119565b34801561022657600080fd5b5061010d610235366004610d4f565b610752565b34801561024657600080fd5b50610152600081565b34801561025b57600080fd5b5061018061026a366004610d4f565b61077b565b34801561027b57600080fd5b5061010d61028a366004610d1a565b60036020526000908152604090205460ff1681565b3480156102ab57600080fd5b506101806102ba366004610de7565b6107a0565b3480156102cb57600080fd5b506101527f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b6101806107ed565b34801561030757600080fd5b50600154610202906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061034c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461036d816108bc565b61037783836108c9565b505050565b6001600160a01b0382166103c55760405162461bcd60e51b815260206004820152600b60248201526a746f6b656e20656d70747960a81b60448201526064015b60405180910390fd5b600081116104045760405162461bcd60e51b815260206004820152600c60248201526b185b5bdd5b9d081b1a5b5a5d60a21b60448201526064016103bc565b6001546040516370a0823160e01b81526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610e02565b60015490915061049190849033906001600160a01b03168561094d565b6001546040516370a0823160e01b81526001600160a01b0391821660048201526000918391908616906370a0823190602401602060405180830381865afa1580156104e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105049190610e02565b61050e9190610e31565b600154604080513381526001600160a01b03808916602083015290921690820152606081018290529091507f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969060800160405180910390a150505050565b6001600160a01b03811633146105dc5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016103bc565b6105e68282610a7d565b5050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610614816108bc565b60008281526003602052604090205460ff16156106665760405162461bcd60e51b815260206004820152601060248201526f1a59081a185cc81899595b881d5cd95960821b60448201526064016103bc565b60008281526003602052604090819020805460ff1916600117905560025490516301e3366760e01b81526001600160a01b038781166004830152868116602483015260448201869052909116906301e3366790606401600060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b5050600254604080516001600160a01b0392831681528983166020820152918816828201526060820187905260808201869052517fc345e7657272a96e7e9a9a0fab5c10c3997f033cb3f35fc787b8c2a22b023e3c93509081900360a0019150a15050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600082815260208190526040902060010154610796816108bc565b6103778383610a7d565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086107ca816108bc565b50600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000341161082f5760405162461bcd60e51b815260206004820152600f60248201526e1b5cd9cb9d985b1d59481b1a5b5a5d608a1b60448201526064016103bc565b6001546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610868573d6000803e3d6000fd5b5060015460408051338152600060208201526001600160a01b0390921682820152346060830152517f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969181900360800190a1565b6108c68133610ae2565b50565b6108d38282610752565b6105e6576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556109093390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916109b19190610e68565b6000604051808303816000865af19150503d80600081146109ee576040519150601f19603f3d011682016040523d82523d6000602084013e6109f3565b606091505b5091509150818015610a1d575080511580610a1d575080806020019051810190610a1d9190610e84565b610a755760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016103bc565b505050505050565b610a878282610752565b156105e6576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610aec8282610752565b6105e657610af981610b3b565b610b04836020610b4d565b604051602001610b15929190610ea6565b60408051601f198184030181529082905262461bcd60e51b82526103bc91600401610f1b565b606061034c6001600160a01b03831660145b60606000610b5c836002610f4e565b610b67906002610f65565b67ffffffffffffffff811115610b7f57610b7f610f78565b6040519080825280601f01601f191660200182016040528015610ba9576020820181803683370190505b509050600360fc1b81600081518110610bc457610bc4610f8e565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610bf357610bf3610f8e565b60200101906001600160f81b031916908160001a9053506000610c17846002610f4e565b610c22906001610f65565b90505b6001811115610c9a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610c5657610c56610f8e565b1a60f81b828281518110610c6c57610c6c610f8e565b60200101906001600160f81b031916908160001a90535060049490941c93610c9381610fa4565b9050610c25565b508315610ce95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103bc565b9392505050565b600060208284031215610d0257600080fd5b81356001600160e01b031981168114610ce957600080fd5b600060208284031215610d2c57600080fd5b5035919050565b80356001600160a01b0381168114610d4a57600080fd5b919050565b60008060408385031215610d6257600080fd5b82359150610d7260208401610d33565b90509250929050565b60008060408385031215610d8e57600080fd5b610d9783610d33565b946020939093013593505050565b60008060008060808587031215610dbb57600080fd5b610dc485610d33565b9350610dd260208601610d33565b93969395505050506040820135916060013590565b600060208284031215610df957600080fd5b610ce982610d33565b600060208284031215610e1457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561034c5761034c610e1b565b60005b83811015610e5f578181015183820152602001610e47565b50506000910152565b60008251610e7a818460208701610e44565b9190910192915050565b600060208284031215610e9657600080fd5b81518015158114610ce957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610ede816017850160208801610e44565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610f0f816028840160208801610e44565b01602801949350505050565b6020815260008251806020840152610f3a816040850160208701610e44565b601f01601f19169190910160400192915050565b808202811582820484141761034c5761034c610e1b565b8082018082111561034c5761034c610e1b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610fb357610fb3610e1b565b50600019019056fea2646970667358221220562e94d12b7ab4027c95651bed9301964f69d2680177e44360e50036a2ad00c264736f6c63430008120033
Deployed Bytecode Sourcemap
35186:1863:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25954:204;;;;;;;;;;-1:-1:-1;25954:204:0;;;;;:::i;:::-;;:::i;:::-;;;470:14:1;;463:22;445:41;;433:2;418:18;25954:204:0;;;;;;;;27777:131;;;;;;;;;;-1:-1:-1;27777:131:0;;;;;:::i;:::-;27851:7;27878:12;;;;;;;;;;:22;;;;27777:131;;;;828:25:1;;;816:2;801:18;27777:131:0;682:177:1;28218:147:0;;;;;;;;;;-1:-1:-1;28218:147:0;;;;;:::i;:::-;;:::i;:::-;;35859:482;;;;;;;;;;-1:-1:-1;35859:482:0;;;;;:::i;:::-;;:::i;29362:218::-;;;;;;;;;;-1:-1:-1;29362:218:0;;;;;:::i;:::-;;:::i;36582:330::-;;;;;;;;;;-1:-1:-1;36582:330:0;;;;;:::i;:::-;;:::i;35319:64::-;;;;;;;;;;-1:-1:-1;35319:64:0;;;;-1:-1:-1;;;;;35319:64:0;;;;;;-1:-1:-1;;;;;2126:32:1;;;2108:51;;2096:2;2081:18;35319:64:0;1962:203:1;26250:147:0;;;;;;;;;;-1:-1:-1;26250:147:0;;;;;:::i;:::-;;:::i;25355:49::-;;;;;;;;;;-1:-1:-1;25355:49:0;25400:4;25355:49;;28658:149;;;;;;;;;;-1:-1:-1;28658:149:0;;;;;:::i;:::-;;:::i;35390:39::-;;;;;;;;;;-1:-1:-1;35390:39:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;36920:126;;;;;;;;;;-1:-1:-1;36920:126:0;;;;;:::i;:::-;;:::i;35436:64::-;;;;;;;;;;;;35475:25;35436:64;;36349:225;;;:::i;35238:74::-;;;;;;;;;;-1:-1:-1;35238:74:0;;;;-1:-1:-1;;;;;35238:74:0;;;25954:204;26039:4;-1:-1:-1;;;;;;26063:47:0;;-1:-1:-1;;;26063:47:0;;:87;;-1:-1:-1;;;;;;;;;;23189:40:0;;;26114:36;26056:94;25954:204;-1:-1:-1;;25954:204:0:o;28218:147::-;27851:7;27878:12;;;;;;;;;;:22;;;25846:16;25857:4;25846:10;:16::i;:::-;28332:25:::1;28343:4;28349:7;28332:10;:25::i;:::-;28218:147:::0;;;:::o;35859:482::-;-1:-1:-1;;;;;35938:19:0;;35930:43;;;;-1:-1:-1;;;35930:43:0;;2748:2:1;35930:43:0;;;2730:21:1;2787:2;2767:18;;;2760:30;-1:-1:-1;;;2806:18:1;;;2799:41;2857:18;;35930:43:0;;;;;;;;;36001:1;35992:6;:10;35984:35;;;;-1:-1:-1;;;35984:35:0;;3088:2:1;35984:35:0;;;3070:21:1;3127:2;3107:18;;;3100:30;-1:-1:-1;;;3146:18:1;;;3139:42;3198:18;;35984:35:0;2886:336:1;35984:35:0;36078:14;;36054:39;;-1:-1:-1;;;36054:39:0;;-1:-1:-1;;;;;36078:14:0;;;36054:39;;;2108:51:1;36030:21:0;;36054:23;;;;;2081:18:1;;36054:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;36155:14;;36030:63;;-1:-1:-1;36104:74:0;;36136:5;;36143:10;;-1:-1:-1;;;;;36155:14:0;36171:6;36104:31;:74::i;:::-;36233:14;;36209:39;;-1:-1:-1;;;36209:39:0;;-1:-1:-1;;;;;36233:14:0;;;36209:39;;;2108:51:1;36189:17:0;;36251:13;;36209:23;;;;;;2081:18:1;;36209:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:55;;;;:::i;:::-;36307:14;;36280:53;;;36288:10;3950:34:1;;-1:-1:-1;;;;;4020:15:1;;;4015:2;4000:18;;3993:43;36307:14:0;;;4052:18:1;;;4045:43;4119:2;4104:18;;4097:34;;;36189:75:0;;-1:-1:-1;36280:53:0;;3899:3:1;3884:19;36280:53:0;;;;;;;35919:422;;35859:482;;:::o;29362:218::-;-1:-1:-1;;;;;29458:23:0;;3812:10;29458:23;29450:83;;;;-1:-1:-1;;;29450:83:0;;4344:2:1;29450:83:0;;;4326:21:1;4383:2;4363:18;;;4356:30;4422:34;4402:18;;;4395:62;-1:-1:-1;;;4473:18:1;;;4466:45;4528:19;;29450:83:0;4142:411:1;29450:83:0;29546:26;29558:4;29564:7;29546:11;:26::i;:::-;29362:218;;:::o;36582:330::-;35475:25;25846:16;25857:4;25846:10;:16::i;:::-;36715::::1;::::0;;;:7:::1;:16;::::0;;;;;::::1;;36714:17;36706:46;;;::::0;-1:-1:-1;;;36706:46:0;;4760:2:1;36706:46:0::1;::::0;::::1;4742:21:1::0;4799:2;4779:18;;;4772:30;-1:-1:-1;;;4818:18:1;;;4811:46;4874:18;;36706:46:0::1;4558:340:1::0;36706:46:0::1;36763:16;::::0;;;:7:::1;:16;::::0;;;;;;:23;;-1:-1:-1;;36763:23:0::1;36782:4;36763:23;::::0;;36803:4:::1;::::0;36797:44;;-1:-1:-1;;;36797:44:0;;-1:-1:-1;;;;;5161:15:1;;;36797:44:0::1;::::0;::::1;5143:34:1::0;5213:15;;;5193:18;;;5186:43;5245:18;;;5238:34;;;36803:4:0;;::::1;::::0;36797:25:::1;::::0;5078:18:1;;36797:44:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;36871:4:0::1;::::0;36857:47:::1;::::0;;-1:-1:-1;;;;;36871:4:0;;::::1;5580:34:1::0;;5650:15;;;5645:2;5630:18;;5623:43;5702:15;;;5682:18;;;5675:43;5749:2;5734:18;;5727:34;;;5792:3;5777:19;;5770:35;;;36857:47:0;::::1;::::0;-1:-1:-1;36857:47:0;;;;5529:3:1;36857:47:0;;-1:-1:-1;36857:47:0::1;36582:330:::0;;;;;:::o;26250:147::-;26336:4;26360:12;;;;;;;;;;;-1:-1:-1;;;;;26360:29:0;;;;;;;;;;;;;;;26250:147::o;28658:149::-;27851:7;27878:12;;;;;;;;;;:22;;;25846:16;25857:4;25846:10;:16::i;:::-;28773:26:::1;28785:4;28791:7;28773:11;:26::i;36920:126::-:0;35475:25;25846:16;25857:4;25846:10;:16::i;:::-;-1:-1:-1;37006:14:0::1;:32:::0;;-1:-1:-1;;;;;;37006:32:0::1;-1:-1:-1::0;;;;;37006:32:0;;;::::1;::::0;;;::::1;::::0;;36920:126::o;36349:225::-;36417:1;36405:9;:13;36397:41;;;;-1:-1:-1;;;36397:41:0;;6018:2:1;36397:41:0;;;6000:21:1;6057:2;6037:18;;;6030:30;-1:-1:-1;;;6076:18:1;;;6069:45;6131:18;;36397:41:0;5816:339:1;36397:41:0;36457:14;;36449:43;;-1:-1:-1;;;;;36457:14:0;;;;36482:9;36449:43;;;;;36457:14;36449:43;36457:14;36449:43;36482:9;36457:14;36449:43;;;;;;;;;;;;;;;;;;;;-1:-1:-1;36540:14:0;;36508:58;;;36516:10;3950:34:1;;36536:1:0;4015:2:1;4000:18;;3993:43;-1:-1:-1;;;;;36540:14:0;;;4052:18:1;;;4045:43;36556:9:0;4119:2:1;4104:18;;4097:34;36508:58:0;;;;;;3899:3:1;36508:58:0;;;36349:225::o;26701:105::-;26768:30;26779:4;3812:10;26768;:30::i;:::-;26701:105;:::o;30959:238::-;31043:22;31051:4;31057:7;31043;:22::i;:::-;31038:152;;31082:6;:12;;;;;;;;;;;-1:-1:-1;;;;;31082:29:0;;;;;;;;;:36;;-1:-1:-1;;31082:36:0;31114:4;31082:36;;;31165:12;3812:10;;3732:98;31165:12;-1:-1:-1;;;;;31138:40:0;31156:7;-1:-1:-1;;;;;31138:40:0;31150:4;31138:40;;;;;;;;;;30959:238;;:::o;34751:323::-;34897:51;;;-1:-1:-1;;;;;5161:15:1;;;34897:51:0;;;5143:34:1;5213:15;;;5193:18;;;5186:43;5245:18;;;;5238:34;;;34897:51:0;;;;;;;;;;5078:18:1;;;;34897:51:0;;;;;;;-1:-1:-1;;;;;34897:51:0;-1:-1:-1;;;34897:51:0;;;34886:63;;-1:-1:-1;;;;34886:10:0;;;;:63;;34897:51;34886:63;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34850:99;;;;34968:7;:57;;;;-1:-1:-1;34980:11:0;;:16;;:44;;;35011:4;35000:24;;;;;;;;;;;;:::i;:::-;34960:106;;;;-1:-1:-1;;;34960:106:0;;7191:2:1;34960:106:0;;;7173:21:1;7230:2;7210:18;;;7203:30;7269:34;7249:18;;;7242:62;-1:-1:-1;;;7320:18:1;;;7313:34;7364:19;;34960:106:0;6989:400:1;34960:106:0;34839:235;;34751:323;;;;:::o;31377:239::-;31461:22;31469:4;31475:7;31461;:22::i;:::-;31457:152;;;31532:5;31500:12;;;;;;;;;;;-1:-1:-1;;;;;31500:29:0;;;;;;;;;;:37;;-1:-1:-1;;31500:37:0;;;31557:40;3812:10;;31500:12;;31557:40;;31532:5;31557:40;31377:239;;:::o;27096:492::-;27185:22;27193:4;27199:7;27185;:22::i;:::-;27180:401;;27373:28;27393:7;27373:19;:28::i;:::-;27474:38;27502:4;27509:2;27474:19;:38::i;:::-;27278:257;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;27278:257:0;;;;;;;;;;-1:-1:-1;;;27224:345:0;;;;;;;:::i;20900:151::-;20958:13;20991:52;-1:-1:-1;;;;;21003:22:0;;18775:2;20296:447;20371:13;20397:19;20429:10;20433:6;20429:1;:10;:::i;:::-;:14;;20442:1;20429:14;:::i;:::-;20419:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;20419:25:0;;20397:47;;-1:-1:-1;;;20455:6:0;20462:1;20455:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;20455:15:0;;;;;;;;;-1:-1:-1;;;20481:6:0;20488:1;20481:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;20481:15:0;;;;;;;;-1:-1:-1;20512:9:0;20524:10;20528:6;20524:1;:10;:::i;:::-;:14;;20537:1;20524:14;:::i;:::-;20512:26;;20507:131;20544:1;20540;:5;20507:131;;;-1:-1:-1;;;20588:5:0;20596:3;20588:11;20579:21;;;;;;;:::i;:::-;;;;20567:6;20574:1;20567:9;;;;;;;;:::i;:::-;;;;:33;-1:-1:-1;;;;;20567:33:0;;;;;;;;-1:-1:-1;20625:1:0;20615:11;;;;;20547:3;;;:::i;:::-;;;20507:131;;;-1:-1:-1;20656:10:0;;20648:55;;;;-1:-1:-1;;;20648:55:0;;9522:2:1;20648:55:0;;;9504:21:1;;;9541:18;;;9534:30;9600:34;9580:18;;;9573:62;9652:18;;20648:55:0;9320:356:1;20648:55:0;20728:6;20296:447;-1:-1:-1;;;20296:447:0:o;14:286:1:-;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;167:23;;-1:-1:-1;;;;;;219:32:1;;209:43;;199:71;;266:1;263;256:12;497:180;556:6;609:2;597:9;588:7;584:23;580:32;577:52;;;625:1;622;615:12;577:52;-1:-1:-1;648:23:1;;497:180;-1:-1:-1;497:180:1:o;864:173::-;932:20;;-1:-1:-1;;;;;981:31:1;;971:42;;961:70;;1027:1;1024;1017:12;961:70;864:173;;;:::o;1042:254::-;1110:6;1118;1171:2;1159:9;1150:7;1146:23;1142:32;1139:52;;;1187:1;1184;1177:12;1139:52;1223:9;1210:23;1200:33;;1252:38;1286:2;1275:9;1271:18;1252:38;:::i;:::-;1242:48;;1042:254;;;;;:::o;1301:::-;1369:6;1377;1430:2;1418:9;1409:7;1405:23;1401:32;1398:52;;;1446:1;1443;1436:12;1398:52;1469:29;1488:9;1469:29;:::i;:::-;1459:39;1545:2;1530:18;;;;1517:32;;-1:-1:-1;;;1301:254:1:o;1560:397::-;1646:6;1654;1662;1670;1723:3;1711:9;1702:7;1698:23;1694:33;1691:53;;;1740:1;1737;1730:12;1691:53;1763:29;1782:9;1763:29;:::i;:::-;1753:39;;1811:38;1845:2;1834:9;1830:18;1811:38;:::i;:::-;1560:397;;1801:48;;-1:-1:-1;;;;1896:2:1;1881:18;;1868:32;;1947:2;1932:18;1919:32;;1560:397::o;2355:186::-;2414:6;2467:2;2455:9;2446:7;2442:23;2438:32;2435:52;;;2483:1;2480;2473:12;2435:52;2506:29;2525:9;2506:29;:::i;3227:184::-;3297:6;3350:2;3338:9;3329:7;3325:23;3321:32;3318:52;;;3366:1;3363;3356:12;3318:52;-1:-1:-1;3389:16:1;;3227:184;-1:-1:-1;3227:184:1:o;3416:127::-;3477:10;3472:3;3468:20;3465:1;3458:31;3508:4;3505:1;3498:15;3532:4;3529:1;3522:15;3548:128;3615:9;;;3636:11;;;3633:37;;;3650:18;;:::i;6160:250::-;6245:1;6255:113;6269:6;6266:1;6263:13;6255:113;;;6345:11;;;6339:18;6326:11;;;6319:39;6291:2;6284:10;6255:113;;;-1:-1:-1;;6402:1:1;6384:16;;6377:27;6160:250::o;6415:287::-;6544:3;6582:6;6576:13;6598:66;6657:6;6652:3;6645:4;6637:6;6633:17;6598:66;:::i;:::-;6680:16;;;;;6415:287;-1:-1:-1;;6415:287:1:o;6707:277::-;6774:6;6827:2;6815:9;6806:7;6802:23;6798:32;6795:52;;;6843:1;6840;6833:12;6795:52;6875:9;6869:16;6928:5;6921:13;6914:21;6907:5;6904:32;6894:60;;6950:1;6947;6940:12;7394:812;7805:25;7800:3;7793:38;7775:3;7860:6;7854:13;7876:75;7944:6;7939:2;7934:3;7930:12;7923:4;7915:6;7911:17;7876:75;:::i;:::-;-1:-1:-1;;;8010:2:1;7970:16;;;8002:11;;;7995:40;8060:13;;8082:76;8060:13;8144:2;8136:11;;8129:4;8117:17;;8082:76;:::i;:::-;8178:17;8197:2;8174:26;;7394:812;-1:-1:-1;;;;7394:812:1:o;8211:396::-;8360:2;8349:9;8342:21;8323:4;8392:6;8386:13;8435:6;8430:2;8419:9;8415:18;8408:34;8451:79;8523:6;8518:2;8507:9;8503:18;8498:2;8490:6;8486:15;8451:79;:::i;:::-;8591:2;8570:15;-1:-1:-1;;8566:29:1;8551:45;;;;8598:2;8547:54;;8211:396;-1:-1:-1;;8211:396:1:o;8612:168::-;8685:9;;;8716;;8733:15;;;8727:22;;8713:37;8703:71;;8754:18;;:::i;8785:125::-;8850:9;;;8871:10;;;8868:36;;;8884:18;;:::i;8915:127::-;8976:10;8971:3;8967:20;8964:1;8957:31;9007:4;9004:1;8997:15;9031:4;9028:1;9021:15;9047:127;9108:10;9103:3;9099:20;9096:1;9089:31;9139:4;9136:1;9129:15;9163:4;9160:1;9153:15;9179:136;9218:3;9246:5;9236:39;;9255:18;;:::i;:::-;-1:-1:-1;;;9291:18:1;;9179:136::o
Swarm Source
ipfs://562e94d12b7ab4027c95651bed9301964f69d2680177e44360e50036a2ad00c2
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MNT
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.