HYPE Price: $23.52 (+4.19%)
 

Overview

HYPE Balance

HyperEVM LogoHyperEVM LogoHyperEVM Logo0 HYPE

HYPE Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

Transaction Hash
Block
From
To
Forward ERC20254258242026-01-24 13:55:454 hrs ago1769262945IN
0x337685fd...D287cC3E2
0 HYPE0.000016220.11
Swap And Forward...254229462026-01-24 13:08:345 hrs ago1769260114IN
0x337685fd...D287cC3E2
0 HYPE0.000111770.47581165
Swap And Forward...254217482026-01-24 12:48:565 hrs ago1769258936IN
0x337685fd...D287cC3E2
0 HYPE0.000107450.20000011
Swap And Forward...253768552026-01-24 0:31:3318 hrs ago1769214693IN
0x337685fd...D287cC3E2
0 HYPE0.000626191.128
Swap And Forward...253667992026-01-23 21:46:4221 hrs ago1769204802IN
0x337685fd...D287cC3E2
0 HYPE0.000762790.9232
Set Mayan Protoc...253441892026-01-23 15:36:0227 hrs ago1769182562IN
0x337685fd...D287cC3E2
0 HYPE0.000022850.49240289
Set Swap Protoco...253304692026-01-23 11:51:0730 hrs ago1769169067IN
0x337685fd...D287cC3E2
0 HYPE0.000004630.1
Swap And Forward...253149092026-01-23 7:36:0235 hrs ago1769153762IN
0x337685fd...D287cC3E2
10.5 HYPE0.000120490.1
Swap And Forward...252736072026-01-22 20:18:5846 hrs ago1769113138IN
0x337685fd...D287cC3E2
4.379 HYPE0.000070670.101075
Swap And Forward...252719002026-01-22 19:50:5946 hrs ago1769111459IN
0x337685fd...D287cC3E2
0 HYPE0.001801382.449
Swap And Forward...252604982026-01-22 16:44:032 days ago1769100243IN
0x337685fd...D287cC3E2
9 HYPE0.001004051.348
Forward ERC20252565712026-01-22 15:39:412 days ago1769096381IN
0x337685fd...D287cC3E2
0 HYPE0.000294681.363
Forward ERC20252292352026-01-22 8:11:332 days ago1769069493IN
0x337685fd...D287cC3E2
0 HYPE0.000142170.9638
Swap And Forward...252288102026-01-22 8:04:352 days ago1769069075IN
0x337685fd...D287cC3E2
1 HYPE0.000059790.13247161
Swap And Forward...251945652026-01-21 22:43:112 days ago1769035391IN
0x337685fd...D287cC3E2
8.54 HYPE0.000084790.1
Set Mayan Protoc...251765632026-01-21 17:48:023 days ago1769017682IN
0x337685fd...D287cC3E2
0 HYPE0.000017970.3872864
Forward ERC20251158012026-01-21 1:11:563 days ago1768957916IN
0x337685fd...D287cC3E2
0 HYPE0.000014270.1
Swap And Forward...251028492026-01-20 21:39:363 days ago1768945176IN
0x337685fd...D287cC3E2
0 HYPE0.000218790.206
Forward ERC20250929122026-01-20 18:56:423 days ago1768935402IN
0x337685fd...D287cC3E2
0 HYPE0.000465063.259
Swap And Forward...250688922026-01-20 12:22:564 days ago1768911776IN
0x337685fd...D287cC3E2
0 HYPE0.000234050.1439
Swap And Forward...250684052026-01-20 12:14:574 days ago1768911297IN
0x337685fd...D287cC3E2
0 HYPE0.000212960.36553401
Swap And Forward...250210312026-01-19 23:18:194 days ago1768864699IN
0x337685fd...D287cC3E2
0 HYPE0.00246212.654
Swap And Forward...249933362026-01-19 15:44:185 days ago1768837458IN
0x337685fd...D287cC3E2
0.35 HYPE0.000498461.10359762
Swap And Forward...249614102026-01-19 7:00:565 days ago1768806056IN
0x337685fd...D287cC3E2
25 HYPE0.000750071.09353263
Swap And Forward...249194112026-01-18 19:32:255 days ago1768764745IN
0x337685fd...D287cC3E2
4 HYPE0.00319752.02178877
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
254253812026-01-24 13:48:294 hrs ago1769262509
0x337685fd...D287cC3E2
0.40959 HYPE
254253812026-01-24 13:48:294 hrs ago1769262509
0x337685fd...D287cC3E2
0.40959 HYPE
254229462026-01-24 13:08:345 hrs ago1769260114
0x337685fd...D287cC3E2
0.01912451 HYPE
254229462026-01-24 13:08:345 hrs ago1769260114
0x337685fd...D287cC3E2
0.01912451 HYPE
253886892026-01-24 3:45:3315 hrs ago1769226333
0x337685fd...D287cC3E2
0.09774236 HYPE
253886892026-01-24 3:45:3315 hrs ago1769226333
0x337685fd...D287cC3E2
0.09774236 HYPE
253344372026-01-23 12:56:1029 hrs ago1769172970
0x337685fd...D287cC3E2
0.24975 HYPE
253344372026-01-23 12:56:1029 hrs ago1769172970
0x337685fd...D287cC3E2
0.24975 HYPE
253344122026-01-23 12:55:4629 hrs ago1769172946
0x337685fd...D287cC3E2
0.2997 HYPE
253344122026-01-23 12:55:4629 hrs ago1769172946
0x337685fd...D287cC3E2
0.2997 HYPE
253343952026-01-23 12:55:2929 hrs ago1769172929
0x337685fd...D287cC3E2
0.34965 HYPE
253343952026-01-23 12:55:2929 hrs ago1769172929
0x337685fd...D287cC3E2
0.34965 HYPE
253213312026-01-23 9:21:1933 hrs ago1769160079
0x337685fd...D287cC3E2
0.16983 HYPE
253213312026-01-23 9:21:1933 hrs ago1769160079
0x337685fd...D287cC3E2
0.16983 HYPE
253149092026-01-23 7:36:0235 hrs ago1769153762
0x337685fd...D287cC3E2
10.5 HYPE
252736072026-01-22 20:18:5846 hrs ago1769113138
0x337685fd...D287cC3E2
4.379 HYPE
252604992026-01-22 16:44:042 days ago1769100244
0x337685fd...D287cC3E2
0.11988 HYPE
252604992026-01-22 16:44:042 days ago1769100244
0x337685fd...D287cC3E2
0.11988 HYPE
252604982026-01-22 16:44:032 days ago1769100243
0x337685fd...D287cC3E2
9 HYPE
252604662026-01-22 16:43:322 days ago1769100212
0x337685fd...D287cC3E2
0.06172422 HYPE
252604662026-01-22 16:43:322 days ago1769100212
0x337685fd...D287cC3E2
0.06172422 HYPE
252591282026-01-22 16:21:362 days ago1769098896
0x337685fd...D287cC3E2
0.126873 HYPE
252591282026-01-22 16:21:362 days ago1769098896
0x337685fd...D287cC3E2
0.126873 HYPE
252371062026-01-22 10:20:352 days ago1769077235
0x337685fd...D287cC3E2
1.36592334 HYPE
252371062026-01-22 10:20:352 days ago1769077235
0x337685fd...D287cC3E2
1.36592334 HYPE
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xfC8368Db...685F895e6 in Sonic Mainnet
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
MayanForwarder2

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 800 runs

