Contract 0xd01e3549160c62acabc4d0eb89f67aafa3de8eed 1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x8eba39f5c474cfc66f96d345b0f5125f2cbb3682e376ead0ef2cd7543a60af50Approve302396672022-07-02 4:53:599 hrs 58 mins ago0xecd02810db92ff027ea1b0850d46bda963676d74 IN  Clipper Exchange: Pool0 MATIC0.000827909461 34.03393332
0x2aee8f87f8edcf9247b3a8705401942957fdb65f660646a3e425bbc7dc4c2bd6Approve302325622022-07-02 0:26:4114 hrs 26 mins ago0x18bd2e8b69e48c5e6deae13682b1f78d1c260bf9 IN  Clipper Exchange: Pool0 MATIC0.001608045 34.50000002
0x60ed0dc07b4ed08d901ff70dfaf1ed3f99cdbbe5a4969c2f654d9aec1a4631d0Unlock Deposit302325292022-07-02 0:25:3514 hrs 27 mins ago0x18bd2e8b69e48c5e6deae13682b1f78d1c260bf9 IN  Clipper Exchange: Pool0 MATIC0.001618462092 31.36980002
0x9a087cc85358dcbea6b4872587527de4e738e9df9be6e8f12be625ddcf5ba229Approve302324872022-07-02 0:24:0714 hrs 28 mins ago0x8f9face7b62d2ab3c7625b7a4fb3b54131c98843 IN  Clipper Exchange: Pool0 MATIC0.001608045007 34.500000155
0xfe6e8be9eb19177906bf4b31474aebe72eb8e79b62083063244084809ba3d9aaUnlock Deposit302324762022-07-02 0:23:4514 hrs 29 mins ago0x8f9face7b62d2ab3c7625b7a4fb3b54131c98843 IN  Clipper Exchange: Pool0 MATIC0.002252034461 43.650000225
0xd93342120f10fa91c9d5338eb98d7daedc6fb9b51aa6da99be267bacdd71890eApprove302324532022-07-02 0:22:5914 hrs 29 mins ago0xb197bcfd992ed6c07effe2ad662d63706bf10762 IN  Clipper Exchange: Pool0 MATIC0.001608045013 34.500000297
0x44221b5ae7d5928bf99ff9784ef49cfdebf278f89935dddfa404206b978e6c5cUnlock Deposit302324402022-07-02 0:22:2914 hrs 30 mins ago0xb197bcfd992ed6c07effe2ad662d63706bf10762 IN  Clipper Exchange: Pool0 MATIC0.002201989249 42.680000193
0x199b09e5328468a24f7fefecd53f81e9edb5f0232138d5da92353d070a7fcf45Approve302235082022-07-01 18:48:5320 hrs 3 mins ago0xecd02810db92ff027ea1b0850d46bda963676d74 IN  Clipper Exchange: Pool0 MATIC0.001608045 34.500000018
0xaf99fdd569886b7c11943b2b5b8b3d1ccc63031da0d519b0cae54a8904b297e6Unlock Deposit302234962022-07-01 18:48:2920 hrs 4 mins ago0xecd02810db92ff027ea1b0850d46bda963676d74 IN  Clipper Exchange: Pool0 MATIC0.00180162756 34.920000016
0x99b44a98daebda22f4a640ab6fef6d21a112e945055854a320893ff5f20cf884Approve302191672022-07-01 16:08:5422 hrs 43 mins ago0x908a697774b5cf33a7e7fc8f67bebcedc7b3544a IN  Clipper Exchange: Pool0 MATIC0.001608045623 34.500013383
0x4abf832741a7c90f90a6bf911b765abaaf38fee315d9b0e11e2e5bc676bb4565Unlock Deposit302191312022-07-01 16:07:3822 hrs 45 mins ago0x908a697774b5cf33a7e7fc8f67bebcedc7b3544a IN  Clipper Exchange: Pool0 MATIC0.001547790593 30.000011511
0x2b1a54bd43431c3248ca946924b019978b0078d6b52f8a39473c76fc96fa488fApprove302189282022-07-01 16:00:4022 hrs 52 mins ago0xe60350b53303d90c52e088e060bcb00ec7464bcc IN  Clipper Exchange: Pool0 MATIC0.001608051058 34.500129989
0x94047f97209e64ce46b50d5ecd090227515130a5f154456773a3fe57f1100d88Unlock Deposit302188892022-07-01 15:59:2222 hrs 53 mins ago0xe60350b53303d90c52e088e060bcb00ec7464bcc IN  Clipper Exchange: Pool0 MATIC0.001547795033 30.000097569
0xe362881874c6caee0604564a246d27a1338d10309fcc5afb4ac7730a3e3cb8a2Approve302188042022-07-01 15:56:0222 hrs 56 mins ago0x625da4feb31ea7619c80cc69ed0f548d5ec5cf47 IN  Clipper Exchange: Pool0 MATIC0.001640825918 35.203302269
0xd1cf61b9e02600dab63d364ca6481092c9198dfa7d5d36fcf61a4fc82f5d7adbUnlock Deposit302187852022-07-01 15:54:4622 hrs 58 mins ago0x625da4feb31ea7619c80cc69ed0f548d5ec5cf47 IN  Clipper Exchange: Pool0 MATIC0.001622009055 31.438548948
0x804a7fc3221d733ca941a4c1a742d28054899e6631b49511224185a5f4e949a1Approve302184282022-07-01 15:41:2023 hrs 11 mins ago0x0f44c0df3455047c1896db7a564e5338943a51ae IN  Clipper Exchange: Pool0 MATIC0.001608572848 34.511324792
0x4bae976bf68738b6e4619bb0cc79d8dc4fdaf8e2f006112d4e44538b18026e9cUnlock Deposit302183682022-07-01 15:39:2023 hrs 13 mins ago0x0f44c0df3455047c1896db7a564e5338943a51ae IN  Clipper Exchange: Pool0 MATIC0.00154887146 30.020961371
0x36518a3fd40c78a20a5f54ec0a1ce7f03b10c96065d289b50dda0eb89d4acc6fApprove302181412022-07-01 15:31:3023 hrs 21 mins ago0x08e89248c86fbfddc30ab8130e136d2d66600a12 IN  Clipper Exchange: Pool0 MATIC0.001609373301 34.528498217
0xb58e98abd59379f87b3a1c92e371bda7c7a9ccc702517f2ad72c7ed6f25d077bUnlock Deposit302180912022-07-01 15:29:4623 hrs 23 mins ago0x08e89248c86fbfddc30ab8130e136d2d66600a12 IN  Clipper Exchange: Pool0 MATIC0.001741108614 33.746993095
0xea294bcc16f0b9bec9fadf5091d9179d88c9958f1af088af883953ee0a75630bApprove302179192022-07-01 15:23:5023 hrs 28 mins ago0x526fe4f6f03cbd9e580537af29d01295da707f4b IN  Clipper Exchange: Pool0 MATIC0.001608754718 34.515226752
0xe2e2f77ef32f7b075f3957fa8360090f92ff6f9e9528306bc4a7cf852efbbe2eUnlock Deposit302178782022-07-01 15:22:2823 hrs 30 mins ago0x526fe4f6f03cbd9e580537af29d01295da707f4b IN  Clipper Exchange: Pool0 MATIC0.001609176456 31.189821428
0x3d30241c00fa8f2594167913b9370693c8dac205ee3bba3c58b21596a986fea9Approve302178162022-07-01 15:20:2023 hrs 32 mins ago0xc48e388c48b110570e5034e112b176039bce7eb2 IN  Clipper Exchange: Pool0 MATIC0.001608858234 34.51744763
0x51951a3a4fcdb74ce49082f0c3dbd0edc180544311d2d5f2f21d42ed0c80a6c9Unlock Deposit302177952022-07-01 15:19:3823 hrs 33 mins ago0xc48e388c48b110570e5034e112b176039bce7eb2 IN  Clipper Exchange: Pool0 MATIC0.00154921431 30.027606664
0x7b5c37dbf06777415710e6fb02942c922a762282cd65daf9b489363522ae2f98Approve302177422022-07-01 15:16:1023 hrs 36 mins ago0x998b7cd5dcdb17d7805e3476c680e8ace01a6fd3 IN  Clipper Exchange: Pool0 MATIC0.00166545172 35.731639578
0x312fb43c1c8ce026470f6420a993d55192c70d814001022b3659f39ddb4c7243Unlock Deposit302176722022-07-01 15:13:1623 hrs 39 mins ago0x998b7cd5dcdb17d7805e3476c680e8ace01a6fd3 IN  Clipper Exchange: Pool0 MATIC0.00194175567 37.636029517
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x28cd99b1ec2dcf1d44dfc093236c14fa31525d1354ac0072858a6d66241a7c2a283762422022-05-16 5:09:1547 days 9 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token0.01 MATIC
0x001b94e9b040ae1a70495de5c13adf6ad6f712ddcadcdca382761fb7c8cf5e7c274761732022-04-23 9:26:0770 days 5 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token200 MATIC
0x6dea2e715dc7d00464d7ce6c85f179b6fbf9ff54cd39418da399585353398905270999692022-04-13 20:16:1279 days 18 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token48.046 MATIC
0xba8384f5dc7c4ac7acb2520e00a7245d4fdcb9a38fdb5da9ea7880dc518fdff6270996852022-04-13 20:06:2479 days 18 hrs ago Clipper Exchange: Pool0x98223ae6445abf49d801cc67ef8009620cd2062e15.552384228416485376 MATIC
0xba8384f5dc7c4ac7acb2520e00a7245d4fdcb9a38fdb5da9ea7880dc518fdff6270996852022-04-13 20:06:2479 days 18 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool15.552384228416485376 MATIC
0xe3393a5e989d57c2db28310bc3bec4fc6a23aff97b56762270d78a98c2cc3657270995402022-04-13 20:01:2679 days 18 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token3 MATIC
0xb8d117380134fe66349569d93a372ae9cf60fc8f6b1dd2f388a0cc791d59f1cb270994852022-04-13 19:59:3279 days 18 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token485 MATIC
0xa1996afed3e0892ac8bd1a243dc4f9b6a5e0056bf1b3d35600c45a9a747a0e62270990102022-04-13 19:43:1479 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token70.746 MATIC
0xd8284f754aecec3eca565191179eb663278ac250d37acf6fdae7f807071ccff3270989962022-04-13 19:42:4279 days 19 hrs ago Clipper Exchange: Pool0xbd17dfb5db2bfbc8e6991ec12671d1ce702144ce70.582104475266473984 MATIC
0xd8284f754aecec3eca565191179eb663278ac250d37acf6fdae7f807071ccff3270989962022-04-13 19:42:4279 days 19 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool70.582104475266473984 MATIC
0xcbe5b8733a4081b4fe56c0902cec57fa0f197c1c7c69adcfb807b55fdd9595e0270989662022-04-13 19:41:4279 days 19 hrs ago Clipper Exchange: Pool0xfdd440fccaeef8244b146c6c3d67e508041d0509100 MATIC
0xcbe5b8733a4081b4fe56c0902cec57fa0f197c1c7c69adcfb807b55fdd9595e0270989662022-04-13 19:41:4279 days 19 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool100 MATIC
0x713e1d0b5605d053e06971a8832b5c40ac46c0e66fc14312a55d72d234816bb0270983992022-04-13 19:22:1279 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token1.1 MATIC
0x5f579ebc24b0a1aa64a6c4eaff94a9e01668664489733a4836b733c0ed47a020270982542022-04-13 19:17:1479 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token160 MATIC
0xe89a4d6de10018ac7a1825d5353679f52b32286741c8d8d2146f6a361c8f744d270982452022-04-13 19:16:5679 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token1.057815803312046592 MATIC
0x21e4612abfecf9e3bba12485d6a9a78ca25431fc086d207348e1ecbc7d92dcd7270982342022-04-13 19:16:3079 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token1.05686496141295488 MATIC
0x83edf13b799fb51d5777dfc65fe75431c3d80f77e96bda507466202ec7d4482b270982172022-04-13 19:15:5679 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token1.057411277193397632 MATIC
0x8a7330fa7f7822f99ae7dd6933a54bf119555fb78a0fcc05677a013f3769a653270981652022-04-13 19:14:0879 days 19 hrs ago Clipper Exchange: Pool0x74470a90f11f7da6cba5fd3ccb1229e9a0b660d6492.68635632841785344 MATIC
0x8a7330fa7f7822f99ae7dd6933a54bf119555fb78a0fcc05677a013f3769a653270981652022-04-13 19:14:0879 days 19 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool492.68635632841785344 MATIC
0x0b38c8c97ce0c244f30626d7ad5ec594c32f0d0f6f86d596113b6f3c5d7127cb270979552022-04-13 19:06:5679 days 19 hrs ago Clipper Exchange: Pool0x741b8c156abd7fae54f00698b70954c27ec6c26318.520939375087689728 MATIC
0x0b38c8c97ce0c244f30626d7ad5ec594c32f0d0f6f86d596113b6f3c5d7127cb270979552022-04-13 19:06:5679 days 19 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool18.520939375087689728 MATIC
0xdccdc44c380a034a8ea468bc4a58cf7a5d004ec79d4df59ebc0ef9847bac13a8270979322022-04-13 19:06:1079 days 19 hrs ago Clipper Exchange: Pool0x60f71d989c1301d1de8a9555358cc5c10e238af422.365615088696356864 MATIC
0xdccdc44c380a034a8ea468bc4a58cf7a5d004ec79d4df59ebc0ef9847bac13a8270979322022-04-13 19:06:1079 days 19 hrs ago Polygon: WMATIC Token Clipper Exchange: Pool22.365615088696356864 MATIC
0x396e231bec9779636cf5e61f15dc3167d6ee29f83644db938e5a1a03f2d99e86270979062022-04-13 19:05:1479 days 19 hrs ago Clipper Exchange: Pool Polygon: WMATIC Token18.547 MATIC
0x6f5c9107fc00bdcb0c056b019f31d7f7f91ea394bc055236792613bef51c2790270978882022-04-13 19:04:3879 days 19 hrs ago Clipper Exchange: Pool0x741b8c156abd7fae54f00698b70954c27ec6c26318.556913731117801472 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ClipperDirectExchange

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : ClipperDirectExchange.sol
//SPDX-License-Identifier: Copyright 2021 Shipyard Software, Inc.
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

