Contract 0x62cd928b16b7a92101c3091f5136fd9bb017870a 10

 

Txn Hash Method
Block
From
To
Value [Txn Fee]
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x622fa65f788b272f8f2ad3f196dbcae51f35173650ff14a7d83e60955b2a5d7f388472312022-11-17 15:27:0677 days 5 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xfbfbab231aaa2c2f710fb82dc7397bc16e2e5bfa168c0e573c0c55844fd6a845388422232022-11-17 15:04:5977 days 5 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x9657acfc22bcfc781c5c5e70ef041ddfab393c85019797814f34e895e2e57a4d388319602022-11-17 14:19:0977 days 6 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xc239ef0256e47221ab9bd913bf3a706e4bc04d3515992612720cd2f02fad08ed388282302022-11-17 14:02:4377 days 6 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xd5791e5f3d499e9a7e7ed9bd260dda183ba1faf6576c267d1bd9588ea8e74f8d388262722022-11-17 13:54:0777 days 6 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xa3e4203a0d4389dcb8247541e86691c695394c4818da73b2993f6816ec89b587169445762022-07-04 3:45:56213 days 16 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xafd16ebd8b0a3792f568ccf9d3ef784ab168c68b5e360895aabc66171b481d37168214282022-07-02 13:10:47215 days 7 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xa0a761eab766f914404735b41370e9825467fc87d38607f1ea57bbba79338d27167065262022-07-01 9:58:08216 days 10 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x3abc12bda45ce9ec83194335ebefe09888b40c465cbbc7be7e8dc21942057e45167041962022-07-01 9:24:50216 days 11 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xf0ac66e1e15206428d2f08514aca871ff33822fe9a0d63eab4a19cbe54969174166969282022-07-01 7:59:11216 days 12 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x0a005bfb1b1649f9c7e63a1819969e316fc8f0f2696ede3f7ccf4505e9146dc2166176552022-06-30 13:42:29217 days 6 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xf4b2ae0a95f96f0d0a12e07eb8010887e45bd4193435a784859f4f0332b18957164980622022-06-29 20:45:34217 days 23 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xdd1b88bb350d7c94f8f249235395b223e44b3f9f22c2b2b0da09450545de0364164828422022-06-29 18:35:51218 days 1 hr ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x27ea16311c7eb286c94cfe0f9aa497ecf54c5d17effe930f06a3fc87e90c48e5164779372022-06-29 17:55:36218 days 2 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x574444196d815b9a13056e6b7163884a49dbee3c2de6a7c5991f2c8b7ccda478164725312022-06-29 17:11:12218 days 3 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x22b2f41c78c34fcd87254f807906aa2c6c80739d56e4a12b6f33acf7bc838e84164014242022-06-29 9:28:56218 days 11 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xfba82b8b40ffdedeca255bdcf81530ce62400c4f0c0b2b196444902d6ff70c81163967222022-06-29 8:59:12218 days 11 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x895322d8005fe1130a7ef9340d96830506f94a847e333a1268fa984d124c0dff163912732022-06-29 8:24:35218 days 12 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x2d1998d2419b75789e34b18c154e354d192568eb0544f24216b1829e6cf23d67161260392022-06-27 20:59:50219 days 23 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xbd18169937450a91b423b32d36b839716602026359661532b475768de323eca6155653572022-06-24 0:50:06223 days 19 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x5e219681853cb7b3316f5d43ab73f8699f8ef8734b254315364f278dec1f2f68155628032022-06-23 23:59:04223 days 20 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x6caa03ecd1ac3ba42d3e0ce4b890fe6133a63a605dd0c633a44c570c9450a114154126912022-06-22 17:02:40225 days 3 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x290cbc21b0c6876b4838319e69e2e8731dd08732519b972bca5950ddff4948b5153730412022-06-22 11:32:50225 days 9 hrs ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0xf1365204da72d554cf8cfc87de4384b3d3ce914c2f684d162e4a72793cd066e7152904412022-06-21 20:14:06226 days 20 mins ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
0x470e58edebfd5e434477ce75bc5e6748def69501e66d59e8b6fb082e9be6d2be152889032022-06-21 19:58:16226 days 36 mins ago 0x9983d8cdeaf7872501628229d311e2f7df396add 0x62cd928b16b7a92101c3091f5136fd9bb017870a0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EvoBridgeV2

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 2 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