Other Settings:
Default EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

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

    /**
     * @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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    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'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @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.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity >=0.8.0 <0.9.0;


library BytesLib {
    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    )
        internal
        pure
        returns (bytes memory)
    {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
              add(add(end, iszero(add(length, mload(_preBytes)))), 31),
              not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    )
        internal
        pure
        returns (bytes memory)
    {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    )
        internal
        view
        returns (bool)
    {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import "./libs/BytesLib.sol";


contract MayanForwarder2 {

	using SafeERC20 for IERC20;
	using BytesLib for bytes;

	event SwapAndForwarded(uint256 amount);

	address public guardian;
	address public nextGuardian;
	mapping(address => bool) public swapProtocols;
	mapping(address => bool) public mayanProtocols;

	event ForwardedEth(address mayanProtocol, bytes protocolData);
	event ForwardedERC20(address token, uint256 amount, address mayanProtocol, bytes protocolData);
	event SwapAndForwardedEth(uint256 amountIn, address swapProtocol, address middleToken, uint256 middleAmount, address mayanProtocol, bytes mayanData);
	event SwapAndForwardedERC20(address tokenIn, uint256 amountIn, address swapProtocol, address middleToken, uint256 middleAmount, address mayanProtocol, bytes mayanData);

	error UnsupportedProtocol();

	struct PermitParams {
		uint256 value;
		uint256 deadline;
		uint8 v;
		bytes32 r;
		bytes32 s;
	}

	constructor(address _guardian, address[] memory _swapProtocols, address[] memory _mayanProtocols) {
		guardian = _guardian;
		for (uint256 i = 0; i < _swapProtocols.length; i++) {
			swapProtocols[_swapProtocols[i]] = true;
		}
		for (uint256 i = 0; i < _mayanProtocols.length; i++) {
			mayanProtocols[_mayanProtocols[i]] = true;
		}
	}

	function forwardEth(
		address mayanProtocol,
		bytes calldata protocolData
	) external payable {
		if (!mayanProtocols[mayanProtocol]) {
			revert UnsupportedProtocol();
		}
		(bool success, ) = mayanProtocol.call{value: msg.value}(protocolData);
		require(success, "mayan protocol call failed");

		emit ForwardedEth(mayanProtocol, protocolData);
	}
	
	function forwardERC20(
		address tokenIn,
		uint256 amountIn,
		PermitParams calldata permitParams,
		address mayanProtocol,
		bytes calldata protocolData
		) external payable {
		if (!mayanProtocols[mayanProtocol]) {
			revert UnsupportedProtocol();
		}

		pullTokenIn(tokenIn, amountIn, permitParams);

		maxApproveIfNeeded(tokenIn, mayanProtocol, amountIn);
		(bool success, ) = mayanProtocol.call{value: msg.value}(protocolData);
		require(success, "mayan protocol call failed");

		emit ForwardedERC20(tokenIn, amountIn, mayanProtocol, protocolData);
	}

	function swapAndForwardEth(
		uint256 amountIn,
		address swapProtocol,
		bytes calldata swapData,
		address middleToken,
		uint256 minMiddleAmount,
		address mayanProtocol,
		bytes calldata mayanData
	) external payable {
		if (!swapProtocols[swapProtocol] || !mayanProtocols[mayanProtocol]) {
			revert UnsupportedProtocol();
		}
		require(middleToken != address(0), "middleToken cannot be zero address");

		require(msg.value >= amountIn, "insufficient amountIn");
		uint256 middleAmount = IERC20(middleToken).balanceOf(address(this));

		(bool success, ) = swapProtocol.call{value: amountIn}(swapData);
		require(success, "swap call failed");

		middleAmount = IERC20(middleToken).balanceOf(address(this)) - middleAmount;
		require(middleAmount >= minMiddleAmount, "insufficient middle token");

		maxApproveIfNeeded(middleToken, mayanProtocol, middleAmount);

		bytes memory modifiedData = replaceMiddleAmount(mayanData, middleAmount);
		(success, ) = mayanProtocol.call{value: msg.value - amountIn}(modifiedData);
		require(success, "mayan protocol call failed");

		emit SwapAndForwardedEth(amountIn, swapProtocol, middleToken, middleAmount, mayanProtocol, mayanData);
	}

	function swapAndForwardERC20(
		address tokenIn,
		uint256 amountIn,
		PermitParams calldata permitParams,
		address swapProtocol,
		bytes calldata swapData,
		address middleToken,
		uint256 minMiddleAmount,
		address mayanProtocol,
		bytes calldata mayanData
	) external payable {
		if (!swapProtocols[swapProtocol] || !mayanProtocols[mayanProtocol]) {
			revert UnsupportedProtocol();
		}
		require(tokenIn != middleToken, "tokenIn and tokenOut must be different");
		uint256 amountBefore = IERC20(tokenIn).balanceOf(address(this));
		pullTokenIn(tokenIn, amountIn, permitParams);

		uint256 middleAmount;
		if (middleToken != address(0)) {
			middleAmount = IERC20(middleToken).balanceOf(address(this));
		} else {
			middleAmount = address(this).balance;
		}

		maxApproveIfNeeded(tokenIn, swapProtocol, amountIn);
		(bool success, ) = swapProtocol.call{value: 0}(swapData);
		require(success, "swap protocol call failed");

		if (middleToken != address(0)) {
			middleAmount = IERC20(middleToken).balanceOf(address(this)) - middleAmount;
		} else {
			middleAmount = address(this).balance - middleAmount;
		}
		require(middleAmount >= minMiddleAmount, "insufficient middle token");

		uint256 val = msg.value;
		if (middleToken == address(0)) {
			val += middleAmount;
		} else {
			maxApproveIfNeeded(middleToken, mayanProtocol, middleAmount);
		}

		(success, ) = mayanProtocol.call{value: val}(middleToken == address(0) ? mayanData : replaceMiddleAmount(mayanData, middleAmount));
		require(success, "mayan protocol call failed");

		transferBackRemaining(tokenIn, amountBefore);

		emit SwapAndForwardedERC20(tokenIn, amountIn, swapProtocol, middleToken, middleAmount, mayanProtocol, mayanData);
	}

	function replaceMiddleAmount(bytes calldata mayanData, uint256 middleAmount) internal pure returns(bytes memory) {
		require(mayanData.length >= 68, "Mayan data too short");
		bytes memory modifiedData = new bytes(mayanData.length);

		// Copy the function selector and token in
		for (uint i = 0; i < 36; i++) {
			modifiedData[i] = mayanData[i];
		}

		// Encode the amount and place it into the modified call data
		// Starting from byte 36 to byte 67 (32 bytes for uint256)
		bytes memory encodedAmount = abi.encode(middleAmount);
		for (uint i = 0; i < 32; i++) {
			modifiedData[i + 36] = encodedAmount[i];
		}

		// Copy the rest of the original data after the first argument
		for (uint i = 68; i < mayanData.length; i++) {
			modifiedData[i] = mayanData[i];
		}

		return modifiedData;
	}

	function maxApproveIfNeeded(address tokenAddr, address spender, uint256 amount) internal {
		IERC20 token = IERC20(tokenAddr);
		uint256 currentAllowance = token.allowance(address(this), spender);

		if (currentAllowance < amount) {
			token.safeApprove(spender, 0);
			token.safeApprove(spender, type(uint256).max);
		}
	}

	function execPermit(
		address token,
		address owner,
		PermitParams calldata permitParams
	) internal {
		IERC20Permit(token).permit(
			owner,
			address(this),
			permitParams.value,
			permitParams.deadline,
			permitParams.v,
			permitParams.r,
			permitParams.s
		);
	}

	function pullTokenIn(
		address tokenIn,
		uint256 amountIn,
		PermitParams calldata permitParams
	) internal {
		uint256 allowance = IERC20(tokenIn).allowance(msg.sender, address(this));
		if (allowance < amountIn) {
			execPermit(tokenIn, msg.sender, permitParams);
		}
		IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
	}

	function transferBackRemaining(address token, uint256 amountBefore) internal {
		uint256 remaining = IERC20(token).balanceOf(address(this));
		if (remaining > amountBefore) {
			IERC20(token).safeTransfer(msg.sender, remaining - amountBefore);
		}
	}

	function rescueToken(address token, uint256 amount, address to) public {
		require(msg.sender == guardian, 'only guardian');
		IERC20(token).safeTransfer(to, amount);
	}

	function rescueEth(uint256 amount, address payable to) public {
		require(msg.sender == guardian, 'only guardian');
		require(to != address(0), 'transfer to the zero address');
		(bool success, ) = payable(to).call{value: amount}('');
		require(success, 'payment failed');
	}

	function changeGuardian(address newGuardian) public {
		require(msg.sender == guardian, 'only guardian');
		nextGuardian = newGuardian;
	}

	function claimGuardian() public {
		require(msg.sender == nextGuardian, 'only next guardian');
		guardian = nextGuardian;
	}

	function setSwapProtocol(address swapProtocol, bool enabled) public {
		require(msg.sender == guardian, 'only guardian');
		swapProtocols[swapProtocol] = enabled;
	}

	function setMayanProtocol(address mayanProtocol, bool enabled) public {
		require(msg.sender == guardian, 'only guardian');
		mayanProtocols[mayanProtocol] = enabled;
	}

	receive() external payable {}
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_guardian","type":"address"},{"internalType":"address[]","name":"_swapProtocols","type":"address[]"},{"internalType":"address[]","name":"_mayanProtocols","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"UnsupportedProtocol","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"mayanProtocol","type":"address"},{"indexed":false,"internalType":"bytes","name":"protocolData","type":"bytes"}],"name":"ForwardedERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"mayanProtocol","type":"address"},{"indexed":false,"internalType":"bytes","name":"protocolData","type":"bytes"}],"name":"ForwardedEth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SwapAndForwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"address","name":"swapProtocol","type":"address"},{"indexed":false,"internalType":"address","name":"middleToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"middleAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"mayanProtocol","type":"address"},{"indexed":false,"internalType":"bytes","name":"mayanData","type":"bytes"}],"name":"SwapAndForwardedERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"address","name":"swapProtocol","type":"address"},{"indexed":false,"internalType":"address","name":"middleToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"middleAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"mayanProtocol","type":"address"},{"indexed":false,"internalType":"bytes","name":"mayanData","type":"bytes"}],"name":"SwapAndForwardedEth","type":"event"},{"inputs":[{"internalType":"address","name":"newGuardian","type":"address"}],"name":"changeGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct MayanForwarder2.PermitParams","name":"permitParams","type":"tuple"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"protocolData","type":"bytes"}],"name":"forwardERC20","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"protocolData","type":"bytes"}],"name":"forwardEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mayanProtocols","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"}],"name":"rescueEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setMayanProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setSwapProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct MayanForwarder2.PermitParams","name":"permitParams","type":"tuple"},{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"middleToken","type":"address"},{"internalType":"uint256","name":"minMiddleAmount","type":"uint256"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"mayanData","type":"bytes"}],"name":"swapAndForwardERC20","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"swapProtocol","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"middleToken","type":"address"},{"internalType":"uint256","name":"minMiddleAmount","type":"uint256"},{"internalType":"address","name":"mayanProtocol","type":"address"},{"internalType":"bytes","name":"mayanData","type":"bytes"}],"name":"swapAndForwardEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"swapProtocols","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

0x60806040523480156200001157600080fd5b506040516200256b3803806200256b83398101604081905262000034916200021b565b600080546001600160a01b0319166001600160a01b0385161781555b8251811015620000c8576001600260008584815181106200008157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000bf8162000295565b91505062000050565b5060005b81518110156200014457600160036000848481518110620000fd57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200013b8162000295565b915050620000cc565b50505050620002d3565b80516001600160a01b03811681146200016657600080fd5b919050565b600082601f8301126200017c578081fd5b815160206001600160401b03808311156200019b576200019b620002bd565b8260051b604051601f19603f83011681018181108482111715620001c357620001c3620002bd565b60405284815283810192508684018288018501891015620001e2578687fd5b8692505b858310156200020f57620001fa816200014e565b845292840192600192909201918401620001e6565b50979650505050505050565b60008060006060848603121562000230578283fd5b6200023b846200014e565b60208501519093506001600160401b038082111562000258578384fd5b62000266878388016200016b565b935060408601519150808211156200027c578283fd5b506200028b868287016200016b565b9150509250925092565b6000600019821415620002b657634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b61228880620002e36000396000f3fe6080604052600436106100e15760003560e01c8063af56ca031161007f578063e4269fc411610059578063e4269fc414610247578063f8a67a621461025a578063fa74fd431461027a578063ffe805411461028d57600080fd5b8063af56ca03146101d4578063b0f584ff14610214578063b25ea8fb1461022757600080fd5b8063459656ee116100bb578063459656ee1461015f5780634818e84d146101745780637fc920eb14610194578063a44382fe146101b457600080fd5b80632fcb4f04146100ed57806330dedc571461010f578063452a93201461012257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004611c80565b6102bd565b005b61010d61011d366004611df3565b61033b565b34801561012e57600080fd5b50600054610142906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016b57600080fd5b5061010d610876565b34801561018057600080fd5b50600154610142906001600160a01b031681565b3480156101a057600080fd5b5061010d6101af366004611ca3565b610901565b3480156101c057600080fd5b5061010d6101cf366004611ca3565b610976565b3480156101e057600080fd5b506102046101ef366004611c80565b60036020526000908152604090205460ff1681565b6040519015158152602001610156565b61010d610222366004611cdb565b6109eb565b34801561023357600080fd5b5061010d610242366004611f11565b610b15565b61010d610255366004611d6f565b610c5d565b34801561026657600080fd5b5061010d610275366004611d2e565b610da4565b61010d610288366004611f35565b610e02565b34801561029957600080fd5b506102046102a8366004611c80565b60026020526000908152604090205460ff1681565b6000546001600160a01b0316331461030c5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b60448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b03881660009081526002602052604090205460ff16158061037c57506001600160a01b03831660009081526003602052604090205460ff16155b1561039a5760405163743f26e160e01b815260040160405180910390fd5b846001600160a01b03168b6001600160a01b031614156104225760405162461bcd60e51b815260206004820152602660248201527f746f6b656e496e20616e6420746f6b656e4f7574206d7573742062652064696660448201527f666572656e7400000000000000000000000000000000000000000000000000006064820152608401610303565b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a082319060240160206040518083038186803b15801561046457600080fd5b505afa158015610478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049c9190611ef9565b90506104a98c8c8c611235565b60006001600160a01b03871615610538576040516370a0823160e01b81523060048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156104f957600080fd5b505afa15801561050d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105319190611ef9565b905061053b565b50475b6105468d8b8e6112e5565b60008a6001600160a01b031660008b8b60405161056492919061203d565b60006040518083038185875af1925050503d80600081146105a1576040519150601f19603f3d011682016040523d82523d6000602084013e6105a6565b606091505b50509050806105f75760405162461bcd60e51b815260206004820152601960248201527f737761702070726f746f636f6c2063616c6c206661696c6564000000000000006044820152606401610303565b6001600160a01b03881615610690576040516370a0823160e01b815230600482015282906001600160a01b038a16906370a082319060240160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f9190611ef9565b61068991906121b8565b915061069d565b61069a82476121b8565b91505b868210156106ed5760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e74206d6964646c6520746f6b656e000000000000006044820152606401610303565b346001600160a01b03891661070d5761070683826121a0565b9050610718565b6107188988856112e5565b6001600160a01b038088169082908b161561073d576107388888876113a5565b610774565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050505b604051610781919061204d565b60006040518083038185875af1925050503d80600081146107be576040519150601f19603f3d011682016040523d82523d6000602084013e6107c3565b606091505b505080925050816108165760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b6108208f85611624565b7f23278f58875126c795a4072b98b5851fe9b21cea19895b02a6224fefbb1e32988f8f8e8c878c8c8c60405161085d989796959493929190612095565b60405180910390a1505050505050505050505050505050565b6001546001600160a01b031633146108d05760405162461bcd60e51b815260206004820152601260248201527f6f6e6c79206e65787420677561726469616e00000000000000000000000000006044820152606401610303565b6001546000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6000546001600160a01b0316331461094b5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6001600160a01b03831660009081526003602052604090205460ff16610a245760405163743f26e160e01b815260040160405180910390fd5b6000836001600160a01b0316348484604051610a4192919061203d565b60006040518083038185875af1925050503d8060008114610a7e576040519150601f19603f3d011682016040523d82523d6000602084013e610a83565b606091505b5050905080610ad45760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7fb8543d214cab9591941648db8d40126a163bfd0db4a865678320b921e1398043848484604051610b0793929190612069565b60405180910390a150505050565b6000546001600160a01b03163314610b5f5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b038116610bb55760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610303565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c02576040519150601f19603f3d011682016040523d82523d6000602084013e610c07565b606091505b5050905080610c585760405162461bcd60e51b815260206004820152600e60248201527f7061796d656e74206661696c65640000000000000000000000000000000000006044820152606401610303565b505050565b6001600160a01b03831660009081526003602052604090205460ff16610c965760405163743f26e160e01b815260040160405180910390fd5b610ca1868686611235565b610cac8684876112e5565b6000836001600160a01b0316348484604051610cc992919061203d565b60006040518083038185875af1925050503d8060008114610d06576040519150601f19603f3d011682016040523d82523d6000602084013e610d0b565b606091505b5050905080610d5c5760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7fbf150db6b4a14b084f7346b4bc300f552ce867afe55be27bce2d6b37e3307cda8787868686604051610d939594939291906120ec565b60405180910390a150505050505050565b6000546001600160a01b03163314610dee5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b610c586001600160a01b03841682846116c3565b6001600160a01b03881660009081526002602052604090205460ff161580610e4357506001600160a01b03831660009081526003602052604090205460ff16155b15610e615760405163743f26e160e01b815260040160405180910390fd5b6001600160a01b038516610ec25760405162461bcd60e51b815260206004820152602260248201527f6d6964646c65546f6b656e2063616e6e6f74206265207a65726f206164647265604482015261737360f01b6064820152608401610303565b88341015610f125760405162461bcd60e51b815260206004820152601560248201527f696e73756666696369656e7420616d6f756e74496e00000000000000000000006044820152606401610303565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190611ef9565b90506000896001600160a01b03168b8a8a604051610fab92919061203d565b60006040518083038185875af1925050503d8060008114610fe8576040519150601f19603f3d011682016040523d82523d6000602084013e610fed565b606091505b505090508061103e5760405162461bcd60e51b815260206004820152601060248201527f737761702063616c6c206661696c6564000000000000000000000000000000006044820152606401610303565b6040516370a0823160e01b815230600482015282906001600160a01b038916906370a082319060240160206040518083038186803b15801561107f57600080fd5b505afa158015611093573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b79190611ef9565b6110c191906121b8565b9150858210156111135760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e74206d6964646c6520746f6b656e000000000000006044820152606401610303565b61111e8786846112e5565b600061112b8585856113a5565b90506001600160a01b0386166111418d346121b8565b8260405161114f919061204d565b60006040518083038185875af1925050503d806000811461118c576040519150601f19603f3d011682016040523d82523d6000602084013e611191565b606091505b505080925050816111e45760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7f7cbff921ae1f3ea71284120d2aabde13587df067f2bb5c831ea6e35d7a9242ac8c8c8a868a8a8a60405161121f9796959493929190612152565b60405180910390a1505050505050505050505050565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0385169063dd62ed3e9060440160206040518083038186803b15801561127d57600080fd5b505afa158015611291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b59190611ef9565b9050828110156112ca576112ca843384611753565b6112df6001600160a01b038516333086611823565b50505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152849160009183169063dd62ed3e9060440160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113699190611ef9565b90508281101561139e576113886001600160a01b03831685600061185b565b61139e6001600160a01b0383168560001961185b565b5050505050565b606060448310156113f85760405162461bcd60e51b815260206004820152601460248201527f4d6179616e206461746120746f6f2073686f72740000000000000000000000006044820152606401610303565b60008367ffffffffffffffff81111561142157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561144b576020820181803683370190505b50905060005b60248110156114cd5785858281811061147a57634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b8282815181106114a457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806114c5816121fb565b915050611451565b506000836040516020016114e391815260200190565b604051602081830303815290604052905060005b602081101561159a5781818151811061152057634e487b7160e01b600052603260045260246000fd5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016836115538360246121a0565b8151811061157157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080611592816121fb565b9150506114f7565b5060445b85811015611619578686828181106115c657634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b8382815181106115f057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080611611816121fb565b91505061159e565b509095945050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561166657600080fd5b505afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190611ef9565b905081811115610c5857610c58336116b684846121b8565b6001600160a01b03861691905b6040516001600160a01b038316602482015260448101829052610c5890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611986565b6001600160a01b03831663d505accf83308435602086013561177b6060880160408901611ff3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b0395861660048201529490931660248501526044840191909152606483015260ff166084820152606084013560a4820152608084013560c482015260e401600060405180830381600087803b15801561180657600080fd5b505af115801561181a573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526112df9085906323b872dd60e01b906084016116ef565b8015806118e45750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156118aa57600080fd5b505afa1580156118be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e29190611ef9565b155b6119565760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610303565b6040516001600160a01b038316602482015260448101829052610c5890849063095ea7b360e01b906064016116ef565b60006119db826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a6e9092919063ffffffff16565b90508051600014806119fc5750808060200190518101906119fc9190611edd565b610c585760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610303565b6060611a7d8484600085611a85565b949350505050565b606082471015611afd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610303565b600080866001600160a01b03168587604051611b19919061204d565b60006040518083038185875af1925050503d8060008114611b56576040519150601f19603f3d011682016040523d82523d6000602084013e611b5b565b606091505b5091509150611b6c87838387611b77565b979650505050505050565b60608315611be3578251611bdc576001600160a01b0385163b611bdc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610303565b5081611a7d565b611a7d8383815115611bf85781518083602001fd5b8060405162461bcd60e51b8152600401610303919061211f565b8035611c1d8161222c565b919050565b60008083601f840112611c33578182fd5b50813567ffffffffffffffff811115611c4a578182fd5b602083019150836020828501011115611c6257600080fd5b9250929050565b600060a08284031215611c7a578081fd5b50919050565b600060208284031215611c91578081fd5b8135611c9c8161222c565b9392505050565b60008060408385031215611cb5578081fd5b8235611cc08161222c565b91506020830135611cd081612244565b809150509250929050565b600080600060408486031215611cef578081fd5b8335611cfa8161222c565b9250602084013567ffffffffffffffff811115611d15578182fd5b611d2186828701611c22565b9497909650939450505050565b600080600060608486031215611d42578283fd5b8335611d4d8161222c565b9250602084013591506040840135611d648161222c565b809150509250925092565b6000806000806000806101208789031215611d88578182fd5b8635611d938161222c565b955060208701359450611da98860408901611c69565b935060e0870135611db98161222c565b925061010087013567ffffffffffffffff811115611dd5578283fd5b611de189828a01611c22565b979a9699509497509295939492505050565b60008060008060008060008060008060006101a08c8e031215611e14578485fd5b611e1e8c3561222c565b8b359a5060208c01359950611e368d60408e01611c69565b9850611e4560e08d013561222c565b60e08c0135975067ffffffffffffffff806101008e01351115611e66578586fd5b611e778e6101008f01358f01611c22565b9098509650611e896101208e01611c12565b95506101408d01359450611ea06101608e01611c12565b9350806101808e01351115611eb3578283fd5b50611ec58d6101808e01358e01611c22565b81935080925050509295989b509295989b9093969950565b600060208284031215611eee578081fd5b8151611c9c81612244565b600060208284031215611f0a578081fd5b5051919050565b60008060408385031215611f23578182fd5b823591506020830135611cd08161222c565b600080600080600080600080600060e08a8c031215611f52578485fd5b8935985060208a0135611f648161222c565b975060408a013567ffffffffffffffff80821115611f80578687fd5b611f8c8d838e01611c22565b909950975060608c01359150611fa18261222c565b90955060808b0135945060a08b013590611fba8261222c565b90935060c08b01359080821115611fcf578384fd5b50611fdc8c828d01611c22565b915080935050809150509295985092959850929598565b600060208284031215612004578081fd5b813560ff81168114611c9c578182fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6000825161205f8184602087016121cf565b9190910192915050565b6001600160a01b038416815260406020820152600061208c604083018486612014565b95945050505050565b60006001600160a01b03808b1683528960208401528089166040840152808816606084015286608084015280861660a08401525060e060c08301526120de60e083018486612014565b9a9950505050505050505050565b60006001600160a01b03808816835286602084015280861660408401525060806060830152611b6c608083018486612014565b602081526000825180602084015261213e8160408501602087016121cf565b601f01601f19169190910160400192915050565b87815260006001600160a01b038089166020840152808816604084015286606084015280861660808401525060c060a083015261219360c083018486612014565b9998505050505050505050565b600082198211156121b3576121b3612216565b500190565b6000828210156121ca576121ca612216565b500390565b60005b838110156121ea5781810151838201526020016121d2565b838111156112df5750506000910152565b600060001982141561220f5761220f612216565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461224157600080fd5b50565b801515811461224157600080fdfea26469706673582212200f6ffdf358e4879a270e9a6969d8c6d1c37b5db041f7c92677ea51f62053052b64736f6c63430008040033000000000000000000000000933e3922e04d47a466e60a20e486b372b64f1ea8000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000980b9271a33c4b31214301fae584b18dbb9731ec0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c38e4e6a15593f908255214653d3d947ca1c2338

Deployed Bytecode

0x6080604052600436106100e15760003560e01c8063af56ca031161007f578063e4269fc411610059578063e4269fc414610247578063f8a67a621461025a578063fa74fd431461027a578063ffe805411461028d57600080fd5b8063af56ca03146101d4578063b0f584ff14610214578063b25ea8fb1461022757600080fd5b8063459656ee116100bb578063459656ee1461015f5780634818e84d146101745780637fc920eb14610194578063a44382fe146101b457600080fd5b80632fcb4f04146100ed57806330dedc571461010f578063452a93201461012257600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d610108366004611c80565b6102bd565b005b61010d61011d366004611df3565b61033b565b34801561012e57600080fd5b50600054610142906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016b57600080fd5b5061010d610876565b34801561018057600080fd5b50600154610142906001600160a01b031681565b3480156101a057600080fd5b5061010d6101af366004611ca3565b610901565b3480156101c057600080fd5b5061010d6101cf366004611ca3565b610976565b3480156101e057600080fd5b506102046101ef366004611c80565b60036020526000908152604090205460ff1681565b6040519015158152602001610156565b61010d610222366004611cdb565b6109eb565b34801561023357600080fd5b5061010d610242366004611f11565b610b15565b61010d610255366004611d6f565b610c5d565b34801561026657600080fd5b5061010d610275366004611d2e565b610da4565b61010d610288366004611f35565b610e02565b34801561029957600080fd5b506102046102a8366004611c80565b60026020526000908152604090205460ff1681565b6000546001600160a01b0316331461030c5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b60448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b03881660009081526002602052604090205460ff16158061037c57506001600160a01b03831660009081526003602052604090205460ff16155b1561039a5760405163743f26e160e01b815260040160405180910390fd5b846001600160a01b03168b6001600160a01b031614156104225760405162461bcd60e51b815260206004820152602660248201527f746f6b656e496e20616e6420746f6b656e4f7574206d7573742062652064696660448201527f666572656e7400000000000000000000000000000000000000000000000000006064820152608401610303565b6040516370a0823160e01b81523060048201526000906001600160a01b038d16906370a082319060240160206040518083038186803b15801561046457600080fd5b505afa158015610478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049c9190611ef9565b90506104a98c8c8c611235565b60006001600160a01b03871615610538576040516370a0823160e01b81523060048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156104f957600080fd5b505afa15801561050d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105319190611ef9565b905061053b565b50475b6105468d8b8e6112e5565b60008a6001600160a01b031660008b8b60405161056492919061203d565b60006040518083038185875af1925050503d80600081146105a1576040519150601f19603f3d011682016040523d82523d6000602084013e6105a6565b606091505b50509050806105f75760405162461bcd60e51b815260206004820152601960248201527f737761702070726f746f636f6c2063616c6c206661696c6564000000000000006044820152606401610303565b6001600160a01b03881615610690576040516370a0823160e01b815230600482015282906001600160a01b038a16906370a082319060240160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f9190611ef9565b61068991906121b8565b915061069d565b61069a82476121b8565b91505b868210156106ed5760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e74206d6964646c6520746f6b656e000000000000006044820152606401610303565b346001600160a01b03891661070d5761070683826121a0565b9050610718565b6107188988856112e5565b6001600160a01b038088169082908b161561073d576107388888876113a5565b610774565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050505b604051610781919061204d565b60006040518083038185875af1925050503d80600081146107be576040519150601f19603f3d011682016040523d82523d6000602084013e6107c3565b606091505b505080925050816108165760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b6108208f85611624565b7f23278f58875126c795a4072b98b5851fe9b21cea19895b02a6224fefbb1e32988f8f8e8c878c8c8c60405161085d989796959493929190612095565b60405180910390a1505050505050505050505050505050565b6001546001600160a01b031633146108d05760405162461bcd60e51b815260206004820152601260248201527f6f6e6c79206e65787420677561726469616e00000000000000000000000000006044820152606401610303565b6001546000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6000546001600160a01b0316331461094b5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6001600160a01b03831660009081526003602052604090205460ff16610a245760405163743f26e160e01b815260040160405180910390fd5b6000836001600160a01b0316348484604051610a4192919061203d565b60006040518083038185875af1925050503d8060008114610a7e576040519150601f19603f3d011682016040523d82523d6000602084013e610a83565b606091505b5050905080610ad45760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7fb8543d214cab9591941648db8d40126a163bfd0db4a865678320b921e1398043848484604051610b0793929190612069565b60405180910390a150505050565b6000546001600160a01b03163314610b5f5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b6001600160a01b038116610bb55760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610303565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c02576040519150601f19603f3d011682016040523d82523d6000602084013e610c07565b606091505b5050905080610c585760405162461bcd60e51b815260206004820152600e60248201527f7061796d656e74206661696c65640000000000000000000000000000000000006044820152606401610303565b505050565b6001600160a01b03831660009081526003602052604090205460ff16610c965760405163743f26e160e01b815260040160405180910390fd5b610ca1868686611235565b610cac8684876112e5565b6000836001600160a01b0316348484604051610cc992919061203d565b60006040518083038185875af1925050503d8060008114610d06576040519150601f19603f3d011682016040523d82523d6000602084013e610d0b565b606091505b5050905080610d5c5760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7fbf150db6b4a14b084f7346b4bc300f552ce867afe55be27bce2d6b37e3307cda8787868686604051610d939594939291906120ec565b60405180910390a150505050505050565b6000546001600160a01b03163314610dee5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9033bab0b93234b0b760991b6044820152606401610303565b610c586001600160a01b03841682846116c3565b6001600160a01b03881660009081526002602052604090205460ff161580610e4357506001600160a01b03831660009081526003602052604090205460ff16155b15610e615760405163743f26e160e01b815260040160405180910390fd5b6001600160a01b038516610ec25760405162461bcd60e51b815260206004820152602260248201527f6d6964646c65546f6b656e2063616e6e6f74206265207a65726f206164647265604482015261737360f01b6064820152608401610303565b88341015610f125760405162461bcd60e51b815260206004820152601560248201527f696e73756666696369656e7420616d6f756e74496e00000000000000000000006044820152606401610303565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190611ef9565b90506000896001600160a01b03168b8a8a604051610fab92919061203d565b60006040518083038185875af1925050503d8060008114610fe8576040519150601f19603f3d011682016040523d82523d6000602084013e610fed565b606091505b505090508061103e5760405162461bcd60e51b815260206004820152601060248201527f737761702063616c6c206661696c6564000000000000000000000000000000006044820152606401610303565b6040516370a0823160e01b815230600482015282906001600160a01b038916906370a082319060240160206040518083038186803b15801561107f57600080fd5b505afa158015611093573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b79190611ef9565b6110c191906121b8565b9150858210156111135760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e74206d6964646c6520746f6b656e000000000000006044820152606401610303565b61111e8786846112e5565b600061112b8585856113a5565b90506001600160a01b0386166111418d346121b8565b8260405161114f919061204d565b60006040518083038185875af1925050503d806000811461118c576040519150601f19603f3d011682016040523d82523d6000602084013e611191565b606091505b505080925050816111e45760405162461bcd60e51b815260206004820152601a60248201527f6d6179616e2070726f746f636f6c2063616c6c206661696c65640000000000006044820152606401610303565b7f7cbff921ae1f3ea71284120d2aabde13587df067f2bb5c831ea6e35d7a9242ac8c8c8a868a8a8a60405161121f9796959493929190612152565b60405180910390a1505050505050505050505050565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0385169063dd62ed3e9060440160206040518083038186803b15801561127d57600080fd5b505afa158015611291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b59190611ef9565b9050828110156112ca576112ca843384611753565b6112df6001600160a01b038516333086611823565b50505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152849160009183169063dd62ed3e9060440160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113699190611ef9565b90508281101561139e576113886001600160a01b03831685600061185b565b61139e6001600160a01b0383168560001961185b565b5050505050565b606060448310156113f85760405162461bcd60e51b815260206004820152601460248201527f4d6179616e206461746120746f6f2073686f72740000000000000000000000006044820152606401610303565b60008367ffffffffffffffff81111561142157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561144b576020820181803683370190505b50905060005b60248110156114cd5785858281811061147a57634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b8282815181106114a457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350806114c5816121fb565b915050611451565b506000836040516020016114e391815260200190565b604051602081830303815290604052905060005b602081101561159a5781818151811061152057634e487b7160e01b600052603260045260246000fd5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016836115538360246121a0565b8151811061157157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080611592816121fb565b9150506114f7565b5060445b85811015611619578686828181106115c657634e487b7160e01b600052603260045260246000fd5b9050013560f81c60f81b8382815181106115f057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080611611816121fb565b91505061159e565b509095945050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561166657600080fd5b505afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190611ef9565b905081811115610c5857610c58336116b684846121b8565b6001600160a01b03861691905b6040516001600160a01b038316602482015260448101829052610c5890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611986565b6001600160a01b03831663d505accf83308435602086013561177b6060880160408901611ff3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b0395861660048201529490931660248501526044840191909152606483015260ff166084820152606084013560a4820152608084013560c482015260e401600060405180830381600087803b15801561180657600080fd5b505af115801561181a573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526112df9085906323b872dd60e01b906084016116ef565b8015806118e45750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156118aa57600080fd5b505afa1580156118be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e29190611ef9565b155b6119565760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610303565b6040516001600160a01b038316602482015260448101829052610c5890849063095ea7b360e01b906064016116ef565b60006119db826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a6e9092919063ffffffff16565b90508051600014806119fc5750808060200190518101906119fc9190611edd565b610c585760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610303565b6060611a7d8484600085611a85565b949350505050565b606082471015611afd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610303565b600080866001600160a01b03168587604051611b19919061204d565b60006040518083038185875af1925050503d8060008114611b56576040519150601f19603f3d011682016040523d82523d6000602084013e611b5b565b606091505b5091509150611b6c87838387611b77565b979650505050505050565b60608315611be3578251611bdc576001600160a01b0385163b611bdc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610303565b5081611a7d565b611a7d8383815115611bf85781518083602001fd5b8060405162461bcd60e51b8152600401610303919061211f565b8035611c1d8161222c565b919050565b60008083601f840112611c33578182fd5b50813567ffffffffffffffff811115611c4a578182fd5b602083019150836020828501011115611c6257600080fd5b9250929050565b600060a08284031215611c7a578081fd5b50919050565b600060208284031215611c91578081fd5b8135611c9c8161222c565b9392505050565b60008060408385031215611cb5578081fd5b8235611cc08161222c565b91506020830135611cd081612244565b809150509250929050565b600080600060408486031215611cef578081fd5b8335611cfa8161222c565b9250602084013567ffffffffffffffff811115611d15578182fd5b611d2186828701611c22565b9497909650939450505050565b600080600060608486031215611d42578283fd5b8335611d4d8161222c565b9250602084013591506040840135611d648161222c565b809150509250925092565b6000806000806000806101208789031215611d88578182fd5b8635611d938161222c565b955060208701359450611da98860408901611c69565b935060e0870135611db98161222c565b925061010087013567ffffffffffffffff811115611dd5578283fd5b611de189828a01611c22565b979a9699509497509295939492505050565b60008060008060008060008060008060006101a08c8e031215611e14578485fd5b611e1e8c3561222c565b8b359a5060208c01359950611e368d60408e01611c69565b9850611e4560e08d013561222c565b60e08c0135975067ffffffffffffffff806101008e01351115611e66578586fd5b611e778e6101008f01358f01611c22565b9098509650611e896101208e01611c12565b95506101408d01359450611ea06101608e01611c12565b9350806101808e01351115611eb3578283fd5b50611ec58d6101808e01358e01611c22565b81935080925050509295989b509295989b9093969950565b600060208284031215611eee578081fd5b8151611c9c81612244565b600060208284031215611f0a578081fd5b5051919050565b60008060408385031215611f23578182fd5b823591506020830135611cd08161222c565b600080600080600080600080600060e08a8c031215611f52578485fd5b8935985060208a0135611f648161222c565b975060408a013567ffffffffffffffff80821115611f80578687fd5b611f8c8d838e01611c22565b909950975060608c01359150611fa18261222c565b90955060808b0135945060a08b013590611fba8261222c565b90935060c08b01359080821115611fcf578384fd5b50611fdc8c828d01611c22565b915080935050809150509295985092959850929598565b600060208284031215612004578081fd5b813560ff81168114611c9c578182fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6000825161205f8184602087016121cf565b9190910192915050565b6001600160a01b038416815260406020820152600061208c604083018486612014565b95945050505050565b60006001600160a01b03808b1683528960208401528089166040840152808816606084015286608084015280861660a08401525060e060c08301526120de60e083018486612014565b9a9950505050505050505050565b60006001600160a01b03808816835286602084015280861660408401525060806060830152611b6c608083018486612014565b602081526000825180602084015261213e8160408501602087016121cf565b601f01601f19169190910160400192915050565b87815260006001600160a01b038089166020840152808816604084015286606084015280861660808401525060c060a083015261219360c083018486612014565b9998505050505050505050565b600082198211156121b3576121b3612216565b500190565b6000828210156121ca576121ca612216565b500390565b60005b838110156121ea5781810151838201526020016121d2565b838111156112df5750506000910152565b600060001982141561220f5761220f612216565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461224157600080fd5b50565b801515811461224157600080fdfea26469706673582212200f6ffdf358e4879a270e9a6969d8c6d1c37b5db041f7c92677ea51f62053052b64736f6c63430008040033

Block Transaction Gas Used Reward
view all blocks ##produced##

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x337685fdaB40D39bd02028545a4FfA7D287cC3E2
Net Worth in USD
$19.01

Net Worth in HYPE
HyperEVM LogoHyperEVM LogoHyperEVM Logo 0.807907

Token Allocations
ETH 76.61%
BNB 16.40%
POL 3.30%
Others 3.70%
Chain Token Portfolio % Price Amount Value
ETH69.10%$2,959.640.00443729$13.13
BSC16.40%$888.240.00350829$3.12
BASE3.52%$2,959.320.000226$0.668798
BASE1.24%$0.9995990.2356$0.2355
POL3.30%$0.1254175$0.627085
OP2.79%$2,959.310.00017901$0.529743
ARB2.20%$89,0380.0000047$0.4184
ARB0.42%$2,959.360.00002714$0.080312
LINEA0.78%$2,959.640.00005$0.147982
MONAD0.25%$0.0189842.5$0.047459
BERA<0.01%$0.7310090.002$0.001462
AVAX<0.01%$12.030.000000005<$0.000001
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.