interface WrapperContractInterface {
  function withdraw(uint256 amount) external;
}

contract ClipperDirectExchange is ERC20, ReentrancyGuard {
  using SafeERC20 for IERC20;
  using EnumerableSet for EnumerableSet.AddressSet;

  struct Signature {
    uint8 v;
    bytes32 r;
    bytes32 s;
  }

  struct Deposit {
      uint lockedUntil;
      uint256 poolTokenAmount;
  }

  uint256 constant ONE_IN_TEN_DECIMALS = 1e10;

  // Signer is passed in on construction, hence "immutable"
  address immutable public DESIGNATED_SIGNER;
  address immutable public WRAPPER_CONTRACT;
  // Constant values for EIP-712 signing
  bytes32 immutable DOMAIN_SEPARATOR;
  string constant VERSION = '1.0.0';
  string constant NAME = 'ClipperDirect';

  bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256(
     abi.encodePacked("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
  );

  bytes32 constant OFFERSTRUCT_TYPEHASH = keccak256(
    abi.encodePacked("OfferStruct(address input_token,address output_token,uint256 input_amount,uint256 output_amount,uint256 good_until,address destination_address)")
  );

  bytes32 constant DEPOSITSTRUCT_TYPEHASH = keccak256(
    abi.encodePacked("DepositStruct(address sender,uint256[] deposit_amounts,uint256 days_locked,uint256 pool_tokens,uint256 good_until)")
  );


  // Assets
  // lastBalances: used for "transmit then swap then sync" modality
  // assetSet is a set of keys that have lastBalances
  mapping(address => uint256) public lastBalances;
  EnumerableSet.AddressSet assetSet;

  // Both deposits and swaps are logged in this structure to prevent replay attacks
  mapping(bytes32 => bool) invalidatedDigests;

  // Allows lookup
  mapping(address => Deposit) public vestingDeposits;


  event Swapped(
    address indexed inAsset,
    address indexed outAsset,
    address indexed recipient,
    uint256 inAmount,
    uint256 outAmount,
    bytes auxiliaryData
  );

  event Deposited(
    address indexed depositor,
    uint256 poolTokens,
    uint256 nDays
  );

  event Withdrawn(
    address indexed withdrawer,
    uint256 poolTokens,
    uint256 fractionOfPool
  );

  // Take in the designated signer address and the token list
  constructor(address theSigner, address theWrapper, address[] memory tokens) ERC20("ClipperDirect Pool Token", "CLPRDRPL") {
    DESIGNATED_SIGNER = theSigner;
    uint i;
    uint n = tokens.length;
    while(i < n) {
        assetSet.add(tokens[i]);
        i++;
    }
    DOMAIN_SEPARATOR = createDomainSeparator(NAME, VERSION, address(this));
    WRAPPER_CONTRACT = theWrapper;
  }

  // Allows the receipt of ETH directly
  receive() external payable {
  }

  function safeEthSend(address recipient, uint256 howMuch) internal {
    (bool success, ) = payable(recipient).call{value: howMuch}("");
    require(success, "Call with value failed");
  }

  /* TOKEN AND ASSET FUNCTIONS */
  function nTokens() public view returns (uint) {
    return assetSet.length();
  }

  function tokenAt(uint i) public view returns (address) {
    return assetSet.at(i);
  } 

  function isToken(address token) public view returns (bool) {
    return assetSet.contains(token);
  }

  function currentDeltaOverLastBalance(address token) internal view returns (uint256) {
    return IERC20(token).balanceOf(address(this))-lastBalances[token];
  }

  function _sync(address token) internal {
    lastBalances[token] = IERC20(token).balanceOf(address(this));
  }

  function _syncAll() internal {
    uint i;
    uint n=assetSet.length();
    while(i < n) {
      _sync(tokenAt(i));
      i++;
    }
  }

  // transferAsset(), syncAndTransfer(), and unwrapAndForwardEth() are the three ways tokens leave the pool
  // Since they transfer assets, they are all marked as nonReentrant
  function transferAsset(address token, address recipient, uint256 amount) internal nonReentrant {
    IERC20(token).safeTransfer(recipient, amount);
    // We never want to transfer an asset without sync'ing
    _sync(token);
  }

  function syncAndTransfer(address inputToken, address outputToken, address recipient, uint256 amount) internal nonReentrant {
    _sync(inputToken);
    IERC20(outputToken).safeTransfer(recipient, amount);
    _sync(outputToken);
  }

  // Essentially transferAsset, but for raw ETH
  function unwrapAndForwardEth(address recipient, uint256 amount) internal nonReentrant {
    WrapperContractInterface(WRAPPER_CONTRACT).withdraw(amount);
    safeEthSend(recipient, amount);
    _sync(WRAPPER_CONTRACT);
  }

  /* DEPOSIT FUNCTIONALITY */
  function canUnlockDeposit(address theAddress) public view returns (bool) {
      Deposit storage myDeposit = vestingDeposits[theAddress];
      return (myDeposit.poolTokenAmount > 0) && (myDeposit.lockedUntil <= block.timestamp);
  }

  function unlockDeposit() external returns (uint256 poolTokens) {
    require(canUnlockDeposit(msg.sender), "ClipperDirect: Deposit cannot be unlocked");
    poolTokens = vestingDeposits[msg.sender].poolTokenAmount;
    delete vestingDeposits[msg.sender];

    _transfer(address(this), msg.sender, poolTokens);
  }

  // Mints tokens to this contract to hold for vesting
  function _createVestingDeposit(address theAddress, uint256 nDays, uint256 numPoolTokens) internal {
    require(nDays > 0, "ClipperDirect: Cannot create vesting deposit without positive vesting period");
    require(vestingDeposits[theAddress].poolTokenAmount==0, "ClipperDirect: Depositor already has an active deposit");

    Deposit memory myDeposit = Deposit({
      lockedUntil: block.timestamp + (nDays * 1 days),
      poolTokenAmount: numPoolTokens
    });
    vestingDeposits[theAddress] = myDeposit;
  
    _mint(address(this), numPoolTokens);
  }

  function transmitAndDeposit(uint256[] calldata depositAmounts, uint256 nDays, uint256 poolTokens, uint256 goodUntil, Signature calldata theSignature) external {
    uint i=0;
    uint n = depositAmounts.length;
    while(i < n){
      IERC20(tokenAt(i)).safeTransferFrom(msg.sender, address(this), depositAmounts[i]);
      i++;
    }
    deposit(msg.sender, depositAmounts, nDays, poolTokens, goodUntil, theSignature);
  }

  function deposit(address sender, uint256[] calldata depositAmounts, uint256 nDays, uint256 poolTokens, uint256 goodUntil, Signature calldata theSignature) public {
    // Make sure the depositor is allowed
    require(msg.sender==sender, "Listed sender does not match msg.sender");
    // Did we actually deposit what we said we would? Revert otherwise
    verifyDepositAmounts(depositAmounts);
    // Check the signature
    bytes32 depositDigest = createDepositDigest(sender, depositAmounts, nDays, poolTokens, goodUntil);
    // Revert if it's signed by the wrong address
    verifyDigestSignature(depositDigest, theSignature);
    // Revert if it's a replay, or if the timestamp is too late
    checkTimestampAndInvalidateDigest(depositDigest, goodUntil);
    // OK now we're good
    if(nDays==0){
      // No vesting period required - mint tokens directly for the user
      _mint(sender, poolTokens);
    } else {
      // Set up a vesting deposit for the sender
      _createVestingDeposit(sender, nDays, poolTokens);
    }
    _syncAll();
    emit Deposited(sender, poolTokens, nDays);
  }

  function verifyDepositAmounts(uint256[] calldata depositAmounts) internal view {
    uint i=0;
    uint n = depositAmounts.length;
    while(i < n){
      uint256 myDeposit = depositAmounts[i];
      if(myDeposit > 0){
        address token = tokenAt(i);
        uint256 delta = currentDeltaOverLastBalance(token);
        require(delta >= myDeposit, "Insufficient token deposit");
      }
      i++;
    }
  }


  /* WITHDRAWAL FUNCTIONALITY */
  function _proportionalWithdrawal(uint256 myFraction) internal {
    uint256 toTransfer;

    uint i;
    uint n = nTokens();
    while(i < n) {
        address theToken = tokenAt(i);
        toTransfer = (myFraction*lastBalances[theToken]) / ONE_IN_TEN_DECIMALS;
        // syncs done automatically on transfer
        transferAsset(theToken, msg.sender, toTransfer);
        i++;
    }
  }

  function burnToWithdraw(uint256 amount) external {
    // Capture the fraction first, before burning
    uint256 theFractionBaseTen = (ONE_IN_TEN_DECIMALS*amount)/totalSupply();
    
    // Reverts if balance is insufficient
    _burn(msg.sender, amount);

    _proportionalWithdrawal(theFractionBaseTen);
    emit Withdrawn(msg.sender, amount, theFractionBaseTen);
  }

  /* SWAP Functionality */

  // Don't need a separate "transmit" function here since it's already payable
  function sellEthForToken(address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress, Signature calldata theSignature, bytes calldata auxiliaryData) external payable {
    // Wrap ETH (as balance or value) as input
    safeEthSend(WRAPPER_CONTRACT, inputAmount);
    swap(WRAPPER_CONTRACT, outputToken, inputAmount, outputAmount, goodUntil, destinationAddress, theSignature, auxiliaryData);
  }

  // Mostly copied from swap functionality
  function sellTokenForEth(address inputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress, Signature calldata theSignature, bytes calldata auxiliaryData) public {
    verifyTokensAndInputAmount(inputToken, WRAPPER_CONTRACT, inputAmount);
    
    bytes32 digest = createSwapDigest(inputToken, WRAPPER_CONTRACT, inputAmount, outputAmount, goodUntil, destinationAddress);
    // Revert if it's signed by the wrong address
    verifyDigestSignature(digest, theSignature);
    // Revert if it's a replay, or if the timestamp is too late
    checkTimestampAndInvalidateDigest(digest, goodUntil);
    
    // We have to _sync the input token manually here
    _sync(inputToken);
    unwrapAndForwardEth(destinationAddress, outputAmount);

    emit Swapped(inputToken, WRAPPER_CONTRACT, destinationAddress, inputAmount, outputAmount, auxiliaryData);
  }

  function transmitAndSellTokenForEth(address inputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress, Signature calldata theSignature, bytes calldata auxiliaryData) external {
    IERC20(inputToken).safeTransferFrom(msg.sender, address(this), inputAmount);
    sellTokenForEth(inputToken, inputAmount, outputAmount, goodUntil, destinationAddress, theSignature, auxiliaryData);
  }

  // all-in-one transfer from msg.sender to destinationAddress.
  function transmitAndSwap(address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress, Signature calldata theSignature, bytes calldata auxiliaryData) public {
    IERC20(inputToken).safeTransferFrom(msg.sender, address(this), inputAmount);
    swap(inputToken, outputToken, inputAmount, outputAmount, goodUntil, destinationAddress, theSignature, auxiliaryData);
  }

  function swap(address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress, Signature calldata theSignature, bytes calldata auxiliaryData) public {
    // Revert if the tokens don't exist or haven't been transmitted
    verifyTokensAndInputAmount(inputToken, outputToken, inputAmount);
    
    bytes32 digest = createSwapDigest(inputToken, outputToken, inputAmount, outputAmount, goodUntil, destinationAddress);
    // Revert if it's signed by the wrong address
    verifyDigestSignature(digest, theSignature);
    // Revert if it's a replay, or if the timestamp is too late
    checkTimestampAndInvalidateDigest(digest, goodUntil);
    // OK, now we are safe to transfer
    syncAndTransfer(inputToken, outputToken, destinationAddress, outputAmount);
    emit Swapped(inputToken, outputToken, destinationAddress, inputAmount, outputAmount, auxiliaryData);
  }


  function verifyTokensAndInputAmount(address inputToken, address outputToken, uint256 inputAmount) internal view {
    require(isToken(inputToken) && isToken(outputToken), "Tokens not present in pool");
    uint256 delta = currentDeltaOverLastBalance(inputToken);
    require((inputAmount > 0) && (delta >= inputAmount), "Insufficient input token amount");
  }


  /* SIGNING Functionality */

  function createDomainSeparator(string memory name, string memory version, address theSigner) internal view returns (bytes32) {
    return keccak256(abi.encode(
        EIP712DOMAIN_TYPEHASH,
        keccak256(abi.encodePacked(name)),
        keccak256(abi.encodePacked(version)),
        uint256(block.chainid),
        theSigner
      ));
  }

  function hashInputOffer(address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress) internal pure returns (bytes32) {
    return keccak256(abi.encode(
            OFFERSTRUCT_TYPEHASH,
            inputToken,
            outputToken,
            inputAmount,
            outputAmount,
            goodUntil,
            destinationAddress
        ));
  }

  function hashDeposit(address sender, uint256[] calldata depositAmounts, uint256 daysLocked, uint256 poolTokens, uint256 goodUntil) internal pure returns (bytes32) {
    bytes32 depositAmountsHash = keccak256(abi.encodePacked(depositAmounts));
    return keccak256(abi.encode(
        DEPOSITSTRUCT_TYPEHASH,
        sender,
        depositAmountsHash,
        daysLocked,
        poolTokens,
        goodUntil
      ));
  }

  function createSwapDigest(address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, address destinationAddress) internal view returns (bytes32 digest){
    bytes32 hashedInput = hashInputOffer(inputToken, outputToken, inputAmount, outputAmount, goodUntil, destinationAddress);    
    digest = ECDSA.toTypedDataHash(DOMAIN_SEPARATOR, hashedInput);
  }

  function createDepositDigest(address sender, uint256[] calldata depositAmounts, uint256 nDays, uint256 poolTokens, uint256 goodUntil) internal view returns (bytes32 depositDigest){
    bytes32 hashedInput = hashDeposit(sender, depositAmounts, nDays, poolTokens, goodUntil);    
    depositDigest = ECDSA.toTypedDataHash(DOMAIN_SEPARATOR, hashedInput);
  }

  function verifyDigestSignature(bytes32 theDigest, Signature calldata theSignature) internal view {
    address signingAddress = ecrecover(theDigest, theSignature.v, theSignature.r, theSignature.s);

    require(signingAddress==DESIGNATED_SIGNER, "Message signed by incorrect address");
  }

  // Used to invalidate swap and deposit digests
  function checkTimestampAndInvalidateDigest(bytes32 theDigest, uint256 goodUntil) internal {
    require(!invalidatedDigests[theDigest], "Message digest already present");
    require(goodUntil >= block.timestamp, "Message received after allowed timestamp");
    invalidatedDigests[theDigest] = true;
  }

}

File 2 of 10 : 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 3 of 10 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 4 of 10 : 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 5 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

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

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

pragma solidity ^0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return recover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return recover(hash, r, vs);
        } else {
            revert("ECDSA: invalid signature length");
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`, `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(
            uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,
            "ECDSA: invalid signature 's' value"
        );
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 7 of 10 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 8 of 10 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 9 of 10 : 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 10 of 10 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"theSigner","type":"address"},{"internalType":"address","name":"theWrapper","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolTokens","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nDays","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"inAsset","type":"address"},{"indexed":true,"internalType":"address","name":"outAsset","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"inAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"outAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"Swapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolTokens","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fractionOfPool","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DESIGNATED_SIGNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPER_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnToWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"theAddress","type":"address"}],"name":"canUnlockDeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256[]","name":"depositAmounts","type":"uint256[]"},{"internalType":"uint256","name":"nDays","type":"uint256"},{"internalType":"uint256","name":"poolTokens","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"outputAmount","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"sellEthForToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"outputAmount","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"sellTokenForEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"outputAmount","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"tokenAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"depositAmounts","type":"uint256[]"},{"internalType":"uint256","name":"nDays","type":"uint256"},{"internalType":"uint256","name":"poolTokens","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"}],"name":"transmitAndDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"outputAmount","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"transmitAndSellTokenForEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"outputAmount","type":"uint256"},{"internalType":"uint256","name":"goodUntil","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ClipperDirectExchange.Signature","name":"theSignature","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"transmitAndSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockDeposit","outputs":[{"internalType":"uint256","name":"poolTokens","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vestingDeposits","outputs":[{"internalType":"uint256","name":"lockedUntil","type":"uint256"},{"internalType":"uint256","name":"poolTokenAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b5060405162002e7638038062002e76833981016040819052620000349162000405565b604080518082018252601881527f436c697070657244697265637420506f6f6c20546f6b656e000000000000000060208083019182528351808501909452600884526710d314149114941360c21b908401528151919291620000999160039162000342565b508051620000af90600490602084019062000342565b50506001600555506001600160601b0319606084901b1660805280516000905b8082101562000131576200011b838381518110620000fd57634e487b7160e01b600052603260045260246000fd5b60200260200101516007620001a360201b62000d811790919060201c565b508162000128816200057a565b925050620000cf565b620001866040518060400160405280600d81526020016c10db1a5c1c195c911a5c9958dd609a1b815250604051806040016040528060058152602001640312e302e360dc1b81525030620001c360201b60201c565b60c05250505060601b6001600160601b03191660a05250620005b8565b6000620001ba836001600160a01b038416620002f0565b90505b92915050565b60006040516020016200023a907f454950373132446f6d61696e28737472696e67206e616d652c737472696e672081527f76657273696f6e2c75696e7432353620636861696e49642c6164647265737320602082015271766572696679696e67436f6e74726163742960701b604082015260520190565b604051602081830303815290604052805190602001208460405160200162000263919062000501565b60405160208183030381529060405280519060200120846040516020016200028c919062000501565b60408051601f1981840301815282825280516020918201209083019490945281019190915260608101919091524660808201526001600160a01b03831660a082015260c0016040516020818303038152906040528051906020012090509392505050565b60008181526001830160205260408120546200033957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001bd565b506000620001bd565b82805462000350906200053d565b90600052602060002090601f016020900481019282620003745760008555620003bf565b82601f106200038f57805160ff1916838001178555620003bf565b82800160010185558215620003bf579182015b82811115620003bf578251825591602001919060010190620003a2565b50620003cd929150620003d1565b5090565b5b80821115620003cd5760008155600101620003d2565b80516001600160a01b03811681146200040057600080fd5b919050565b6000806000606084860312156200041a578283fd5b6200042584620003e8565b9250602062000436818601620003e8565b60408601519093506001600160401b038082111562000453578384fd5b818701915087601f83011262000467578384fd5b8151818111156200047c576200047c620005a2565b8060051b604051601f19603f83011681018181108582111715620004a457620004a4620005a2565b604052828152858101935084860182860187018c1015620004c3578788fd5b8795505b83861015620004f057620004db81620003e8565b855260019590950194938601938601620004c7565b508096505050505050509250925092565b60008251815b8181101562000523576020818601810151858301520162000507565b81811115620005325782828501525b509190910192915050565b600181811c908216806200055257607f821691505b602082108114156200057457634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156200059b57634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c60c0516128506200062660003960006112b60152600081816103ce015281816107600152818161078a01528181610a5901528181610a8601528181610ae3015281816117d30152611846015260008181610450015261137a01526128506000f3fe6080604052600436106101bb5760003560e01c80634cb6864c116100ec578063a457c2d71161008a578063c72da66a11610064578063c72da66a14610530578063dd62ed3e14610550578063eb1c645314610596578063ecc7633d146105b657600080fd5b8063a457c2d7146104a7578063a9059cbb146104c7578063c325a549146104e757600080fd5b806370a08231116100c657806370a08231146104085780638dda8f3f1461043e57806392a91a3a1461047257806395d89b411461049257600080fd5b80634cb6864c1461037c5780635250d7301461039c5780635aecdda5146103bc57600080fd5b806329d0c8fc11610159578063368dfc1811610133578063368dfc1814610307578063377a368c14610327578063395093511461033c5780633b26e4eb1461035c57600080fd5b806329d0c8fc146102ab5780632b651a6c146102cb578063313ce567146102eb57600080fd5b806319f373611161019557806319f37361146102415780631b6a87591461026157806323b872dd1461027657806327a9b4241461029657600080fd5b806306fdde03146101c7578063095ea7b3146101f257806318160ddd1461022257600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101dc6105e3565b6040516101e99190612673565b60405180910390f35b3480156101fe57600080fd5b5061021261020d366004612492565b610675565b60405190151581526020016101e9565b34801561022e57600080fd5b506002545b6040519081526020016101e9565b34801561024d57600080fd5b5061021261025c3660046122e4565b61068c565b34801561026d57600080fd5b50610233610699565b34801561028257600080fd5b50610212610291366004612330565b6106aa565b6102a96102a43660046124bb565b61075b565b005b3480156102b757600080fd5b506102a96102c636600461254e565b6107c0565b3480156102d757600080fd5b506102a96102e636600461236b565b610833565b3480156102f757600080fd5b50604051601281526020016101e9565b34801561031357600080fd5b506102a96103223660046125dc565b6108d7565b34801561033357600080fd5b5061023361094f565b34801561034857600080fd5b50610212610357366004612492565b6109e6565b34801561036857600080fd5b506102a961037736600461236b565b610a22565b34801561038857600080fd5b506102a96103973660046124bb565b610a53565b3480156103a857600080fd5b506102a96103b7366004612411565b610b5d565b3480156103c857600080fd5b506103f07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101e9565b34801561041457600080fd5b506102336104233660046122e4565b6001600160a01b031660009081526020819052604090205490565b34801561044a57600080fd5b506103f07f000000000000000000000000000000000000000000000000000000000000000081565b34801561047e57600080fd5b506103f061048d3660046125dc565b610c6a565b34801561049e57600080fd5b506101dc610c77565b3480156104b357600080fd5b506102126104c2366004612492565b610c86565b3480156104d357600080fd5b506102126104e2366004612492565b610d1f565b3480156104f357600080fd5b5061051b6105023660046122e4565b600a602052600090815260409020805460019091015482565b604080519283526020830191909152016101e9565b34801561053c57600080fd5b506102a961054b3660046124bb565b610d2c565b34801561055c57600080fd5b5061023361056b3660046122fe565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156105a257600080fd5b506102126105b13660046122e4565b610d51565b3480156105c257600080fd5b506102336105d13660046122e4565b60066020526000908152604090205481565b6060600380546105f2906127b4565b80601f016020809104026020016040519081016040528092919081815260200182805461061e906127b4565b801561066b5780601f106106405761010080835404028352916020019161066b565b820191906000526020600020905b81548152906001019060200180831161064e57829003601f168201915b5050505050905090565b6000610682338484610d96565b5060015b92915050565b6000610686600783610eba565b60006106a56007610edc565b905090565b60006106b7848484610ee6565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156107415760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61074e8533858403610d96565b60019150505b9392505050565b6107857f0000000000000000000000000000000000000000000000000000000000000000886110b6565b6107b67f00000000000000000000000000000000000000000000000000000000000000008989898989898989610833565b5050505050505050565b6000855b808210156108245761081233308a8a868181106107f157634e487b7160e01b600052603260045260246000fd5b9050602002013561080186610c6a565b6001600160a01b0316929190611157565b8161081c816127e9565b9250506107c4565b6107b633898989898989610b5d565b61083e8989896111c2565b600061084e8a8a8a8a8a8a611290565b905061085a8185611306565b6108648187611405565b6108708a8a878a6114e1565b846001600160a01b0316896001600160a01b03168b6001600160a01b03167f4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c88b8b88886040516108c394939291906126dd565b60405180910390a450505050505050505050565b60006108e260025490565b6108f1836402540be400612752565b6108fb9190612732565b9050610907338361153a565b61091081611688565b604080518381526020810183905233917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a25050565b600061095a33610d51565b6109b85760405162461bcd60e51b815260206004820152602960248201527f436c69707065724469726563743a204465706f7369742063616e6e6f74206265604482015268081d5b9b1bd8dad95960ba1b6064820152608401610738565b50336000818152600a602052604081206001810180549183905591909155906109e390309083610ee6565b90565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610682918590610a1d90869061271a565b610d96565b610a376001600160a01b038a1633308a611157565b610a48898989898989898989610833565b505050505050505050565b610a7e887f0000000000000000000000000000000000000000000000000000000000000000896111c2565b6000610aae897f00000000000000000000000000000000000000000000000000000000000000008a8a8a8a611290565b9050610aba8185611306565b610ac48187611405565b610acd89611702565b610ad78588611795565b846001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a6001600160a01b03167f4be05c8d54f5e056ab2cfa033e9f582057001268c3e28561bb999d35d2c8f2c88b8b8888604051610b4a94939291906126dd565b60405180910390a4505050505050505050565b336001600160a01b03881614610bc55760405162461bcd60e51b815260206004820152602760248201527f4c69737465642073656e64657220646f6573206e6f74206d61746368206d73676044820152661739b2b73232b960c91b6064820152608401610738565b610bcf8686611873565b6000610bdf888888888888611933565b9050610beb8183611306565b610bf58184611405565b84610c0957610c048885611944565b610c14565b610c14888686611a24565b610c1c611b98565b60408051858152602081018790526001600160a01b038a16917f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca910160405180910390a25050505050505050565b6000610686600783611bd3565b6060600480546105f2906127b4565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610d085760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610738565b610d153385858403610d96565b5060019392505050565b6000610682338484610ee6565b610d416001600160a01b03891633308a611157565b6107b68888888888888888610a53565b6001600160a01b0381166000908152600a6020526040812060018101541580159061075457505442101592915050565b6000610754836001600160a01b038416611bdf565b6001600160a01b038316610df85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610738565b6001600160a01b038216610e595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610738565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03811660009081526001830160205260408120541515610754565b6000610686825490565b6001600160a01b038316610f4a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610738565b6001600160a01b038216610fac5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610738565b6001600160a01b038316600090815260208190526040902054818110156110245760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610738565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061105b90849061271a565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110a791815260200190565b60405180910390a35b50505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611103576040519150601f19603f3d011682016040523d82523d6000602084013e611108565b606091505b50509050806111525760405162461bcd60e51b815260206004820152601660248201527510d85b1b081dda5d1a081d985b1d594819985a5b195960521b6044820152606401610738565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526110b09085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c2e565b6111cb8361068c565b80156111db57506111db8261068c565b6112275760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e73206e6f742070726573656e7420696e20706f6f6c0000000000006044820152606401610738565b600061123284611d00565b90506000821180156112445750818110155b6110b05760405162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e7420696e70757420746f6b656e20616d6f756e74006044820152606401610738565b6000806112a1888888888888611d93565b6040805161190160f01b6020808301919091527f00000000000000000000000000000000000000000000000000000000000000006022830152604280830194909452825180830390940184526062909101909152815191012098975050505050505050565b6000600183611318602085018561260c565b604080516000815260208181018084529490945260ff9092168282015291850135606082015290840135608082015260a0016020604051602081039080840390855afa15801561136c573d6000803e3d6000fd5b5050506020604051035190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316146111525760405162461bcd60e51b815260206004820152602360248201527f4d657373616765207369676e656420627920696e636f7272656374206164647260448201526265737360e81b6064820152608401610738565b60008281526009602052604090205460ff16156114645760405162461bcd60e51b815260206004820152601e60248201527f4d6573736167652064696765737420616c72656164792070726573656e7400006044820152606401610738565b428110156114c55760405162461bcd60e51b815260206004820152602860248201527f4d65737361676520726563656976656420616674657220616c6c6f77656420746044820152670696d657374616d760c41b6064820152608401610738565b506000908152600960205260409020805460ff19166001179055565b600260055414156115045760405162461bcd60e51b8152600401610738906126a6565b600260055561151284611702565b6115266001600160a01b0384168383611ec4565b61152f83611702565b505060016005555050565b6001600160a01b03821661159a5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610738565b6001600160a01b0382166000908152602081905260409020548181101561160e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610738565b6001600160a01b038316600090815260208190526040812083830390556002805484929061163d908490612771565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6000806000611695610699565b90505b808210156110b05760006116ab83610c6a565b6001600160a01b0381166000908152600660205260409020549091506402540be400906116d89087612752565b6116e29190612732565b93506116ef813386611ef4565b826116f9816127e9565b93505050611698565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a082319060240160206040518083038186803b15801561174157600080fd5b505afa158015611755573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177991906125f4565b6001600160a01b03909116600090815260066020526040902055565b600260055414156117b85760405162461bcd60e51b8152600401610738906126a6565b6002600555604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561181f57600080fd5b505af1158015611833573d6000803e3d6000fd5b5050505061184182826110b6565b61186a7f0000000000000000000000000000000000000000000000000000000000000000611702565b50506001600555565b6000815b808210156110b05760008484848181106118a157634e487b7160e01b600052603260045260246000fd5b90506020020135905060008111156119205760006118be84610c6a565b905060006118cb82611d00565b90508281101561191d5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e206465706f7369740000000000006044820152606401610738565b50505b8261192a816127e9565b93505050611877565b6000806112a1888888888888611f43565b6001600160a01b03821661199a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610738565b80600260008282546119ac919061271a565b90915550506001600160a01b038216600090815260208190526040812080548392906119d990849061271a565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b5050565b60008211611aaf5760405162461bcd60e51b815260206004820152604c60248201527f436c69707065724469726563743a2043616e6e6f74206372656174652076657360448201527f74696e67206465706f73697420776974686f757420706f73697469766520766560648201526b1cdd1a5b99c81c195c9a5bd960a21b608482015260a401610738565b6001600160a01b0383166000908152600a602052604090206001015415611b375760405162461bcd60e51b815260206004820152603660248201527f436c69707065724469726563743a204465706f7369746f7220616c7265616479604482015275081a185cc8185b881858dd1a5d994819195c1bdcda5d60521b6064820152608401610738565b600060405180604001604052808462015180611b539190612752565b611b5d904261271a565b815260209081018490526001600160a01b0386166000908152600a825260409020825181559082015160019091015590506110b03083611944565b600080611ba56007610edc565b90505b80821015611a2057611bc1611bbc83610c6a565b611702565b81611bcb816127e9565b925050611ba8565b60006107548383612077565b6000818152600183016020526040812054611c2657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610686565b506000610686565b6000611c83826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120af9092919063ffffffff16565b8051909150156111525780806020019051810190611ca191906125bc565b6111525760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610738565b6001600160a01b0381166000818152600660205260408082205490516370a0823160e01b8152306004820152919290916370a082319060240160206040518083038186803b158015611d5157600080fd5b505afa158015611d65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8991906125f4565b6106869190612771565b6000604051602001611e52907f4f66666572537472756374286164647265737320696e7075745f746f6b656e2c81527f61646472657373206f75747075745f746f6b656e2c75696e7432353620696e7060208201527f75745f616d6f756e742c75696e74323536206f75747075745f616d6f756e742c60408201527f75696e7432353620676f6f645f756e74696c2c6164647265737320646573746960608201526e6e6174696f6e5f616464726573732960881b6080820152608f0190565b60408051808303601f190181528282528051602091820120818401526001600160a01b03998a16838301529789166060830152608082019690965260a08101949094525060c083019190915290931660e080850191909152815180850390910181526101009093019052815191012090565b6040516001600160a01b03831660248201526044810182905261115290849063a9059cbb60e01b9060640161118b565b60026005541415611f175760405162461bcd60e51b8152600401610738906126a6565b6002600555611f306001600160a01b0384168383611ec4565b611f3983611702565b5050600160055550565b6000808686604051602001611f5992919061262d565b60405160208183030381529060405280519060200120905060405160200161200b907f4465706f73697453747275637428616464726573732073656e6465722c75696e81527f743235365b5d206465706f7369745f616d6f756e74732c75696e74323536206460208201527f6179735f6c6f636b65642c75696e7432353620706f6f6c5f746f6b656e732c75604082015271696e7432353620676f6f645f756e74696c2960701b606082015260720190565b60408051601f198184030181528282528051602091820120908301526001600160a01b038a1690820152606081018290526080810186905260a0810185905260c0810184905260e001604051602081830303815290604052805190602001209150509695505050505050565b600082600001828154811061209c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b60606120be84846000856120c6565b949350505050565b6060824710156121275760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610738565b843b6121755760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610738565b600080866001600160a01b031685876040516121919190612657565b60006040518083038185875af1925050503d80600081146121ce576040519150601f19603f3d011682016040523d82523d6000602084013e6121d3565b606091505b50915091506121e38282866121ee565b979650505050505050565b606083156121fd575081610754565b82511561220d5782518084602001fd5b8160405162461bcd60e51b81526004016107389190612673565b80356001600160a01b038116811461223e57600080fd5b919050565b60008083601f840112612254578182fd5b50813567ffffffffffffffff81111561226b578182fd5b6020830191508360208260051b850101111561228657600080fd5b9250929050565b60008083601f84011261229e578182fd5b50813567ffffffffffffffff8111156122b5578182fd5b60208301915083602082850101111561228657600080fd5b6000606082840312156122de578081fd5b50919050565b6000602082840312156122f5578081fd5b61075482612227565b60008060408385031215612310578081fd5b61231983612227565b915061232760208401612227565b90509250929050565b600080600060608486031215612344578081fd5b61234d84612227565b925061235b60208501612227565b9150604084013590509250925092565b60008060008060008060008060006101408a8c031215612389578485fd5b6123928a612227565b98506123a060208b01612227565b975060408a0135965060608a0135955060808a013594506123c360a08b01612227565b93506123d28b60c08c016122cd565b92506101208a013567ffffffffffffffff8111156123ee578283fd5b6123fa8c828d0161228d565b915080935050809150509295985092959850929598565b6000806000806000806000610100888a03121561242c578283fd5b61243588612227565b9650602088013567ffffffffffffffff811115612450578384fd5b61245c8a828b01612243565b9097509550506040880135935060608801359250608088013591506124848960a08a016122cd565b905092959891949750929550565b600080604083850312156124a4578182fd5b6124ad83612227565b946020939093013593505050565b600080600080600080600080610120898b0312156124d7578384fd5b6124e089612227565b975060208901359650604089013595506060890135945061250360808a01612227565b93506125128a60a08b016122cd565b925061010089013567ffffffffffffffff81111561252e578283fd5b61253a8b828c0161228d565b999c989b5096995094979396929594505050565b60008060008060008060e08789031215612566578182fd5b863567ffffffffffffffff81111561257c578283fd5b61258889828a01612243565b9097509550506020870135935060408701359250606087013591506125b088608089016122cd565b90509295509295509295565b6000602082840312156125cd578081fd5b81518015158114610754578182fd5b6000602082840312156125ed578081fd5b5035919050565b600060208284031215612605578081fd5b5051919050565b60006020828403121561261d578081fd5b813560ff81168114610754578182fd5b60006001600160fb1b03831115612642578081fd5b8260051b808584379190910190815292915050565b60008251612669818460208701612788565b9190910192915050565b6020815260008251806020840152612692816040850160208701612788565b601f01601f19169190910160400192915050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b6000821982111561272d5761272d612804565b500190565b60008261274d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561276c5761276c612804565b500290565b60008282101561278357612783612804565b500390565b60005b838110156127a357818101518382015260200161278b565b838111156110b05750506000910152565b600181811c908216806127c857607f821691505b602082108114156122de57634e487b7160e01b600052602260045260246000fd5b60006000198214156127fd576127fd612804565b5060010190565b634e487b7160e01b600052601160045260246000fdfea26469706673582212201ad29673a02b3ef085c5e8aebcba8b456baac40684ee51943c9196b418893a8864736f6c6343000804003300000000000000000000000008938a61ba9523298dbcacee0cda5b371fb7f1f80000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000070000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000008f3cf7ad23cd3cadbd9735aff958023239c6a0630000000000000000000000001bfd67037b42cf73acf2047067bd4f2c47d9bfd6000000000000000000000000482bc619ee7662759cdc0685b4e78f464da39c73

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000008938a61ba9523298dbcacee0cda5b371fb7f1f80000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000070000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000008f3cf7ad23cd3cadbd9735aff958023239c6a0630000000000000000000000001bfd67037b42cf73acf2047067bd4f2c47d9bfd6000000000000000000000000482bc619ee7662759cdc0685b4e78f464da39c73

-----Decoded View---------------
Arg [0] : theSigner (address): 0x08938a61ba9523298dbcacee0cda5b371fb7f1f8
Arg [1] : theWrapper (address): 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [2] : tokens (address[]): 0x2791bca1f2de4661ed88a30c99a7a9449aa84174,0x7ceb23fd6bc0add59e62ac25578270cff1b9f619,0xc2132d05d31c914a87c6611c10748aeb04b58e8f,0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270,0x8f3cf7ad23cd3cadbd9735aff958023239c6a063,0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6,0x482bc619ee7662759cdc0685b4e78f464da39c73

-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000008938a61ba9523298dbcacee0cda5b371fb7f1f8
Arg [1] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [4] : 0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Arg [5] : 0000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619
Arg [6] : 000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f
Arg [7] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [8] : 0000000000000000000000008f3cf7ad23cd3cadbd9735aff958023239c6a063
Arg [9] : 0000000000000000000000001bfd67037b42cf73acf2047067bd4f2c47d9bfd6
Arg [10] : 000000000000000000000000482bc619ee7662759cdc0685b4e78f464da39c73


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.