File 3 of 6 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.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;

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

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

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

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

    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");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. 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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 6 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev 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) {
        require(isContract(target), "Address: delegate call to non-contract");

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

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

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

File 5 of 6 : EvoBridgeV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';

import './interfaces/IBridgeERC20.sol';

contract EvoBridgeV2 is ReentrancyGuard {
    using SafeERC20 for IERC20;

    struct Withdraw {
        bytes32 id;
        address token;
        uint amount;
        uint bonus;
        address payable recipient;
        uint[] feeAmounts;
        address[] feeTargets;
        bytes data;
    }

    event Deposited(address indexed sender, address indexed token, uint8 indexed to, uint amount, bool bonus, bytes recipient);
    event Withdrawn(bytes32 indexed id, address indexed token, address indexed recipient, uint amount);

    address public owner;
    mapping(bytes32 => bool) public isWithdrawn;
    mapping(address => bool) public isSigner;
    mapping(address => bool) public isSenderContract;
    mapping(address => bool) public isRecipientContract;
    mapping(address => bool) public isOwnedToken;

    constructor() {
        setOwner(address(1));
    }

    function setOwner(address newOwner) public {
        require(msg.sender == owner || owner == address(0), 'forbidden');
        require(newOwner != address(0), 'owner can not be zero');
        owner = newOwner;
    }

    function setIsOwnedToken(address token, bool _owned) external {
        require(msg.sender == owner, 'forbidden');
        isOwnedToken[token] = _owned;
    }

    function setSigner(address account, bool state) external {
        require(msg.sender == owner, 'forbidden');
        isSigner[account] = state;
    }

    function setSenderContract(address account, bool state) external {
        require(msg.sender == owner, 'forbidden');
        isSenderContract[account] = state;
    }

    function setRecipientContract(address account, bool state) external {
        require(msg.sender == owner, 'forbidden');
        isRecipientContract[account] = state;
    }

    function deposit(address token, uint amount, uint8 to, bool bonus, bytes calldata recipient) external payable nonReentrant() {
        require(tx.origin == msg.sender || isSenderContract[msg.sender], 'call from unauthorized contract');
        require(address(token) != address(0) && amount > 0 && recipient.length > 0, 'invalid input');

        if (address(token) == address(1)) {
            require(amount == msg.value, 'value must equal amount');
        } else {
            takeTokens(token, msg.sender, amount);
        }

        emit Deposited(msg.sender, address(token), to, amount, bonus, recipient);
    }

    function withdraw(Withdraw[] calldata ws) external nonReentrant() {
        require(isSigner[msg.sender], 'forbidden');

        for (uint i = 0; i < ws.length; i++) {
            Withdraw memory w = ws[i];

            require(!isWithdrawn[w.id], 'already withdrawn');
            isWithdrawn[w.id] = true;

            if (address(w.token) == address(1)) {
                require(address(this).balance >= w.amount, 'too low token balance');
                Address.sendValue(w.recipient, w.amount);
            } else {
                giveTokens(w.token, w.recipient, w.amount);
            }

            if (w.bonus > 0) {
                require(address(this).balance >= w.bonus, 'too low token balance for bonus');
                (bool success, ) = w.recipient.call{value: w.bonus}('');
                require(success || Address.isContract(w.recipient)); // allow fail on contracts
            }

            if (address(w.token) != address(1) && w.feeAmounts.length > 0) {
                for (uint j = 0; j < w.feeAmounts.length; j++) {
                    giveTokens(w.token, w.feeTargets[j], w.feeAmounts[j]);
                }
            }

            if (w.data.length > 0) {
                require(isRecipientContract[w.recipient], 'call to unauthorized contract');
                Address.functionCall(w.recipient, w.data, 'call to recipient contract failed');
            }

            emit Withdrawn(w.id, address(w.token), w.recipient, w.amount);
        }
    }

    receive() external payable {}

    function takeTokens(address token, address from, uint256 amount) internal {
        require(IERC20(token).balanceOf(from) >= amount, 'too low token balance');
        if (isOwnedToken[token]) {
            IBridgeERC20(token).burnFrom(from, amount);
        } else {
            IERC20(token).safeTransferFrom(from, address(this), amount);
        }
    }

    function giveTokens(address token, address to, uint256 amount) internal {
        if (isOwnedToken[token]) {
            IBridgeERC20(token).mint(to, amount);
        } else {
            require(IERC20(token).balanceOf(address(this)) >= amount, 'too low token balance');
            IERC20(token).safeTransfer(to, amount);
        }
    }
}

