ETH Price: $3,873.35 (-3.43%)

Contract

0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f
 
Transaction Hash
Method
Block
From
To
Transfer213861692024-12-12 11:36:475 days ago1734003407IN
OKX DEX: TokenApprove
0.00513284 ETH0.00038518.33360142
Transfer213284002024-12-04 10:00:2313 days ago1733306423IN
OKX DEX: TokenApprove
0.00005241 ETH0.0004296120.45793376
Swap Exact ETH F...213082642024-12-01 14:29:3516 days ago1733063375IN
OKX DEX: TokenApprove
1 ETH0.0005043622.04275702
Approve212429472024-11-22 11:23:1125 days ago1732274591IN
OKX DEX: TokenApprove
0 ETH0.000178938.22025619
Approve212371032024-11-21 15:48:5926 days ago1732204139IN
OKX DEX: TokenApprove
0 ETH0.0004518920.76035083
Transfer211661712024-11-11 18:16:1136 days ago1731348971IN
OKX DEX: TokenApprove
0.005 ETH0.0009784146.59123851
Approve211652192024-11-11 15:04:4736 days ago1731337487IN
OKX DEX: TokenApprove
0 ETH0.0007904235.74141131
Transfer210068512024-10-20 12:40:1158 days ago1729428011IN
OKX DEX: TokenApprove
0.00078289 ETH0.0003262615.53659056
Transfer210068472024-10-20 12:39:2358 days ago1729427963IN
OKX DEX: TokenApprove
0.00102806 ETH0.0002498711.89898386
Approve209396832024-10-11 3:25:4768 days ago1728617147IN
OKX DEX: TokenApprove
0 ETH0.0009562443.93081202
Transfer208935762024-10-04 17:12:1174 days ago1728061931IN
OKX DEX: TokenApprove
0.00448581 ETH0.0002144810.21353045
Transfer208926832024-10-04 14:13:3574 days ago1728051215IN
OKX DEX: TokenApprove
0.00050387 ETH0.000250111.9096291
Transfer208190492024-09-24 7:46:1185 days ago1727163971IN
OKX DEX: TokenApprove
0.00012689 ETH0.0007533635.87455124
Approve207769372024-09-18 10:38:5990 days ago1726655939IN
OKX DEX: TokenApprove
0 ETH0.000193698.88387077
Approve207694662024-09-17 9:34:5992 days ago1726565699IN
OKX DEX: TokenApprove
0 ETH0.000085463.92003379
Approve207694372024-09-17 9:29:1192 days ago1726565351IN
OKX DEX: TokenApprove
0 ETH0.000096884.44361182
Transfer205551232024-08-18 11:10:23121 days ago1723979423IN
OKX DEX: TokenApprove
0.0008 ETH0.000028921.37737542
Approve202601602024-07-08 6:59:23163 days ago1720421963IN
OKX DEX: TokenApprove
0 ETH0.000056652.59835276
Approve202601302024-07-08 6:53:23163 days ago1720421603IN
OKX DEX: TokenApprove
0 ETH0.000057582.64092873
Approve202601182024-07-08 6:50:59163 days ago1720421459IN
OKX DEX: TokenApprove
0 ETH0.000057492.63707998
Approve199241712024-05-22 8:16:11210 days ago1716365771IN
OKX DEX: TokenApprove
0 ETH0.000203179.329
Approve199241102024-05-22 8:03:59210 days ago1716365039IN
OKX DEX: TokenApprove
0 ETH0.0002304310.5805
Approve199240972024-05-22 8:01:23210 days ago1716364883IN
OKX DEX: TokenApprove
0 ETH0.000200539.2075
0xe2cf089e196308652024-04-11 7:23:11251 days ago1712820191IN
OKX DEX: TokenApprove
0 ETH0.000521921.65318473
0xe2cf089e196307702024-04-11 7:03:47251 days ago1712819027IN
OKX DEX: TokenApprove
0 ETH0.0004331317.98800965
View all transactions

