Contract 0x929376c77a2fb8152375a089a4fccf84ff481479 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xd8faa817de88a5fa7a2b9055e8be00c12fc9b5c5363c4bd3d28c5e58cc1dff940x60c0604041754792021-12-30 7:21:54786 days 8 hrs ago0x28047c3cc8cdd140acfafff7bfc22774941b10ef IN  Create: ConnectV2OneInchV4Arbitrum0 ETH0.025543101257 ETH1.00191884
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x2e8afd9bcadbe4bb78d4e75bf85fe5b0d617f661f212505ba331d666848374db477801302022-12-21 10:17:19430 days 5 hrs ago 0x3da0ca208e3227641bacf6cf0bde86374be04c36 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x0dad4b3b7f4152931cfbb4bd025e7ecc3ac4ec650792ead291cb336420310940474275592022-12-20 0:41:20431 days 15 hrs ago 0xd89a62406f6db8a4f973bd42b44f20273efa00a0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xfe6fdd93e45499a3ba019baee02560181fb717b1aa63ceae58e0617fbb799e47433799112022-12-03 22:45:27447 days 17 hrs ago 0x595c07b15dc744d94c5b3ab5023d8020331c7b90 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xdc84df7c9052473eab3d441da0c3bf81bc192a2ff4eb061185f9b69ef8336629433730082022-12-03 22:05:28447 days 17 hrs ago 0x0834c67d087d6e83ff411ff8f4267ef5429a6688 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x9cb534bee579ecee898e490df8e1c9ab7cece9387fa44f8c1510d55b8dd97f9d432254372022-12-03 10:17:45448 days 5 hrs ago 0x8c52a9df233edf563abfc651f12defc7de6b5e2d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x9b1e4b27a558ec569136eacdf9efebf65312cc65ef596f105b2ac0775e8502e3432247032022-12-03 10:14:19448 days 5 hrs ago 0x8c52a9df233edf563abfc651f12defc7de6b5e2d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xea4e5d7046708eaaaf9957fdeb55643fae480e232c5a27b6a1a571bc7fa656dc431964892022-12-03 8:04:06448 days 7 hrs ago 0x4d9f9c26ac3b391bd79b62ecac75751eb172655f 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x5b0f8103af0d5b3ad0f7c12baeb088c3bb1db94c8d70baa5f78d05b07dd0d600417481072022-11-28 0:26:40453 days 15 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x9dc88b97d374bcf760be5578308ffdf6a9e1c50c0d7724fc8051e4c700ab9be3412669712022-11-26 4:24:16455 days 11 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x5fa08197adc55906c6fca2a1255adaabcd46211f287026ac3ae50dbe151e1076412459032022-11-26 2:25:53455 days 13 hrs ago 0xc9f1d4a17d91d69809a5b2f4c22ec2c033d8173d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x460cb2a79c88c914467c2c698a1348b6d9033b543ad9b59f6e6e0eb7c833c4e5412453912022-11-26 2:22:51455 days 13 hrs ago 0xc9f1d4a17d91d69809a5b2f4c22ec2c033d8173d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xe98f67b892cea741b6836927a236070a4f397180d211eb81fc13c3765fd6bff7412439802022-11-26 2:15:17455 days 13 hrs ago 0xc9f1d4a17d91d69809a5b2f4c22ec2c033d8173d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x32ffc613337a1ea32c1a0ba23c3d4ce01a5b8ac16b4ad4b004905c9c2ebd8b7d407236542022-11-24 4:27:48457 days 11 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x0085871e566b799f3b8a743881d5126795dfaf17eef7011f17679620cbee3b8e404224742022-11-23 2:51:59458 days 13 hrs ago 0x44f00f7c5291615af7acce0b475d307ad502d29f 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x7501a826dccf53c901a3d254b340d07d314c86302523aa81a531e4fc7cc9209a399819702022-11-21 15:24:23460 days 28 mins ago 0x2a16a27bfbfc3d2e2fec846768f8b59e5341af6a 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xcf03bc4b63e7e3d7362e8afd89684dd74e279cd54a50f7c8df27d0db4d36a4cd399445212022-11-21 12:46:25460 days 3 hrs ago 0x2a16a27bfbfc3d2e2fec846768f8b59e5341af6a 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xf2e3fe479e6e4d370d4d1740a29569578ef100f94f449746f4ec88e8726fd6e2398420952022-11-21 5:18:13460 days 10 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x1f5e130637e168b78229fe45ab6d8192c697d891e416e257f3ea8c247c7e1269397814832022-11-21 0:06:30460 days 15 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x4530c900fb8f662442d86899d70c02203af54360a4d583eac216293843e26deb397811332022-11-21 0:04:41460 days 15 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x07d5849f6a4aae0c67e4c78cd72584564bb8bb1e6e63c4c2a667305ec5671abe397808062022-11-21 0:02:36460 days 15 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x50a90b97541a9f192174508f35a5857530eedb2a4d8809e4842adcec530186a7395044302022-11-20 3:19:40461 days 12 hrs ago 0x96e793c068836acbbaa8c0d534543976e1623ec5 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x16bc1311e75a9d42a5ddbbf060d4261601d485187ee0e689beefc6b7bcd63b17395032712022-11-20 3:14:03461 days 12 hrs ago 0x96e793c068836acbbaa8c0d534543976e1623ec5 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x15f54a7a14554be67ccec62d862fb673b513933cb957ea0ea29a6a0e33806b76391293762022-11-18 19:10:22462 days 20 hrs ago 0x1ecfbb4de2aaa1fbe08e4c9e6ffce8779961748d 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xb62f7dafffacdcd046adb02afeb5092e19c547b167cec79f4c4857389fbb2e72388780362022-11-17 18:33:51463 days 21 hrs ago 0xd3692f99aefc0ad608ae9d821d184374d63b17d0 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x040103cd040a5343adfcb9466f86926b5f0ec0ee2548d8af412626d6121179aa387765472022-11-17 9:53:26464 days 5 hrs ago 0x824aa0a6ebd86849ba9237999abe781b41e1d2f7 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ConnectV2OneInchV4Arbitrum

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : main.sol
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;

