ETH Price: $3,442.97 (-1.00%)
Gas: 3 Gwei

Contract

0x072073f78a2d58610Ee3d5e170CA7AC9CB58a345
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Create Delegate132257632021-09-14 19:36:571021 days ago1631648217IN
AirSwap: Delegate
0 ETH0.1876885489
Create Delegate128182772021-07-13 10:29:351084 days ago1626172175IN
AirSwap: Delegate
0 ETH0.0407009919.3
Create Delegate126330502021-06-14 14:15:411113 days ago1623680141IN
AirSwap: Delegate
0 ETH0.0590480828
Create Delegate126304632021-06-14 4:38:011114 days ago1623645481IN
AirSwap: Delegate
0 ETH0.004639492.2
Create Delegate126267282021-06-13 14:43:531114 days ago1623595433IN
AirSwap: Delegate
0 ETH0.021088610
Create Delegate126241772021-06-13 5:09:321115 days ago1623560972IN
AirSwap: Delegate
0 ETH0.021088610
Create Delegate125866622021-06-07 9:43:421120 days ago1623059022IN
AirSwap: Delegate
0 ETH0.0305784714.5
Create Delegate125848872021-06-07 2:56:411121 days ago1623034601IN
AirSwap: Delegate
0 ETH0.0210884810
Create Delegate125846032021-06-07 1:50:551121 days ago1623030655IN
AirSwap: Delegate
0 ETH0.0278367913.2
Create Delegate124508562021-05-17 8:36:161142 days ago1621240576IN
AirSwap: Delegate
0 ETH0.1096607252
Create Delegate123704252021-05-04 22:16:461154 days ago1620166606IN
AirSwap: Delegate
0 ETH0.1075518651
Create Delegate121130862021-03-26 6:44:081194 days ago1616741048IN
AirSwap: Delegate
0 ETH0.1961686193.5
Create Delegate120441852021-03-15 16:19:551204 days ago1615825195IN
AirSwap: Delegate
0 ETH0.51612276246
Create Delegate119705282021-03-04 7:45:461216 days ago1614843946IN
AirSwap: Delegate
0 ETH0.1657467479
Create Delegate119584752021-03-02 11:10:541217 days ago1614683454IN
AirSwap: Delegate
0 ETH0.1867273489
Create Delegate119502012021-03-01 4:32:141219 days ago1614573134IN
AirSwap: Delegate
0 ETH0.1720409282
Create Delegate119426552021-02-28 0:36:421220 days ago1614472602IN
AirSwap: Delegate
0 ETH0.21190406101
Create Delegate118828212021-02-18 19:53:561229 days ago1613678036IN
AirSwap: Delegate
0 ETH0.33988572162
Create Delegate118782512021-02-18 2:55:501230 days ago1613616950IN
AirSwap: Delegate
0 ETH0.004246193
Create Delegate118778762021-02-18 1:30:571230 days ago1613611857IN
AirSwap: Delegate
0 ETH0.0055250
Create Delegate118748172021-02-17 14:11:511230 days ago1613571111IN
AirSwap: Delegate
0 ETH0.27904198133
Create Delegate118665842021-02-16 7:54:371232 days ago1613462077IN
AirSwap: Delegate
0 ETH0.25596332122
Create Delegate117799592021-02-03 0:09:511245 days ago1612310991IN
AirSwap: Delegate
0 ETH0.28743422137
Create Delegate117051722021-01-22 12:01:501256 days ago1611316910IN
AirSwap: Delegate
0 ETH0.1636486878
Create Delegate117036832021-01-22 6:23:531257 days ago1611296633IN
AirSwap: Delegate
0 ETH0.1594516476
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
132257632021-09-14 19:36:571021 days ago1631648217
AirSwap: Delegate
 Contract Creation0 ETH
128182772021-07-13 10:29:351084 days ago1626172175
AirSwap: Delegate
 Contract Creation0 ETH
126330502021-06-14 14:15:411113 days ago1623680141
AirSwap: Delegate
 Contract Creation0 ETH
126304632021-06-14 4:38:011114 days ago1623645481
AirSwap: Delegate
 Contract Creation0 ETH
126267282021-06-13 14:43:531114 days ago1623595433
AirSwap: Delegate
 Contract Creation0 ETH
126241772021-06-13 5:09:321115 days ago1623560972
AirSwap: Delegate
 Contract Creation0 ETH
125866622021-06-07 9:43:421120 days ago1623059022
AirSwap: Delegate
 Contract Creation0 ETH
125848872021-06-07 2:56:411121 days ago1623034601
AirSwap: Delegate
 Contract Creation0 ETH
125846032021-06-07 1:50:551121 days ago1623030655
AirSwap: Delegate
 Contract Creation0 ETH
124508562021-05-17 8:36:161142 days ago1621240576
AirSwap: Delegate
 Contract Creation0 ETH
123704252021-05-04 22:16:461154 days ago1620166606
AirSwap: Delegate
 Contract Creation0 ETH
121130862021-03-26 6:44:081194 days ago1616741048
AirSwap: Delegate
 Contract Creation0 ETH
120441852021-03-15 16:19:551204 days ago1615825195
AirSwap: Delegate
 Contract Creation0 ETH
119705282021-03-04 7:45:461216 days ago1614843946
AirSwap: Delegate
 Contract Creation0 ETH
119584752021-03-02 11:10:541217 days ago1614683454
AirSwap: Delegate
 Contract Creation0 ETH
119502012021-03-01 4:32:141219 days ago1614573134
AirSwap: Delegate
 Contract Creation0 ETH
119426552021-02-28 0:36:421220 days ago1614472602
AirSwap: Delegate
 Contract Creation0 ETH
118828212021-02-18 19:53:561229 days ago1613678036
AirSwap: Delegate
 Contract Creation0 ETH
118748172021-02-17 14:11:511230 days ago1613571111
AirSwap: Delegate
 Contract Creation0 ETH
118665842021-02-16 7:54:371232 days ago1613462077
AirSwap: Delegate
 Contract Creation0 ETH
117799592021-02-03 0:09:511245 days ago1612310991
AirSwap: Delegate
 Contract Creation0 ETH
117051722021-01-22 12:01:501256 days ago1611316910
AirSwap: Delegate
 Contract Creation0 ETH
117036832021-01-22 6:23:531257 days ago1611296633
AirSwap: Delegate
 Contract Creation0 ETH
116944812021-01-20 20:18:241258 days ago1611173904
AirSwap: Delegate
 Contract Creation0 ETH
116666632021-01-16 14:05:511262 days ago1610805951
AirSwap: Delegate
 Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DelegateFactory

Compiler Version
v0.5.12+commit.7709ece9

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-01-30
*/

pragma solidity 0.5.12;
pragma experimental ABIEncoderV2;
// File: @airswap/types/contracts/Types.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
/**
  * @title Types: Library of Swap Protocol Types and Hashes
  */
