Gate Layer is live! View your transactions on  Gate Layer Explorer .
gate
GT Price:$10.85-1.54%
Med Gas Fee:12.07 NANOGT
Account Details
Contract0xd73c11a23e7aea18f283d0c3e68c4b7c55f5ce04

Overview

GT Balance

0.002 GT($0.02)

Token Holdings

0 Tokens

More Info

Contract Creator

Contract Source Code Verified (Exact Match)
Contract Name
BridgersSwap
Optimization

Yes, with

200

runs

Compiler
solidity
Compiler Version
v0.8.20+commit.a1b79de6.js
Other Settings

istanbul

evmVersion

None

License

</> Contract source code
File 1 of 7: BridgersSwap.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./SafeMath.sol";
import "./TransferHelper.sol";


contract BridgersSwap is ReentrancyGuard, Ownable {
    using SafeMath for uint256;

    string public name;

    string public symbol;

    event Swap(
        address fromToken,
        string toToken,
        address sender,
        string destination,
        uint256 fromAmount,
        uint256 minReturnAmount
    );

    
    event SwapEth(
        string toToken,
        address sender,
        string destination,
        uint256 fromAmount,
        uint256 minReturnAmount
    );

    event WithdrawETH(uint256 amount);

    event Withdtraw(address token, uint256 amount);

    constructor() {
        name = "Bridgers Swap1.1";
        symbol = "BridgersSwap";
    }

    
    function swap(
        address fromToken,
        string memory toToken,
        string memory destination,
        uint256 fromAmount,
        uint256 minReturnAmount
    ) external nonReentrant {
        require(fromToken != address(0), "FROMTOKEN_CANT_T_BE_0"); 
        require(fromAmount > 0, "FROM_TOKEN_AMOUNT_MUST_BE_MORE_THAN_0");
        uint256 _inputAmount;
        uint256 _fromTokenBalanceOrigin = IERC20(fromToken).balanceOf(address(this));
        TransferHelper.safeTransferFrom(fromToken, msg.sender, address(this), fromAmount);
        uint256 _fromTokenBalanceNew = IERC20(fromToken).balanceOf(address(this));
        _inputAmount = _fromTokenBalanceNew.sub(_fromTokenBalanceOrigin);
        require(_inputAmount > 0, "NO_FROM_TOKEN_TRANSFER_TO_THIS_CONTRACT");
        emit Swap(fromToken, toToken, msg.sender, destination, fromAmount, minReturnAmount);
    }

    
    function swapEth(string memory toToken, string memory destination, uint256 minReturnAmount
    ) external payable nonReentrant {
        uint256 _ethAmount = msg.value; 
        require(_ethAmount > 0, "ETH_AMOUNT_MUST_BE_MORE_THAN_0");
        emit SwapEth(toToken, msg.sender, destination, _ethAmount, minReturnAmount);
    }

    function withdrawETH(address destination, uint256 amount) external onlyOwner {
        require(destination != address(0), "DESTINATION_CANNT_BE_0_ADDRESS");
        uint256 balance = address(this).balance;
        require(balance >= amount, "AMOUNT_CANNT_MORE_THAN_BALANCE");
        TransferHelper.safeTransferETH(destination, amount);
        emit WithdrawETH(amount);
    }

    function withdraw(address token, address destination, uint256 amount) external onlyOwner {
        require(destination != address(0), "DESTINATION_CANNT_BE_0_ADDRESS");
        require(token != address(0), "TOKEN_MUST_NOT_BE_0");
        uint256 balance = IERC20(token).balanceOf(address(this));
        require(balance >= amount, "AMOUNT_CANNT_MORE_THAN_BALANCE");
        TransferHelper.safeTransfer(token, destination, amount);
        emit Withdtraw(token, amount);
    }

    receive() external payable {}
}
File 2 of 7: Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
File 3 of 7: IERC20.sol
// SPDX-License-Identifier: MIT

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 4 of 7: Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
File 5 of 7: ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

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 make 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 6 of 7: SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
File 7 of 7: TransferHelper.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