File 6 of 6 : IBridgeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IBridgeERC20 is IERC20 {
  function mint(address to, uint amount) external;
  function burnFrom(address account, uint256 amount) external;
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint8","name":"to","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"bonus","type":"bool"},{"indexed":false,"internalType":"bytes","name":"recipient","type":"bytes"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"to","type":"uint8"},{"internalType":"bool","name":"bonus","type":"bool"},{"internalType":"bytes","name":"recipient","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isOwnedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isRecipientContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSenderContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"isWithdrawn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"_owned","type":"bool"}],"name":"setIsOwnedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setRecipientContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setSenderContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"bonus","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"feeAmounts","type":"uint256[]"},{"internalType":"address[]","name":"feeTargets","type":"address[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct EvoBridgeV2.Withdraw[]","name":"ws","type":"tuple[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b506001600081905561002190610026565b6100fd565b6001546001600160a01b031633148061004857506001546001600160a01b0316155b6100855760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b60448201526064015b60405180910390fd5b6001600160a01b0381166100db5760405162461bcd60e51b815260206004820152601560248201527f6f776e65722063616e206e6f74206265207a65726f0000000000000000000000604482015260640161007c565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61197e8061010c6000396000f3fe6080604052600436106100d65760003560e01c80637df73e271161007f57806390cfe7781161005957806390cfe778146102715780639f839c8014610284578063e08631aa146102a4578063fc1fae68146102d457600080fd5b80637df73e27146101e95780638c3cd29b146102195780638da5cb5b1461023957600080fd5b806339676dd7116100b057806339676dd7146101695780636770974d146101995780637597bf46146101c957600080fd5b80630e3a918c146100e257806313af40351461012757806331cb61051461014957600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b506101126100fd36600461136a565b60026020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561013357600080fd5b506101476101423660046113ab565b6102f4565b005b34801561015557600080fd5b506101476101643660046113d6565b6103e3565b34801561017557600080fd5b506101126101843660046113ab565b60066020526000908152604090205460ff1681565b3480156101a557600080fd5b506101126101b43660046113ab565b60046020526000908152604090205460ff1681565b3480156101d557600080fd5b506101476101e43660046113d6565b610454565b3480156101f557600080fd5b506101126102043660046113ab565b60036020526000908152604090205460ff1681565b34801561022557600080fd5b5061014761023436600461140f565b6104c5565b34801561024557600080fd5b50600154610259906001600160a01b031681565b6040516001600160a01b03909116815260200161011e565b61014761027f366004611484565b610945565b34801561029057600080fd5b5061014761029f3660046113d6565b610b47565b3480156102b057600080fd5b506101126102bf3660046113ab565b60056020526000908152604090205460ff1681565b3480156102e057600080fd5b506101476102ef3660046113d6565b610bb8565b6001546001600160a01b031633148061031657506001546001600160a01b0316155b6103535760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b60448201526064015b60405180910390fd5b6001600160a01b0381166103a95760405162461bcd60e51b815260206004820152601560248201527f6f776e65722063616e206e6f74206265207a65726f0000000000000000000000604482015260640161034a565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001546001600160a01b031633146104295760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015260640161034a565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6001546001600160a01b0316331461049a5760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015260640161034a565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6002600054036105175760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161034a565b600260009081553381526003602052604090205460ff166105665760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015260640161034a565b60005b8181101561093b5760008383838181106105855761058561153d565b90506020028101906105979190611553565b6105a090611747565b805160009081526002602052604090205490915060ff16156106045760405162461bcd60e51b815260206004820152601160248201527f616c72656164792077697468647261776e000000000000000000000000000000604482015260640161034a565b805160009081526002602090815260409091208054600160ff199091161790558101516001600160a01b0316600019016106a357806040015147101561068c5760405162461bcd60e51b815260206004820152601560248201527f746f6f206c6f7720746f6b656e2062616c616e63650000000000000000000000604482015260640161034a565b61069e81608001518260400151610c29565b6106ba565b6106ba816020015182608001518360400151610d47565b6060810151156107915780606001514710156107185760405162461bcd60e51b815260206004820152601f60248201527f746f6f206c6f7720746f6b656e2062616c616e636520666f7220626f6e757300604482015260640161034a565b600081608001516001600160a01b0316826060015160405160006040518083038185875af1925050503d806000811461076d576040519150601f19603f3d011682016040523d82523d6000602084013e610772565b606091505b505090508080610786575060808201513b15155b61078f57600080fd5b505b60208101516001600160a01b03166001148015906107b4575060008160a0015151115b156108265760005b8160a00151518110156108245761081282602001518360c0015183815181106107e7576107e761153d565b60200260200101518460a0015184815181106108055761080561153d565b6020026020010151610d47565b8061081c8161181a565b9150506107bc565b505b60e081015151156108ca5760808101516001600160a01b031660009081526005602052604090205460ff1661089d5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c20746f20756e617574686f72697a656420636f6e7472616374000000604482015260640161034a565b6108c881608001518260e0015160405180606001604052806021815260200161192860219139610eb5565b505b80608001516001600160a01b031681602001516001600160a01b031682600001517fa6786aab7dbbc48b4b0387488b407bd81448030ab207b50bea7dbb5fbc1cd9eb846040015160405161092091815260200190565b60405180910390a450806109338161181a565b915050610569565b5050600160005550565b6002600054036109975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161034a565b6002600055323314806109b957503360009081526004602052604090205460ff165b610a055760405162461bcd60e51b815260206004820152601f60248201527f63616c6c2066726f6d20756e617574686f72697a656420636f6e747261637400604482015260640161034a565b6001600160a01b03861615801590610a1d5750600085115b8015610a2857508015155b610a745760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e70757400000000000000000000000000000000000000604482015260640161034a565b6000196001600160a01b03871601610ada57348514610ad55760405162461bcd60e51b815260206004820152601760248201527f76616c7565206d75737420657175616c20616d6f756e74000000000000000000604482015260640161034a565b610ae5565b610ae5863387610ece565b8360ff16866001600160a01b0316336001600160a01b03167ffeb2da6e3bb63ff64c908271c247558271e7ef50ee44055f410c2bd554552b4e88878787604051610b329493929190611841565b60405180910390a45050600160005550505050565b6001546001600160a01b03163314610b8d5760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015260640161034a565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6001546001600160a01b03163314610bfe5760405162461bcd60e51b81526020600482015260096024820152683337b93134b23232b760b91b604482015260640161034a565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b80471015610c795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161034a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610cc6576040519150601f19603f3d011682016040523d82523d6000602084013e610ccb565b606091505b5050905080610d425760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161034a565b505050565b6001600160a01b03831660009081526006602052604090205460ff1615610de9576040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018390528416906340c10f19906044015b600060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b50505050505050565b6040516370a0823160e01b815230600482015281906001600160a01b038516906370a0823190602401602060405180830381865afa158015610e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e539190611880565b1015610ea15760405162461bcd60e51b815260206004820152601560248201527f746f6f206c6f7720746f6b656e2062616c616e63650000000000000000000000604482015260640161034a565b610d426001600160a01b038416838361100d565b6060610ec484846000856110b6565b90505b9392505050565b6040516370a0823160e01b81526001600160a01b0383811660048301528291908516906370a0823190602401602060405180830381865afa158015610f17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3b9190611880565b1015610f895760405162461bcd60e51b815260206004820152601560248201527f746f6f206c6f7720746f6b656e2062616c616e63650000000000000000000000604482015260640161034a565b6001600160a01b03831660009081526006602052604090205460ff1615610ff8576040517f79cc67900000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018390528416906379cc679090604401610db2565b610d426001600160a01b0384168330846111f5565b6040516001600160a01b038316602482015260448101829052610d429084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261124c565b60608247101561112e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161034a565b843b61117c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161034a565b600080866001600160a01b0316858760405161119891906118c5565b60006040518083038185875af1925050503d80600081146111d5576040519150601f19603f3d011682016040523d82523d6000602084013e6111da565b606091505b50915091506111ea828286611331565b979650505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526112469085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611052565b50505050565b60006112a1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eb59092919063ffffffff16565b805190915015610d4257808060200190518101906112bf91906118d7565b610d425760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161034a565b60608315611340575081610ec7565b8251156113505782518084602001fd5b8160405162461bcd60e51b815260040161034a91906118f4565b60006020828403121561137c57600080fd5b5035919050565b6001600160a01b038116811461139857600080fd5b50565b80356113a681611383565b919050565b6000602082840312156113bd57600080fd5b8135610ec781611383565b801515811461139857600080fd5b600080604083850312156113e957600080fd5b82356113f481611383565b91506020830135611404816113c8565b809150509250929050565b6000806020838503121561142257600080fd5b823567ffffffffffffffff8082111561143a57600080fd5b818501915085601f83011261144e57600080fd5b81358181111561145d57600080fd5b8660208260051b850101111561147257600080fd5b60209290920196919550909350505050565b60008060008060008060a0878903121561149d57600080fd5b86356114a881611383565b955060208701359450604087013560ff811681146114c557600080fd5b935060608701356114d5816113c8565b9250608087013567ffffffffffffffff808211156114f257600080fd5b818901915089601f83011261150657600080fd5b81358181111561151557600080fd5b8a602082850101111561152757600080fd5b6020830194508093505050509295509295509295565b634e487b7160e01b600052603260045260246000fd5b6000823560fe1983360301811261156957600080fd5b9190910192915050565b634e487b7160e01b600052604160045260246000fd5b604051610100810167ffffffffffffffff811182821017156115ad576115ad611573565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156115dc576115dc611573565b604052919050565b600067ffffffffffffffff8211156115fe576115fe611573565b5060051b60200190565b600082601f83011261161957600080fd5b8135602061162e611629836115e4565b6115b3565b82815260059290921b8401810191818101908684111561164d57600080fd5b8286015b848110156116685780358352918301918301611651565b509695505050505050565b600082601f83011261168457600080fd5b81356020611694611629836115e4565b82815260059290921b840181019181810190868411156116b357600080fd5b8286015b848110156116685780356116ca81611383565b83529183019183016116b7565b600082601f8301126116e857600080fd5b813567ffffffffffffffff81111561170257611702611573565b611715601f8201601f19166020016115b3565b81815284602083860101111561172a57600080fd5b816020850160208301376000918101602001919091529392505050565b6000610100823603121561175a57600080fd5b611762611589565b823581526117726020840161139b565b602082015260408301356040820152606083013560608201526117976080840161139b565b608082015260a083013567ffffffffffffffff808211156117b757600080fd5b6117c336838701611608565b60a084015260c08501359150808211156117dc57600080fd5b6117e836838701611673565b60c084015260e085013591508082111561180157600080fd5b5061180e368286016116d7565b60e08301525092915050565b60006001820161183a57634e487b7160e01b600052601160045260246000fd5b5060010190565b848152831515602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b60006020828403121561189257600080fd5b5051919050565b60005b838110156118b457818101518382015260200161189c565b838111156112465750506000910152565b60008251611569818460208701611899565b6000602082840312156118e957600080fd5b8151610ec7816113c8565b6020815260008251806020840152611913816040850160208701611899565b601f01601f1916919091016040019291505056fe63616c6c20746f20726563697069656e7420636f6e7472616374206661696c6564a2646970667358221220f1af2e622a3f48b04196769520eaa9a0896e329295d41b9ff191b869cc1c95b764736f6c634300080d0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.