Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
3549071 | 5 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
DepositHandler
Compiler Version
v0.8.28+commit.7893614a
ZkSolc Version
v1.5.11
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; contract DepositHandler is Initializable, OwnableUpgradeable { using SafeERC20 for IERC20; address public treasury; mapping(address => bool) public allowedTokens; // ERC20 tokens allowed for deposit event Deposit( address indexed sender, uint256 userId, uint256 amount, address token // address(0) for ETH ); function initialize() public initializer { __Ownable_init(msg.sender); // require(_treasury != address(0), "Invalid treasury address"); treasury = msg.sender; } function depositETH(uint256 userId) external payable { require(msg.value > 0, "Must send ETH"); (bool sent, ) = treasury.call{value: msg.value}(""); require(sent, "Failed to send ETH to treasury"); emit Deposit(msg.sender, userId, msg.value, address(0)); } function depositERC20( address token, uint256 amount, uint256 userId ) external { require(allowedTokens[token], "Token not allowed"); require(amount > 0, "Amount must be greater than 0"); IERC20(token).transferFrom(msg.sender, treasury, amount); emit Deposit(msg.sender, userId, amount, token); } function setTreasury(address _treasury) external onlyOwner { require(_treasury != address(0), "Invalid treasury address"); treasury = _treasury; } function addAllowedToken(address token) external onlyOwner { require(token != address(0), "Invalid token address"); allowedTokens[token] = true; } function removeAllowedToken(address token) external onlyOwner { allowedTokens[token] = false; } function version() public pure virtual returns (string memory) { return "1.0.0"; } // We don't want to receive ETH directly, we don't have userId this way receive() external payable { revert("Use depositETH function"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. 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 OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 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 IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @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). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @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). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * 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[ERC 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); }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"userId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","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"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addAllowedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"userId","type":"uint256"}],"name":"depositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"userId","type":"uint256"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeAllowedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
9c4d535b0000000000000000000000000000000000000000000000000000000000000000010000f34fbcee7f56f7b6587353ed67faa45786d1423ec6314c2b9797ae57b300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x0001000000000002000300000000000200000000000103550000008003000039000000400030043f0000000100200190000000260000c13d0000006002100270000000b502200197000000040020008c0000002e0000413d000000000301043b000000e003300270000000ba0030009c0000003a0000213d000000c20030009c000000570000213d000000c60030009c000000870000613d000000c70030009c000000af0000613d000000c80030009c000002710000c13d000000240020008c000002710000413d0000000003000416000000000003004b000001390000c13d000000b701000041000000800010043f0000002001000039000000840010043f0000000d01000039000000a40010043f000000ea01000041000000c40010043f000000b901000041000002d2000104300000000001000416000000000001004b000002710000c13d000000200100003900000100001004430000012000000443000000b601000041000002d10001042e000000000002004b000002710000c13d000000b701000041000000800010043f0000002001000039000000840010043f0000001701000039000000a40010043f000000b801000041000000c40010043f000000b901000041000002d200010430000000bb0030009c000000720000213d000000bf0030009c000000ca0000613d000000c00030009c000000ec0000613d000000c10030009c000002710000c13d000000240020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000401100370000000000101043b000000c90010009c000002710000213d000300000001001d02d002ac0000040f0000000301000029000000000010043f0000000101000039000000200010043f02d002b90000040f000000000301041a000000f102300197000000000021041b0000000001000019000002d10001042e000000c30030009c000000f20000613d000000c40030009c000001020000613d000000c50030009c000002710000c13d0000000001000416000000000001004b000002710000c13d000000ca01000041000000000201041a000000c9052001970000000003000411000000000035004b000001890000c13d000000cd02200197000000000021041b0000000001000414000000b50010009c000000b501008041000000c001100210000000d8011001c70000800d020000390000000303000039000000d9040000410000000006000019000001840000013d000000bc0030009c0000010a0000613d000000bd0030009c0000011e0000613d000000be0030009c000002710000c13d000000240020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000401100370000000000101043b000000c90010009c000002710000213d000300000001001d02d002ac0000040f000000030100002902d002910000040f0000000001000019000002d10001042e000000640020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000402100370000000000302043b000000c90030009c000002710000213d0000002401100370000000000101043b000200000001001d000000000030043f0000000101000039000000200010043f0000000001000414000000b50010009c000000b501008041000000c001100210000000ec011001c70000801002000039000300000003001d02d002cb0000040f00000003060000290000000100200190000002710000613d000000000101043b000000000101041a000000ff00100190000001b40000c13d000000b701000041000000800010043f0000002001000039000000840010043f0000001101000039000000a40010043f000000f001000041000000c40010043f000000b901000041000002d200010430000000240020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000401100370000000000101043b000000c90010009c000002710000213d000000ca02000041000000000202041a000000c9032001970000000002000411000000000023004b0000018e0000c13d000000000001004b000001c80000c13d000000b701000041000000800010043f0000002001000039000000840010043f0000001501000039000000a40010043f000000eb01000041000000c40010043f000000b901000041000002d2000104300000000001000416000000000001004b000002710000c13d000000d001000041000000000201041a000000d103200197000000d201200198000001930000613d000000010010008c000000e80000c13d000200000002001d000300000003001d000000d3010000410000000000100443000000000100041000000004001004430000000001000414000000b50010009c000000b501008041000000c001100210000000d4011001c7000080020200003902d002cb0000040f0000000100200190000001b30000613d000000000101043b000000000001004b00000003030000290000000202000029000001950000613d000000e001000041000000000010043f000000df01000041000002d2000104300000000001000416000000000001004b000002710000c13d000000ca01000041000000000101041a000001060000013d0000000001000416000000000001004b000002710000c13d000000c001000039000000400010043f0000000501000039000000800010043f000000e102000041000000a00020043f0000002003000039000000c00030043f000000e00010043f000001000020043f000001050000043f000000e201000041000002d10001042e0000000001000416000000000001004b000002710000c13d000000000100041a000000c901100197000000800010043f000000cf01000041000002d10001042e000000240020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000401100370000000000101043b000000c90010009c000002710000213d000000000010043f0000000101000039000000200010043f02d002b90000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f000000cf01000041000002d10001042e000000240020008c000002710000413d0000000002000416000000000002004b000002710000c13d0000000401100370000000000101043b000000c90010009c000002710000213d000000ca02000041000000000202041a000000c9032001970000000002000411000000000023004b0000018e0000c13d000000000001004b000001d20000c13d000000b701000041000000800010043f0000002001000039000000840010043f0000001801000039000000a40010043f000000ce01000041000000c40010043f000000b901000041000002d200010430000000000100041a0000000002000414000000c904100197000000b50020009c000000b502008041000000c001200210000000d8011001c70000800902000039000000000500001902d002c60000040f0000006003100270000000b5033001980000016b0000613d0000001f04300039000000e3044001970000003f04400039000000e404400197000000400500043d0000000004450019000000000054004b00000000060000390000000106004039000000d20040009c0000023f0000213d00000001006001900000023f0000c13d000000400040043f0000001f0430018f0000000006350436000000e50530019800000000035600190000015e0000613d000000000701034f000000007807043c0000000006860436000000000036004b0000015a0000c13d000000000004004b0000016b0000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000000400100043d0000000100200190000001a30000613d00000004020000390000000002200367000000000202043b000000200310003900000000040004160000000000430435000000000021043500000040021000390000000000020435000000b50010009c000000b50100804100000040011002100000000002000414000000b50020009c000000b502008041000000c002200210000000000112019f000000e8011001c70000800d0200003900000002030000390000000005000411000000e90400004102d002c60000040f0000000100200190000002710000613d0000000001000019000002d10001042e000000cb01000041000000000010043f000000040030043f000000cc01000041000002d200010430000000cb01000041000000000010043f000000040020043f000000cc01000041000002d200010430000000000003004b000000e80000c13d000000d50120019700000001011001bf000000d602200197000000d7022001c7000000000003004b000000000201c019000000d001000041000000000021041b000000d100200198000001d80000c13d000000de01000041000000000010043f000000df01000041000002d2000104300000004402100039000000e603000041000000000032043500000024021000390000001e030000390000000000320435000000b7020000410000000000210435000000040210003900000020030000390000000000320435000000b50010009c000000b5010080410000004001100210000000e7011001c7000002d200010430000000000001042f000000400800043d0000004401800039000000240280003900000004038000390000000207000029000000000007004b000001e00000c13d000000b7040000410000000000480435000000200400003900000000004304350000001d030000390000000000320435000000ef020000410000000000210435000000b50080009c000000b5080080410000004001800210000000e7011001c7000002d200010430000000000010043f0000000101000039000000200010043f02d002b90000040f000000000201041a000000f10220019700000001022001bf000000000021041b0000000001000019000002d10001042e000000000200041a000000cd02200197000000000112019f000000000010041b0000000001000019000002d10001042e0000000001000411000000c906100198000002450000c13d000000dd01000041000000000010043f000000040000043f000000cc01000041000002d200010430000000000400041a000000ed05000041000000000058043500000000050004110000000000530435000000c90340019700000000003204350000000000710435000000b50080009c000000b501000041000000000108401900000040011002100000000002000414000000b50020009c000000b502008041000000c002200210000000000112019f000000e7011001c70000000002060019000100000008001d02d002c60000040f000000010b0000290000006003100270000000b503300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000002050000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000002010000c13d000000000006004b000002120000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f00000000006504350000000100200190000002730000613d0000001f01400039000000600210018f0000000001b20019000000000021004b00000000020000390000000102004039000000d20010009c0000023f0000213d00000001002001900000023f0000c13d000000400010043f000000200030008c0000000304000029000002710000413d00000000020b0433000000000002004b0000000003000039000000010300c039000000000032004b000002710000c13d00000044020000390000000002200367000000000202043b000000400310003900000000004304350000002003100039000000020400002900000000004304350000000000210435000000b50010009c000000b50100804100000040011002100000000002000414000000b50020009c000000b502008041000000c002200210000000000112019f000000e8011001c70000800d020000390000000203000039000000e9040000410000000005000411000001840000013d000000ee01000041000000000010043f0000004101000039000000040010043f000000cc01000041000002d200010430000300000003001d000000ca01000041000000000201041a000000cd03200197000000000363019f000000000031041b0000000001000414000000c905200197000000b50010009c000000b501008041000000c001100210000000d8011001c70000800d020000390000000303000039000000d90400004102d002c60000040f0000000100200190000002710000613d000000000100041a000000cd011001970000000002000411000000000121019f000000000010041b000000030000006b000001870000c13d000000d001000041000000000201041a000000da02200197000000000021041b0000000103000039000000400100043d0000000000310435000000b50010009c000000b50100804100000040011002100000000002000414000000b50020009c000000b502008041000000c002200210000000000112019f000000db011001c70000800d02000039000000dc04000041000001840000013d0000000001000019000002d2000104300000001f0530018f000000e506300198000000400200043d00000000046200190000027e0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b0000027a0000c13d000000000005004b0000028b0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000000b50020009c000000b5020080410000004002200210000000000112019f000002d200010430000000c906100198000002a50000613d000000ca01000041000000000201041a000000cd03200197000000000363019f000000000031041b0000000001000414000000c905200197000000b50010009c000000b501008041000000c001100210000000d8011001c70000800d020000390000000303000039000000d90400004102d002c60000040f0000000100200190000002aa0000613d000000000001042d000000dd01000041000000000010043f000000040000043f000000cc01000041000002d2000104300000000001000019000002d200010430000000ca01000041000000000101041a000000c9021001970000000001000411000000000012004b000002b30000c13d000000000001042d000000cb02000041000000000020043f000000040010043f000000cc01000041000002d200010430000000000001042f0000000001000414000000b50010009c000000b501008041000000c001100210000000ec011001c7000080100200003902d002cb0000040f0000000100200190000002c40000613d000000000101043b000000000001042d0000000001000019000002d200010430000002c9002104210000000102000039000000000001042d0000000002000019000000000001042d000002ce002104230000000102000039000000000001042d0000000002000019000000000001042d000002d000000432000002d10001042e000002d200010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffff000000020000000000000000000000000000004000000100000000000000000008c379a000000000000000000000000000000000000000000000000000000000557365206465706f7369744554482066756e6374696f6e0000000000000000000000000000000000000000000000000000000064000000800000000000000000000000000000000000000000000000000000000000000000000000008129fc1b00000000000000000000000000000000000000000000000000000000e744092d00000000000000000000000000000000000000000000000000000000e744092e00000000000000000000000000000000000000000000000000000000f0f4426000000000000000000000000000000000000000000000000000000000f2fde38b000000000000000000000000000000000000000000000000000000008129fc1c000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000090469a9d0000000000000000000000000000000000000000000000000000000054fd4d4f0000000000000000000000000000000000000000000000000000000054fd4d500000000000000000000000000000000000000000000000000000000061d027b300000000000000000000000000000000000000000000000000000000715018a60000000000000000000000000000000000000000000000000000000021425ee0000000000000000000000000000000000000000000000000000000004178617f000000000000000000000000000000000000000000000000000000005358fbda000000000000000000000000ffffffffffffffffffffffffffffffffffffffff9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300118cdaa7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000496e76616c6964207472656173757279206164647265737300000000000000000000000000000000000000000000000000000020000000800000000000000000f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff1806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000001000000000000000102000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff0200000000000000000000000000000000000020000000000000000000000000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d21e4fbdf700000000000000000000000000000000000000000000000000000000d7e6bcf8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f92ee8a900000000000000000000000000000000000000000000000000000000312e302e300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000c0000000000000000000000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000003ffffffe000000000000000000000000000000000000000000000000000000000ffffffe04661696c656420746f2073656e642045544820746f20747265617375727900000000000000000000000000000000000000000064000000000000000000000000020000000000000000000000000000000000006000000000000000000000000002d7e648dd130fc184d383e55bb126ac4c9c60e8f94bf05acdf557ba2d540b474d7573742073656e642045544800000000000000000000000000000000000000496e76616c696420746f6b656e20616464726573730000000000000000000000020000000000000000000000000000000000004000000000000000000000000023b872dd000000000000000000000000000000000000000000000000000000004e487b7100000000000000000000000000000000000000000000000000000000416d6f756e74206d7573742062652067726561746572207468616e2030000000546f6b656e206e6f7420616c6c6f776564000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00abb3cc962a1224781c514ba6eb586934a326777efde10b23a3338aa5e42a4b6d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.