Latest 5 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
213345902024-12-05 6:45:4713 days ago1733381147
OKX DEX: TokenApprove
0.12874758 ETH
212508692024-11-23 13:54:1124 days ago1732370051
OKX DEX: TokenApprove
0.00296089 ETH
212035622024-11-16 23:31:1131 days ago1731799871
OKX DEX: TokenApprove
0.00261268 ETH
209400982024-10-11 4:49:1168 days ago1728622151
OKX DEX: TokenApprove
0.00030659 ETH
207007672024-09-07 19:18:11101 days ago1725736691
OKX DEX: TokenApprove
0.02188514 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenApprove

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2023-06-26
*/

/**
 *Submitted for verification at BscScan.com on 2023-06-26
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

/**
 * @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 a proxied contract can't have 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.
 *
 * 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 initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

/**
 * @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 {
        __Context_init_unchained();
    }

    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;
    }
    uint256[50] private __gap;
}

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
    uint256[49] private __gap;
}

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint);

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);

    function transfer(address to, uint value) external returns (bool);

    function transferFrom(address from, address to, uint value) external returns (bool);
}

library SafeMath {
    uint256 constant WAD = 10 ** 18;
    uint256 constant RAY = 10 ** 27;

    function wad() public pure returns (uint256) {
        return WAD;
    }

    function ray() public pure returns (uint256) {
        return RAY;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }

    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a <= b ? a : b;
    }

    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    function sqrt(uint256 a) internal pure returns (uint256 b) {
        if (a > 3) {
            b = a;
            uint256 x = a / 2 + 1;
            while (x < b) {
                b = x;
                x = (a / x + x) / 2;
            }
        } else if (a != 0) {
            b = 1;
        }
    }

    function wmul(uint256 a, uint256 b) internal pure returns (uint256) {
        return mul(a, b) / WAD;
    }

    function wmulRound(uint256 a, uint256 b) internal pure returns (uint256) {
        return add(mul(a, b), WAD / 2) / WAD;
    }

    function rmul(uint256 a, uint256 b) internal pure returns (uint256) {
        return mul(a, b) / RAY;
    }

    function rmulRound(uint256 a, uint256 b) internal pure returns (uint256) {
        return add(mul(a, b), RAY / 2) / RAY;
    }

    function wdiv(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(mul(a, WAD), b);
    }

    function wdivRound(uint256 a, uint256 b) internal pure returns (uint256) {
        return add(mul(a, WAD), b / 2) / b;
    }

    function rdiv(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(mul(a, RAY), b);
    }

    function rdivRound(uint256 a, uint256 b) internal pure returns (uint256) {
        return add(mul(a, RAY), b / 2) / b;
    }

    function wpow(uint256 x, uint256 n) internal pure returns (uint256) {
        uint256 result = WAD;
        while (n > 0) {
            if (n % 2 != 0) {
                result = wmul(result, x);
            }
            x = wmul(x, x);
            n /= 2;
        }
        return result;
    }

    function rpow(uint256 x, uint256 n) internal pure returns (uint256) {
        uint256 result = RAY;
        while (n > 0) {
            if (n % 2 != 0) {
                result = rmul(result, x);
            }
            x = rmul(x, x);
            n /= 2;
        }
        return result;
    }

    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 quotient = div(a, b);
        uint256 remainder = a - quotient * b;
        if (remainder > 0) {
            return quotient + 1;
        } else {
            return quotient;
        }
    }
}

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following 
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return payable(account);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

/// @title Handle authorizations in dex platform
/// @notice Explain to an end user what this does
/// @dev Explain to a developer any extra details
contract TokenApprove is OwnableUpgradeable {
  using SafeERC20 for IERC20;

  address public tokenApproveProxy;

  function initialize(address _tokenApproveProxy) public initializer {
    __Ownable_init();
    tokenApproveProxy = _tokenApproveProxy;
  }

  //-------------------------------
  //------- Events ----------------
  //-------------------------------

  event ProxyUpdate(address indexed oldProxy, address indexed newProxy);

  //-------------------------------
  //------- Modifier --------------
  //-------------------------------

  //--------------------------------
  //------- Internal Functions -----
  //--------------------------------

  //---------------------------------
  //------- Admin functions ---------
  //---------------------------------

  function setApproveProxy(address _newTokenApproveProxy) external onlyOwner {
    tokenApproveProxy = _newTokenApproveProxy;
    emit ProxyUpdate(tokenApproveProxy, _newTokenApproveProxy);
  }

  //---------------------------------
  //-------  Users Functions --------
  //---------------------------------

  function claimTokens(
    address _token,
    address _who,
    address _dest,
    uint256 _amount
  ) external {
    require(msg.sender == tokenApproveProxy, "TokenApprove: Access restricted");
    if (_amount > 0) {
      IERC20(_token).safeTransferFrom(_who, _dest, _amount);
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldProxy","type":"address"},{"indexed":true,"internalType":"address","name":"newProxy","type":"address"}],"name":"ProxyUpdate","type":"event"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_who","type":"address"},{"internalType":"address","name":"_dest","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenApproveProxy","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newTokenApproveProxy","type":"address"}],"name":"setApproveProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenApproveProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610855806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ce578063aad0ae5b146100df578063c4d66de8146100f2578063f2fde38b1461010557600080fd5b80630a5ea4661461008257806312ec8dcc14610097578063715018a6146100c6575b600080fd5b6100956100903660046106f7565b610118565b005b6065546100aa906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b610095610198565b6033546001600160a01b03166100aa565b6100956100ed3660046106d5565b6101ce565b6100956101003660046106d5565b610244565b6100956101133660046106d5565b610321565b6065546001600160a01b031633146101775760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e417070726f76653a2041636365737320726573747269637465640060448201526064015b60405180910390fd5b8015610192576101926001600160a01b0385168484846103bc565b50505050565b6033546001600160a01b031633146101c25760405162461bcd60e51b815260040161016e9061079f565b6101cc6000610416565b565b6033546001600160a01b031633146101f85760405162461bcd60e51b815260040161016e9061079f565b606580546001600160a01b0319166001600160a01b03831690811790915560405181907ff213750e75b7d8975215501c91778a99d0e1d7e30453ea61619aba02b5e0d17d90600090a350565b600054610100900460ff1661025f5760005460ff1615610263565b303b155b6102c65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161016e565b600054610100900460ff161580156102e8576000805461ffff19166101011790555b6102f0610468565b606580546001600160a01b0319166001600160a01b038416179055801561031d576000805461ff00191690555b5050565b6033546001600160a01b0316331461034b5760405162461bcd60e51b815260040161016e9061079f565b6001600160a01b0381166103b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161016e565b6103b981610416565b50565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261019290859061049f565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661048f5760405162461bcd60e51b815260040161016e906107d4565b610497610626565b6101cc61064d565b6104b1826001600160a01b031661067d565b6104fd5760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161016e565b600080836001600160a01b0316836040516105189190610764565b6000604051808303816000865af19150503d8060008114610555576040519150601f19603f3d011682016040523d82523d6000602084013e61055a565b606091505b5091509150816105ac5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161016e565b80511561019257808060200190518101906105c79190610742565b6101925760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161016e565b600054610100900460ff166101cc5760405162461bcd60e51b815260040161016e906107d4565b600054610100900460ff166106745760405162461bcd60e51b815260040161016e906107d4565b6101cc33610416565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906106b157508115155b949350505050565b80356001600160a01b03811681146106d057600080fd5b919050565b6000602082840312156106e757600080fd5b6106f0826106b9565b9392505050565b6000806000806080858703121561070d57600080fd5b610716856106b9565b9350610724602086016106b9565b9250610732604086016106b9565b9396929550929360600135925050565b60006020828403121561075457600080fd5b815180151581146106f057600080fd5b6000825160005b81811015610785576020818601810151858301520161076b565b81811115610794576000828501525b509190910192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212204145507bfa15500c0eee86c57c125e8500315ccc134912cdaa0914a0badb3f8d64736f6c63430008060033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ce578063aad0ae5b146100df578063c4d66de8146100f2578063f2fde38b1461010557600080fd5b80630a5ea4661461008257806312ec8dcc14610097578063715018a6146100c6575b600080fd5b6100956100903660046106f7565b610118565b005b6065546100aa906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b610095610198565b6033546001600160a01b03166100aa565b6100956100ed3660046106d5565b6101ce565b6100956101003660046106d5565b610244565b6100956101133660046106d5565b610321565b6065546001600160a01b031633146101775760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e417070726f76653a2041636365737320726573747269637465640060448201526064015b60405180910390fd5b8015610192576101926001600160a01b0385168484846103bc565b50505050565b6033546001600160a01b031633146101c25760405162461bcd60e51b815260040161016e9061079f565b6101cc6000610416565b565b6033546001600160a01b031633146101f85760405162461bcd60e51b815260040161016e9061079f565b606580546001600160a01b0319166001600160a01b03831690811790915560405181907ff213750e75b7d8975215501c91778a99d0e1d7e30453ea61619aba02b5e0d17d90600090a350565b600054610100900460ff1661025f5760005460ff1615610263565b303b155b6102c65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161016e565b600054610100900460ff161580156102e8576000805461ffff19166101011790555b6102f0610468565b606580546001600160a01b0319166001600160a01b038416179055801561031d576000805461ff00191690555b5050565b6033546001600160a01b0316331461034b5760405162461bcd60e51b815260040161016e9061079f565b6001600160a01b0381166103b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161016e565b6103b981610416565b50565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261019290859061049f565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661048f5760405162461bcd60e51b815260040161016e906107d4565b610497610626565b6101cc61064d565b6104b1826001600160a01b031661067d565b6104fd5760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161016e565b600080836001600160a01b0316836040516105189190610764565b6000604051808303816000865af19150503d8060008114610555576040519150601f19603f3d011682016040523d82523d6000602084013e61055a565b606091505b5091509150816105ac5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161016e565b80511561019257808060200190518101906105c79190610742565b6101925760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161016e565b600054610100900460ff166101cc5760405162461bcd60e51b815260040161016e906107d4565b600054610100900460ff166106745760405162461bcd60e51b815260040161016e906107d4565b6101cc33610416565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906106b157508115155b949350505050565b80356001600160a01b03811681146106d057600080fd5b919050565b6000602082840312156106e757600080fd5b6106f0826106b9565b9392505050565b6000806000806080858703121561070d57600080fd5b610716856106b9565b9350610724602086016106b9565b9250610732604086016106b9565b9396929550929360600135925050565b60006020828403121561075457600080fd5b815180151581146106f057600080fd5b6000825160005b81811015610785576020818601810151858301520161076b565b81811115610794576000828501525b509190910192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212204145507bfa15500c0eee86c57c125e8500315ccc134912cdaa0914a0badb3f8d64736f6c63430008060033

Deployed Bytecode Sourcemap

26357:1425:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27481:298;;;;;;:::i;:::-;;:::i;:::-;;26439:32;;;;;-1:-1:-1;;;;;26439:32:0;;;;;;-1:-1:-1;;;;;1668:32:1;;;1650:51;;1638:2;1623:18;26439:32:0;;;;;;;13252:103;;;:::i;12601:87::-;12674:6;;-1:-1:-1;;;;;12674:6:0;12601:87;;27162:194;;;;;;:::i;:::-;;:::i;26478:141::-;;;;;;:::i;:::-;;:::i;13510:201::-;;;;;;:::i;:::-;;:::i;27481:298::-;27627:17;;-1:-1:-1;;;;;27627:17:0;27613:10;:31;27605:75;;;;-1:-1:-1;;;27605:75:0;;3062:2:1;27605:75:0;;;3044:21:1;3101:2;3081:18;;;3074:30;3140:33;3120:18;;;3113:61;3191:18;;27605:75:0;;;;;;;;;27691:11;;27687:87;;27713:53;-1:-1:-1;;;;;27713:31:0;;27745:4;27751:5;27758:7;27713:31;:53::i;:::-;27481:298;;;;:::o;13252:103::-;12674:6;;-1:-1:-1;;;;;12674:6:0;11289:10;12821:23;12813:68;;;;-1:-1:-1;;;12813:68:0;;;;;;;:::i;:::-;13317:30:::1;13344:1;13317:18;:30::i;:::-;13252:103::o:0;27162:194::-;12674:6;;-1:-1:-1;;;;;12674:6:0;11289:10;12821:23;12813:68;;;;-1:-1:-1;;;12813:68:0;;;;;;;:::i;:::-;27244:17:::1;:41:::0;;-1:-1:-1;;;;;;27244:41:0::1;-1:-1:-1::0;;;;;27244:41:0;::::1;::::0;;::::1;::::0;;;27297:53:::1;::::0;27244:41;;27297:53:::1;::::0;-1:-1:-1;;27297:53:0::1;27162:194:::0;:::o;26478:141::-;9636:13;;;;;;;:48;;9672:12;;;;9671:13;9636:48;;;10439:4;1382:20;1430:8;9652:16;9628:107;;;;-1:-1:-1;;;9628:107:0;;3422:2:1;9628:107:0;;;3404:21:1;3461:2;3441:18;;;3434:30;3500:34;3480:18;;;3473:62;-1:-1:-1;;;3551:18:1;;;3544:44;3605:19;;9628:107:0;3394:236:1;9628:107:0;9748:19;9771:13;;;;;;9770:14;9795:101;;;;9830:13;:20;;-1:-1:-1;;9865:19:0;;;;;9795:101;26552:16:::1;:14;:16::i;:::-;26575:17;:38:::0;;-1:-1:-1;;;;;;26575:38:0::1;-1:-1:-1::0;;;;;26575:38:0;::::1;;::::0;;9922:68;;;;9973:5;9957:21;;-1:-1:-1;;9957:21:0;;;9922:68;9343:654;26478:141;:::o;13510:201::-;12674:6;;-1:-1:-1;;;;;12674:6:0;11289:10;12821:23;12813:68;;;;-1:-1:-1;;;12813:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;13599:22:0;::::1;13591:73;;;::::0;-1:-1:-1;;;13591:73:0;;2294:2:1;13591:73:0::1;::::0;::::1;2276:21:1::0;2333:2;2313:18;;;2306:30;2372:34;2352:18;;;2345:62;-1:-1:-1;;;2423:18:1;;;2416:36;2469:19;;13591:73:0::1;2266:228:1::0;13591:73:0::1;13675:28;13694:8;13675:18;:28::i;:::-;13510:201:::0;:::o;23229:204::-;23356:68;;;-1:-1:-1;;;;;1970:15:1;;;23356:68:0;;;1952:34:1;2022:15;;2002:18;;;1995:43;2054:18;;;;2047:34;;;23356:68:0;;;;;;;;;;1887:18:1;;;;23356:68:0;;;;;;;;-1:-1:-1;;;;;23356:68:0;-1:-1:-1;;;23356:68:0;;;23330:95;;23349:5;;23330:18;:95::i;13871:191::-;13964:6;;;-1:-1:-1;;;;;13981:17:0;;;-1:-1:-1;;;;;;13981:17:0;;;;;;;14014:40;;13964:6;;;13981:17;13964:6;;14014:40;;13945:16;;14014:40;13934:128;13871:191;:::o;12265:134::-;10239:13;;;;;;;10231:69;;;;-1:-1:-1;;;10231:69:0;;;;;;;:::i;:::-;12328:26:::1;:24;:26::i;:::-;12365;:24;:26::i;25084:1114::-:0;25688:27;25696:5;-1:-1:-1;;;;;25688:25:0;;:27::i;:::-;25680:71;;;;-1:-1:-1;;;25680:71:0;;5021:2:1;25680:71:0;;;5003:21:1;5060:2;5040:18;;;5033:30;5099:33;5079:18;;;5072:61;5150:18;;25680:71:0;4993:181:1;25680:71:0;25825:12;25839:23;25874:5;-1:-1:-1;;;;;25866:19:0;25886:4;25866:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25824:67;;;;25910:7;25902:52;;;;-1:-1:-1;;;25902:52:0;;2701:2:1;25902:52:0;;;2683:21:1;;;2720:18;;;2713:30;2779:34;2759:18;;;2752:62;2831:18;;25902:52:0;2673:182:1;25902:52:0;25971:17;;:21;25967:224;;26113:10;26102:30;;;;;;;;;;;;:::i;:::-;26094:85;;;;-1:-1:-1;;;26094:85:0;;4610:2:1;26094:85:0;;;4592:21:1;4649:2;4629:18;;;4622:30;4688:34;4668:18;;;4661:62;-1:-1:-1;;;4739:18:1;;;4732:40;4789:19;;26094:85:0;4582:232:1;11133:70:0;10239:13;;;;;;;10231:69;;;;-1:-1:-1;;;10231:69:0;;;;;;;:::i;12407:113::-;10239:13;;;;;;;10231:69;;;;-1:-1:-1;;;10231:69:0;;;;;;;:::i;:::-;12480:32:::1;11289:10:::0;12480:18:::1;:32::i;20183:619::-:0;20243:4;20711:20;;20554:66;20751:23;;;;;;:42;;-1:-1:-1;20778:15:0;;;20751:42;20743:51;20183:619;-1:-1:-1;;;;20183:619:0:o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:2;;177:1;174;167:12;111:2;63:124;;;:::o;192:186::-;251:6;304:2;292:9;283:7;279:23;275:32;272:2;;;320:1;317;310:12;272:2;343:29;362:9;343:29;:::i;:::-;333:39;262:116;-1:-1:-1;;;262:116:1:o;383:403::-;469:6;477;485;493;546:3;534:9;525:7;521:23;517:33;514:2;;;563:1;560;553:12;514:2;586:29;605:9;586:29;:::i;:::-;576:39;;634:38;668:2;657:9;653:18;634:38;:::i;:::-;624:48;;691:38;725:2;714:9;710:18;691:38;:::i;:::-;504:282;;;;-1:-1:-1;681:48:1;;776:2;761:18;748:32;;-1:-1:-1;;504:282:1:o;791:277::-;858:6;911:2;899:9;890:7;886:23;882:32;879:2;;;927:1;924;917:12;879:2;959:9;953:16;1012:5;1005:13;998:21;991:5;988:32;978:2;;1034:1;1031;1024:12;1073:426;1202:3;1240:6;1234:13;1265:1;1275:129;1289:6;1286:1;1283:13;1275:129;;;1387:4;1371:14;;;1367:25;;1361:32;1348:11;;;1341:53;1304:12;1275:129;;;1422:6;1419:1;1416:13;1413:2;;;1457:1;1448:6;1443:3;1439:16;1432:27;1413:2;-1:-1:-1;1477:16:1;;;;;1210:289;-1:-1:-1;;1210:289:1:o;3635:356::-;3837:2;3819:21;;;3856:18;;;3849:30;3915:34;3910:2;3895:18;;3888:62;3982:2;3967:18;;3809:182::o;3996:407::-;4198:2;4180:21;;;4237:2;4217:18;;;4210:30;4276:34;4271:2;4256:18;;4249:62;-1:-1:-1;;;4342:2:1;4327:18;;4320:41;4393:3;4378:19;;4170:233::o

Swarm Source

ipfs://4145507bfa15500c0eee86c57c125e8500315ccc134912cdaa0914a0badb3f8d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.