Contract 0x929376c77a2fb8152375a089a4fccf84ff481479 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xd8faa817de88a5fa7a2b9055e8be00c12fc9b5c5363c4bd3d28c5e58cc1dff940x60c0604041754792021-12-30 7:21:54185 days 19 hrs ago0x28047c3cc8cdd140acfafff7bfc22774941b10ef IN  Create: ConnectV2OneInchV4Arbitrum0 ETH0.025543101257 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x41d8e36173851a2d7a4eae5a91e30ca43212f24209044c4a76e77d0ddd6a616a169269982022-07-03 21:03:365 hrs 40 mins ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x77be39139a1673bc9b005d614152c3eadfa68c6a1506734d9dabfd604420ce81169268742022-07-03 21:00:145 hrs 43 mins ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xab8da82c3ba7d1a5e680a014207c0a99be9aff854b5d46340e55b08107754feb169268212022-07-03 20:58:365 hrs 45 mins ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xed242e2b389933ec6d3706d03ff2e8bcacf45348da94910d89282f01b42ee76a169267472022-07-03 20:58:365 hrs 45 mins ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x51785347057c4ef08df4e9dbaa4d2f3d9f5ccbddc064ea3a8527e41700c7fefa169125952022-07-03 16:17:4210 hrs 26 mins ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xa9e9e79da41c3c2b1040f3670b4660e569db8f7700d6429dfdf7e0191966ebbe168839182022-07-03 8:47:1917 hrs 56 mins ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x55df77955e380316a34326657e32584bafb6c8022bb3b4751e6f02056db074b6168711112022-07-03 5:12:4621 hrs 31 mins ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x8e875e9159f7c5fb3670813e02965cab16fd492ce4e3516ea22386a8964a49cc168259122022-07-02 14:12:541 day 12 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x66c099f5e5373532078827d3ce2256faf11b486836b40209651831ecec6c2d29166843512022-07-01 5:29:362 days 21 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x957cbb998e6f3a85f467442e1830e038266b3f2fcb93400c075208fbf7a68b6b166413832022-06-30 18:02:273 days 8 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xe9bf5537af08e66a3fa1e98b78ebae45c3bdbfa16c42ed786c047695de0a0e93166383892022-06-30 17:10:363 days 9 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xcd3876ca8912b911dd49c23a6ff2b26e4ba4a2bd5afb81ad22a62e3859f8ea3b166215952022-06-30 14:12:363 days 12 hrs ago 0x4b41e77761e6ef46514f7f2fddeebb22d99db76e 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xc55cce3b7b1830cac0dca708ced369f2f6ed4c233f9c504b3dc5560976cec7cb166148062022-06-30 13:20:583 days 13 hrs ago 0x44d71ffedf6dbf0717abb1fcd16b6a9d6d458904 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x3177ef13892627a4418a053f4f2d1c35d5bb6d3268dee0230568bf887fc50e4f166034982022-06-30 11:37:463 days 15 hrs ago 0x4b41e77761e6ef46514f7f2fddeebb22d99db76e 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x4b4a96105e1e9bfef0cb534f91e4b9ae6e4d9748cc912aef20c0315f27b0e93d165711392022-06-30 7:26:243 days 19 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xb59081c747c95e4c3e556dca2006d86bcc6aa82416bc22f96345b176d41479ea165686122022-06-30 7:10:493 days 19 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xdb2b48bfd99973fe97e7e383571874772663c783bd6fe5129c6f25fe052a68a2165656432022-06-30 6:51:443 days 19 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xf4ce9af1fea3921d2c8014bc62c190ab27692a39977ce250c514389c6c228c6c165571382022-06-30 5:46:423 days 20 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xef6188e864b8467262a639bc4db6eb5b180fa67597e3f9dee66cb24b3e5ade27164842592022-06-29 18:48:574 days 7 hrs ago 0x4b41e77761e6ef46514f7f2fddeebb22d99db76e 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x9842f8bf700700e9681e26a92c0ff706b243e5dce3e7756faeff079f4deef827163769912022-06-29 6:52:344 days 19 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xef411cf524db6652c4ed5cb834445c5ab6da87d439fcff22b5c49e2c7c1ca605163768002022-06-29 6:51:364 days 19 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xc72e2ddfc8f5458b1d112fd8f5edb1bf48c0e05c4efe2ccfe4215e40b7f62a5f163767292022-06-29 6:50:344 days 19 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x60a808e2f290b9c3e244c6c2b5d54f1d507aa1c238cdbf0b5c96ddd0d1be2023163766602022-06-29 6:49:214 days 19 hrs ago 0xe9f0d7249d3d7da3672673acbb2bb434ff5ac478 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0x14a742afa1c4b508eca03e7ac67958752767a00d922aa0106a2991917d2aa853163153382022-06-29 0:26:065 days 2 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 0x929376c77a2fb8152375a089a4fccf84ff4814790 ETH
0xd225112194739c026892ed16f5a818d31f0b24a3829ee8a299e409929825ccec163152392022-06-29 0:24:395 days 2 hrs ago 0x079b3427dc1f63c303cae8fea3ef12bbf3c031fe 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

Contract Source Code (Solidity Standard Json-Input format)

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

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