Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60e06040 | 14133070 | 932 days ago | IN | 0 ETH | 0.19432442 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ZeroExV2Adapter
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "../../../../utils/FundDeployerOwnerMixin.sol"; import "../utils/actions/ZeroExV2ActionsMixin.sol"; import "../utils/AdapterBase.sol"; /// @title ZeroExV2Adapter Contract /// @author Enzyme Council <[email protected]> /// @notice Adapter to 0xV2 Exchange Contract contract ZeroExV2Adapter is AdapterBase, FundDeployerOwnerMixin, ZeroExV2ActionsMixin { event AllowedMakerAdded(address indexed account); event AllowedMakerRemoved(address indexed account); mapping(address => bool) private makerToIsAllowed; // Gas could be optimized for the end-user by also storing an immutable ZRX_ASSET_DATA, // for example, but in the narrow OTC use-case of this adapter, taker fees are unlikely. constructor( address _integrationManager, address _exchange, address _fundDeployer, address[] memory _allowedMakers ) public AdapterBase(_integrationManager) FundDeployerOwnerMixin(_fundDeployer) ZeroExV2ActionsMixin(_exchange) { if (_allowedMakers.length > 0) { __addAllowedMakers(_allowedMakers); } } // EXTERNAL FUNCTIONS /// @notice Take an order on 0x /// @param _vaultProxy The VaultProxy of the calling fund /// @param _actionData Data specific to this action /// @param _assetData Parsed spend assets and incoming assets data for this action function takeOrder( address _vaultProxy, bytes calldata _actionData, bytes calldata _assetData ) external onlyIntegrationManager postActionIncomingAssetsTransferHandler(_vaultProxy, _assetData) { ( bytes memory encodedZeroExOrderArgs, uint256 takerAssetFillAmount ) = __decodeTakeOrderCallArgs(_actionData); IZeroExV2.Order memory order = __constructOrderStruct(encodedZeroExOrderArgs); (, , , bytes memory signature) = __decodeZeroExOrderArgs(encodedZeroExOrderArgs); __zeroExV2TakeOrder(order, takerAssetFillAmount, signature); } ///////////////////////////// // PARSE ASSETS FOR METHOD // ///////////////////////////// /// @notice Parses the expected assets in a particular action /// @param _selector The function selector for the callOnIntegration /// @param _actionData Data specific to this action /// @return spendAssetsHandleType_ A type that dictates how to handle granting /// the adapter access to spend assets (`None` by default) /// @return spendAssets_ The assets to spend in the call /// @return spendAssetAmounts_ The max asset amounts to spend in the call /// @return incomingAssets_ The assets to receive in the call /// @return minIncomingAssetAmounts_ The min asset amounts to receive in the call function parseAssetsForAction( address, bytes4 _selector, bytes calldata _actionData ) external view override returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAssets_, uint256[] memory minIncomingAssetAmounts_ ) { require(_selector == TAKE_ORDER_SELECTOR, "parseAssetsForAction: _selector invalid"); ( bytes memory encodedZeroExOrderArgs, uint256 takerAssetFillAmount ) = __decodeTakeOrderCallArgs(_actionData); IZeroExV2.Order memory order = __constructOrderStruct(encodedZeroExOrderArgs); require( isAllowedMaker(order.makerAddress), "parseAssetsForAction: Order maker is not allowed" ); require( takerAssetFillAmount <= order.takerAssetAmount, "parseAssetsForAction: Taker asset fill amount greater than available" ); address makerAsset = __getAssetAddress(order.makerAssetData); address takerAsset = __getAssetAddress(order.takerAssetData); // Format incoming assets incomingAssets_ = new address[](1); incomingAssets_[0] = makerAsset; minIncomingAssetAmounts_ = new uint256[](1); minIncomingAssetAmounts_[0] = __calcRelativeQuantity( order.takerAssetAmount, order.makerAssetAmount, takerAssetFillAmount ); if (order.takerFee > 0) { address takerFeeAsset = __getAssetAddress( IZeroExV2(getZeroExV2Exchange()).ZRX_ASSET_DATA() ); uint256 takerFeeFillAmount = __calcRelativeQuantity( order.takerAssetAmount, order.takerFee, takerAssetFillAmount ); // fee calculated relative to taker fill amount if (takerFeeAsset == makerAsset) { require( order.takerFee < order.makerAssetAmount, "parseAssetsForAction: Fee greater than makerAssetAmount" ); spendAssets_ = new address[](1); spendAssets_[0] = takerAsset; spendAssetAmounts_ = new uint256[](1); spendAssetAmounts_[0] = takerAssetFillAmount; minIncomingAssetAmounts_[0] = minIncomingAssetAmounts_[0].sub(takerFeeFillAmount); } else if (takerFeeAsset == takerAsset) { spendAssets_ = new address[](1); spendAssets_[0] = takerAsset; spendAssetAmounts_ = new uint256[](1); spendAssetAmounts_[0] = takerAssetFillAmount.add(takerFeeFillAmount); } else { spendAssets_ = new address[](2); spendAssets_[0] = takerAsset; spendAssets_[1] = takerFeeAsset; spendAssetAmounts_ = new uint256[](2); spendAssetAmounts_[0] = takerAssetFillAmount; spendAssetAmounts_[1] = takerFeeFillAmount; } } else { spendAssets_ = new address[](1); spendAssets_[0] = takerAsset; spendAssetAmounts_ = new uint256[](1); spendAssetAmounts_[0] = takerAssetFillAmount; } return ( IIntegrationManager.SpendAssetsHandleType.Transfer, spendAssets_, spendAssetAmounts_, incomingAssets_, minIncomingAssetAmounts_ ); } // PRIVATE FUNCTIONS /// @dev Decode the parameters of a takeOrder call /// @param _actionData Encoded parameters passed from client side /// @return encodedZeroExOrderArgs_ Encoded args of the 0x order /// @return takerAssetFillAmount_ Amount of taker asset to fill function __decodeTakeOrderCallArgs(bytes memory _actionData) private pure returns (bytes memory encodedZeroExOrderArgs_, uint256 takerAssetFillAmount_) { return abi.decode(_actionData, (bytes, uint256)); } ///////////////////////////// // ALLOWED MAKERS REGISTRY // ///////////////////////////// /// @notice Adds accounts to the list of allowed 0x order makers /// @param _accountsToAdd Accounts to add function addAllowedMakers(address[] calldata _accountsToAdd) external onlyFundDeployerOwner { __addAllowedMakers(_accountsToAdd); } /// @notice Removes accounts from the list of allowed 0x order makers /// @param _accountsToRemove Accounts to remove function removeAllowedMakers(address[] calldata _accountsToRemove) external onlyFundDeployerOwner { require(_accountsToRemove.length > 0, "removeAllowedMakers: Empty _accountsToRemove"); for (uint256 i; i < _accountsToRemove.length; i++) { require( isAllowedMaker(_accountsToRemove[i]), "removeAllowedMakers: Account is not an allowed maker" ); makerToIsAllowed[_accountsToRemove[i]] = false; emit AllowedMakerRemoved(_accountsToRemove[i]); } } /// @dev Helper to add accounts to the list of allowed makers function __addAllowedMakers(address[] memory _accountsToAdd) private { require(_accountsToAdd.length > 0, "__addAllowedMakers: Empty _accountsToAdd"); for (uint256 i; i < _accountsToAdd.length; i++) { require(!isAllowedMaker(_accountsToAdd[i]), "__addAllowedMakers: Value already set"); makerToIsAllowed[_accountsToAdd[i]] = true; emit AllowedMakerAdded(_accountsToAdd[i]); } } /// @dev Parses user inputs into a ZeroExV2.Order format function __constructOrderStruct(bytes memory _encodedOrderArgs) private pure returns (IZeroExV2.Order memory order_) { ( address[4] memory orderAddresses, uint256[6] memory orderValues, bytes[2] memory orderData, ) = __decodeZeroExOrderArgs(_encodedOrderArgs); return IZeroExV2.Order({ makerAddress: orderAddresses[0], takerAddress: orderAddresses[1], feeRecipientAddress: orderAddresses[2], senderAddress: orderAddresses[3], makerAssetAmount: orderValues[0], takerAssetAmount: orderValues[1], makerFee: orderValues[2], takerFee: orderValues[3], expirationTimeSeconds: orderValues[4], salt: orderValues[5], makerAssetData: orderData[0], takerAssetData: orderData[1] }); } /// @dev Decode the parameters of a 0x order /// @param _encodedZeroExOrderArgs Encoded parameters of the 0x order /// @return orderAddresses_ Addresses used in the order /// - [0] 0x Order param: makerAddress /// - [1] 0x Order param: takerAddress /// - [2] 0x Order param: feeRecipientAddress /// - [3] 0x Order param: senderAddress /// @return orderValues_ Values used in the order /// - [0] 0x Order param: makerAssetAmount /// - [1] 0x Order param: takerAssetAmount /// - [2] 0x Order param: makerFee /// - [3] 0x Order param: takerFee /// - [4] 0x Order param: expirationTimeSeconds /// - [5] 0x Order param: salt /// @return orderData_ Bytes data used in the order /// - [0] 0x Order param: makerAssetData /// - [1] 0x Order param: takerAssetData /// @return signature_ Signature of the order function __decodeZeroExOrderArgs(bytes memory _encodedZeroExOrderArgs) private pure returns ( address[4] memory orderAddresses_, uint256[6] memory orderValues_, bytes[2] memory orderData_, bytes memory signature_ ) { return abi.decode(_encodedZeroExOrderArgs, (address[4], uint256[6], bytes[2], bytes)); } /////////////////// // STATE GETTERS // /////////////////// /// @notice Checks whether an account is an allowed maker of 0x orders /// @param _who The account to check /// @return isAllowedMaker_ True if _who is an allowed maker function isAllowedMaker(address _who) public view returns (bool isAllowedMaker_) { return makerToIsAllowed[_who]; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; /// @title IFundDeployer Interface /// @author Enzyme Council <[email protected]> interface IFundDeployer { function getOwner() external view returns (address); function hasReconfigurationRequest(address) external view returns (bool); function isAllowedBuySharesOnBehalfCaller(address) external view returns (bool); function isAllowedVaultCall( address, bytes4, bytes32 ) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; /// @title IIntegrationManager interface /// @author Enzyme Council <[email protected]> /// @notice Interface for the IntegrationManager interface IIntegrationManager { enum SpendAssetsHandleType {None, Approve, Transfer} }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "../IIntegrationManager.sol"; /// @title Integration Adapter interface /// @author Enzyme Council <[email protected]> /// @notice Interface for all integration adapters interface IIntegrationAdapter { function parseAssetsForAction( address _vaultProxy, bytes4 _selector, bytes calldata _encodedCallArgs ) external view returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAssets_, uint256[] memory minIncomingAssetAmounts_ ); }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../../../../utils/AssetHelpers.sol"; import "../IIntegrationAdapter.sol"; import "./IntegrationSelectors.sol"; /// @title AdapterBase Contract /// @author Enzyme Council <[email protected]> /// @notice A base contract for integration adapters abstract contract AdapterBase is IIntegrationAdapter, IntegrationSelectors, AssetHelpers { using SafeERC20 for ERC20; address internal immutable INTEGRATION_MANAGER; /// @dev Provides a standard implementation for transferring incoming assets /// from an adapter to a VaultProxy at the end of an adapter action modifier postActionIncomingAssetsTransferHandler( address _vaultProxy, bytes memory _assetData ) { _; (, , address[] memory incomingAssets) = __decodeAssetData(_assetData); __pushFullAssetBalances(_vaultProxy, incomingAssets); } /// @dev Provides a standard implementation for transferring unspent spend assets /// from an adapter to a VaultProxy at the end of an adapter action modifier postActionSpendAssetsTransferHandler(address _vaultProxy, bytes memory _assetData) { _; (address[] memory spendAssets, , ) = __decodeAssetData(_assetData); __pushFullAssetBalances(_vaultProxy, spendAssets); } modifier onlyIntegrationManager { require( msg.sender == INTEGRATION_MANAGER, "Only the IntegrationManager can call this function" ); _; } constructor(address _integrationManager) public { INTEGRATION_MANAGER = _integrationManager; } // INTERNAL FUNCTIONS /// @dev Helper to decode the _assetData param passed to adapter call function __decodeAssetData(bytes memory _assetData) internal pure returns ( address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAssets_ ) { return abi.decode(_assetData, (address[], uint256[], address[])); } /////////////////// // STATE GETTERS // /////////////////// /// @notice Gets the `INTEGRATION_MANAGER` variable /// @return integrationManager_ The `INTEGRATION_MANAGER` variable value function getIntegrationManager() external view returns (address integrationManager_) { return INTEGRATION_MANAGER; } }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; /// @title IntegrationSelectors Contract /// @author Enzyme Council <[email protected]> /// @notice Selectors for integration actions /// @dev Selectors are created from their signatures rather than hardcoded for easy verification abstract contract IntegrationSelectors { // Trading bytes4 public constant TAKE_ORDER_SELECTOR = bytes4( keccak256("takeOrder(address,bytes,bytes)") ); // Lending bytes4 public constant LEND_SELECTOR = bytes4(keccak256("lend(address,bytes,bytes)")); bytes4 public constant REDEEM_SELECTOR = bytes4(keccak256("redeem(address,bytes,bytes)")); // Staking bytes4 public constant STAKE_SELECTOR = bytes4(keccak256("stake(address,bytes,bytes)")); bytes4 public constant UNSTAKE_SELECTOR = bytes4(keccak256("unstake(address,bytes,bytes)")); // Rewards bytes4 public constant CLAIM_REWARDS_SELECTOR = bytes4( keccak256("claimRewards(address,bytes,bytes)") ); // Combined bytes4 public constant LEND_AND_STAKE_SELECTOR = bytes4( keccak256("lendAndStake(address,bytes,bytes)") ); bytes4 public constant UNSTAKE_AND_REDEEM_SELECTOR = bytes4( keccak256("unstakeAndRedeem(address,bytes,bytes)") ); }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "../../../../../interfaces/IZeroExV2.sol"; import "../../../../../utils/AssetHelpers.sol"; import "../../../../../utils/MathHelpers.sol"; /// @title ZeroExV2ActionsMixin Contract /// @author Enzyme Council <[email protected]> /// @notice Mixin contract for interacting with the ZeroExV2 exchange functions abstract contract ZeroExV2ActionsMixin is AssetHelpers, MathHelpers { address private immutable ZERO_EX_V2_EXCHANGE; constructor(address _exchange) public { ZERO_EX_V2_EXCHANGE = _exchange; } /// @dev Helper to execute takeOrder function __zeroExV2TakeOrder( IZeroExV2.Order memory _order, uint256 _takerAssetFillAmount, bytes memory _signature ) internal { // Approve spend assets as needed __approveAssetMaxAsNeeded( __getAssetAddress(_order.takerAssetData), __getAssetProxy(_order.takerAssetData), _takerAssetFillAmount ); // Ignores whether makerAsset or takerAsset overlap with the takerFee asset for simplicity if (_order.takerFee > 0) { bytes memory zrxData = IZeroExV2(ZERO_EX_V2_EXCHANGE).ZRX_ASSET_DATA(); __approveAssetMaxAsNeeded( __getAssetAddress(zrxData), __getAssetProxy(zrxData), __calcRelativeQuantity( _order.takerAssetAmount, _order.takerFee, _takerAssetFillAmount ) // fee calculated relative to taker fill amount ); } // Execute order IZeroExV2(ZERO_EX_V2_EXCHANGE).fillOrder(_order, _takerAssetFillAmount, _signature); } /// @dev Parses the asset address from 0x assetData function __getAssetAddress(bytes memory _assetData) internal pure returns (address assetAddress_) { assembly { assetAddress_ := mload(add(_assetData, 36)) } } /// @dev Gets the 0x assetProxy address for an ERC20 token function __getAssetProxy(bytes memory _assetData) internal view returns (address assetProxy_) { bytes4 assetProxyId; assembly { assetProxyId := and( mload(add(_assetData, 32)), 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 ) } assetProxy_ = IZeroExV2(getZeroExV2Exchange()).getAssetProxy(assetProxyId); } /////////////////// // STATE GETTERS // /////////////////// /// @notice Gets the `ZERO_EX_V2_EXCHANGE` variable value /// @return zeroExV2Exchange_ The `ZERO_EX_V2_EXCHANGE` variable value function getZeroExV2Exchange() public view returns (address zeroExV2Exchange_) { return ZERO_EX_V2_EXCHANGE; } }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /// @dev Minimal interface for our interactions with the ZeroEx Exchange contract interface IZeroExV2 { struct Order { address makerAddress; address takerAddress; address feeRecipientAddress; address senderAddress; uint256 makerAssetAmount; uint256 takerAssetAmount; uint256 makerFee; uint256 takerFee; uint256 expirationTimeSeconds; uint256 salt; bytes makerAssetData; bytes takerAssetData; } struct OrderInfo { uint8 orderStatus; bytes32 orderHash; uint256 orderTakerAssetFilledAmount; } struct FillResults { uint256 makerAssetFilledAmount; uint256 takerAssetFilledAmount; uint256 makerFeePaid; uint256 takerFeePaid; } function ZRX_ASSET_DATA() external view returns (bytes memory); function filled(bytes32) external view returns (uint256); function cancelled(bytes32) external view returns (bool); function getOrderInfo(Order calldata) external view returns (OrderInfo memory); function getAssetProxy(bytes4) external view returns (address); function isValidSignature( bytes32, address, bytes calldata ) external view returns (bool); function preSign( bytes32, address, bytes calldata ) external; function cancelOrder(Order calldata) external; function fillOrder( Order calldata, uint256, bytes calldata ) external returns (FillResults memory); }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; /// @title AssetHelpers Contract /// @author Enzyme Council <[email protected]> /// @notice A util contract for common token actions abstract contract AssetHelpers { using SafeERC20 for ERC20; using SafeMath for uint256; /// @dev Helper to approve a target account with the max amount of an asset. /// This is helpful for fully trusted contracts, such as adapters that /// interact with external protocol like Uniswap, Compound, etc. function __approveAssetMaxAsNeeded( address _asset, address _target, uint256 _neededAmount ) internal { uint256 allowance = ERC20(_asset).allowance(address(this), _target); if (allowance < _neededAmount) { if (allowance > 0) { ERC20(_asset).safeApprove(_target, 0); } ERC20(_asset).safeApprove(_target, type(uint256).max); } } /// @dev Helper to transfer full asset balances from the current contract to a target function __pushFullAssetBalances(address _target, address[] memory _assets) internal returns (uint256[] memory amountsTransferred_) { amountsTransferred_ = new uint256[](_assets.length); for (uint256 i; i < _assets.length; i++) { ERC20 assetContract = ERC20(_assets[i]); amountsTransferred_[i] = assetContract.balanceOf(address(this)); if (amountsTransferred_[i] > 0) { assetContract.safeTransfer(_target, amountsTransferred_[i]); } } return amountsTransferred_; } }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "../core/fund-deployer/IFundDeployer.sol"; /// @title FundDeployerOwnerMixin Contract /// @author Enzyme Council <[email protected]> /// @notice A mixin contract that defers ownership to the owner of FundDeployer abstract contract FundDeployerOwnerMixin { address internal immutable FUND_DEPLOYER; modifier onlyFundDeployerOwner() { require( msg.sender == getOwner(), "onlyFundDeployerOwner: Only the FundDeployer owner can call this function" ); _; } constructor(address _fundDeployer) public { FUND_DEPLOYER = _fundDeployer; } /// @notice Gets the owner of this contract /// @return owner_ The owner /// @dev Ownership is deferred to the owner of the FundDeployer contract function getOwner() public view returns (address owner_) { return IFundDeployer(FUND_DEPLOYER).getOwner(); } /////////////////// // STATE GETTERS // /////////////////// /// @notice Gets the `FUND_DEPLOYER` variable /// @return fundDeployer_ The `FUND_DEPLOYER` variable value function getFundDeployer() public view returns (address fundDeployer_) { return FUND_DEPLOYER; } }
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; /// @title MathHelpers Contract /// @author Enzyme Council <[email protected]> /// @notice Helper functions for common math operations abstract contract MathHelpers { using SafeMath for uint256; /// @dev Calculates a proportional value relative to a known ratio. /// Caller is responsible as-necessary for: /// 1. validating _quantity1 to be non-zero /// 2. validating relativeQuantity2_ to be non-zero function __calcRelativeQuantity( uint256 _quantity1, uint256 _quantity2, uint256 _relativeQuantity1 ) internal pure returns (uint256 relativeQuantity2_) { return _relativeQuantity1.mul(_quantity2).div(_quantity1); } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "details": { "constantOptimizer": true, "cse": true, "deduplicate": true, "jumpdestRemover": true, "orderLiterals": true, "peephole": true, "yul": false }, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_integrationManager","type":"address"},{"internalType":"address","name":"_exchange","type":"address"},{"internalType":"address","name":"_fundDeployer","type":"address"},{"internalType":"address[]","name":"_allowedMakers","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AllowedMakerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AllowedMakerRemoved","type":"event"},{"inputs":[],"name":"CLAIM_REWARDS_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LEND_AND_STAKE_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LEND_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEEM_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TAKE_ORDER_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNSTAKE_AND_REDEEM_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNSTAKE_SELECTOR","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accountsToAdd","type":"address[]"}],"name":"addAllowedMakers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFundDeployer","outputs":[{"internalType":"address","name":"fundDeployer_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIntegrationManager","outputs":[{"internalType":"address","name":"integrationManager_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getZeroExV2Exchange","outputs":[{"internalType":"address","name":"zeroExV2Exchange_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_who","type":"address"}],"name":"isAllowedMaker","outputs":[{"internalType":"bool","name":"isAllowedMaker_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes4","name":"_selector","type":"bytes4"},{"internalType":"bytes","name":"_actionData","type":"bytes"}],"name":"parseAssetsForAction","outputs":[{"internalType":"enum IIntegrationManager.SpendAssetsHandleType","name":"spendAssetsHandleType_","type":"uint8"},{"internalType":"address[]","name":"spendAssets_","type":"address[]"},{"internalType":"uint256[]","name":"spendAssetAmounts_","type":"uint256[]"},{"internalType":"address[]","name":"incomingAssets_","type":"address[]"},{"internalType":"uint256[]","name":"minIncomingAssetAmounts_","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accountsToRemove","type":"address[]"}],"name":"removeAllowedMakers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultProxy","type":"address"},{"internalType":"bytes","name":"_actionData","type":"bytes"},{"internalType":"bytes","name":"_assetData","type":"bytes"}],"name":"takeOrder","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162002e9e38038062002e9e833981016040819052620000349162000254565b6001600160601b0319606085811b821660805283811b821660a05284901b1660c0528051156200006957620000698162000073565b505050506200040c565b6000815111620000a05760405162461bcd60e51b815260040162000097906200036b565b60405180910390fd5b60005b81518110156200019657620000d2828281518110620000be57fe5b60200260200101516200019a60201b60201c565b15620000f25760405162461bcd60e51b815260040162000097906200037d565b60016000808484815181106200010457fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055508181815181106200015057fe5b60200260200101516001600160a01b03167f2e1c3b07a83c6d2606a67771e6dd5c25722baac28ecf38e8056fb820d88536a860405160405180910390a2600101620000a3565b5050565b6001600160a01b031660009081526020819052604090205460ff1690565b8051620001c581620003f2565b92915050565b600082601f830112620001dd57600080fd5b8151620001f4620001ee82620003b6565b6200038f565b915081818352602084019350602081019050838560208402820111156200021a57600080fd5b60005b838110156200024a5781620002338882620001b8565b84525060209283019291909101906001016200021d565b5050505092915050565b600080600080608085870312156200026b57600080fd5b6000620002798787620001b8565b94505060206200028c87828801620001b8565b93505060406200029f87828801620001b8565b92505060608501516001600160401b03811115620002bc57600080fd5b620002ca87828801620001cb565b91505092959194509250565b6000620002e5602883620003d7565b7f5f5f616464416c6c6f7765644d616b6572733a20456d707479205f6163636f758152671b9d1cd51bd0591960c21b602082015260400192915050565b600062000331602583620003d7565b7f5f5f616464416c6c6f7765644d616b6572733a2056616c756520616c726561648152641e481cd95d60da1b602082015260400192915050565b60208082528101620001c581620002d6565b60208082528101620001c58162000322565b6040518181016001600160401b0381118282101715620003ae57600080fd5b604052919050565b60006001600160401b03821115620003cd57600080fd5b5060209081020190565b90815260200190565b60006001600160a01b038216620001c5565b620003fd81620003e0565b81146200040957600080fd5b50565b60805160601c60a05160601c60c05160601c612a48620004566000398061037f5280610e865280610f615250806104ad528061054352508061021d5280610c135250612a486000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063863e5ad0116100a2578063c54efee511610071578063c54efee5146101ab578063c960260d146101cf578063e7c45690146101e2578063f7d882b5146101ea578063ff7ede37146101f25761010b565b8063863e5ad01461018b578063893d20e81461019357806397c0ac871461019b578063b23228cf146101a35761010b565b8063257cb1a3116100de578063257cb1a3146101605780633ffc15911461016857806340da225d146101705780634ce13fb0146101785761010b565b806303e38a2b14610110578063080456c114610125578063131461c0146101435780631d566eee1461014b575b600080fd5b61012361011e366004611c51565b610212565b005b61012d610335565b60405161013a9190612705565b60405180910390f35b61012d610359565b61015361037d565b60405161013a91906126b3565b61012d6103a1565b61012d6103c5565b61012d6103e9565b610123610186366004611d68565b61040d565b61012d610485565b6101536104a9565b610153610541565b61012d610565565b6101be6101b9366004611bea565b610589565b60405161013a959493929190612713565b6101236101dd366004611d68565b610ac0565b610153610c11565b61012d610c35565b610205610200366004611ba6565b610c59565b60405161013a91906126f7565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102635760405162461bcd60e51b815260040161025a90612800565b60405180910390fd5b8482828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020601f8c018190048102820181019092528a8152606095509193506102db92508a908a9081908401838280828437600092019190915250610c7b92505050565b915091506102e761173d565b6102f083610c9c565b905060606102fd84610e16565b935050505061030d828483610e53565b50505050606061031c82610ff2565b9250505061032a8382611018565b505050505050505050565b7f8334eb99be0145865eba9889fca2ee920288090caefff4cc776038e20ad9259a81565b7f29fa046e79524c3c5ac4c01df692c35e217802b2b13b21121b76cf0ef02b138c81565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f099f75155f0e997bf83a7993a71d5e7e7540bd386fe1e84643a09ce6b412521981565b7ffa7dd04da627f433da73c4355ead9c75682a67a8fc84d3f6170ef0922f402d2481565b7fb9dfbaccbe5cd2a84fdcf1d15f23ef25d23086f5afbaa99516065ed4a5bbc7a381565b6104156104a9565b6001600160a01b0316336001600160a01b0316146104455760405162461bcd60e51b815260040161025a906127a0565b61048182828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061117492505050565b5050565b7f03e38a2bd7063d45c897edeafc330e71657502dd86434d3c37a489caf116af6981565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b15801561050457600080fd5b505afa158015610518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053c9190611bcc565b905090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f68e30677f607df46e87da13e15b637784cfa62374b653f35ab43d10361a2f83081565b600060608080806001600160e01b031988166303e38a2b60e01b146105c05760405162461bcd60e51b815260040161025a90612880565b6060600061060389898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c7b92505050565b9150915061060f61173d565b61061883610c9c565b90506106278160000151610c59565b6106435760405162461bcd60e51b815260040161025a90612820565b8060a001518211156106675760405162461bcd60e51b815260040161025a906127d0565b600061067782610140015161127b565b9050600061068983610160015161127b565b6040805160018082528183019092529192506020808301908036833701905050965081876000815181106106b957fe5b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505095506107028360a00151846080015186611282565b8660008151811061070f57fe5b602090810291909101015260e083015115610a2d5760006107aa61073161037d565b6001600160a01b031663db123b1a6040518163ffffffff1660e01b815260040160006040518083038186803b15801561076957600080fd5b505afa15801561077d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107a59190810190611e58565b61127b565b905060006107c18560a001518660e0015188611282565b9050836001600160a01b0316826001600160a01b031614156108c75784608001518560e00151106108045760405162461bcd60e51b815260040161025a90612790565b6040805160018082528183019092529060208083019080368337019050509a50828b60008151811061083257fe5b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509950858a60008151811061087657fe5b6020026020010181815250506108a9818960008151811061089357fe5b60200260200101516112a290919063ffffffff16565b886000815181106108b657fe5b602002602001018181525050610a26565b826001600160a01b0316826001600160a01b0316141561095c576040805160018082528183019092529060208083019080368337019050509a50828b60008151811061090f57fe5b6001600160a01b039290921660209283029190910182015260408051600180825281830190925291828101908036833701905050995061094f86826112ca565b8a6000815181106108b657fe5b6040805160028082526060820183529091602083019080368337019050509a50828b60008151811061098a57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818b6001815181106109b857fe5b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352909290919083019080368337019050509950858a6000815181106109ff57fe5b602002602001018181525050808a600181518110610a1957fe5b6020026020010181815250505b5050610aac565b60408051600180825281830190925290602080830190803683370190505098508089600081518110610a5b57fe5b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505097508388600081518110610a9f57fe5b6020026020010181815250505b600299505050505050945094509450945094565b610ac86104a9565b6001600160a01b0316336001600160a01b031614610af85760405162461bcd60e51b815260040161025a906127a0565b80610b155760405162461bcd60e51b815260040161025a90612780565b60005b81811015610c0c57610b44838383818110610b2f57fe5b90506020020160208101906102009190611ba6565b610b605760405162461bcd60e51b815260040161025a90612870565b6000806000858585818110610b7157fe5b9050602002016020810190610b869190611ba6565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055828282818110610bba57fe5b9050602002016020810190610bcf9190611ba6565b6001600160a01b03167f20bc817441764d1758bec8956a90bf0ba498c8c4098524577f7c068d3c9f8c3660405160405180910390a2600101610b18565b505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7fc29fa9dde84204c2908778afd0613d802d31cf046179b88f6d2b4a4e507ea2d581565b6001600160a01b03811660009081526020819052604090205460ff165b919050565b6060600082806020019051810190610c939190611e8c565b91509150915091565b610ca461173d565b610cac6117c2565b610cb46117e0565b610cbc6117fe565b610cc585610e16565b5092509250925060405180610180016040528084600060048110610ce557fe5b60200201516001600160a01b0316815260200184600160048110610d0557fe5b60200201516001600160a01b0316815260200184600260048110610d2557fe5b60200201516001600160a01b0316815260200184600360048110610d4557fe5b60200201516001600160a01b0316815260200183600060068110610d6557fe5b6020020151815260200183600160068110610d7c57fe5b6020020151815260200183600260068110610d9357fe5b6020020151815260200183600360068110610daa57fe5b6020020151815260200183600460068110610dc157fe5b6020020151815260200183600560068110610dd857fe5b6020020151815260200182600060028110610def57fe5b6020020151815260200182600160028110610e0657fe5b6020020151905295945050505050565b610e1e6117c2565b610e266117e0565b610e2e6117fe565b606084806020019051810190610e449190611cd6565b93509350935093509193509193565b610e78610e6484610160015161127b565b610e728561016001516112ef565b84611384565b60e083015115610f4a5760607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663db123b1a6040518163ffffffff1660e01b815260040160006040518083038186803b158015610edd57600080fd5b505afa158015610ef1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f199190810190611e58565b9050610f48610f278261127b565b610f30836112ef565b610f438760a001518860e0015188611282565b611384565b505b60405163b4be83d560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b4be83d590610f9a90869086908690600401612890565b608060405180830381600087803b158015610fb457600080fd5b505af1158015610fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fec9190611edc565b50505050565b60608060608380602001905181019061100b9190611da9565b9250925092509193909250565b606081516001600160401b038111801561103157600080fd5b5060405190808252806020026020018201604052801561105b578160200160208202803683370190505b50905060005b825181101561116c57600083828151811061107857fe5b60200260200101519050806001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016110ae91906126b3565b60206040518083038186803b1580156110c657600080fd5b505afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe9190611efa565b83838151811061110a57fe5b602002602001018181525050600083838151811061112457fe5b60200260200101511115611163576111638584848151811061114257fe5b6020026020010151836001600160a01b03166114409092919063ffffffff16565b50600101611061565b505b92915050565b60008151116111955760405162461bcd60e51b815260040161025a906127c0565b60005b8151811015610481576111bd8282815181106111b057fe5b6020026020010151610c59565b156111da5760405162461bcd60e51b815260040161025a90612840565b60016000808484815181106111eb57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555081818151811061123657fe5b60200260200101516001600160a01b03167f2e1c3b07a83c6d2606a67771e6dd5c25722baac28ecf38e8056fb820d88536a860405160405180910390a2600101611198565b6024015190565b6000611298846112928486611496565b906114d0565b90505b9392505050565b6000828211156112c45760405162461bcd60e51b815260040161025a906127e0565b50900390565b60008282018381101561129b5760405162461bcd60e51b815260040161025a906127b0565b60208101516000906001600160e01b03191661130961037d565b6001600160a01b03166360704108826040518263ffffffff1660e01b81526004016113349190612705565b60206040518083038186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190611bcc565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e906113b590309087906004016126c1565b60206040518083038186803b1580156113cd57600080fd5b505afa1580156113e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114059190611efa565b905081811015610fec57801561142a5761142a6001600160a01b038516846000611502565b610fec6001600160a01b03851684600019611502565b610c0c8363a9059cbb60e01b848460405160240161145f9291906126dc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526115c5565b6000826114a55750600061116e565b828202828482816114b257fe5b041461129b5760405162461bcd60e51b815260040161025a90612810565b60008082116114f15760405162461bcd60e51b815260040161025a906127f0565b8183816114fa57fe5b049392505050565b80158061158a5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e9061153890309086906004016126c1565b60206040518083038186803b15801561155057600080fd5b505afa158015611564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115889190611efa565b155b6115a65760405162461bcd60e51b815260040161025a90612860565b610c0c8363095ea7b360e01b848460405160240161145f9291906126dc565b606061161a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116549092919063ffffffff16565b805190915015610c0c57808060200190518101906116389190611e3a565b610c0c5760405162461bcd60e51b815260040161025a90612850565b6060611298848460008585611668856116fe565b6116845760405162461bcd60e51b815260040161025a90612830565b60006060866001600160a01b031685876040516116a191906126a7565b60006040518083038185875af1925050503d80600081146116de576040519150601f19603f3d011682016040523d82523d6000602084013e6116e3565b606091505b50915091506116f3828286611704565b979650505050505050565b3b151590565b6060831561171357508161129b565b8251156117235782518084602001fd5b8160405162461bcd60e51b815260040161025a919061276f565b60405180610180016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001606081525090565b60405180608001604052806004906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180604001604052806002905b606081526020019060019003908161180d5790505090565b803561116e816129e3565b805161116e816129e3565b600082601f83011261184c57600080fd5b600461185f61185a826128e8565b6128c2565b9150818385602084028201111561187557600080fd5b60005b838110156118a1578161188b8882611830565b8452506020928301929190910190600101611878565b5050505092915050565b60008083601f8401126118bd57600080fd5b5081356001600160401b038111156118d457600080fd5b6020830191508360208202830111156118ec57600080fd5b9250929050565b600082601f83011261190457600080fd5b815161191261185a82612905565b9150818183526020840193506020810190508385602084028201111561193757600080fd5b60005b838110156118a1578161194d8882611830565b845250602092830192919091019060010161193a565b600082601f83011261197457600080fd5b600261198261185a826128e8565b9150818360005b838110156118a1578151860161199f8882611add565b8452506020928301929190910190600101611989565b600082601f8301126119c657600080fd5b60066119d461185a826128e8565b915081838560208402820111156119ea57600080fd5b60005b838110156118a15781611a008882611b9b565b84525060209283019291909101906001016119ed565b600082601f830112611a2757600080fd5b8151611a3561185a82612905565b91508181835260208401935060208101905083856020840282011115611a5a57600080fd5b60005b838110156118a15781611a708882611b9b565b8452506020928301929190910190600101611a5d565b805161116e816129f7565b803561116e81612a00565b60008083601f840112611aae57600080fd5b5081356001600160401b03811115611ac557600080fd5b6020830191508360018202830111156118ec57600080fd5b600082601f830112611aee57600080fd5b8151611afc61185a82612925565b91508082526020830160208301858383011115611b1857600080fd5b611b238382846129a0565b50505092915050565b600060808284031215611b3e57600080fd5b611b4860806128c2565b90506000611b568484611b9b565b8252506020611b6784848301611b9b565b6020830152506040611b7b84828501611b9b565b6040830152506060611b8f84828501611b9b565b60608301525092915050565b805161116e81612a09565b600060208284031215611bb857600080fd5b6000611bc48484611825565b949350505050565b600060208284031215611bde57600080fd5b6000611bc48484611830565b60008060008060608587031215611c0057600080fd5b6000611c0c8787611825565b9450506020611c1d87828801611a91565b93505060408501356001600160401b03811115611c3957600080fd5b611c4587828801611a9c565b95989497509550505050565b600080600080600060608688031215611c6957600080fd5b6000611c758888611825565b95505060208601356001600160401b03811115611c9157600080fd5b611c9d88828901611a9c565b945094505060408601356001600160401b03811115611cbb57600080fd5b611cc788828901611a9c565b92509250509295509295909350565b6000806000806101808587031215611ced57600080fd5b6000611cf9878761183b565b9450506080611d0a878288016119b5565b9350506101408501516001600160401b03811115611d2757600080fd5b611d3387828801611963565b9250506101608501516001600160401b03811115611d5057600080fd5b611d5c87828801611add565b91505092959194509250565b60008060208385031215611d7b57600080fd5b82356001600160401b03811115611d9157600080fd5b611d9d858286016118ab565b92509250509250929050565b600080600060608486031215611dbe57600080fd5b83516001600160401b03811115611dd457600080fd5b611de0868287016118f3565b93505060208401516001600160401b03811115611dfc57600080fd5b611e0886828701611a16565b92505060408401516001600160401b03811115611e2457600080fd5b611e30868287016118f3565b9150509250925092565b600060208284031215611e4c57600080fd5b6000611bc48484611a86565b600060208284031215611e6a57600080fd5b81516001600160401b03811115611e8057600080fd5b611bc484828501611add565b60008060408385031215611e9f57600080fd5b82516001600160401b03811115611eb557600080fd5b611ec185828601611add565b9250506020611ed285828601611b9b565b9150509250929050565b600060808284031215611eee57600080fd5b6000611bc48484611b2c565b600060208284031215611f0c57600080fd5b6000611bc48484611b9b565b6000611f248383611f38565b505060200190565b6000611f24838361269e565b611f418161295f565b82525050565b6000611f5282612952565b611f5c8185612956565b9350611f678361294c565b8060005b83811015611f95578151611f7f8882611f18565b9750611f8a8361294c565b925050600101611f6b565b509495945050505050565b6000611fab82612952565b611fb58185612956565b9350611fc08361294c565b8060005b83811015611f95578151611fd88882611f2c565b9750611fe38361294c565b925050600101611fc4565b611f418161296a565b611f418161296f565b600061200b82612952565b6120158185612956565b93506120258185602086016129a0565b61202e816129cc565b9093019392505050565b600061204382612952565b61204d8185610c76565b935061205d8185602086016129a0565b9290920192915050565b611f4181612995565b600061207d602c83612956565b7f72656d6f7665416c6c6f7765644d616b6572733a20456d707479205f6163636f81526b756e7473546f52656d6f766560a01b602082015260400192915050565b60006120cb603783612956565b7f7061727365417373657473466f72416374696f6e3a204665652067726561746581527f72207468616e206d616b65724173736574416d6f756e74000000000000000000602082015260400192915050565b600061212a604983612956565b7f6f6e6c7946756e644465706c6f7965724f776e65723a204f6e6c79207468652081527f46756e644465706c6f796572206f776e65722063616e2063616c6c207468697360208201526810333ab731ba34b7b760b91b604082015260600192915050565b600061219b601b83612956565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b60006121d4602883612956565b7f5f5f616464416c6c6f7765644d616b6572733a20456d707479205f6163636f758152671b9d1cd51bd0591960c21b602082015260400192915050565b600061221e604483612956565b7f7061727365417373657473466f72416374696f6e3a2054616b6572206173736581527f742066696c6c20616d6f756e742067726561746572207468616e20617661696c60208201526361626c6560e01b604082015260600192915050565b600061228a601e83612956565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b60006122c3601a83612956565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b60006122fc603283612956565b7f4f6e6c792074686520496e746567726174696f6e4d616e616765722063616e2081527131b0b636103a3434b990333ab731ba34b7b760711b602082015260400192915050565b6000612350602183612956565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612393603083612956565b7f7061727365417373657473466f72416374696f6e3a204f72646572206d616b6581526f1c881a5cc81b9bdd08185b1b1bddd95960821b602082015260400192915050565b60006123e5601d83612956565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000815260200192915050565b600061241e602583612956565b7f5f5f616464416c6c6f7765644d616b6572733a2056616c756520616c726561648152641e481cd95d60da1b602082015260400192915050565b6000612465602a83612956565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b60006124b1603683612956565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f81527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b602082015260400192915050565b6000612509603483612956565b7f72656d6f7665416c6c6f7765644d616b6572733a204163636f756e74206973208152733737ba1030b71030b63637bbb2b21036b0b5b2b960611b602082015260400192915050565b600061255f602783612956565b7f7061727365417373657473466f72416374696f6e3a205f73656c6563746f72208152661a5b9d985b1a5960ca1b602082015260400192915050565b80516000906101808401906125b08582611f38565b5060208301516125c36020860182611f38565b5060408301516125d66040860182611f38565b5060608301516125e96060860182611f38565b5060808301516125fc608086018261269e565b5060a083015161260f60a086018261269e565b5060c083015161262260c086018261269e565b5060e083015161263560e086018261269e565b5061010083015161264a61010086018261269e565b5061012083015161265f61012086018261269e565b506101408301518482036101408601526126798282612000565b9150506101608301518482036101608601526126958282612000565b95945050505050565b611f4181612992565b600061129b8284612038565b6020810161116e8284611f38565b604081016126cf8285611f38565b61129b6020830184611f38565b604081016126ea8285611f38565b61129b602083018461269e565b6020810161116e8284611fee565b6020810161116e8284611ff7565b60a081016127218288612067565b81810360208301526127338187611f47565b905081810360408301526127478186611fa0565b9050818103606083015261275b8185611f47565b905081810360808301526116f38184611fa0565b6020808252810161129b8184612000565b6020808252810161116e81612070565b6020808252810161116e816120be565b6020808252810161116e8161211d565b6020808252810161116e8161218e565b6020808252810161116e816121c7565b6020808252810161116e81612211565b6020808252810161116e8161227d565b6020808252810161116e816122b6565b6020808252810161116e816122ef565b6020808252810161116e81612343565b6020808252810161116e81612386565b6020808252810161116e816123d8565b6020808252810161116e81612411565b6020808252810161116e81612458565b6020808252810161116e816124a4565b6020808252810161116e816124fc565b6020808252810161116e81612552565b606080825281016128a1818661259b565b90506128b0602083018561269e565b81810360408301526126958184612000565b6040518181016001600160401b03811182821017156128e057600080fd5b604052919050565b60006001600160401b038211156128fe57600080fd5b5060200290565b60006001600160401b0382111561291b57600080fd5b5060209081020190565b60006001600160401b0382111561293b57600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b600061116e82612986565b151590565b6001600160e01b03191690565b80610c76816129d6565b6001600160a01b031690565b90565b600061116e8261297c565b60005b838110156129bb5781810151838201526020016129a3565b83811115610fec5750506000910152565b601f01601f191690565b600381106129e057fe5b50565b6129ec8161295f565b81146129e057600080fd5b6129ec8161296a565b6129ec8161296f565b6129ec8161299256fea26469706673582212205c21cc3f38d32d5b4c7fa1c6a3b0027d0d979917762f0fcb3ee9e17363e9b24f64736f6c634300060c003300000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e000000000000000000000000080bf510fcbf18b91105470639e95610229377120000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc63600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000200000000000000000000000056178a0d5f301baf6cf3e1cd53d9863437345bf9000000000000000000000000e0238da09cab56b3066f26f98657dcce801c16b9
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063863e5ad0116100a2578063c54efee511610071578063c54efee5146101ab578063c960260d146101cf578063e7c45690146101e2578063f7d882b5146101ea578063ff7ede37146101f25761010b565b8063863e5ad01461018b578063893d20e81461019357806397c0ac871461019b578063b23228cf146101a35761010b565b8063257cb1a3116100de578063257cb1a3146101605780633ffc15911461016857806340da225d146101705780634ce13fb0146101785761010b565b806303e38a2b14610110578063080456c114610125578063131461c0146101435780631d566eee1461014b575b600080fd5b61012361011e366004611c51565b610212565b005b61012d610335565b60405161013a9190612705565b60405180910390f35b61012d610359565b61015361037d565b60405161013a91906126b3565b61012d6103a1565b61012d6103c5565b61012d6103e9565b610123610186366004611d68565b61040d565b61012d610485565b6101536104a9565b610153610541565b61012d610565565b6101be6101b9366004611bea565b610589565b60405161013a959493929190612713565b6101236101dd366004611d68565b610ac0565b610153610c11565b61012d610c35565b610205610200366004611ba6565b610c59565b60405161013a91906126f7565b336001600160a01b037f00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e16146102635760405162461bcd60e51b815260040161025a90612800565b60405180910390fd5b8482828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020601f8c018190048102820181019092528a8152606095509193506102db92508a908a9081908401838280828437600092019190915250610c7b92505050565b915091506102e761173d565b6102f083610c9c565b905060606102fd84610e16565b935050505061030d828483610e53565b50505050606061031c82610ff2565b9250505061032a8382611018565b505050505050505050565b7f8334eb99be0145865eba9889fca2ee920288090caefff4cc776038e20ad9259a81565b7f29fa046e79524c3c5ac4c01df692c35e217802b2b13b21121b76cf0ef02b138c81565b7f000000000000000000000000080bf510fcbf18b91105470639e956102293771290565b7f099f75155f0e997bf83a7993a71d5e7e7540bd386fe1e84643a09ce6b412521981565b7ffa7dd04da627f433da73c4355ead9c75682a67a8fc84d3f6170ef0922f402d2481565b7fb9dfbaccbe5cd2a84fdcf1d15f23ef25d23086f5afbaa99516065ed4a5bbc7a381565b6104156104a9565b6001600160a01b0316336001600160a01b0316146104455760405162461bcd60e51b815260040161025a906127a0565b61048182828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061117492505050565b5050565b7f03e38a2bd7063d45c897edeafc330e71657502dd86434d3c37a489caf116af6981565b60007f0000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc63606001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b15801561050457600080fd5b505afa158015610518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053c9190611bcc565b905090565b7f0000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc636090565b7f68e30677f607df46e87da13e15b637784cfa62374b653f35ab43d10361a2f83081565b600060608080806001600160e01b031988166303e38a2b60e01b146105c05760405162461bcd60e51b815260040161025a90612880565b6060600061060389898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c7b92505050565b9150915061060f61173d565b61061883610c9c565b90506106278160000151610c59565b6106435760405162461bcd60e51b815260040161025a90612820565b8060a001518211156106675760405162461bcd60e51b815260040161025a906127d0565b600061067782610140015161127b565b9050600061068983610160015161127b565b6040805160018082528183019092529192506020808301908036833701905050965081876000815181106106b957fe5b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505095506107028360a00151846080015186611282565b8660008151811061070f57fe5b602090810291909101015260e083015115610a2d5760006107aa61073161037d565b6001600160a01b031663db123b1a6040518163ffffffff1660e01b815260040160006040518083038186803b15801561076957600080fd5b505afa15801561077d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107a59190810190611e58565b61127b565b905060006107c18560a001518660e0015188611282565b9050836001600160a01b0316826001600160a01b031614156108c75784608001518560e00151106108045760405162461bcd60e51b815260040161025a90612790565b6040805160018082528183019092529060208083019080368337019050509a50828b60008151811061083257fe5b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509950858a60008151811061087657fe5b6020026020010181815250506108a9818960008151811061089357fe5b60200260200101516112a290919063ffffffff16565b886000815181106108b657fe5b602002602001018181525050610a26565b826001600160a01b0316826001600160a01b0316141561095c576040805160018082528183019092529060208083019080368337019050509a50828b60008151811061090f57fe5b6001600160a01b039290921660209283029190910182015260408051600180825281830190925291828101908036833701905050995061094f86826112ca565b8a6000815181106108b657fe5b6040805160028082526060820183529091602083019080368337019050509a50828b60008151811061098a57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818b6001815181106109b857fe5b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352909290919083019080368337019050509950858a6000815181106109ff57fe5b602002602001018181525050808a600181518110610a1957fe5b6020026020010181815250505b5050610aac565b60408051600180825281830190925290602080830190803683370190505098508089600081518110610a5b57fe5b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505097508388600081518110610a9f57fe5b6020026020010181815250505b600299505050505050945094509450945094565b610ac86104a9565b6001600160a01b0316336001600160a01b031614610af85760405162461bcd60e51b815260040161025a906127a0565b80610b155760405162461bcd60e51b815260040161025a90612780565b60005b81811015610c0c57610b44838383818110610b2f57fe5b90506020020160208101906102009190611ba6565b610b605760405162461bcd60e51b815260040161025a90612870565b6000806000858585818110610b7157fe5b9050602002016020810190610b869190611ba6565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055828282818110610bba57fe5b9050602002016020810190610bcf9190611ba6565b6001600160a01b03167f20bc817441764d1758bec8956a90bf0ba498c8c4098524577f7c068d3c9f8c3660405160405180910390a2600101610b18565b505050565b7f00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e90565b7fc29fa9dde84204c2908778afd0613d802d31cf046179b88f6d2b4a4e507ea2d581565b6001600160a01b03811660009081526020819052604090205460ff165b919050565b6060600082806020019051810190610c939190611e8c565b91509150915091565b610ca461173d565b610cac6117c2565b610cb46117e0565b610cbc6117fe565b610cc585610e16565b5092509250925060405180610180016040528084600060048110610ce557fe5b60200201516001600160a01b0316815260200184600160048110610d0557fe5b60200201516001600160a01b0316815260200184600260048110610d2557fe5b60200201516001600160a01b0316815260200184600360048110610d4557fe5b60200201516001600160a01b0316815260200183600060068110610d6557fe5b6020020151815260200183600160068110610d7c57fe5b6020020151815260200183600260068110610d9357fe5b6020020151815260200183600360068110610daa57fe5b6020020151815260200183600460068110610dc157fe5b6020020151815260200183600560068110610dd857fe5b6020020151815260200182600060028110610def57fe5b6020020151815260200182600160028110610e0657fe5b6020020151905295945050505050565b610e1e6117c2565b610e266117e0565b610e2e6117fe565b606084806020019051810190610e449190611cd6565b93509350935093509193509193565b610e78610e6484610160015161127b565b610e728561016001516112ef565b84611384565b60e083015115610f4a5760607f000000000000000000000000080bf510fcbf18b91105470639e95610229377126001600160a01b031663db123b1a6040518163ffffffff1660e01b815260040160006040518083038186803b158015610edd57600080fd5b505afa158015610ef1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f199190810190611e58565b9050610f48610f278261127b565b610f30836112ef565b610f438760a001518860e0015188611282565b611384565b505b60405163b4be83d560e01b81526001600160a01b037f000000000000000000000000080bf510fcbf18b91105470639e9561022937712169063b4be83d590610f9a90869086908690600401612890565b608060405180830381600087803b158015610fb457600080fd5b505af1158015610fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fec9190611edc565b50505050565b60608060608380602001905181019061100b9190611da9565b9250925092509193909250565b606081516001600160401b038111801561103157600080fd5b5060405190808252806020026020018201604052801561105b578160200160208202803683370190505b50905060005b825181101561116c57600083828151811061107857fe5b60200260200101519050806001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016110ae91906126b3565b60206040518083038186803b1580156110c657600080fd5b505afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe9190611efa565b83838151811061110a57fe5b602002602001018181525050600083838151811061112457fe5b60200260200101511115611163576111638584848151811061114257fe5b6020026020010151836001600160a01b03166114409092919063ffffffff16565b50600101611061565b505b92915050565b60008151116111955760405162461bcd60e51b815260040161025a906127c0565b60005b8151811015610481576111bd8282815181106111b057fe5b6020026020010151610c59565b156111da5760405162461bcd60e51b815260040161025a90612840565b60016000808484815181106111eb57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555081818151811061123657fe5b60200260200101516001600160a01b03167f2e1c3b07a83c6d2606a67771e6dd5c25722baac28ecf38e8056fb820d88536a860405160405180910390a2600101611198565b6024015190565b6000611298846112928486611496565b906114d0565b90505b9392505050565b6000828211156112c45760405162461bcd60e51b815260040161025a906127e0565b50900390565b60008282018381101561129b5760405162461bcd60e51b815260040161025a906127b0565b60208101516000906001600160e01b03191661130961037d565b6001600160a01b03166360704108826040518263ffffffff1660e01b81526004016113349190612705565b60206040518083038186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190611bcc565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e906113b590309087906004016126c1565b60206040518083038186803b1580156113cd57600080fd5b505afa1580156113e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114059190611efa565b905081811015610fec57801561142a5761142a6001600160a01b038516846000611502565b610fec6001600160a01b03851684600019611502565b610c0c8363a9059cbb60e01b848460405160240161145f9291906126dc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526115c5565b6000826114a55750600061116e565b828202828482816114b257fe5b041461129b5760405162461bcd60e51b815260040161025a90612810565b60008082116114f15760405162461bcd60e51b815260040161025a906127f0565b8183816114fa57fe5b049392505050565b80158061158a5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e9061153890309086906004016126c1565b60206040518083038186803b15801561155057600080fd5b505afa158015611564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115889190611efa565b155b6115a65760405162461bcd60e51b815260040161025a90612860565b610c0c8363095ea7b360e01b848460405160240161145f9291906126dc565b606061161a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116549092919063ffffffff16565b805190915015610c0c57808060200190518101906116389190611e3a565b610c0c5760405162461bcd60e51b815260040161025a90612850565b6060611298848460008585611668856116fe565b6116845760405162461bcd60e51b815260040161025a90612830565b60006060866001600160a01b031685876040516116a191906126a7565b60006040518083038185875af1925050503d80600081146116de576040519150601f19603f3d011682016040523d82523d6000602084013e6116e3565b606091505b50915091506116f3828286611704565b979650505050505050565b3b151590565b6060831561171357508161129b565b8251156117235782518084602001fd5b8160405162461bcd60e51b815260040161025a919061276f565b60405180610180016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001606081525090565b60405180608001604052806004906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b60405180604001604052806002905b606081526020019060019003908161180d5790505090565b803561116e816129e3565b805161116e816129e3565b600082601f83011261184c57600080fd5b600461185f61185a826128e8565b6128c2565b9150818385602084028201111561187557600080fd5b60005b838110156118a1578161188b8882611830565b8452506020928301929190910190600101611878565b5050505092915050565b60008083601f8401126118bd57600080fd5b5081356001600160401b038111156118d457600080fd5b6020830191508360208202830111156118ec57600080fd5b9250929050565b600082601f83011261190457600080fd5b815161191261185a82612905565b9150818183526020840193506020810190508385602084028201111561193757600080fd5b60005b838110156118a1578161194d8882611830565b845250602092830192919091019060010161193a565b600082601f83011261197457600080fd5b600261198261185a826128e8565b9150818360005b838110156118a1578151860161199f8882611add565b8452506020928301929190910190600101611989565b600082601f8301126119c657600080fd5b60066119d461185a826128e8565b915081838560208402820111156119ea57600080fd5b60005b838110156118a15781611a008882611b9b565b84525060209283019291909101906001016119ed565b600082601f830112611a2757600080fd5b8151611a3561185a82612905565b91508181835260208401935060208101905083856020840282011115611a5a57600080fd5b60005b838110156118a15781611a708882611b9b565b8452506020928301929190910190600101611a5d565b805161116e816129f7565b803561116e81612a00565b60008083601f840112611aae57600080fd5b5081356001600160401b03811115611ac557600080fd5b6020830191508360018202830111156118ec57600080fd5b600082601f830112611aee57600080fd5b8151611afc61185a82612925565b91508082526020830160208301858383011115611b1857600080fd5b611b238382846129a0565b50505092915050565b600060808284031215611b3e57600080fd5b611b4860806128c2565b90506000611b568484611b9b565b8252506020611b6784848301611b9b565b6020830152506040611b7b84828501611b9b565b6040830152506060611b8f84828501611b9b565b60608301525092915050565b805161116e81612a09565b600060208284031215611bb857600080fd5b6000611bc48484611825565b949350505050565b600060208284031215611bde57600080fd5b6000611bc48484611830565b60008060008060608587031215611c0057600080fd5b6000611c0c8787611825565b9450506020611c1d87828801611a91565b93505060408501356001600160401b03811115611c3957600080fd5b611c4587828801611a9c565b95989497509550505050565b600080600080600060608688031215611c6957600080fd5b6000611c758888611825565b95505060208601356001600160401b03811115611c9157600080fd5b611c9d88828901611a9c565b945094505060408601356001600160401b03811115611cbb57600080fd5b611cc788828901611a9c565b92509250509295509295909350565b6000806000806101808587031215611ced57600080fd5b6000611cf9878761183b565b9450506080611d0a878288016119b5565b9350506101408501516001600160401b03811115611d2757600080fd5b611d3387828801611963565b9250506101608501516001600160401b03811115611d5057600080fd5b611d5c87828801611add565b91505092959194509250565b60008060208385031215611d7b57600080fd5b82356001600160401b03811115611d9157600080fd5b611d9d858286016118ab565b92509250509250929050565b600080600060608486031215611dbe57600080fd5b83516001600160401b03811115611dd457600080fd5b611de0868287016118f3565b93505060208401516001600160401b03811115611dfc57600080fd5b611e0886828701611a16565b92505060408401516001600160401b03811115611e2457600080fd5b611e30868287016118f3565b9150509250925092565b600060208284031215611e4c57600080fd5b6000611bc48484611a86565b600060208284031215611e6a57600080fd5b81516001600160401b03811115611e8057600080fd5b611bc484828501611add565b60008060408385031215611e9f57600080fd5b82516001600160401b03811115611eb557600080fd5b611ec185828601611add565b9250506020611ed285828601611b9b565b9150509250929050565b600060808284031215611eee57600080fd5b6000611bc48484611b2c565b600060208284031215611f0c57600080fd5b6000611bc48484611b9b565b6000611f248383611f38565b505060200190565b6000611f24838361269e565b611f418161295f565b82525050565b6000611f5282612952565b611f5c8185612956565b9350611f678361294c565b8060005b83811015611f95578151611f7f8882611f18565b9750611f8a8361294c565b925050600101611f6b565b509495945050505050565b6000611fab82612952565b611fb58185612956565b9350611fc08361294c565b8060005b83811015611f95578151611fd88882611f2c565b9750611fe38361294c565b925050600101611fc4565b611f418161296a565b611f418161296f565b600061200b82612952565b6120158185612956565b93506120258185602086016129a0565b61202e816129cc565b9093019392505050565b600061204382612952565b61204d8185610c76565b935061205d8185602086016129a0565b9290920192915050565b611f4181612995565b600061207d602c83612956565b7f72656d6f7665416c6c6f7765644d616b6572733a20456d707479205f6163636f81526b756e7473546f52656d6f766560a01b602082015260400192915050565b60006120cb603783612956565b7f7061727365417373657473466f72416374696f6e3a204665652067726561746581527f72207468616e206d616b65724173736574416d6f756e74000000000000000000602082015260400192915050565b600061212a604983612956565b7f6f6e6c7946756e644465706c6f7965724f776e65723a204f6e6c79207468652081527f46756e644465706c6f796572206f776e65722063616e2063616c6c207468697360208201526810333ab731ba34b7b760b91b604082015260600192915050565b600061219b601b83612956565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b60006121d4602883612956565b7f5f5f616464416c6c6f7765644d616b6572733a20456d707479205f6163636f758152671b9d1cd51bd0591960c21b602082015260400192915050565b600061221e604483612956565b7f7061727365417373657473466f72416374696f6e3a2054616b6572206173736581527f742066696c6c20616d6f756e742067726561746572207468616e20617661696c60208201526361626c6560e01b604082015260600192915050565b600061228a601e83612956565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b60006122c3601a83612956565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b60006122fc603283612956565b7f4f6e6c792074686520496e746567726174696f6e4d616e616765722063616e2081527131b0b636103a3434b990333ab731ba34b7b760711b602082015260400192915050565b6000612350602183612956565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612393603083612956565b7f7061727365417373657473466f72416374696f6e3a204f72646572206d616b6581526f1c881a5cc81b9bdd08185b1b1bddd95960821b602082015260400192915050565b60006123e5601d83612956565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000815260200192915050565b600061241e602583612956565b7f5f5f616464416c6c6f7765644d616b6572733a2056616c756520616c726561648152641e481cd95d60da1b602082015260400192915050565b6000612465602a83612956565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b60006124b1603683612956565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f81527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b602082015260400192915050565b6000612509603483612956565b7f72656d6f7665416c6c6f7765644d616b6572733a204163636f756e74206973208152733737ba1030b71030b63637bbb2b21036b0b5b2b960611b602082015260400192915050565b600061255f602783612956565b7f7061727365417373657473466f72416374696f6e3a205f73656c6563746f72208152661a5b9d985b1a5960ca1b602082015260400192915050565b80516000906101808401906125b08582611f38565b5060208301516125c36020860182611f38565b5060408301516125d66040860182611f38565b5060608301516125e96060860182611f38565b5060808301516125fc608086018261269e565b5060a083015161260f60a086018261269e565b5060c083015161262260c086018261269e565b5060e083015161263560e086018261269e565b5061010083015161264a61010086018261269e565b5061012083015161265f61012086018261269e565b506101408301518482036101408601526126798282612000565b9150506101608301518482036101608601526126958282612000565b95945050505050565b611f4181612992565b600061129b8284612038565b6020810161116e8284611f38565b604081016126cf8285611f38565b61129b6020830184611f38565b604081016126ea8285611f38565b61129b602083018461269e565b6020810161116e8284611fee565b6020810161116e8284611ff7565b60a081016127218288612067565b81810360208301526127338187611f47565b905081810360408301526127478186611fa0565b9050818103606083015261275b8185611f47565b905081810360808301526116f38184611fa0565b6020808252810161129b8184612000565b6020808252810161116e81612070565b6020808252810161116e816120be565b6020808252810161116e8161211d565b6020808252810161116e8161218e565b6020808252810161116e816121c7565b6020808252810161116e81612211565b6020808252810161116e8161227d565b6020808252810161116e816122b6565b6020808252810161116e816122ef565b6020808252810161116e81612343565b6020808252810161116e81612386565b6020808252810161116e816123d8565b6020808252810161116e81612411565b6020808252810161116e81612458565b6020808252810161116e816124a4565b6020808252810161116e816124fc565b6020808252810161116e81612552565b606080825281016128a1818661259b565b90506128b0602083018561269e565b81810360408301526126958184612000565b6040518181016001600160401b03811182821017156128e057600080fd5b604052919050565b60006001600160401b038211156128fe57600080fd5b5060200290565b60006001600160401b0382111561291b57600080fd5b5060209081020190565b60006001600160401b0382111561293b57600080fd5b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b600061116e82612986565b151590565b6001600160e01b03191690565b80610c76816129d6565b6001600160a01b031690565b90565b600061116e8261297c565b60005b838110156129bb5781810151838201526020016129a3565b83811115610fec5750506000910152565b601f01601f191690565b600381106129e057fe5b50565b6129ec8161295f565b81146129e057600080fd5b6129ec8161296a565b6129ec8161296f565b6129ec8161299256fea26469706673582212205c21cc3f38d32d5b4c7fa1c6a3b0027d0d979917762f0fcb3ee9e17363e9b24f64736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e000000000000000000000000080bf510fcbf18b91105470639e95610229377120000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc63600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000200000000000000000000000056178a0d5f301baf6cf3e1cd53d9863437345bf9000000000000000000000000e0238da09cab56b3066f26f98657dcce801c16b9
-----Decoded View---------------
Arg [0] : _integrationManager (address): 0x31329024f1a3E4a4B3336E0b1DfA74CC3FEc633e
Arg [1] : _exchange (address): 0x080bf510FCbF18b91105470639e9561022937712
Arg [2] : _fundDeployer (address): 0x4f1C53F096533C04d8157EFB6Bca3eb22ddC6360
Arg [3] : _allowedMakers (address[]): 0x56178a0d5F301bAf6CF3e1Cd53d9863437345Bf9,0xe0238DA09Cab56B3066F26F98657DccE801c16B9
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e
Arg [1] : 000000000000000000000000080bf510fcbf18b91105470639e9561022937712
Arg [2] : 0000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc6360
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [5] : 00000000000000000000000056178a0d5f301baf6cf3e1cd53d9863437345bf9
Arg [6] : 000000000000000000000000e0238da09cab56b3066f26f98657dcce801c16b9
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.