library Types {
  bytes constant internal EIP191_HEADER = "\x19\x01";
  struct Order {
    uint256 nonce;                // Unique per order and should be sequential
    uint256 expiry;               // Expiry in seconds since 1 January 1970
    Party signer;                 // Party to the trade that sets terms
    Party sender;                 // Party to the trade that accepts terms
    Party affiliate;              // Party compensated for facilitating (optional)
    Signature signature;          // Signature of the order
  }
  struct Party {
    bytes4 kind;                  // Interface ID of the token
    address wallet;               // Wallet address of the party
    address token;                // Contract address of the token
    uint256 amount;               // Amount for ERC-20 or ERC-1155
    uint256 id;                   // ID for ERC-721 or ERC-1155
  }
  struct Signature {
    address signatory;            // Address of the wallet used to sign
    address validator;            // Address of the intended swap contract
    bytes1 version;               // EIP-191 signature version
    uint8 v;                      // `v` value of an ECDSA signature
    bytes32 r;                    // `r` value of an ECDSA signature
    bytes32 s;                    // `s` value of an ECDSA signature
  }
  bytes32 constant internal DOMAIN_TYPEHASH = keccak256(abi.encodePacked(
    "EIP712Domain(",
    "string name,",
    "string version,",
    "address verifyingContract",
    ")"
  ));
  bytes32 constant internal ORDER_TYPEHASH = keccak256(abi.encodePacked(
    "Order(",
    "uint256 nonce,",
    "uint256 expiry,",
    "Party signer,",
    "Party sender,",
    "Party affiliate",
    ")",
    "Party(",
    "bytes4 kind,",
    "address wallet,",
    "address token,",
    "uint256 amount,",
    "uint256 id",
    ")"
  ));
  bytes32 constant internal PARTY_TYPEHASH = keccak256(abi.encodePacked(
    "Party(",
    "bytes4 kind,",
    "address wallet,",
    "address token,",
    "uint256 amount,",
    "uint256 id",
    ")"
  ));
  /**
    * @notice Hash an order into bytes32
    * @dev EIP-191 header and domain separator included
    * @param order Order The order to be hashed
    * @param domainSeparator bytes32
    * @return bytes32 A keccak256 abi.encodePacked value
    */
  function hashOrder(
    Order calldata order,
    bytes32 domainSeparator
  ) external pure returns (bytes32) {
    return keccak256(abi.encodePacked(
      EIP191_HEADER,
      domainSeparator,
      keccak256(abi.encode(
        ORDER_TYPEHASH,
        order.nonce,
        order.expiry,
        keccak256(abi.encode(
          PARTY_TYPEHASH,
          order.signer.kind,
          order.signer.wallet,
          order.signer.token,
          order.signer.amount,
          order.signer.id
        )),
        keccak256(abi.encode(
          PARTY_TYPEHASH,
          order.sender.kind,
          order.sender.wallet,
          order.sender.token,
          order.sender.amount,
          order.sender.id
        )),
        keccak256(abi.encode(
          PARTY_TYPEHASH,
          order.affiliate.kind,
          order.affiliate.wallet,
          order.affiliate.token,
          order.affiliate.amount,
          order.affiliate.id
        ))
      ))
    ));
  }
  /**
    * @notice Hash domain parameters into bytes32
    * @dev Used for signature validation (EIP-712)
    * @param name bytes
    * @param version bytes
    * @param verifyingContract address
    * @return bytes32 returns a keccak256 abi.encodePacked value
    */
  function hashDomain(
    bytes calldata name,
    bytes calldata version,
    address verifyingContract
  ) external pure returns (bytes32) {
    return keccak256(abi.encode(
      DOMAIN_TYPEHASH,
      keccak256(name),
      keccak256(version),
      verifyingContract
    ));
  }
}
// File: @airswap/delegate/contracts/interfaces/IDelegate.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
interface IDelegate {
  struct Rule {
    uint256 maxSenderAmount;      // The maximum amount of ERC-20 token the delegate would send
    uint256 priceCoef;            // Number to be multiplied by 10^(-priceExp) - the price coefficient
    uint256 priceExp;             // Indicates location of the decimal priceCoef * 10^(-priceExp)
  }
  event SetRule(
    address indexed owner,
    address indexed senderToken,
    address indexed signerToken,
    uint256 maxSenderAmount,
    uint256 priceCoef,
    uint256 priceExp
  );
  event UnsetRule(
    address indexed owner,
    address indexed senderToken,
    address indexed signerToken
  );
  event ProvideOrder(
    address indexed owner,
    address tradeWallet,
    address indexed senderToken,
    address indexed signerToken,
    uint256 senderAmount,
    uint256 priceCoef,
    uint256 priceExp
  );
  function setRule(
    address senderToken,
    address signerToken,
    uint256 maxSenderAmount,
    uint256 priceCoef,
    uint256 priceExp
  ) external;
  function unsetRule(
    address senderToken,
    address signerToken
  ) external;
  function provideOrder(
    Types.Order calldata order
  ) external;
  function rules(address, address) external view returns (Rule memory);
  function getSignerSideQuote(
    uint256 senderAmount,
    address senderToken,
    address signerToken
  ) external view returns (
    uint256 signerAmount
  );
  function getSenderSideQuote(
    uint256 signerAmount,
    address signerToken,
    address senderToken
  ) external view returns (
    uint256 senderAmount
  );
  function getMaxQuote(
    address senderToken,
    address signerToken
  ) external view returns (
    uint256 senderAmount,
    uint256 signerAmount
  );
  function owner()
    external view returns (address);
  function tradeWallet()
    external view returns (address);
}
// File: @airswap/indexer/contracts/interfaces/IIndexer.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
interface IIndexer {
  event CreateIndex(
    address indexed signerToken,
    address indexed senderToken,
    bytes2 protocol,
    address indexAddress
  );
  event Stake(
    address indexed staker,
    address indexed signerToken,
    address indexed senderToken,
    bytes2 protocol,
    uint256 stakeAmount
  );
  event Unstake(
    address indexed staker,
    address indexed signerToken,
    address indexed senderToken,
    bytes2 protocol,
    uint256 stakeAmount
  );
  event AddTokenToBlacklist(
    address token
  );
  event RemoveTokenFromBlacklist(
    address token
  );
  function setLocatorWhitelist(
    bytes2 protocol,
    address newLocatorWhitelist
  ) external;
  function createIndex(
    address signerToken,
    address senderToken,
    bytes2 protocol
  ) external returns (address);
  function addTokenToBlacklist(
    address token
  ) external;
  function removeTokenFromBlacklist(
    address token
  ) external;
  function setIntent(
    address signerToken,
    address senderToken,
    bytes2 protocol,
    uint256 stakingAmount,
    bytes32 locator
  ) external;
  function unsetIntent(
    address signerToken,
    address senderToken,
    bytes2 protocol
  ) external;
  function stakingToken() external view returns (address);
  function indexes(address, address, bytes2) external view returns (address);
  function tokenBlacklist(address) external view returns (bool);
  function getStakedAmount(
    address user,
    address signerToken,
    address senderToken,
    bytes2 protocol
  ) external view returns (uint256);
  function getLocators(
    address signerToken,
    address senderToken,
    bytes2 protocol,
    address cursor,
    uint256 limit
  ) external view returns (
    bytes32[] memory,
    uint256[] memory,
    address
  );
}
// File: @airswap/transfers/contracts/interfaces/ITransferHandler.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
/**
  * @title ITransferHandler: interface for token transfers
  */
interface ITransferHandler {
 /**
  * @notice Function to wrap token transfer for different token types
  * @param from address Wallet address to transfer from
  * @param to address Wallet address to transfer to
  * @param amount uint256 Amount for ERC-20
  * @param id token ID for ERC-721
  * @param token address Contract address of token
  * @return bool on success of the token transfer
  */
  function transferTokens(
    address from,
    address to,
    uint256 amount,
    uint256 id,
    address token
  ) external returns (bool);
}
// File: openzeppelin-solidity/contracts/GSN/Context.sol
/*
 * @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 GSN 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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks
    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }
    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        _owner = _msgSender();
        emit OwnershipTransferred(address(0), _owner);
    }
    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }
    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }
    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }
    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }
    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }
    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}
// File: @airswap/transfers/contracts/TransferHandlerRegistry.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
/**
  * @title TransferHandlerRegistry: holds registry of contract to
  * facilitate token transfers
  */
contract TransferHandlerRegistry is Ownable {
  event AddTransferHandler(
    bytes4 kind,
    address contractAddress
  );
  // Mapping of bytes4 to contract interface type
  mapping (bytes4 => ITransferHandler) public transferHandlers;
  /**
  * @notice Adds handler to mapping
  * @param kind bytes4 Key value that defines a token type
  * @param transferHandler ITransferHandler
  */
  function addTransferHandler(bytes4 kind, ITransferHandler transferHandler)
    external onlyOwner {
      require(address(transferHandlers[kind]) == address(0), "HANDLER_EXISTS_FOR_KIND");
      transferHandlers[kind] = transferHandler;
      emit AddTransferHandler(kind, address(transferHandler));
    }
}
// File: @airswap/swap/contracts/interfaces/ISwap.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
interface ISwap {
  event Swap(
    uint256 indexed nonce,
    uint256 timestamp,
    address indexed signerWallet,
    uint256 signerAmount,
    uint256 signerId,
    address signerToken,
    address indexed senderWallet,
    uint256 senderAmount,
    uint256 senderId,
    address senderToken,
    address affiliateWallet,
    uint256 affiliateAmount,
    uint256 affiliateId,
    address affiliateToken
  );
  event Cancel(
    uint256 indexed nonce,
    address indexed signerWallet
  );
  event CancelUpTo(
    uint256 indexed nonce,
    address indexed signerWallet
  );
  event AuthorizeSender(
    address indexed authorizerAddress,
    address indexed authorizedSender
  );
  event AuthorizeSigner(
    address indexed authorizerAddress,
    address indexed authorizedSigner
  );
  event RevokeSender(
    address indexed authorizerAddress,
    address indexed revokedSender
  );
  event RevokeSigner(
    address indexed authorizerAddress,
    address indexed revokedSigner
  );
  /**
    * @notice Atomic Token Swap
    * @param order Types.Order
    */
  function swap(
    Types.Order calldata order
  ) external;
  /**
    * @notice Cancel one or more open orders by nonce
    * @param nonces uint256[]
    */
  function cancel(
    uint256[] calldata nonces
  ) external;
  /**
    * @notice Cancels all orders below a nonce value
    * @dev These orders can be made active by reducing the minimum nonce
    * @param minimumNonce uint256
    */
  function cancelUpTo(
    uint256 minimumNonce
  ) external;
  /**
    * @notice Authorize a delegated sender
    * @param authorizedSender address
    */
  function authorizeSender(
    address authorizedSender
  ) external;
  /**
    * @notice Authorize a delegated signer
    * @param authorizedSigner address
    */
  function authorizeSigner(
    address authorizedSigner
  ) external;
  /**
    * @notice Revoke an authorization
    * @param authorizedSender address
    */
  function revokeSender(
    address authorizedSender
  ) external;
  /**
    * @notice Revoke an authorization
    * @param authorizedSigner address
    */
  function revokeSigner(
    address authorizedSigner
  ) external;
  function senderAuthorizations(address, address) external view returns (bool);
  function signerAuthorizations(address, address) external view returns (bool);
  function signerNonceStatus(address, uint256) external view returns (byte);
  function signerMinimumNonce(address) external view returns (uint256);
  function registry() external view returns (TransferHandlerRegistry);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }
    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }
    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;
        return c;
    }
    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }
    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }
    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }
    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }
    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
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: contracts/Delegate.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
/**
  * @title Delegate: Deployable Trading Rules for the AirSwap Network
  * @notice Supports fungible tokens (ERC-20)
  * @dev inherits IDelegate, Ownable uses SafeMath library
  */