library TransferHelper {
    function safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }

    function safeTransfer(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function safeTransferETH(address to, uint value) internal {
        (bool success,) = to.call{value:value}(new bytes(0));
        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
    }
}
</> Contract Creation Bytecode
0x60806040523480156200001157600080fd5b506001600055620000223362000092565b60408051808201909152601081526f42726964676572732053776170312e3160801b602082015260029062000058908262000189565b5060408051808201909152600c81526b04272696467657273537761760a41b60208201526003906200008b908262000189565b5062000255565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200010f57607f821691505b6020821081036200013057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200018457600081815260208120601f850160051c810160208610156200015f5750805b601f850160051c820191505b8181101562000180578281556001016200016b565b5050505b505050565b81516001600160401b03811115620001a557620001a5620000e4565b620001bd81620001b68454620000fa565b8462000136565b602080601f831160018114620001f55760008415620001dc5750858301515b600019600386901b1c1916600185901b17855562000180565b600085815260208120601f198616915b82811015620002265788860151825594840194600190910190840162000205565b5085821015620002455787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61117480620002656000396000f3fe60806040526004361061008a5760003560e01c80638da5cb5b116100595780638da5cb5b1461010b57806395d89b41146101335780639ddf93bb14610148578063d9caed1214610168578063f2fde38b1461018857600080fd5b806306fdde031461009657806316b3b4c2146100c15780634782f779146100d6578063715018a6146100f657600080fd5b3661009157005b600080fd5b3480156100a257600080fd5b506100ab6101a8565b6040516100b89190610d6e565b60405180910390f35b6100d46100cf366004610e24565b610236565b005b3480156100e257600080fd5b506100d46100f1366004610ead565b61032a565b34801561010257600080fd5b506100d461043d565b34801561011757600080fd5b506001546040516001600160a01b0390911681526020016100b8565b34801561013f57600080fd5b506100ab610473565b34801561015457600080fd5b506100d4610163366004610ed7565b610480565b34801561017457600080fd5b506100d4610183366004610f5d565b610727565b34801561019457600080fd5b506100d46101a3366004610f99565b610903565b600280546101b590610fb4565b80601f01602080910402602001604051908101604052809291908181526020018280546101e190610fb4565b801561022e5780601f106102035761010080835404028352916020019161022e565b820191906000526020600020905b81548152906001019060200180831161021157829003601f168201915b505050505081565b60026000540361028d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005534806102e05760405162461bcd60e51b815260206004820152601e60248201527f4554485f414d4f554e545f4d5553545f42455f4d4f52455f5448414e5f3000006044820152606401610284565b7f4e96fb90a89341a56db7ad2bbf04c715bbf20be6a9a9e764671f718c4697649a8433858486604051610317959493929190610fee565b60405180910390a1505060016000555050565b6001546001600160a01b031633146103545760405162461bcd60e51b815260040161028490611037565b6001600160a01b0382166103aa5760405162461bcd60e51b815260206004820152601e60248201527f44455354494e4154494f4e5f43414e4e545f42455f305f4144445245535300006044820152606401610284565b47818110156103fb5760405162461bcd60e51b815260206004820152601e60248201527f414d4f554e545f43414e4e545f4d4f52455f5448414e5f42414c414e434500006044820152606401610284565b610405838361099e565b6040518281527f94effa14ea3a1ef396fa2fd829336d1597f1d76b548c26bfa2332869706638af9060200160405180910390a1505050565b6001546001600160a01b031633146104675760405162461bcd60e51b815260040161028490611037565b6104716000610a6c565b565b600380546101b590610fb4565b6002600054036104d25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610284565b60026000556001600160a01b0385166105255760405162461bcd60e51b8152602060048201526015602482015274046524f4d544f4b454e5f43414e545f545f42455f3605c1b6044820152606401610284565b600082116105835760405162461bcd60e51b815260206004820152602560248201527f46524f4d5f544f4b454e5f414d4f554e545f4d5553545f42455f4d4f52455f54604482015264048414e5f360dc1b6064820152608401610284565b6040516370a0823160e01b815230600482015260009081906001600160a01b038816906370a0823190602401602060405180830381865afa1580156105cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f0919061106c565b90506105fe87333087610abe565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015610645573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610669919061106c565b90506106758183610bee565b9250600083116106d75760405162461bcd60e51b815260206004820152602760248201527f4e4f5f46524f4d5f544f4b454e5f5452414e534645525f544f5f544849535f4360448201526613d395149050d560ca1b6064820152608401610284565b7f45f377f845e1cc76ae2c08f990e15d58bcb732db46f92a4852b956580c3a162f88883389898960405161071096959493929190611085565b60405180910390a150506001600055505050505050565b6001546001600160a01b031633146107515760405162461bcd60e51b815260040161028490611037565b6001600160a01b0382166107a75760405162461bcd60e51b815260206004820152601e60248201527f44455354494e4154494f4e5f43414e4e545f42455f305f4144445245535300006044820152606401610284565b6001600160a01b0383166107f35760405162461bcd60e51b81526020600482015260136024820152720544f4b454e5f4d5553545f4e4f545f42455f3606c1b6044820152606401610284565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e919061106c565b9050818110156108b05760405162461bcd60e51b815260206004820152601e60248201527f414d4f554e545f43414e4e545f4d4f52455f5448414e5f42414c414e434500006044820152606401610284565b6108bb848484610c03565b604080516001600160a01b0386168152602081018490527f7bf0873174a9cc6b28e039b52e74903dd59d650205f32748e3c3dd6b9918ea87910160405180910390a150505050565b6001546001600160a01b0316331461092d5760405162461bcd60e51b815260040161028490611037565b6001600160a01b0381166109925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610284565b61099b81610a6c565b50565b604080516000808252602082019092526001600160a01b0384169083906040516109c891906110d8565b60006040518083038185875af1925050503d8060008114610a05576040519150601f19603f3d011682016040523d82523d6000602084013e610a0a565b606091505b5050905080610a675760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b6064820152608401610284565b505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691610b2291906110d8565b6000604051808303816000865af19150503d8060008114610b5f576040519150601f19603f3d011682016040523d82523d6000602084013e610b64565b606091505b5091509150818015610b8e575080511580610b8e575080806020019051810190610b8e91906110f4565b610be65760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610284565b505050505050565b6000610bfa828461111d565b90505b92915050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691610c5f91906110d8565b6000604051808303816000865af19150503d8060008114610c9c576040519150601f19603f3d011682016040523d82523d6000602084013e610ca1565b606091505b5091509150818015610ccb575080511580610ccb575080806020019051810190610ccb91906110f4565b610d175760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610284565b5050505050565b60005b83811015610d39578181015183820152602001610d21565b50506000910152565b60008151808452610d5a816020860160208601610d1e565b601f01601f19169290920160200192915050565b602081526000610bfa6020830184610d42565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610da857600080fd5b813567ffffffffffffffff80821115610dc357610dc3610d81565b604051601f8301601f19908116603f01168101908282118183101715610deb57610deb610d81565b81604052838152866020858801011115610e0457600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e3957600080fd5b833567ffffffffffffffff80821115610e5157600080fd5b610e5d87838801610d97565b94506020860135915080821115610e7357600080fd5b50610e8086828701610d97565b925050604084013590509250925092565b80356001600160a01b0381168114610ea857600080fd5b919050565b60008060408385031215610ec057600080fd5b610ec983610e91565b946020939093013593505050565b600080600080600060a08688031215610eef57600080fd5b610ef886610e91565b9450602086013567ffffffffffffffff80821115610f1557600080fd5b610f2189838a01610d97565b95506040880135915080821115610f3757600080fd5b50610f4488828901610d97565b9598949750949560608101359550608001359392505050565b600080600060608486031215610f7257600080fd5b610f7b84610e91565b9250610f8960208501610e91565b9150604084013590509250925092565b600060208284031215610fab57600080fd5b610bfa82610e91565b600181811c90821680610fc857607f821691505b602082108103610fe857634e487b7160e01b600052602260045260246000fd5b50919050565b60a08152600061100160a0830188610d42565b6001600160a01b038716602084015282810360408401526110228187610d42565b60608401959095525050608001529392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561107e57600080fd5b5051919050565b600060018060a01b03808916835260c060208401526110a760c0840189610d42565b818816604085015283810360608501526110c18188610d42565b608085019690965250505060a00152949350505050565b600082516110ea818460208701610d1e565b9190910192915050565b60006020828403121561110657600080fd5b8151801515811461111657600080fd5b9392505050565b81810381811115610bfd57634e487b7160e01b600052601160045260246000fdfea2646970667358221220e4f6bcb337c4c8aa0af62fbba76f85e0de5351f3d41f54c7b9d3c94a0ca4a2ec64736f6c63430008140033
</> Contract ABI
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"string","name":"toToken","type":"string"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"string","name":"destination","type":"string"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minReturnAmount","type":"uint256"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"toToken","type":"string"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"string","name":"destination","type":"string"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minReturnAmount","type":"uint256"}],"name":"SwapEth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdtraw","type":"event"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"string","name":"toToken","type":"string"},{"internalType":"string","name":"destination","type":"string"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"toToken","type":"string"},{"internalType":"string","name":"destination","type":"string"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"}],"name":"swapEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
</> Contract Deployment Bytecode
0x60806040526004361061008a5760003560e01c80638da5cb5b116100595780638da5cb5b1461010b57806395d89b41146101335780639ddf93bb14610148578063d9caed1214610168578063f2fde38b1461018857600080fd5b806306fdde031461009657806316b3b4c2146100c15780634782f779146100d6578063715018a6146100f657600080fd5b3661009157005b600080fd5b3480156100a257600080fd5b506100ab6101a8565b6040516100b89190610d6e565b60405180910390f35b6100d46100cf366004610e24565b610236565b005b3480156100e257600080fd5b506100d46100f1366004610ead565b61032a565b34801561010257600080fd5b506100d461043d565b34801561011757600080fd5b506001546040516001600160a01b0390911681526020016100b8565b34801561013f57600080fd5b506100ab610473565b34801561015457600080fd5b506100d4610163366004610ed7565b610480565b34801561017457600080fd5b506100d4610183366004610f5d565b610727565b34801561019457600080fd5b506100d46101a3366004610f99565b610903565b600280546101b590610fb4565b80601f01602080910402602001604051908101604052809291908181526020018280546101e190610fb4565b801561022e5780601f106102035761010080835404028352916020019161022e565b820191906000526020600020905b81548152906001019060200180831161021157829003601f168201915b505050505081565b60026000540361028d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005534806102e05760405162461bcd60e51b815260206004820152601e60248201527f4554485f414d4f554e545f4d5553545f42455f4d4f52455f5448414e5f3000006044820152606401610284565b7f4e96fb90a89341a56db7ad2bbf04c715bbf20be6a9a9e764671f718c4697649a8433858486604051610317959493929190610fee565b60405180910390a1505060016000555050565b6001546001600160a01b031633146103545760405162461bcd60e51b815260040161028490611037565b6001600160a01b0382166103aa5760405162461bcd60e51b815260206004820152601e60248201527f44455354494e4154494f4e5f43414e4e545f42455f305f4144445245535300006044820152606401610284565b47818110156103fb5760405162461bcd60e51b815260206004820152601e60248201527f414d4f554e545f43414e4e545f4d4f52455f5448414e5f42414c414e434500006044820152606401610284565b610405838361099e565b6040518281527f94effa14ea3a1ef396fa2fd829336d1597f1d76b548c26bfa2332869706638af9060200160405180910390a1505050565b6001546001600160a01b031633146104675760405162461bcd60e51b815260040161028490611037565b6104716000610a6c565b565b600380546101b590610fb4565b6002600054036104d25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610284565b60026000556001600160a01b0385166105255760405162461bcd60e51b8152602060048201526015602482015274046524f4d544f4b454e5f43414e545f545f42455f3605c1b6044820152606401610284565b600082116105835760405162461bcd60e51b815260206004820152602560248201527f46524f4d5f544f4b454e5f414d4f554e545f4d5553545f42455f4d4f52455f54604482015264048414e5f360dc1b6064820152608401610284565b6040516370a0823160e01b815230600482015260009081906001600160a01b038816906370a0823190602401602060405180830381865afa1580156105cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f0919061106c565b90506105fe87333087610abe565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015610645573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610669919061106c565b90506106758183610bee565b9250600083116106d75760405162461bcd60e51b815260206004820152602760248201527f4e4f5f46524f4d5f544f4b454e5f5452414e534645525f544f5f544849535f4360448201526613d395149050d560ca1b6064820152608401610284565b7f45f377f845e1cc76ae2c08f990e15d58bcb732db46f92a4852b956580c3a162f88883389898960405161071096959493929190611085565b60405180910390a150506001600055505050505050565b6001546001600160a01b031633146107515760405162461bcd60e51b815260040161028490611037565b6001600160a01b0382166107a75760405162461bcd60e51b815260206004820152601e60248201527f44455354494e4154494f4e5f43414e4e545f42455f305f4144445245535300006044820152606401610284565b6001600160a01b0383166107f35760405162461bcd60e51b81526020600482015260136024820152720544f4b454e5f4d5553545f4e4f545f42455f3606c1b6044820152606401610284565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e919061106c565b9050818110156108b05760405162461bcd60e51b815260206004820152601e60248201527f414d4f554e545f43414e4e545f4d4f52455f5448414e5f42414c414e434500006044820152606401610284565b6108bb848484610c03565b604080516001600160a01b0386168152602081018490527f7bf0873174a9cc6b28e039b52e74903dd59d650205f32748e3c3dd6b9918ea87910160405180910390a150505050565b6001546001600160a01b0316331461092d5760405162461bcd60e51b815260040161028490611037565b6001600160a01b0381166109925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610284565b61099b81610a6c565b50565b604080516000808252602082019092526001600160a01b0384169083906040516109c891906110d8565b60006040518083038185875af1925050503d8060008114610a05576040519150601f19603f3d011682016040523d82523d6000602084013e610a0a565b606091505b5050905080610a675760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b6064820152608401610284565b505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b1790529151600092839290881691610b2291906110d8565b6000604051808303816000865af19150503d8060008114610b5f576040519150601f19603f3d011682016040523d82523d6000602084013e610b64565b606091505b5091509150818015610b8e575080511580610b8e575080806020019051810190610b8e91906110f4565b610be65760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b6064820152608401610284565b505050505050565b6000610bfa828461111d565b90505b92915050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691610c5f91906110d8565b6000604051808303816000865af19150503d8060008114610c9c576040519150601f19603f3d011682016040523d82523d6000602084013e610ca1565b606091505b5091509150818015610ccb575080511580610ccb575080806020019051810190610ccb91906110f4565b610d175760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610284565b5050505050565b60005b83811015610d39578181015183820152602001610d21565b50506000910152565b60008151808452610d5a816020860160208601610d1e565b601f01601f19169290920160200192915050565b602081526000610bfa6020830184610d42565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610da857600080fd5b813567ffffffffffffffff80821115610dc357610dc3610d81565b604051601f8301601f19908116603f01168101908282118183101715610deb57610deb610d81565b81604052838152866020858801011115610e0457600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e3957600080fd5b833567ffffffffffffffff80821115610e5157600080fd5b610e5d87838801610d97565b94506020860135915080821115610e7357600080fd5b50610e8086828701610d97565b925050604084013590509250925092565b80356001600160a01b0381168114610ea857600080fd5b919050565b60008060408385031215610ec057600080fd5b610ec983610e91565b946020939093013593505050565b600080600080600060a08688031215610eef57600080fd5b610ef886610e91565b9450602086013567ffffffffffffffff80821115610f1557600080fd5b610f2189838a01610d97565b95506040880135915080821115610f3757600080fd5b50610f4488828901610d97565b9598949750949560608101359550608001359392505050565b600080600060608486031215610f7257600080fd5b610f7b84610e91565b9250610f8960208501610e91565b9150604084013590509250925092565b600060208284031215610fab57600080fd5b610bfa82610e91565b600181811c90821680610fc857607f821691505b602082108103610fe857634e487b7160e01b600052602260045260246000fd5b50919050565b60a08152600061100160a0830188610d42565b6001600160a01b038716602084015282810360408401526110228187610d42565b60608401959095525050608001529392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561107e57600080fd5b5051919050565b600060018060a01b03808916835260c060208401526110a760c0840189610d42565b818816604085015283810360608501526110c18188610d42565b608085019690965250505060a00152949350505050565b600082516110ea818460208701610d1e565b9190910192915050565b60006020828403121561110657600080fd5b8151801515811461111657600080fd5b9392505050565b81810381811115610bfd57634e487b7160e01b600052601160045260246000fdfea2646970667358221220e4f6bcb337c4c8aa0af62fbba76f85e0de5351f3d41f54c7b9d3c94a0ca4a2ec64736f6c63430008140033
logo
GateScan is a Block Explorer and Analytics Platform for GateChain