/**
 * @title 1InchV4.
 * @dev On-chain DEX Aggregator.
 */

// import files from common directory
import { TokenInterface , MemoryInterface } from "../../../common/interfaces.sol";
import { Stores } from "../../../common/stores.sol";
import { OneInchInterace, OneInchData } from "./interface.sol";
import { Helpers } from "./helpers.sol";
import { Events } from "./events.sol";

abstract contract OneInchResolver is Helpers, Events {


    /**
     * @dev 1inch API swap handler
     * @param oneInchData - contains data returned from 1inch API. Struct defined in interfaces.sol
     * @param ethAmt - Eth to swap for .value()
     */
    function oneInchSwap(
        OneInchData memory oneInchData,
        uint ethAmt
    ) internal returns (uint buyAmt) {
        TokenInterface buyToken = oneInchData.buyToken;
        (uint _buyDec, uint _sellDec) = getTokensDec(buyToken, oneInchData.sellToken);
        uint _sellAmt18 = convertTo18(_sellDec, oneInchData._sellAmt);
        uint _slippageAmt = convert18ToDec(_buyDec, wmul(oneInchData.unitAmt, _sellAmt18));

        uint initalBal = getTokenBal(buyToken);

        // solium-disable-next-line security/no-call-value
        (bool success, ) = oneInchAddr.call{value: ethAmt}(oneInchData.callData);
        if (!success) revert("1Inch-swap-failed");

        uint finalBal = getTokenBal(buyToken);

        buyAmt = sub(finalBal, initalBal);

        require(_slippageAmt <= buyAmt, "Too much slippage");
    }

}