contract Delegate is IDelegate, Ownable {
  using SafeMath for uint256;
  // The Swap contract to be used to settle trades
  ISwap public swapContract;
  // The Indexer to stake intent to trade on
  IIndexer public indexer;
  // Maximum integer for token transfer approval
  uint256 constant internal MAX_INT =  2**256 - 1;
  // Address holding tokens that will be trading through this delegate
  address public tradeWallet;
  // Mapping of senderToken to signerToken for rule lookup
  mapping (address => mapping (address => Rule)) public rules;
  // ERC-20 (fungible token) interface identifier (ERC-165)
  bytes4 constant internal ERC20_INTERFACE_ID = 0x36372b07;
  // The protocol identifier for setting intents on an Index
  bytes2 public protocol;
  /**
    * @notice Contract Constructor
    * @dev owner defaults to msg.sender if delegateContractOwner is provided as address(0)
    * @param delegateSwap address Swap contract the delegate will deploy with
    * @param delegateIndexer address Indexer contract the delegate will deploy with
    * @param delegateContractOwner address Owner of the delegate
    * @param delegateTradeWallet address Wallet the delegate will trade from
    * @param delegateProtocol bytes2 The protocol identifier for Delegate contracts
    */
  constructor(
    ISwap delegateSwap,
    IIndexer delegateIndexer,
    address delegateContractOwner,
    address delegateTradeWallet,
    bytes2 delegateProtocol
  ) public {
    swapContract = delegateSwap;
    indexer = delegateIndexer;
    protocol = delegateProtocol;
    // If no delegate owner is provided, the deploying address is the owner.
    if (delegateContractOwner != address(0)) {
      transferOwnership(delegateContractOwner);
    }
    // If no trade wallet is provided, the owner's wallet is the trade wallet.
    if (delegateTradeWallet != address(0)) {
      tradeWallet = delegateTradeWallet;
    } else {
      tradeWallet = owner();
    }
    // Ensure that the indexer can pull funds from delegate account.
    require(
      IERC20(indexer.stakingToken())
      .approve(address(indexer), MAX_INT), "STAKING_APPROVAL_FAILED"
    );
  }
  /**
    * @notice Set a Trading Rule
    * @dev only callable by the owner of the contract
    * @dev 1 senderToken = priceCoef * 10^(-priceExp) * signerToken
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    * @param maxSenderAmount uint256 Maximum amount of ERC-20 token the delegate would send
    * @param priceCoef uint256 Whole number that will be multiplied by 10^(-priceExp) - the price coefficient
    * @param priceExp uint256 Exponent of the price to indicate location of the decimal priceCoef * 10^(-priceExp)
    */
  function setRule(
    address senderToken,
    address signerToken,
    uint256 maxSenderAmount,
    uint256 priceCoef,
    uint256 priceExp
  ) external onlyOwner {
    _setRule(
      senderToken,
      signerToken,
      maxSenderAmount,
      priceCoef,
      priceExp
    );
  }
  /**
    * @notice Unset a Trading Rule
    * @dev only callable by the owner of the contract, removes from a mapping
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    */
  function unsetRule(
    address senderToken,
    address signerToken
  ) external onlyOwner {
    _unsetRule(
      senderToken,
      signerToken
    );
  }
  /**
    * @notice sets a rule on the delegate and an intent on the indexer
    * @dev only callable by owner
    * @dev delegate needs to be given allowance from msg.sender for the newStakeAmount
    * @dev swap needs to be given permission to move funds from the delegate
    * @param senderToken address Token the delgeate will send
    * @param signerToken address Token the delegate will receive
    * @param rule Rule Rule to set on a delegate
    * @param newStakeAmount uint256 Amount to stake for an intent
    */
  function setRuleAndIntent(
    address senderToken,
    address signerToken,
    Rule calldata rule,
    uint256 newStakeAmount
  ) external onlyOwner {
    _setRule(
      senderToken,
      signerToken,
      rule.maxSenderAmount,
      rule.priceCoef,
      rule.priceExp
    );
    // get currentAmount staked or 0 if never staked
    uint256 oldStakeAmount = indexer.getStakedAmount(address(this), signerToken, senderToken, protocol);
    if (oldStakeAmount == newStakeAmount && oldStakeAmount > 0) {
      return; // forgo trying to reset intent with non-zero same stake amount
    } else if (oldStakeAmount < newStakeAmount) {
      // transfer only the difference from the sender to the Delegate.
      require(
        IERC20(indexer.stakingToken())
        .transferFrom(msg.sender, address(this), newStakeAmount - oldStakeAmount), "STAKING_TRANSFER_FAILED"
      );
    }
    indexer.setIntent(
      signerToken,
      senderToken,
      protocol,
      newStakeAmount,
      bytes32(uint256(address(this)) << 96) //NOTE: this will pad 0's to the right
    );
    if (oldStakeAmount > newStakeAmount) {
      // return excess stake back
      require(
        IERC20(indexer.stakingToken())
        .transfer(msg.sender, oldStakeAmount - newStakeAmount), "STAKING_RETURN_FAILED"
      );
    }
  }
  /**
    * @notice unsets a rule on the delegate and removes an intent on the indexer
    * @dev only callable by owner
    * @param senderToken address Maker token in the token pair for rules and intents
    * @param signerToken address Taker token  in the token pair for rules and intents
    */
  function unsetRuleAndIntent(
    address senderToken,
    address signerToken
  ) external onlyOwner {
    _unsetRule(senderToken, signerToken);
    // Query the indexer for the amount staked.
    uint256 stakedAmount = indexer.getStakedAmount(address(this), signerToken, senderToken, protocol);
    indexer.unsetIntent(signerToken, senderToken, protocol);
    // Upon unstaking, the Delegate will be given the staking amount.
    // This is returned to the msg.sender.
    if (stakedAmount > 0) {
      require(
        IERC20(indexer.stakingToken())
          .transfer(msg.sender, stakedAmount),"STAKING_RETURN_FAILED"
      );
    }
  }
  /**
    * @notice Provide an Order
    * @dev Rules get reset with new maxSenderAmount
    * @param order Types.Order Order a user wants to submit to Swap.
    */
  function provideOrder(
    Types.Order calldata order
  ) external {
    Rule memory rule = rules[order.sender.token][order.signer.token];
    require(order.signature.v != 0,
      "SIGNATURE_MUST_BE_SENT");
    // Ensure the order is for the trade wallet.
    require(order.sender.wallet == tradeWallet,
      "SENDER_WALLET_INVALID");
    // Ensure the tokens are valid ERC20 tokens.
    require(order.signer.kind == ERC20_INTERFACE_ID,
      "SIGNER_KIND_MUST_BE_ERC20");
    require(order.sender.kind == ERC20_INTERFACE_ID,
      "SENDER_KIND_MUST_BE_ERC20");
    // Ensure that a rule exists.
    require(rule.maxSenderAmount != 0,
      "TOKEN_PAIR_INACTIVE");
    // Ensure the order does not exceed the maximum amount.
    require(order.sender.amount <= rule.maxSenderAmount,
      "AMOUNT_EXCEEDS_MAX");
    // Ensure the order is priced according to the rule.
    require(order.sender.amount <= _calculateSenderAmount(order.signer.amount, rule.priceCoef, rule.priceExp),
      "PRICE_INVALID");
    // Overwrite the rule with a decremented maxSenderAmount.
    rules[order.sender.token][order.signer.token] = Rule({
      maxSenderAmount: (rule.maxSenderAmount).sub(order.sender.amount),
      priceCoef: rule.priceCoef,
      priceExp: rule.priceExp
    });
    // Perform the swap.
    swapContract.swap(order);
    emit ProvideOrder(
      owner(),
      tradeWallet,
      order.sender.token,
      order.signer.token,
      order.sender.amount,
      rule.priceCoef,
      rule.priceExp
    );
  }
  /**
    * @notice Set a new trade wallet
    * @param newTradeWallet address Address of the new trade wallet
    */
  function setTradeWallet(address newTradeWallet) external onlyOwner {
    require(newTradeWallet != address(0), "TRADE_WALLET_REQUIRED");
    tradeWallet = newTradeWallet;
  }
  /**
    * @notice Get a Signer-Side Quote from the Delegate
    * @param senderAmount uint256 Amount of ERC-20 token the delegate would send
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    * @return uint256 signerAmount Amount of ERC-20 token the consumer would send
    */
  function getSignerSideQuote(
    uint256 senderAmount,
    address senderToken,
    address signerToken
  ) external view returns (
    uint256 signerAmount
  ) {
    Rule memory rule = rules[senderToken][signerToken];
    // Ensure that a rule exists.
    if(rule.maxSenderAmount > 0) {
      // Ensure the senderAmount does not exceed maximum for the rule.
      if(senderAmount <= rule.maxSenderAmount) {
        signerAmount = _calculateSignerAmount(senderAmount, rule.priceCoef, rule.priceExp);
        // Return the quote.
        return signerAmount;
      }
    }
    return 0;
  }
  /**
    * @notice Get a Sender-Side Quote from the Delegate
    * @param signerAmount uint256 Amount of ERC-20 token the consumer would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @return uint256 senderAmount Amount of ERC-20 token the delegate would send
    */
  function getSenderSideQuote(
    uint256 signerAmount,
    address signerToken,
    address senderToken
  ) external view returns (
    uint256 senderAmount
  ) {
    Rule memory rule = rules[senderToken][signerToken];
    // Ensure that a rule exists.
    if(rule.maxSenderAmount > 0) {
      // Calculate the senderAmount.
      senderAmount = _calculateSenderAmount(signerAmount, rule.priceCoef, rule.priceExp);
      // Ensure the senderAmount does not exceed the maximum trade amount.
      if(senderAmount <= rule.maxSenderAmount) {
        return senderAmount;
      }
    }
    return 0;
  }
  /**
    * @notice Get a Maximum Quote from the Delegate
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    * @return uint256 senderAmount Amount the delegate would send
    * @return uint256 signerAmount Amount the consumer would send
    */
  function getMaxQuote(
    address senderToken,
    address signerToken
  ) external view returns (
    uint256 senderAmount,
    uint256 signerAmount
  ) {
    Rule memory rule = rules[senderToken][signerToken];
    senderAmount = rule.maxSenderAmount;
    // Ensure that a rule exists.
    if (senderAmount > 0) {
      // calculate the signerAmount
      signerAmount = _calculateSignerAmount(senderAmount, rule.priceCoef, rule.priceExp);
      // Return the maxSenderAmount and calculated signerAmount.
      return (
        senderAmount,
        signerAmount
      );
    }
    return (0, 0);
  }
  /**
    * @notice Set a Trading Rule
    * @dev only callable by the owner of the contract
    * @dev 1 senderToken = priceCoef * 10^(-priceExp) * signerToken
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    * @param maxSenderAmount uint256 Maximum amount of ERC-20 token the delegate would send
    * @param priceCoef uint256 Whole number that will be multiplied by 10^(-priceExp) - the price coefficient
    * @param priceExp uint256 Exponent of the price to indicate location of the decimal priceCoef * 10^(-priceExp)
    */
  function _setRule(
    address senderToken,
    address signerToken,
    uint256 maxSenderAmount,
    uint256 priceCoef,
    uint256 priceExp
  ) internal {
    require(priceCoef > 0, "PRICE_COEF_INVALID");
    rules[senderToken][signerToken] = Rule({
      maxSenderAmount: maxSenderAmount,
      priceCoef: priceCoef,
      priceExp: priceExp
    });
    emit SetRule(
      owner(),
      senderToken,
      signerToken,
      maxSenderAmount,
      priceCoef,
      priceExp
    );
  }
  /**
    * @notice Unset a Trading Rule
    * @param senderToken address Address of an ERC-20 token the delegate would send
    * @param signerToken address Address of an ERC-20 token the consumer would send
    */
  function _unsetRule(
    address senderToken,
    address signerToken
  ) internal {
    // using non-zero rule.priceCoef for rule existence check
    if (rules[senderToken][signerToken].priceCoef > 0) {
      // Delete the rule.
      delete rules[senderToken][signerToken];
      emit UnsetRule(
        owner(),
        senderToken,
        signerToken
    );
    }
  }
  /**
    * @notice Calculate the signer amount for a given sender amount and price
    * @param senderAmount uint256 The amount the delegate would send in the swap
    * @param priceCoef uint256 Coefficient of the token price defined in the rule
    * @param priceExp uint256 Exponent of the token price defined in the rule
    */
  function _calculateSignerAmount(
    uint256 senderAmount,
    uint256 priceCoef,
    uint256 priceExp
  ) internal pure returns (
    uint256 signerAmount
  ) {
    // Calculate the signer amount using the price formula
    uint256 multiplier = senderAmount.mul(priceCoef);
    signerAmount = multiplier.div(10 ** priceExp);
    // If the div rounded down, round up
    if (multiplier.mod(10 ** priceExp) > 0) {
      signerAmount++;
    }
  }
  /**
    * @notice Calculate the sender amount for a given signer amount and price
    * @param signerAmount uint256 The amount the signer would send in the swap
    * @param priceCoef uint256 Coefficient of the token price defined in the rule
    * @param priceExp uint256 Exponent of the token price defined in the rule
    */
  function _calculateSenderAmount(
    uint256 signerAmount,
    uint256 priceCoef,
    uint256 priceExp
  ) internal pure returns (
    uint256 senderAmount
  ) {
    // Calculate the sender anount using the price formula
    senderAmount = signerAmount
      .mul(10 ** priceExp)
      .div(priceCoef);
  }
}
// File: contracts/interfaces/IDelegateFactory.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
interface IDelegateFactory {
  event CreateDelegate(
    address indexed delegateContract,
    address swapContract,
    address indexerContract,
    address indexed delegateContractOwner,
    address delegateTradeWallet
  );
  /**
    * @notice Deploy a trusted delegate contract
    * @param delegateTradeWallet the wallet the delegate will trade from
    * @return delegateContractAddress address of the delegate contract created
    */
  function createDelegate(
    address delegateTradeWallet
  ) external returns (address delegateContractAddress);
}
// File: @airswap/indexer/contracts/interfaces/ILocatorWhitelist.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
interface ILocatorWhitelist {
  function has(
    bytes32 locator
  ) external view returns (bool);
}
// File: contracts/DelegateFactory.sol
/*
  Copyright 2020 Swap Holdings Ltd.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
contract DelegateFactory is IDelegateFactory, ILocatorWhitelist {
  // Mapping specifying whether an address was deployed by this factory
  mapping(address => bool) internal _deployedAddresses;
  // The swap and indexer contracts to use in the deployment of Delegates
  ISwap public swapContract;
  IIndexer public indexerContract;
  bytes2 public protocol;
  /**
    * @notice Create a new Delegate contract
    * @dev swapContract is unable to be changed after the factory sets it
    * @param factorySwapContract address Swap contract the delegate will deploy with
    * @param factoryIndexerContract address Indexer contract the delegate will deploy with
    * @param factoryProtocol bytes2 Protocol type of the delegates the factory deploys
    */
  constructor(
    ISwap factorySwapContract,
    IIndexer factoryIndexerContract,
    bytes2 factoryProtocol
  ) public {
    swapContract = factorySwapContract;
    indexerContract = factoryIndexerContract;
    protocol = factoryProtocol;
  }
  /**
    * @param delegateTradeWallet address Wallet the delegate will trade from
    * @return address delegateContractAddress Address of the delegate contract created
    */
  function createDelegate(
    address delegateTradeWallet
  ) external returns (address delegateContractAddress) {
    delegateContractAddress = address(
      new Delegate(swapContract, indexerContract, msg.sender, delegateTradeWallet, protocol)
    );
    _deployedAddresses[delegateContractAddress] = true;
    emit CreateDelegate(
      delegateContractAddress,
      address(swapContract),
      address(indexerContract),
      msg.sender,
      delegateTradeWallet
    );
    return delegateContractAddress;
  }
  /**
    * @notice To check whether a locator was deployed
    * @dev Implements ILocatorWhitelist.has
    * @param locator bytes32 Locator of the delegate in question
    * @return bool True if the delegate was deployed by this contract
    */
  function has(bytes32 locator) external view returns (bool) {
    return _deployedAddresses[address(bytes20(locator))];
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ISwap","name":"factorySwapContract","type":"address"},{"internalType":"contract IIndexer","name":"factoryIndexerContract","type":"address"},{"internalType":"bytes2","name":"factoryProtocol","type":"bytes2"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegateContract","type":"address"},{"indexed":false,"internalType":"address","name":"swapContract","type":"address"},{"indexed":false,"internalType":"address","name":"indexerContract","type":"address"},{"indexed":true,"internalType":"address","name":"delegateContractOwner","type":"address"},{"indexed":false,"internalType":"address","name":"delegateTradeWallet","type":"address"}],"name":"CreateDelegate","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"delegateTradeWallet","type":"address"}],"name":"createDelegate","outputs":[{"internalType":"address","name":"delegateContractAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"locator","type":"bytes32"}],"name":"has","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"indexerContract","outputs":[{"internalType":"contract IIndexer","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"protocol","outputs":[{"internalType":"bytes2","name":"","type":"bytes2"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"swapContract","outputs":[{"internalType":"contract ISwap","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516131e13803806131e183398101604081905261002f916100a9565b600180546001600160a01b03199081166001600160a01b039586161790915560028054909116929093169190911761ffff60a01b19167401000000000000000000000000000000000000000060f09290921c9190910217905561015d565b80516100988161013d565b92915050565b805161009881610154565b6000806000606084860312156100be57600080fd5b60006100ca868661009e565b93505060206100db8682870161009e565b92505060406100ec8682870161008d565b9150509250925092565b600061009882610131565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b6000610098826100f6565b6001600160a01b031690565b61014681610101565b811461015157600080fd5b50565b61014681610126565b6130758061016c6000396000f3fe60806040523480156200001157600080fd5b5060043610620000705760003560e01c80638ea8303111620000575780638ea8303114620000b05780639d0d7c3014620000ba578063b7dc560f14620000e05762000070565b80637cb557b214620000755780638ce744261462000097575b600080fd5b6200007f62000106565b6040516200008e9190620003b2565b60405180910390f35b620000a162000122565b6040516200008e9190620003a2565b6200007f62000143565b620000d1620000cb366004620002cd565b6200015f565b6040516200008e919062000354565b620000f7620000f1366004620002f6565b62000287565b6040516200008e919062000392565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60025474010000000000000000000000000000000000000000900460f01b81565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60015460025460405160009273ffffffffffffffffffffffffffffffffffffffff9081169290811691339186917401000000000000000000000000000000000000000090910460f01b90620001b4906200029f565b620001c4959493929190620003c2565b604051809103906000f080158015620001e1573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff8082166000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155546002549151949550339492937fff8beab89e8c26a642d622a3afc4cddcb2f06b35a39b280a98b1f7a465080115936200027a939282169290911690889062000364565b60405180910390a3919050565b60601c60009081526020819052604090205460ff1690565b612b8d80620004a683390190565b8035620002ba8162000480565b92915050565b8035620002ba816200049a565b600060208284031215620002e057600080fd5b6000620002ee8484620002ad565b949350505050565b6000602082840312156200030957600080fd5b6000620002ee8484620002c0565b62000322816200046b565b82525050565b620003228162000418565b620003228162000425565b62000322816200042a565b620003228162000473565b60208101620002ba828462000328565b6060810162000374828662000328565b62000383602083018562000328565b620002ee604083018462000328565b60208101620002ba828462000333565b60208101620002ba82846200033e565b60208101620002ba828462000349565b60a08101620003d2828862000349565b620003e1602083018762000349565b620003f0604083018662000317565b620003ff606083018562000328565b6200040e60808301846200033e565b9695505050505050565b6000620002ba8262000452565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b6000620002ba825b6000620002ba8262000418565b6200048b8162000418565b81146200049757600080fd5b50565b6200048b816200044f56fe60806040523480156200001157600080fd5b5060405162002b8d38038062002b8d833981016040819052620000349162000472565b620000476001600160e01b03620002bc16565b600080546001600160a01b0319166001600160a01b039283161780825560405192169160008051602062002b6d833981519152908290a3600180546001600160a01b03199081166001600160a01b0388811691909117909255600280549091168683161790556005805461ffff191660f084901c179055831615620000da57620000da836001600160e01b03620002c016565b6001600160a01b038216156200010b57600380546001600160a01b0319166001600160a01b0384161790556200013f565b6200011e6001600160e01b036200032316565b600380546001600160a01b0319166001600160a01b03929092169190911790555b600260009054906101000a90046001600160a01b03166001600160a01b03166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156200018e57600080fd5b505afa158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c9919081019062000428565b6002546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b039283169263095ea7b392620002199291169060001990600401620005e5565b602060405180830381600087803b1580156200023457600080fd5b505af115801562000249573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506200026f919081019062000451565b620002b1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200061d565b60405180910390fd5b5050505050620006d5565b3390565b620002d36001600160e01b036200033216565b6200030c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200062f565b62000320816001600160e01b036200036116565b50565b6000546001600160a01b031690565b600080546001600160a01b0316620003526001600160e01b03620002bc16565b6001600160a01b031614905090565b6001600160a01b038116620003a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200060b565b600080546040516001600160a01b038085169392169160008051602062002b6d83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b8051620003fb816200069d565b92915050565b8051620003fb81620006b4565b8051620003fb81620006bf565b8051620003fb81620006ca565b6000602082840312156200043b57600080fd5b6000620004498484620003ee565b949350505050565b6000602082840312156200046457600080fd5b600062000449848462000401565b600080600080600060a086880312156200048b57600080fd5b60006200049988886200041b565b9550506020620004ac888289016200041b565b9450506040620004bf88828901620003ee565b9350506060620004d288828901620003ee565b9250506080620004e5888289016200040e565b9150509295509295909350565b620004fd816200064a565b82525050565b60006200051260268362000641565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b60006200057360178362000641565b7f5354414b494e475f415050524f56414c5f4641494c4544000000000000000000815260200192915050565b6000620005ae60208362000641565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b620004fd816200069a565b60408101620005f58285620004f2565b620006046020830184620005da565b9392505050565b60208082528101620003fb8162000503565b60208082528101620003fb8162000564565b60208082528101620003fb816200059f565b90815260200190565b6000620003fb826200068e565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b6000620003fb826200064a565b6001600160a01b031690565b90565b620006a8816200064a565b81146200032057600080fd5b620006a88162000657565b620006a8816200065c565b620006a88162000681565b61248880620006e56000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c806383134056116100b25780638f32d59b11610081578063d6770f8111610066578063d6770f811461027f578063e06118b714610292578063f2fde38b1461029a57610136565b80638f32d59b14610257578063b9d5a0651461026c57610136565b806383134056146102045780638ce74426146102255780638da5cb5b1461023a5780638ea830311461024257610136565b806323b71b8111610109578063715018a6116100ee578063715018a6146101d65780637a2d107c146101de5780637bb57fb3146101f157610136565b806323b71b81146101b05780632bfa91af146101c357610136565b80630a36f49d1461013b5780630f8d3b8114610166578063130a82921461017b57806322f7c21714610190575b600080fd5b61014e610149366004611854565b6102ad565b60405161015d93929190612286565b60405180910390f35b610179610174366004611854565b6102d9565b005b610183610314565b60405161015d9190612008565b6101a361019e3660046119dd565b610330565b60405161015d919061226a565b6101796101be366004611818565b6103cc565b6101796101d136600461188e565b61046a565b6101796108be565b6101796101ec3660046119a0565b610951565b6101796101ff366004611854565b610de7565b610217610212366004611854565b6110b7565b60405161015d929190612278565b61022d611152565b60405161015d919061214e565b61018361115b565b61024a611177565b60405161015d919061215c565b61025f611193565b60405161015d9190612140565b61017961027a3660046118ef565b6111d1565b6101a361028d3660046119dd565b611202565b61024a611291565b6101796102a8366004611818565b6112ad565b600460209081526000928352604080842090915290825290208054600182015460029092015490919083565b6102e1611193565b6103065760405162461bcd60e51b81526004016102fd9061222b565b60405180910390fd5b61031082826112dd565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600061033a611774565b5073ffffffffffffffffffffffffffffffffffffffff80841660009081526004602090815260408083209386168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252156103bf57805185116103bf576103b685826020015183604001516113a9565b91506103c59050565b60009150505b9392505050565b6103d4611193565b6103f05760405162461bcd60e51b81526004016102fd9061222b565b73ffffffffffffffffffffffffffffffffffffffff81166104235760405162461bcd60e51b81526004016102fd9061218b565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610472611193565b61048e5760405162461bcd60e51b81526004016102fd9061222b565b6104a484848435602086013560408701356113ff565b6002546005546040517f03f868f700000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff16916303f868f79161050991309189918b9160f09190911b90600401612059565b60206040518083038186803b15801561052157600080fd5b505afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061055991908101906119bf565b9050818114801561056a5750600081115b1561057557506108b8565b818110156106c957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156105e557600080fd5b505afa1580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061061d9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd33308486036040518463ffffffff1660e01b815260040161065b93929190612016565b602060405180830381600087803b15801561067557600080fd5b505af1158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106ad9190810190611964565b6106c95760405162461bcd60e51b81526004016102fd9061219b565b6002546005546040517f948ee3f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163948ee3f6916107329188918a9160f09190911b9088903060601b906004016120bf565b600060405180830381600087803b15801561074c57600080fd5b505af1158015610760573d6000803e3d6000fd5b50505050818111156108b657600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d457600080fd5b505afa1580156107e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061080c9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338484036040518363ffffffff1660e01b815260040161084892919061203e565b602060405180830381600087803b15801561086257600080fd5b505af1158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061089a9190810190611964565b6108b65760405162461bcd60e51b81526004016102fd906121bb565b505b50505050565b6108c6611193565b6108e25760405162461bcd60e51b81526004016102fd9061222b565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b610959611774565b6004600061096f61014085016101208601611818565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000908120906109a860a0850160808601611818565b73ffffffffffffffffffffffffffffffffffffffff168152602080820192909252604090810160002081516060810183528154815260018201549381019390935260020154908201529050610a056102a083016102808401611a2a565b60ff16610a245760405162461bcd60e51b81526004016102fd9061223b565b60035473ffffffffffffffffffffffffffffffffffffffff16610a4f61012084016101008501611818565b73ffffffffffffffffffffffffffffffffffffffff1614610a825760405162461bcd60e51b81526004016102fd9061217b565b7f36372b0700000000000000000000000000000000000000000000000000000000610ab36060840160408501611982565b7fffffffff000000000000000000000000000000000000000000000000000000001614610af25760405162461bcd60e51b81526004016102fd906121fb565b7f36372b0700000000000000000000000000000000000000000000000000000000610b24610100840160e08501611982565b7fffffffff000000000000000000000000000000000000000000000000000000001614610b635760405162461bcd60e51b81526004016102fd906121db565b8051610b815760405162461bcd60e51b81526004016102fd906121cb565b80516101408301351115610ba75760405162461bcd60e51b81526004016102fd9061220b565b610bc18260400160600135826020015183604001516114e2565b6101408301351115610be55760405162461bcd60e51b81526004016102fd906121eb565b604080516060810190915281518190610c099061014086013563ffffffff61151016565b81526020838101519082015260408084015191015260046000610c3461014086016101208701611818565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600090812090610c6d60a0860160808701611818565b73ffffffffffffffffffffffffffffffffffffffff90811682526020808301939093526040918201600020845181559284015160018085019190915593820151600290930192909255915491517f67641c2f0000000000000000000000000000000000000000000000000000000081529116906367641c2f90610cf490859060040161225b565b600060405180830381600087803b158015610d0e57600080fd5b505af1158015610d22573d6000803e3d6000fd5b50610d379250505060a0830160808401611818565b73ffffffffffffffffffffffffffffffffffffffff16610d5f61014084016101208501611818565b73ffffffffffffffffffffffffffffffffffffffff16610d7d61115b565b6003546020850151604080870151905173ffffffffffffffffffffffffffffffffffffffff948516947f0189daca1660a5f26ed6b6d45a91d45b31911dc06e9f69c24838beac4b3f502d94610ddb949116926101408b01359261210b565b60405180910390a45050565b610def611193565b610e0b5760405162461bcd60e51b81526004016102fd9061222b565b610e1582826112dd565b6002546005546040517f03f868f700000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff16916303f868f791610e7a9130918791899160f09190911b90600401612059565b60206040518083038186803b158015610e9257600080fd5b505afa158015610ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610eca91908101906119bf565b6002546005546040517fdf9d6d6700000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9091169163df9d6d6791610f2f918691889160f09190911b90600401612097565b600060405180830381600087803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b5050505060008111156110b257600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd257600080fd5b505afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061100a9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161104492919061203e565b602060405180830381600087803b15801561105e57600080fd5b505af1158015611072573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110969190810190611964565b6110b25760405162461bcd60e51b81526004016102fd906121bb565b505050565b6000806110c2611774565b5073ffffffffffffffffffffffffffffffffffffffff80851660009081526004602090815260408083209387168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252925082156111425761113983826020015183604001516113a9565b915061114b9050565b50600091508190505b9250929050565b60055460f01b81565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff166111b561155b565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6111d9611193565b6111f55760405162461bcd60e51b81526004016102fd9061222b565b6108b685858585856113ff565b600061120c611774565b5073ffffffffffffffffffffffffffffffffffffffff80831660009081526004602090815260408083209387168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252156103bf5761128085826020015183604001516114e2565b815190925082116103bf57506103c5565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6112b5611193565b6112d15760405162461bcd60e51b81526004016102fd9061222b565b6112da8161155f565b50565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260046020908152604080832093851683529290522060010154156103105773ffffffffffffffffffffffffffffffffffffffff8083166000818152600460209081526040808320948616808452949091528120818155600181018290556002015561136361115b565b73ffffffffffffffffffffffffffffffffffffffff167f8a5de2720528dbd2e4fe17889175d99555344219a0e2ef60298dc68801f57c9860405160405180910390a45050565b6000806113bc858563ffffffff61161f16565b90506113d281600a85900a63ffffffff61165916565b915060006113ea82600a86900a63ffffffff61169b16565b11156113f7576001909101905b509392505050565b6000821161141f5760405162461bcd60e51b81526004016102fd9061224b565b60408051606081018252848152602080820185815282840185815273ffffffffffffffffffffffffffffffffffffffff808b16600081815260048652878120928c1680825292909552959093209351845590516001840155516002909201919091559061148a61115b565b73ffffffffffffffffffffffffffffffffffffffff167feef1056edebc4703267ec0a6f9845851c98be3eefddf0eb8927e7de6b2732e8e8686866040516114d393929190612286565b60405180910390a45050505050565b6000611508836114fc86600a86900a63ffffffff61161f16565b9063ffffffff61165916565b949350505050565b600061155283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116dd565b90505b92915050565b3390565b73ffffffffffffffffffffffffffffffffffffffff81166115925760405162461bcd60e51b81526004016102fd906121ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008261162e57506000611555565b8282028284828161163b57fe5b04146115525760405162461bcd60e51b81526004016102fd9061221b565b600061155283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611709565b600061155283836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611740565b600081848411156117015760405162461bcd60e51b81526004016102fd919061216a565b505050900390565b6000818361172a5760405162461bcd60e51b81526004016102fd919061216a565b50600083858161173657fe5b0495945050505050565b600081836117615760405162461bcd60e51b81526004016102fd919061216a565b5082848161176b57fe5b06949350505050565b60405180606001604052806000815260200160008152602001600081525090565b803561155581612404565b805161155581612404565b805161155581612418565b803561155581612421565b80356115558161242a565b803561155581612433565b60006102e082840312156117ea57600080fd5b50919050565b6000606082840312156117ea57600080fd5b80516115558161242a565b80356115558161243c565b60006020828403121561182a57600080fd5b60006115088484611795565b60006020828403121561184857600080fd5b600061150884846117a0565b6000806040838503121561186757600080fd5b60006118738585611795565b925050602061188485828601611795565b9150509250929050565b60008060008060c085870312156118a457600080fd5b60006118b08787611795565b94505060206118c187828801611795565b93505060406118d2878288016117f0565b92505060a06118e3878288016117c1565b91505092959194509250565b600080600080600060a0868803121561190757600080fd5b60006119138888611795565b955050602061192488828901611795565b9450506040611935888289016117c1565b9350506060611946888289016117c1565b9250506080611957888289016117c1565b9150509295509295909350565b60006020828403121561197657600080fd5b600061150884846117ab565b60006020828403121561199457600080fd5b600061150884846117cc565b60006102e082840312156119b357600080fd5b600061150884846117d7565b6000602082840312156119d157600080fd5b60006115088484611802565b6000806000606084860312156119f257600080fd5b60006119fe86866117c1565b9350506020611a0f86828701611795565b9250506040611a2086828701611795565b9150509250925092565b600060208284031215611a3c57600080fd5b6000611508848461180d565b611a518161239e565b82525050565b611a51816122fd565b611a5181612308565b611a518161230d565b611a5181612332565b611a5181612357565b611a518161235a565b611a51816123a5565b6000611aa1826122a1565b611aab81856122a5565b9350611abb8185602086016123b0565b611ac4816123dc565b9093019392505050565b6000611adb6015836122a5565b7f53454e4445525f57414c4c45545f494e56414c49440000000000000000000000815260200192915050565b6000611b146015836122a5565b7f54524144455f57414c4c45545f52455155495245440000000000000000000000815260200192915050565b6000611b4d6017836122a5565b7f5354414b494e475f5452414e534645525f4641494c4544000000000000000000815260200192915050565b6000611b866026836122a5565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611be56015836122a5565b7f5354414b494e475f52455455524e5f4641494c45440000000000000000000000815260200192915050565b6000611c1e6013836122a5565b7f544f4b454e5f504149525f494e41435449564500000000000000000000000000815260200192915050565b6000611c576019836122a5565b7f53454e4445525f4b494e445f4d5553545f42455f455243323000000000000000815260200192915050565b6000611c90600d836122a5565b7f50524943455f494e56414c494400000000000000000000000000000000000000815260200192915050565b6000611cc96019836122a5565b7f5349474e45525f4b494e445f4d5553545f42455f455243323000000000000000815260200192915050565b6000611d026012836122a5565b7f414d4f554e545f455843454544535f4d41580000000000000000000000000000815260200192915050565b6000611d3b6021836122a5565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611d9a6020836122a5565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000611dd36016836122a5565b7f5349474e41545552455f4d5553545f42455f53454e5400000000000000000000815260200192915050565b6000611e0c6012836122a5565b7f50524943455f434f45465f494e56414c49440000000000000000000000000000815260200192915050565b6102e08201611e4782806122cc565b611e518482611a7b565b50611e5f60208301836122cc565b611e6c6020850182611a7b565b50611e7a60408301836122ea565b611e876040850182611edc565b50611e9560e08301836122ea565b611ea260e0850182611edc565b50611eb16101808301836122ea565b611ebf610180850182611edc565b50611ece6102208301836122ea565b6108b8610220850182611f60565b60a08201611eea82806122db565b611ef48482611a84565b50611f0260208301836122ae565b611f0f6020850182611a57565b50611f1d60408301836122ae565b611f2a6040850182611a57565b50611f3860608301836122cc565b611f456060850182611a7b565b50611f5360808301836122cc565b6108b86080850182611a7b565b60c08201611f6e82806122ae565b611f788482611a57565b50611f8660208301836122ae565b611f936020850182611a57565b50611fa160408301836122bd565b611fae6040850182611a69565b50611fbc60608301836122ee565b611fc96060850182611fff565b50611fd760808301836122cc565b611fe46080850182611a7b565b50611ff260a08301836122cc565b6108b860a0850182611a7b565b611a5181612398565b602081016115558284611a57565b606081016120248286611a48565b6120316020830185611a57565b6115086040830184611a7b565b6040810161204c8285611a48565b6103c56020830184611a7b565b608081016120678287611a57565b6120746020830186611a57565b6120816040830185611a57565b61208e6060830184611a72565b95945050505050565b606081016120a58286611a57565b6120b26020830185611a57565b6115086040830184611a72565b60a081016120cd8288611a57565b6120da6020830187611a57565b6120e76040830186611a72565b6120f46060830185611a7b565b6121016080830184611a7b565b9695505050505050565b608081016121198287611a57565b6121266020830186611a7b565b6121336040830185611a7b565b61208e6060830184611a7b565b602081016115558284611a60565b602081016115558284611a72565b602081016115558284611a8d565b602080825281016115528184611a96565b6020808252810161155581611ace565b6020808252810161155581611b07565b6020808252810161155581611b40565b6020808252810161155581611b79565b6020808252810161155581611bd8565b6020808252810161155581611c11565b6020808252810161155581611c4a565b6020808252810161155581611c83565b6020808252810161155581611cbc565b6020808252810161155581611cf5565b6020808252810161155581611d2e565b6020808252810161155581611d8d565b6020808252810161155581611dc6565b6020808252810161155581611dff565b6102e081016115558284611e38565b602081016115558284611a7b565b6040810161204c8285611a7b565b606081016122948286611a7b565b6120316020830185611a7b565b5190565b90815260200190565b60006115526020840184611795565b600061155260208401846117b6565b600061155260208401846117c1565b600061155260208401846117cc565b5090565b6000611552602084018461180d565b60006115558261237f565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6000611555825b6000611555826122fd565b60005b838110156123cb5781810151838201526020016123b3565b838111156108b85750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b61240d816122fd565b81146112da57600080fd5b61240d81612308565b61240d8161230d565b61240d81612357565b61240d8161235a565b61240d8161239856fea365627a7a72315820f9bfe81b5bceb428400a5b841687167490939197f8c71f8df40da692d993cd336c6578706572696d656e74616cf564736f6c634300050c00408be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a365627a7a723158202efd4d004699abffe954d3fe83c0fc89198fd3cbd2f7e90daa8e1f12f2e893846c6578706572696d656e74616cf564736f6c634300050c00400000000000000000000000004572f2554421bd64bef1c22c8a81840e8d496bea000000000000000000000000ba9ab9710bd461f30c247f4ca2cb7f453c22570e0001000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620000705760003560e01c80638ea8303111620000575780638ea8303114620000b05780639d0d7c3014620000ba578063b7dc560f14620000e05762000070565b80637cb557b214620000755780638ce744261462000097575b600080fd5b6200007f62000106565b6040516200008e9190620003b2565b60405180910390f35b620000a162000122565b6040516200008e9190620003a2565b6200007f62000143565b620000d1620000cb366004620002cd565b6200015f565b6040516200008e919062000354565b620000f7620000f1366004620002f6565b62000287565b6040516200008e919062000392565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60025474010000000000000000000000000000000000000000900460f01b81565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60015460025460405160009273ffffffffffffffffffffffffffffffffffffffff9081169290811691339186917401000000000000000000000000000000000000000090910460f01b90620001b4906200029f565b620001c4959493929190620003c2565b604051809103906000f080158015620001e1573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff8082166000818152602081905260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155546002549151949550339492937fff8beab89e8c26a642d622a3afc4cddcb2f06b35a39b280a98b1f7a465080115936200027a939282169290911690889062000364565b60405180910390a3919050565b60601c60009081526020819052604090205460ff1690565b612b8d80620004a683390190565b8035620002ba8162000480565b92915050565b8035620002ba816200049a565b600060208284031215620002e057600080fd5b6000620002ee8484620002ad565b949350505050565b6000602082840312156200030957600080fd5b6000620002ee8484620002c0565b62000322816200046b565b82525050565b620003228162000418565b620003228162000425565b62000322816200042a565b620003228162000473565b60208101620002ba828462000328565b6060810162000374828662000328565b62000383602083018562000328565b620002ee604083018462000328565b60208101620002ba828462000333565b60208101620002ba82846200033e565b60208101620002ba828462000349565b60a08101620003d2828862000349565b620003e1602083018762000349565b620003f0604083018662000317565b620003ff606083018562000328565b6200040e60808301846200033e565b9695505050505050565b6000620002ba8262000452565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b6000620002ba825b6000620002ba8262000418565b6200048b8162000418565b81146200049757600080fd5b50565b6200048b816200044f56fe60806040523480156200001157600080fd5b5060405162002b8d38038062002b8d833981016040819052620000349162000472565b620000476001600160e01b03620002bc16565b600080546001600160a01b0319166001600160a01b039283161780825560405192169160008051602062002b6d833981519152908290a3600180546001600160a01b03199081166001600160a01b0388811691909117909255600280549091168683161790556005805461ffff191660f084901c179055831615620000da57620000da836001600160e01b03620002c016565b6001600160a01b038216156200010b57600380546001600160a01b0319166001600160a01b0384161790556200013f565b6200011e6001600160e01b036200032316565b600380546001600160a01b0319166001600160a01b03929092169190911790555b600260009054906101000a90046001600160a01b03166001600160a01b03166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156200018e57600080fd5b505afa158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001c9919081019062000428565b6002546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b039283169263095ea7b392620002199291169060001990600401620005e5565b602060405180830381600087803b1580156200023457600080fd5b505af115801562000249573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506200026f919081019062000451565b620002b1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200061d565b60405180910390fd5b5050505050620006d5565b3390565b620002d36001600160e01b036200033216565b6200030c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200062f565b62000320816001600160e01b036200036116565b50565b6000546001600160a01b031690565b600080546001600160a01b0316620003526001600160e01b03620002bc16565b6001600160a01b031614905090565b6001600160a01b038116620003a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a8906200060b565b600080546040516001600160a01b038085169392169160008051602062002b6d83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b8051620003fb816200069d565b92915050565b8051620003fb81620006b4565b8051620003fb81620006bf565b8051620003fb81620006ca565b6000602082840312156200043b57600080fd5b6000620004498484620003ee565b949350505050565b6000602082840312156200046457600080fd5b600062000449848462000401565b600080600080600060a086880312156200048b57600080fd5b60006200049988886200041b565b9550506020620004ac888289016200041b565b9450506040620004bf88828901620003ee565b9350506060620004d288828901620003ee565b9250506080620004e5888289016200040e565b9150509295509295909350565b620004fd816200064a565b82525050565b60006200051260268362000641565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b60006200057360178362000641565b7f5354414b494e475f415050524f56414c5f4641494c4544000000000000000000815260200192915050565b6000620005ae60208362000641565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b620004fd816200069a565b60408101620005f58285620004f2565b620006046020830184620005da565b9392505050565b60208082528101620003fb8162000503565b60208082528101620003fb8162000564565b60208082528101620003fb816200059f565b90815260200190565b6000620003fb826200068e565b151590565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b6000620003fb826200064a565b6001600160a01b031690565b90565b620006a8816200064a565b81146200032057600080fd5b620006a88162000657565b620006a8816200065c565b620006a88162000681565b61248880620006e56000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c806383134056116100b25780638f32d59b11610081578063d6770f8111610066578063d6770f811461027f578063e06118b714610292578063f2fde38b1461029a57610136565b80638f32d59b14610257578063b9d5a0651461026c57610136565b806383134056146102045780638ce74426146102255780638da5cb5b1461023a5780638ea830311461024257610136565b806323b71b8111610109578063715018a6116100ee578063715018a6146101d65780637a2d107c146101de5780637bb57fb3146101f157610136565b806323b71b81146101b05780632bfa91af146101c357610136565b80630a36f49d1461013b5780630f8d3b8114610166578063130a82921461017b57806322f7c21714610190575b600080fd5b61014e610149366004611854565b6102ad565b60405161015d93929190612286565b60405180910390f35b610179610174366004611854565b6102d9565b005b610183610314565b60405161015d9190612008565b6101a361019e3660046119dd565b610330565b60405161015d919061226a565b6101796101be366004611818565b6103cc565b6101796101d136600461188e565b61046a565b6101796108be565b6101796101ec3660046119a0565b610951565b6101796101ff366004611854565b610de7565b610217610212366004611854565b6110b7565b60405161015d929190612278565b61022d611152565b60405161015d919061214e565b61018361115b565b61024a611177565b60405161015d919061215c565b61025f611193565b60405161015d9190612140565b61017961027a3660046118ef565b6111d1565b6101a361028d3660046119dd565b611202565b61024a611291565b6101796102a8366004611818565b6112ad565b600460209081526000928352604080842090915290825290208054600182015460029092015490919083565b6102e1611193565b6103065760405162461bcd60e51b81526004016102fd9061222b565b60405180910390fd5b61031082826112dd565b5050565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600061033a611774565b5073ffffffffffffffffffffffffffffffffffffffff80841660009081526004602090815260408083209386168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252156103bf57805185116103bf576103b685826020015183604001516113a9565b91506103c59050565b60009150505b9392505050565b6103d4611193565b6103f05760405162461bcd60e51b81526004016102fd9061222b565b73ffffffffffffffffffffffffffffffffffffffff81166104235760405162461bcd60e51b81526004016102fd9061218b565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610472611193565b61048e5760405162461bcd60e51b81526004016102fd9061222b565b6104a484848435602086013560408701356113ff565b6002546005546040517f03f868f700000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff16916303f868f79161050991309189918b9160f09190911b90600401612059565b60206040518083038186803b15801561052157600080fd5b505afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061055991908101906119bf565b9050818114801561056a5750600081115b1561057557506108b8565b818110156106c957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156105e557600080fd5b505afa1580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061061d9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd33308486036040518463ffffffff1660e01b815260040161065b93929190612016565b602060405180830381600087803b15801561067557600080fd5b505af1158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106ad9190810190611964565b6106c95760405162461bcd60e51b81526004016102fd9061219b565b6002546005546040517f948ee3f600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163948ee3f6916107329188918a9160f09190911b9088903060601b906004016120bf565b600060405180830381600087803b15801561074c57600080fd5b505af1158015610760573d6000803e3d6000fd5b50505050818111156108b657600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d457600080fd5b505afa1580156107e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061080c9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338484036040518363ffffffff1660e01b815260040161084892919061203e565b602060405180830381600087803b15801561086257600080fd5b505af1158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061089a9190810190611964565b6108b65760405162461bcd60e51b81526004016102fd906121bb565b505b50505050565b6108c6611193565b6108e25760405162461bcd60e51b81526004016102fd9061222b565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b610959611774565b6004600061096f61014085016101208601611818565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000908120906109a860a0850160808601611818565b73ffffffffffffffffffffffffffffffffffffffff168152602080820192909252604090810160002081516060810183528154815260018201549381019390935260020154908201529050610a056102a083016102808401611a2a565b60ff16610a245760405162461bcd60e51b81526004016102fd9061223b565b60035473ffffffffffffffffffffffffffffffffffffffff16610a4f61012084016101008501611818565b73ffffffffffffffffffffffffffffffffffffffff1614610a825760405162461bcd60e51b81526004016102fd9061217b565b7f36372b0700000000000000000000000000000000000000000000000000000000610ab36060840160408501611982565b7fffffffff000000000000000000000000000000000000000000000000000000001614610af25760405162461bcd60e51b81526004016102fd906121fb565b7f36372b0700000000000000000000000000000000000000000000000000000000610b24610100840160e08501611982565b7fffffffff000000000000000000000000000000000000000000000000000000001614610b635760405162461bcd60e51b81526004016102fd906121db565b8051610b815760405162461bcd60e51b81526004016102fd906121cb565b80516101408301351115610ba75760405162461bcd60e51b81526004016102fd9061220b565b610bc18260400160600135826020015183604001516114e2565b6101408301351115610be55760405162461bcd60e51b81526004016102fd906121eb565b604080516060810190915281518190610c099061014086013563ffffffff61151016565b81526020838101519082015260408084015191015260046000610c3461014086016101208701611818565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600090812090610c6d60a0860160808701611818565b73ffffffffffffffffffffffffffffffffffffffff90811682526020808301939093526040918201600020845181559284015160018085019190915593820151600290930192909255915491517f67641c2f0000000000000000000000000000000000000000000000000000000081529116906367641c2f90610cf490859060040161225b565b600060405180830381600087803b158015610d0e57600080fd5b505af1158015610d22573d6000803e3d6000fd5b50610d379250505060a0830160808401611818565b73ffffffffffffffffffffffffffffffffffffffff16610d5f61014084016101208501611818565b73ffffffffffffffffffffffffffffffffffffffff16610d7d61115b565b6003546020850151604080870151905173ffffffffffffffffffffffffffffffffffffffff948516947f0189daca1660a5f26ed6b6d45a91d45b31911dc06e9f69c24838beac4b3f502d94610ddb949116926101408b01359261210b565b60405180910390a45050565b610def611193565b610e0b5760405162461bcd60e51b81526004016102fd9061222b565b610e1582826112dd565b6002546005546040517f03f868f700000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff16916303f868f791610e7a9130918791899160f09190911b90600401612059565b60206040518083038186803b158015610e9257600080fd5b505afa158015610ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610eca91908101906119bf565b6002546005546040517fdf9d6d6700000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9091169163df9d6d6791610f2f918691889160f09190911b90600401612097565b600060405180830381600087803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b5050505060008111156110b257600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166372f702f36040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd257600080fd5b505afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061100a9190810190611836565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161104492919061203e565b602060405180830381600087803b15801561105e57600080fd5b505af1158015611072573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110969190810190611964565b6110b25760405162461bcd60e51b81526004016102fd906121bb565b505050565b6000806110c2611774565b5073ffffffffffffffffffffffffffffffffffffffff80851660009081526004602090815260408083209387168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252925082156111425761113983826020015183604001516113a9565b915061114b9050565b50600091508190505b9250929050565b60055460f01b81565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff166111b561155b565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6111d9611193565b6111f55760405162461bcd60e51b81526004016102fd9061222b565b6108b685858585856113ff565b600061120c611774565b5073ffffffffffffffffffffffffffffffffffffffff80831660009081526004602090815260408083209387168352928152908290208251606081018452815480825260018301549382019390935260029091015492810192909252156103bf5761128085826020015183604001516114e2565b815190925082116103bf57506103c5565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6112b5611193565b6112d15760405162461bcd60e51b81526004016102fd9061222b565b6112da8161155f565b50565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260046020908152604080832093851683529290522060010154156103105773ffffffffffffffffffffffffffffffffffffffff8083166000818152600460209081526040808320948616808452949091528120818155600181018290556002015561136361115b565b73ffffffffffffffffffffffffffffffffffffffff167f8a5de2720528dbd2e4fe17889175d99555344219a0e2ef60298dc68801f57c9860405160405180910390a45050565b6000806113bc858563ffffffff61161f16565b90506113d281600a85900a63ffffffff61165916565b915060006113ea82600a86900a63ffffffff61169b16565b11156113f7576001909101905b509392505050565b6000821161141f5760405162461bcd60e51b81526004016102fd9061224b565b60408051606081018252848152602080820185815282840185815273ffffffffffffffffffffffffffffffffffffffff808b16600081815260048652878120928c1680825292909552959093209351845590516001840155516002909201919091559061148a61115b565b73ffffffffffffffffffffffffffffffffffffffff167feef1056edebc4703267ec0a6f9845851c98be3eefddf0eb8927e7de6b2732e8e8686866040516114d393929190612286565b60405180910390a45050505050565b6000611508836114fc86600a86900a63ffffffff61161f16565b9063ffffffff61165916565b949350505050565b600061155283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116dd565b90505b92915050565b3390565b73ffffffffffffffffffffffffffffffffffffffff81166115925760405162461bcd60e51b81526004016102fd906121ab565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008261162e57506000611555565b8282028284828161163b57fe5b04146115525760405162461bcd60e51b81526004016102fd9061221b565b600061155283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611709565b600061155283836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611740565b600081848411156117015760405162461bcd60e51b81526004016102fd919061216a565b505050900390565b6000818361172a5760405162461bcd60e51b81526004016102fd919061216a565b50600083858161173657fe5b0495945050505050565b600081836117615760405162461bcd60e51b81526004016102fd919061216a565b5082848161176b57fe5b06949350505050565b60405180606001604052806000815260200160008152602001600081525090565b803561155581612404565b805161155581612404565b805161155581612418565b803561155581612421565b80356115558161242a565b803561155581612433565b60006102e082840312156117ea57600080fd5b50919050565b6000606082840312156117ea57600080fd5b80516115558161242a565b80356115558161243c565b60006020828403121561182a57600080fd5b60006115088484611795565b60006020828403121561184857600080fd5b600061150884846117a0565b6000806040838503121561186757600080fd5b60006118738585611795565b925050602061188485828601611795565b9150509250929050565b60008060008060c085870312156118a457600080fd5b60006118b08787611795565b94505060206118c187828801611795565b93505060406118d2878288016117f0565b92505060a06118e3878288016117c1565b91505092959194509250565b600080600080600060a0868803121561190757600080fd5b60006119138888611795565b955050602061192488828901611795565b9450506040611935888289016117c1565b9350506060611946888289016117c1565b9250506080611957888289016117c1565b9150509295509295909350565b60006020828403121561197657600080fd5b600061150884846117ab565b60006020828403121561199457600080fd5b600061150884846117cc565b60006102e082840312156119b357600080fd5b600061150884846117d7565b6000602082840312156119d157600080fd5b60006115088484611802565b6000806000606084860312156119f257600080fd5b60006119fe86866117c1565b9350506020611a0f86828701611795565b9250506040611a2086828701611795565b9150509250925092565b600060208284031215611a3c57600080fd5b6000611508848461180d565b611a518161239e565b82525050565b611a51816122fd565b611a5181612308565b611a518161230d565b611a5181612332565b611a5181612357565b611a518161235a565b611a51816123a5565b6000611aa1826122a1565b611aab81856122a5565b9350611abb8185602086016123b0565b611ac4816123dc565b9093019392505050565b6000611adb6015836122a5565b7f53454e4445525f57414c4c45545f494e56414c49440000000000000000000000815260200192915050565b6000611b146015836122a5565b7f54524144455f57414c4c45545f52455155495245440000000000000000000000815260200192915050565b6000611b4d6017836122a5565b7f5354414b494e475f5452414e534645525f4641494c4544000000000000000000815260200192915050565b6000611b866026836122a5565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611be56015836122a5565b7f5354414b494e475f52455455524e5f4641494c45440000000000000000000000815260200192915050565b6000611c1e6013836122a5565b7f544f4b454e5f504149525f494e41435449564500000000000000000000000000815260200192915050565b6000611c576019836122a5565b7f53454e4445525f4b494e445f4d5553545f42455f455243323000000000000000815260200192915050565b6000611c90600d836122a5565b7f50524943455f494e56414c494400000000000000000000000000000000000000815260200192915050565b6000611cc96019836122a5565b7f5349474e45525f4b494e445f4d5553545f42455f455243323000000000000000815260200192915050565b6000611d026012836122a5565b7f414d4f554e545f455843454544535f4d41580000000000000000000000000000815260200192915050565b6000611d3b6021836122a5565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81527f7700000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611d9a6020836122a5565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000611dd36016836122a5565b7f5349474e41545552455f4d5553545f42455f53454e5400000000000000000000815260200192915050565b6000611e0c6012836122a5565b7f50524943455f434f45465f494e56414c49440000000000000000000000000000815260200192915050565b6102e08201611e4782806122cc565b611e518482611a7b565b50611e5f60208301836122cc565b611e6c6020850182611a7b565b50611e7a60408301836122ea565b611e876040850182611edc565b50611e9560e08301836122ea565b611ea260e0850182611edc565b50611eb16101808301836122ea565b611ebf610180850182611edc565b50611ece6102208301836122ea565b6108b8610220850182611f60565b60a08201611eea82806122db565b611ef48482611a84565b50611f0260208301836122ae565b611f0f6020850182611a57565b50611f1d60408301836122ae565b611f2a6040850182611a57565b50611f3860608301836122cc565b611f456060850182611a7b565b50611f5360808301836122cc565b6108b86080850182611a7b565b60c08201611f6e82806122ae565b611f788482611a57565b50611f8660208301836122ae565b611f936020850182611a57565b50611fa160408301836122bd565b611fae6040850182611a69565b50611fbc60608301836122ee565b611fc96060850182611fff565b50611fd760808301836122cc565b611fe46080850182611a7b565b50611ff260a08301836122cc565b6108b860a0850182611a7b565b611a5181612398565b602081016115558284611a57565b606081016120248286611a48565b6120316020830185611a57565b6115086040830184611a7b565b6040810161204c8285611a48565b6103c56020830184611a7b565b608081016120678287611a57565b6120746020830186611a57565b6120816040830185611a57565b61208e6060830184611a72565b95945050505050565b606081016120a58286611a57565b6120b26020830185611a57565b6115086040830184611a72565b60a081016120cd8288611a57565b6120da6020830187611a57565b6120e76040830186611a72565b6120f46060830185611a7b565b6121016080830184611a7b565b9695505050505050565b608081016121198287611a57565b6121266020830186611a7b565b6121336040830185611a7b565b61208e6060830184611a7b565b602081016115558284611a60565b602081016115558284611a72565b602081016115558284611a8d565b602080825281016115528184611a96565b6020808252810161155581611ace565b6020808252810161155581611b07565b6020808252810161155581611b40565b6020808252810161155581611b79565b6020808252810161155581611bd8565b6020808252810161155581611c11565b6020808252810161155581611c4a565b6020808252810161155581611c83565b6020808252810161155581611cbc565b6020808252810161155581611cf5565b6020808252810161155581611d2e565b6020808252810161155581611d8d565b6020808252810161155581611dc6565b6020808252810161155581611dff565b6102e081016115558284611e38565b602081016115558284611a7b565b6040810161204c8285611a7b565b606081016122948286611a7b565b6120316020830185611a7b565b5190565b90815260200190565b60006115526020840184611795565b600061155260208401846117b6565b600061155260208401846117c1565b600061155260208401846117cc565b5090565b6000611552602084018461180d565b60006115558261237f565b151590565b7fff000000000000000000000000000000000000000000000000000000000000001690565b7fffff0000000000000000000000000000000000000000000000000000000000001690565b90565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b73ffffffffffffffffffffffffffffffffffffffff1690565b60ff1690565b6000611555825b6000611555826122fd565b60005b838110156123cb5781810151838201526020016123b3565b838111156108b85750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b61240d816122fd565b81146112da57600080fd5b61240d81612308565b61240d8161230d565b61240d81612357565b61240d8161235a565b61240d8161239856fea365627a7a72315820f9bfe81b5bceb428400a5b841687167490939197f8c71f8df40da692d993cd336c6578706572696d656e74616cf564736f6c634300050c00408be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a365627a7a723158202efd4d004699abffe954d3fe83c0fc89198fd3cbd2f7e90daa8e1f12f2e893846c6578706572696d656e74616cf564736f6c634300050c0040

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

0000000000000000000000004572f2554421bd64bef1c22c8a81840e8d496bea000000000000000000000000ba9ab9710bd461f30c247f4ca2cb7f453c22570e0001000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : factorySwapContract (address): 0x4572f2554421Bd64Bef1c22c8a81840E8D496BeA
Arg [1] : factoryIndexerContract (address): 0xbA9aB9710Bd461F30C247f4cA2Cb7f453C22570e
Arg [2] : factoryProtocol (bytes2): 0x0001

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004572f2554421bd64bef1c22c8a81840e8d496bea
Arg [1] : 000000000000000000000000ba9ab9710bd461f30c247f4ca2cb7f453c22570e
Arg [2] : 0001000000000000000000000000000000000000000000000000000000000000


Swarm Source

bzzr://2efd4d004699abffe954d3fe83c0fc89198fd3cbd2f7e90daa8e1f12f2e89384

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.