abstract contract OneInchResolverHelpers is OneInchResolver {

    /**
     * @dev Gets the swapping data from 1inch's API.
     * @param oneInchData Struct with multiple swap data defined in interfaces.sol 
     * @param setId Set token amount at this ID in `InstaMemory` Contract.
     */
    function _sell(
        OneInchData memory oneInchData,
        uint setId
    ) internal returns (OneInchData memory) {
        TokenInterface _sellAddr = oneInchData.sellToken;

        uint ethAmt;
        if (address(_sellAddr) == ethAddr) {
            ethAmt = oneInchData._sellAmt;
        } else {
            approve(TokenInterface(_sellAddr), oneInchAddr, oneInchData._sellAmt);
        }

        oneInchData._buyAmt = oneInchSwap(oneInchData, ethAmt);
        setUint(setId, oneInchData._buyAmt);

        return oneInchData;
    }
}

abstract contract OneInch is OneInchResolverHelpers {
    /**
     * @dev Sell ETH/ERC20_Token using 1Inch.
     * @notice Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain.
     * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
     * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
     * @param sellAmt The amount of the token to sell.
     * @param unitAmt The amount of buyAmt/sellAmt with slippage.
     * @param callData Data from 1inch API.
     * @param setId ID stores the amount of token brought.
    */
    function sell(
        address buyAddr,
        address sellAddr,
        uint sellAmt,
        uint unitAmt,
        bytes calldata callData,
        uint setId
    ) external payable returns (string memory _eventName, bytes memory _eventParam) {
        OneInchData memory oneInchData = OneInchData({
            buyToken: TokenInterface(buyAddr),
            sellToken: TokenInterface(sellAddr),
            unitAmt: unitAmt,
            callData: callData,
            _sellAmt: sellAmt,
            _buyAmt: 0
        });

        oneInchData = _sell(oneInchData, setId);

        _eventName = "LogSell(address,address,uint256,uint256,uint256,uint256)";
        _eventParam = abi.encode(buyAddr, sellAddr, oneInchData._buyAmt, oneInchData._sellAmt, 0, setId);
    }
}

contract ConnectV2OneInchV4Arbitrum is OneInch {
    string public name = "1Inch-v4";
}

File 2 of 9 : interfaces.sol
pragma solidity ^0.7.0;

interface TokenInterface {
    function approve(address, uint256) external;
    function transfer(address, uint) external;
    function transferFrom(address, address, uint) external;
    function deposit() external payable;
    function withdraw(uint) external;
    function balanceOf(address) external view returns (uint);
    function decimals() external view returns (uint);
}

interface MemoryInterface {
    function getUint(uint id) external returns (uint num);
    function setUint(uint id, uint val) external;
}

interface InstaMapping {
    function cTokenMapping(address) external view returns (address);
    function gemJoinMapping(bytes32) external view returns (address);
}

interface AccountInterface {
    function enable(address) external;
    function disable(address) external;
    function isAuth(address) external view returns (bool);
}

File 3 of 9 : stores.sol
pragma solidity ^0.7.0;

import { MemoryInterface, InstaMapping } from "./interfaces.sol";


abstract contract Stores {

  /**
   * @dev Return ethereum address
   */
  address constant internal ethAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

  /**
   * @dev Return Wrapped ETH address
   */
  address constant internal wethAddr = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;

  /**
   * @dev Return memory variable address
   */
  MemoryInterface constant internal instaMemory = MemoryInterface(0xc109f7Ef06152c3a63dc7254fD861E612d3Ac571);

  /**
   * @dev Get Uint value from InstaMemory Contract.
   */
  function getUint(uint getId, uint val) internal returns (uint returnVal) {
    returnVal = getId == 0 ? val : instaMemory.getUint(getId);
  }

  /**
  * @dev Set Uint value in InstaMemory Contract.
  */
  function setUint(uint setId, uint val) virtual internal {
    if (setId != 0) instaMemory.setUint(setId, val);
  }

}

File 4 of 9 : interface.sol
pragma solidity ^0.7.0;

import { TokenInterface } from "../../../common/interfaces.sol";

interface OneInchInterace {
    function swap(
        TokenInterface fromToken,
        TokenInterface toToken,
        uint256 fromTokenAmount,
        uint256 minReturnAmount,
        uint256 guaranteedAmount,
        address payable referrer,
        address[] calldata callAddresses,
        bytes calldata callDataConcat,
        uint256[] calldata starts,
        uint256[] calldata gasLimitsAndValues
    )
    external
    payable
    returns (uint256 returnAmount);
}

struct OneInchData {
    TokenInterface sellToken;
    TokenInterface buyToken;
    uint _sellAmt;
    uint _buyAmt;
    uint unitAmt;
    bytes callData;
}

File 5 of 9 : helpers.sol
pragma solidity ^0.7.0;

import { TokenInterface } from "../../../common/interfaces.sol";
import { DSMath } from "../../../common/math.sol";
import { Basic } from "../../../common/basic.sol";


abstract contract Helpers is DSMath, Basic {
    /**
     * @dev 1Inch Address
     */
address internal constant oneInchAddr = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
}

File 6 of 9 : events.sol
pragma solidity ^0.7.0;

contract Events {
    event LogSell(
        address indexed buyToken,
        address indexed sellToken,
        uint256 buyAmt,
        uint256 sellAmt,
        uint256 getId,
        uint256 setId
    );
}

File 7 of 9 : math.sol
pragma solidity ^0.7.0;

import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";

contract DSMath {
  uint constant WAD = 10 ** 18;
  uint constant RAY = 10 ** 27;

  function add(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.add(x, y);
  }

  function sub(uint x, uint y) internal virtual pure returns (uint z) {
    z = SafeMath.sub(x, y);
  }

  function mul(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.mul(x, y);
  }

  function div(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.div(x, y);
  }

  function wmul(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.add(SafeMath.mul(x, y), WAD / 2) / WAD;
  }

  function wdiv(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.add(SafeMath.mul(x, WAD), y / 2) / y;
  }

  function rdiv(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.add(SafeMath.mul(x, RAY), y / 2) / y;
  }

  function rmul(uint x, uint y) internal pure returns (uint z) {
    z = SafeMath.add(SafeMath.mul(x, y), RAY / 2) / RAY;
  }

  function toInt(uint x) internal pure returns (int y) {
    y = int(x);
    require(y >= 0, "int-overflow");
  }

  function toRad(uint wad) internal pure returns (uint rad) {
    rad = mul(wad, 10 ** 27);
  }

}

File 8 of 9 : basic.sol
pragma solidity ^0.7.0;

import { TokenInterface } from "./interfaces.sol";
import { Stores } from "./stores.sol";
import { DSMath } from "./math.sol";

abstract contract Basic is DSMath, Stores {

    function convert18ToDec(uint _dec, uint256 _amt) internal pure returns (uint256 amt) {
        amt = (_amt / 10 ** (18 - _dec));
    }

    function convertTo18(uint _dec, uint256 _amt) internal pure returns (uint256 amt) {
        amt = mul(_amt, 10 ** (18 - _dec));
    }

    function getTokenBal(TokenInterface token) internal view returns(uint _amt) {
        _amt = address(token) == ethAddr ? address(this).balance : token.balanceOf(address(this));
    }

    function getTokensDec(TokenInterface buyAddr, TokenInterface sellAddr) internal view returns(uint buyDec, uint sellDec) {
        buyDec = address(buyAddr) == ethAddr ?  18 : buyAddr.decimals();
        sellDec = address(sellAddr) == ethAddr ?  18 : sellAddr.decimals();
    }

    function encodeEvent(string memory eventName, bytes memory eventParam) internal pure returns (bytes memory) {
        return abi.encode(eventName, eventParam);
    }

    function approve(TokenInterface token, address spender, uint256 amount) internal {
        try token.approve(spender, amount) {

        } catch {
            token.approve(spender, 0);
            token.approve(spender, amount);
        }
    }

    function changeEthAddress(address buy, address sell) internal pure returns(TokenInterface _buy, TokenInterface _sell){
        _buy = buy == ethAddr ? TokenInterface(wethAddr) : TokenInterface(buy);
        _sell = sell == ethAddr ? TokenInterface(wethAddr) : TokenInterface(sell);
    }

    function convertEthToWeth(bool isEth, TokenInterface token, uint amount) internal {
        if(isEth) token.deposit{value: amount}();
    }

    function convertWethToEth(bool isEth, TokenInterface token, uint amount) internal {
       if(isEth) {
            approve(token, address(token), amount);
            token.withdraw(amount);
        }
    }
}

File 9 of 9 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
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) {
        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) {
        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) {
        // 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) {
        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) {
        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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @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. 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) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b > 0, "SafeMath: modulo by zero");
        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) {
        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.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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) {
        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) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyToken","type":"address"},{"indexed":true,"internalType":"address","name":"sellToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"buyAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sellAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"getId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"setId","type":"uint256"}],"name":"LogSell","type":"event"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"buyAddr","type":"address"},{"internalType":"address","name":"sellAddr","type":"address"},{"internalType":"uint256","name":"sellAmt","type":"uint256"},{"internalType":"uint256","name":"unitAmt","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"setId","type":"uint256"}],"name":"sell","outputs":[{"internalType":"string","name":"_eventName","type":"string"},{"internalType":"bytes","name":"_eventParam","type":"bytes"}],"stateMutability":"payable","type":"function"}]

60c060405260086080819052670c525b98da0b5d8d60c21b60a0908152610029916000919061003c565b5034801561003657600080fd5b506100dd565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261007257600085556100b8565b82601f1061008b57805160ff19168380011785556100b8565b828001600101855582156100b8579182015b828111156100b857825182559160200191906001019061009d565b506100c49291506100c8565b5090565b5b808211156100c457600081556001016100c9565b610bb5806100ec6000396000f3fe6080604052600436106100295760003560e01c806306fdde031461002e578063f892b2ad14610059575b600080fd5b34801561003a57600080fd5b5061004361007a565b6040516100509190610a5f565b60405180910390f35b61006c610067366004610932565b610108565b604051610050929190610a72565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156101005780601f106100d557610100808354040283529160200191610100565b820191906000526020600020905b8154815290600101906020018083116100e357829003601f168201915b505050505081565b60608060006040518060c001604052808a6001600160a01b031681526020018b6001600160a01b031681526020018981526020016000815260200188815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061018d81856101ec565b9050604051806060016040528060388152602001610b276038913992508989826060015183604001516000886040516020016101ce96959493929190610a26565b60405160208183030381529060405291505097509795505050505050565b6101f46108ce565b825160006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156102285750604084015161024b565b61024b82731111111254fb6c44bac0bed2854e76f90643097d8760400151610273565b61025585826103bb565b606086018190526102679085906104fa565b84925050505b92915050565b826001600160a01b031663095ea7b383836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156102ca57600080fd5b505af19250505080156102db575060015b6103b6576040805163095ea7b360e01b81526001600160a01b03848116600483015260006024830181905292519086169263095ea7b3926044808201939182900301818387803b15801561032e57600080fd5b505af1158015610342573d6000803e3d6000fd5b50505050826001600160a01b031663095ea7b383836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561039d57600080fd5b505af11580156103b1573d6000803e3d6000fd5b505050505b505050565b600080836020015190506000806103d6838760000151610577565b9150915060006103ea8288604001516106a7565b90506000610405846104008a60800151856106c0565b6106f5565b9050600061041286610706565b90506000731111111254fb6c44bac0bed2854e76f90643097d6001600160a01b0316898b60a001516040516104479190610a0a565b60006040518083038185875af1925050503d8060008114610484576040519150601f19603f3d011682016040523d82523d6000602084013e610489565b606091505b50509050806104b35760405162461bcd60e51b81526004016104aa90610acb565b60405180910390fd5b60006104be88610706565b90506104ca81846107aa565b9850888411156104ec5760405162461bcd60e51b81526004016104aa90610aa0565b505050505050505092915050565b81156105735760408051631878f25160e21b81526004810184905260248101839052905173c109f7ef06152c3a63dc7254fd861e612d3ac571916361e3c94491604480830192600092919082900301818387803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b505050505b5050565b6000806001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461060857836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d757600080fd5b505afa1580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b505161060b565b60125b91506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461069b57826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561066a57600080fd5b505afa15801561067e573d6000803e3d6000fd5b505050506040513d602081101561069457600080fd5b505161069e565b60125b90509250929050565b60006106b98284601203600a0a6107b6565b9392505050565b6000670de0b6b3a76400006106e66106d885856107be565b6706f05b59d3b20000610817565b816106ed57fe5b049392505050565b600082601203600a0a82816106ed57fe5b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107a357604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d602081101561079c57600080fd5b505161026d565b4792915050565b60006106b98383610871565b60006106b983835b6000826107cd5750600061026d565b828202828482816107da57fe5b04146106b95760405162461bcd60e51b8152600401808060200182810382526021815260200180610b5f6021913960400191505060405180910390fd5b6000828201838110156106b9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156108c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6040518060c0016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001606081525090565b80356001600160a01b038116811461092d57600080fd5b919050565b600080600080600080600060c0888a03121561094c578283fd5b61095588610916565b965061096360208901610916565b95506040880135945060608801359350608088013567ffffffffffffffff8082111561098d578485fd5b818a0191508a601f8301126109a0578485fd5b8135818111156109ae578586fd5b8b60208285010111156109bf578586fd5b60208301955080945050505060a0880135905092959891949750929550565b600081518084526109f6816020860160208601610af6565b601f01601f19169290920160200192915050565b60008251610a1c818460208701610af6565b9190910192915050565b6001600160a01b0396871681529490951660208501526040840192909252606083015260ff16608082015260a081019190915260c00190565b6000602082526106b960208301846109de565b600060408252610a8560408301856109de565b8281036020840152610a9781856109de565b95945050505050565b602080825260119082015270546f6f206d75636820736c69707061676560781b604082015260600190565b6020808252601190820152700c525b98da0b5cddd85c0b59985a5b1959607a1b604082015260600190565b60005b83811015610b11578181015183820152602001610af9565b83811115610b20576000848401525b5050505056fe4c6f6753656c6c28616464726573732c616464726573732c75696e743235362c75696e743235362c75696e743235362c75696e7432353629536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212208851ad8b04371084fec01fb133e78f871a8d711d6c6fdc6556fe7003e966e87564736f6c63430007060033

Deployed Bytecode

0x6080604052600436106100295760003560e01c806306fdde031461002e578063f892b2ad14610059575b600080fd5b34801561003a57600080fd5b5061004361007a565b6040516100509190610a5f565b60405180910390f35b61006c610067366004610932565b610108565b604051610050929190610a72565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156101005780601f106100d557610100808354040283529160200191610100565b820191906000526020600020905b8154815290600101906020018083116100e357829003601f168201915b505050505081565b60608060006040518060c001604052808a6001600160a01b031681526020018b6001600160a01b031681526020018981526020016000815260200188815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061018d81856101ec565b9050604051806060016040528060388152602001610b276038913992508989826060015183604001516000886040516020016101ce96959493929190610a26565b60405160208183030381529060405291505097509795505050505050565b6101f46108ce565b825160006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156102285750604084015161024b565b61024b82731111111254fb6c44bac0bed2854e76f90643097d8760400151610273565b61025585826103bb565b606086018190526102679085906104fa565b84925050505b92915050565b826001600160a01b031663095ea7b383836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156102ca57600080fd5b505af19250505080156102db575060015b6103b6576040805163095ea7b360e01b81526001600160a01b03848116600483015260006024830181905292519086169263095ea7b3926044808201939182900301818387803b15801561032e57600080fd5b505af1158015610342573d6000803e3d6000fd5b50505050826001600160a01b031663095ea7b383836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561039d57600080fd5b505af11580156103b1573d6000803e3d6000fd5b505050505b505050565b600080836020015190506000806103d6838760000151610577565b9150915060006103ea8288604001516106a7565b90506000610405846104008a60800151856106c0565b6106f5565b9050600061041286610706565b90506000731111111254fb6c44bac0bed2854e76f90643097d6001600160a01b0316898b60a001516040516104479190610a0a565b60006040518083038185875af1925050503d8060008114610484576040519150601f19603f3d011682016040523d82523d6000602084013e610489565b606091505b50509050806104b35760405162461bcd60e51b81526004016104aa90610acb565b60405180910390fd5b60006104be88610706565b90506104ca81846107aa565b9850888411156104ec5760405162461bcd60e51b81526004016104aa90610aa0565b505050505050505092915050565b81156105735760408051631878f25160e21b81526004810184905260248101839052905173c109f7ef06152c3a63dc7254fd861e612d3ac571916361e3c94491604480830192600092919082900301818387803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b505050505b5050565b6000806001600160a01b03841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461060857836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d757600080fd5b505afa1580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b505161060b565b60125b91506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461069b57826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561066a57600080fd5b505afa15801561067e573d6000803e3d6000fd5b505050506040513d602081101561069457600080fd5b505161069e565b60125b90509250929050565b60006106b98284601203600a0a6107b6565b9392505050565b6000670de0b6b3a76400006106e66106d885856107be565b6706f05b59d3b20000610817565b816106ed57fe5b049392505050565b600082601203600a0a82816106ed57fe5b60006001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107a357604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d602081101561079c57600080fd5b505161026d565b4792915050565b60006106b98383610871565b60006106b983835b6000826107cd5750600061026d565b828202828482816107da57fe5b04146106b95760405162461bcd60e51b8152600401808060200182810382526021815260200180610b5f6021913960400191505060405180910390fd5b6000828201838110156106b9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156108c8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6040518060c0016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001606081525090565b80356001600160a01b038116811461092d57600080fd5b919050565b600080600080600080600060c0888a03121561094c578283fd5b61095588610916565b965061096360208901610916565b95506040880135945060608801359350608088013567ffffffffffffffff8082111561098d578485fd5b818a0191508a601f8301126109a0578485fd5b8135818111156109ae578586fd5b8b60208285010111156109bf578586fd5b60208301955080945050505060a0880135905092959891949750929550565b600081518084526109f6816020860160208601610af6565b601f01601f19169290920160200192915050565b60008251610a1c818460208701610af6565b9190910192915050565b6001600160a01b0396871681529490951660208501526040840192909252606083015260ff16608082015260a081019190915260c00190565b6000602082526106b960208301846109de565b600060408252610a8560408301856109de565b8281036020840152610a9781856109de565b95945050505050565b602080825260119082015270546f6f206d75636820736c69707061676560781b604082015260600190565b6020808252601190820152700c525b98da0b5cddd85c0b59985a5b1959607a1b604082015260600190565b60005b83811015610b11578181015183820152602001610af9565b83811115610b20576000848401525b5050505056fe4c6f6753656c6c28616464726573732c616464726573732c75696e743235362c75696e743235362c75696e743235362c75696e7432353629536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212208851ad8b04371084fec01fb133e78f871a8d711d6c6fdc6556fe7003e966e87564736f6c63430007060033

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.