Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ComptrollerLib
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; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../../../../persistent/dispatcher/IDispatcher.sol"; import "../../../../persistent/external-positions/IExternalPosition.sol"; import "../../../extensions/IExtension.sol"; import "../../../extensions/fee-manager/IFeeManager.sol"; import "../../../extensions/policy-manager/IPolicyManager.sol"; import "../../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; import "../../../infrastructure/gas-relayer/IGasRelayPaymaster.sol"; import "../../../infrastructure/gas-relayer/IGasRelayPaymasterDepositor.sol"; import "../../../infrastructure/value-interpreter/IValueInterpreter.sol"; import "../../../utils/beacon-proxy/IBeaconProxyFactory.sol"; import "../../../utils/AddressArrayLib.sol"; import "../../fund-deployer/IFundDeployer.sol"; import "../vault/IVault.sol"; import "./IComptroller.sol"; /// @title ComptrollerLib Contract /// @author Enzyme Council <[email protected]> /// @notice The core logic library shared by all funds contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRecipientMixin { using AddressArrayLib for address[]; using SafeMath for uint256; using SafeERC20 for ERC20; event AutoProtocolFeeSharesBuybackSet(bool autoProtocolFeeSharesBuyback); event BuyBackMaxProtocolFeeSharesFailed( bytes indexed failureReturnData, uint256 sharesAmount, uint256 buybackValueInMln, uint256 gav ); event DeactivateFeeManagerFailed(); event GasRelayPaymasterSet(address gasRelayPaymaster); event MigratedSharesDuePaid(uint256 sharesDue); event PayProtocolFeeDuringDestructFailed(); event PreRedeemSharesHookFailed( bytes indexed failureReturnData, address indexed redeemer, uint256 sharesAmount ); event RedeemSharesInKindCalcGavFailed(); event SharesBought( address indexed buyer, uint256 investmentAmount, uint256 sharesIssued, uint256 sharesReceived ); event SharesRedeemed( address indexed redeemer, address indexed recipient, uint256 sharesAmount, address[] receivedAssets, uint256[] receivedAssetAmounts ); event VaultProxySet(address vaultProxy); // Constants and immutables - shared by all proxies uint256 private constant ONE_HUNDRED_PERCENT = 10000; uint256 private constant SHARES_UNIT = 10**18; address private constant SPECIFIC_ASSET_REDEMPTION_DUMMY_FORFEIT_ADDRESS = 0x000000000000000000000000000000000000aaaa; address private immutable DISPATCHER; address private immutable EXTERNAL_POSITION_MANAGER; address private immutable FUND_DEPLOYER; address private immutable FEE_MANAGER; address private immutable INTEGRATION_MANAGER; address private immutable MLN_TOKEN; address private immutable POLICY_MANAGER; address private immutable PROTOCOL_FEE_RESERVE; address private immutable VALUE_INTERPRETER; address private immutable WETH_TOKEN; // Pseudo-constants (can only be set once) address internal denominationAsset; address internal vaultProxy; // True only for the one non-proxy bool internal isLib; // Storage // Attempts to buy back protocol fee shares immediately after collection bool internal autoProtocolFeeSharesBuyback; // A reverse-mutex, granting atomic permission for particular contracts to make vault calls bool internal permissionedVaultActionAllowed; // A mutex to protect against reentrancy bool internal reentranceLocked; // A timelock after the last time shares were bought for an account // that must expire before that account transfers or redeems their shares uint256 internal sharesActionTimelock; mapping(address => uint256) internal acctToLastSharesBoughtTimestamp; // The contract which manages paying gas relayers address private gasRelayPaymaster; /////////////// // MODIFIERS // /////////////// modifier allowsPermissionedVaultAction { __assertPermissionedVaultActionNotAllowed(); permissionedVaultActionAllowed = true; _; permissionedVaultActionAllowed = false; } modifier locksReentrance() { __assertNotReentranceLocked(); reentranceLocked = true; _; reentranceLocked = false; } modifier onlyFundDeployer() { __assertIsFundDeployer(); _; } modifier onlyGasRelayPaymaster() { __assertIsGasRelayPaymaster(); _; } modifier onlyOwner() { __assertIsOwner(__msgSender()); _; } modifier onlyOwnerNotRelayable() { __assertIsOwner(msg.sender); _; } // ASSERTION HELPERS // Modifiers are inefficient in terms of contract size, // so we use helper functions to prevent repetitive inlining of expensive string values. function __assertIsFundDeployer() private view { require(msg.sender == getFundDeployer(), "Only FundDeployer callable"); } function __assertIsGasRelayPaymaster() private view { require(msg.sender == getGasRelayPaymaster(), "Only Gas Relay Paymaster callable"); } function __assertIsOwner(address _who) private view { require(_who == IVault(getVaultProxy()).getOwner(), "Only fund owner callable"); } function __assertNotReentranceLocked() private view { require(!reentranceLocked, "Re-entrance"); } function __assertPermissionedVaultActionNotAllowed() private view { require(!permissionedVaultActionAllowed, "Vault action re-entrance"); } function __assertSharesActionNotTimelocked(address _vaultProxy, address _account) private view { uint256 lastSharesBoughtTimestamp = getLastSharesBoughtTimestampForAccount(_account); require( lastSharesBoughtTimestamp == 0 || block.timestamp.sub(lastSharesBoughtTimestamp) >= getSharesActionTimelock() || __hasPendingMigrationOrReconfiguration(_vaultProxy), "Shares action timelocked" ); } constructor( address _dispatcher, address _protocolFeeReserve, address _fundDeployer, address _valueInterpreter, address _externalPositionManager, address _feeManager, address _integrationManager, address _policyManager, address _gasRelayPaymasterFactory, address _mlnToken, address _wethToken ) public GasRelayRecipientMixin(_gasRelayPaymasterFactory) { DISPATCHER = _dispatcher; EXTERNAL_POSITION_MANAGER = _externalPositionManager; FEE_MANAGER = _feeManager; FUND_DEPLOYER = _fundDeployer; INTEGRATION_MANAGER = _integrationManager; MLN_TOKEN = _mlnToken; POLICY_MANAGER = _policyManager; PROTOCOL_FEE_RESERVE = _protocolFeeReserve; VALUE_INTERPRETER = _valueInterpreter; WETH_TOKEN = _wethToken; isLib = true; } ///////////// // GENERAL // ///////////// /// @notice Calls a specified action on an Extension /// @param _extension The Extension contract to call (e.g., FeeManager) /// @param _actionId An ID representing the action to take on the extension (see extension) /// @param _callArgs The encoded data for the call /// @dev Used to route arbitrary calls, so that msg.sender is the ComptrollerProxy /// (for access control). Uses a mutex of sorts that allows "permissioned vault actions" /// during calls originating from this function. function callOnExtension( address _extension, uint256 _actionId, bytes calldata _callArgs ) external override locksReentrance allowsPermissionedVaultAction { require( _extension == getFeeManager() || _extension == getIntegrationManager() || _extension == getExternalPositionManager(), "callOnExtension: _extension invalid" ); IExtension(_extension).receiveCallFromComptroller(__msgSender(), _actionId, _callArgs); } /// @notice Makes an arbitrary call with the VaultProxy contract as the sender /// @param _contract The contract to call /// @param _selector The selector to call /// @param _encodedArgs The encoded arguments for the call /// @return returnData_ The data returned by the call function vaultCallOnContract( address _contract, bytes4 _selector, bytes calldata _encodedArgs ) external onlyOwner returns (bytes memory returnData_) { require( IFundDeployer(getFundDeployer()).isAllowedVaultCall( _contract, _selector, keccak256(_encodedArgs) ), "vaultCallOnContract: Not allowed" ); return IVault(getVaultProxy()).callOnContract( _contract, abi.encodePacked(_selector, _encodedArgs) ); } /// @dev Helper to check if a VaultProxy has a pending migration or reconfiguration request function __hasPendingMigrationOrReconfiguration(address _vaultProxy) private view returns (bool hasPendingMigrationOrReconfiguration) { return IDispatcher(getDispatcher()).hasMigrationRequest(_vaultProxy) || IFundDeployer(getFundDeployer()).hasReconfigurationRequest(_vaultProxy); } ////////////////// // PROTOCOL FEE // ////////////////// /// @notice Buys back shares collected as protocol fee at a discounted shares price, using MLN /// @param _sharesAmount The amount of shares to buy back function buyBackProtocolFeeShares(uint256 _sharesAmount) external { address vaultProxyCopy = vaultProxy; require( IVault(vaultProxyCopy).canManageAssets(__msgSender()), "buyBackProtocolFeeShares: Unauthorized" ); uint256 gav = calcGav(); IVault(vaultProxyCopy).buyBackProtocolFeeShares( _sharesAmount, __getBuybackValueInMln(vaultProxyCopy, _sharesAmount, gav), gav ); } /// @notice Sets whether to attempt to buyback protocol fee shares immediately when collected /// @param _nextAutoProtocolFeeSharesBuyback True if protocol fee shares should be attempted /// to be bought back immediately when collected function setAutoProtocolFeeSharesBuyback(bool _nextAutoProtocolFeeSharesBuyback) external onlyOwner { autoProtocolFeeSharesBuyback = _nextAutoProtocolFeeSharesBuyback; emit AutoProtocolFeeSharesBuybackSet(_nextAutoProtocolFeeSharesBuyback); } /// @dev Helper to buyback the max available protocol fee shares, during an auto-buyback function __buyBackMaxProtocolFeeShares(address _vaultProxy, uint256 _gav) private { uint256 sharesAmount = ERC20(_vaultProxy).balanceOf(getProtocolFeeReserve()); uint256 buybackValueInMln = __getBuybackValueInMln(_vaultProxy, sharesAmount, _gav); try IVault(_vaultProxy).buyBackProtocolFeeShares(sharesAmount, buybackValueInMln, _gav) {} catch (bytes memory reason) { emit BuyBackMaxProtocolFeeSharesFailed(reason, sharesAmount, buybackValueInMln, _gav); } } /// @dev Helper to buyback the max available protocol fee shares function __getBuybackValueInMln( address _vaultProxy, uint256 _sharesAmount, uint256 _gav ) private returns (uint256 buybackValueInMln_) { address denominationAssetCopy = getDenominationAsset(); uint256 grossShareValue = __calcGrossShareValue( _gav, ERC20(_vaultProxy).totalSupply(), 10**uint256(ERC20(denominationAssetCopy).decimals()) ); uint256 buybackValueInDenominationAsset = grossShareValue.mul(_sharesAmount).div( SHARES_UNIT ); return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAssetCopy, buybackValueInDenominationAsset, getMlnToken() ); } //////////////////////////////// // PERMISSIONED VAULT ACTIONS // //////////////////////////////// /// @notice Makes a permissioned, state-changing call on the VaultProxy contract /// @param _action The enum representing the VaultAction to perform on the VaultProxy /// @param _actionData The call data for the action to perform function permissionedVaultAction(IVault.VaultAction _action, bytes calldata _actionData) external override { __assertPermissionedVaultAction(msg.sender, _action); // Validate action as needed if (_action == IVault.VaultAction.RemoveTrackedAsset) { require( abi.decode(_actionData, (address)) != getDenominationAsset(), "permissionedVaultAction: Cannot untrack denomination asset" ); } IVault(getVaultProxy()).receiveValidatedVaultAction(_action, _actionData); } /// @dev Helper to assert that a caller is allowed to perform a particular VaultAction. /// Uses this pattern rather than multiple `require` statements to save on contract size. function __assertPermissionedVaultAction(address _caller, IVault.VaultAction _action) private view { bool validAction; if (permissionedVaultActionAllowed) { // Calls are roughly ordered by likely frequency if (_caller == getIntegrationManager()) { if ( _action == IVault.VaultAction.AddTrackedAsset || _action == IVault.VaultAction.RemoveTrackedAsset || _action == IVault.VaultAction.WithdrawAssetTo || _action == IVault.VaultAction.ApproveAssetSpender ) { validAction = true; } } else if (_caller == getFeeManager()) { if ( _action == IVault.VaultAction.MintShares || _action == IVault.VaultAction.BurnShares || _action == IVault.VaultAction.TransferShares ) { validAction = true; } } else if (_caller == getExternalPositionManager()) { if ( _action == IVault.VaultAction.CallOnExternalPosition || _action == IVault.VaultAction.AddExternalPosition || _action == IVault.VaultAction.RemoveExternalPosition ) { validAction = true; } } } require(validAction, "__assertPermissionedVaultAction: Action not allowed"); } /////////////// // LIFECYCLE // /////////////// // Ordered by execution in the lifecycle /// @notice Initializes a fund with its core config /// @param _denominationAsset The asset in which the fund's value should be denominated /// @param _sharesActionTimelock The minimum number of seconds between any two "shares actions" /// (buying or selling shares) by the same user /// @dev Pseudo-constructor per proxy. /// No need to assert access because this is called atomically on deployment, /// and once it's called, it cannot be called again. function init(address _denominationAsset, uint256 _sharesActionTimelock) external override { require(getDenominationAsset() == address(0), "init: Already initialized"); require( IValueInterpreter(getValueInterpreter()).isSupportedPrimitiveAsset(_denominationAsset), "init: Bad denomination asset" ); denominationAsset = _denominationAsset; sharesActionTimelock = _sharesActionTimelock; } /// @notice Sets the VaultProxy /// @param _vaultProxy The VaultProxy contract /// @dev No need to assert anything beyond FundDeployer access. /// Called atomically with init(), but after ComptrollerProxy has been deployed. function setVaultProxy(address _vaultProxy) external override onlyFundDeployer { vaultProxy = _vaultProxy; emit VaultProxySet(_vaultProxy); } /// @notice Runs atomic logic after a ComptrollerProxy has become its vaultProxy's `accessor` /// @param _isMigration True if a migrated fund is being activated /// @dev No need to assert anything beyond FundDeployer access. function activate(bool _isMigration) external override onlyFundDeployer { address vaultProxyCopy = getVaultProxy(); if (_isMigration) { // Distribute any shares in the VaultProxy to the fund owner. // This is a mechanism to ensure that even in the edge case of a fund being unable // to payout fee shares owed during migration, these shares are not lost. uint256 sharesDue = ERC20(vaultProxyCopy).balanceOf(vaultProxyCopy); if (sharesDue > 0) { IVault(vaultProxyCopy).transferShares( vaultProxyCopy, IVault(vaultProxyCopy).getOwner(), sharesDue ); emit MigratedSharesDuePaid(sharesDue); } } IVault(vaultProxyCopy).addTrackedAsset(getDenominationAsset()); // Activate extensions IExtension(getFeeManager()).activateForFund(_isMigration); IExtension(getPolicyManager()).activateForFund(_isMigration); } /// @notice Wind down and destroy a ComptrollerProxy that is active /// @param _deactivateFeeManagerGasLimit The amount of gas to forward to deactivate the FeeManager /// @param _payProtocolFeeGasLimit The amount of gas to forward to pay the protocol fee /// @dev No need to assert anything beyond FundDeployer access. /// Uses the try/catch pattern throughout out of an abundance of caution for the function's success. /// All external calls must use limited forwarded gas to ensure that a migration to another release /// does not get bricked by logic that consumes too much gas for the block limit. function destructActivated( uint256 _deactivateFeeManagerGasLimit, uint256 _payProtocolFeeGasLimit ) external override onlyFundDeployer allowsPermissionedVaultAction { // Forwarding limited gas here also protects fee recipients by guaranteeing that fee payout logic // will run in the next function call try IVault(getVaultProxy()).payProtocolFee{gas: _payProtocolFeeGasLimit}() {} catch { emit PayProtocolFeeDuringDestructFailed(); } // Do not attempt to auto-buyback protocol fee shares in this case, // as the call is gav-dependent and can consume too much gas // Deactivate extensions only as-necessary // Pays out shares outstanding for fees try IExtension(getFeeManager()).deactivateForFund{gas: _deactivateFeeManagerGasLimit}() {} catch { emit DeactivateFeeManagerFailed(); } __selfDestruct(); } /// @notice Destroy a ComptrollerProxy that has not been activated function destructUnactivated() external override onlyFundDeployer { __selfDestruct(); } /// @dev Helper to self-destruct the contract. /// There should never be ETH in the ComptrollerLib, /// so no need to waste gas to get the fund owner function __selfDestruct() private { // Not necessary, but failsafe to protect the lib against selfdestruct require(!isLib, "__selfDestruct: Only delegate callable"); selfdestruct(payable(address(this))); } //////////////// // ACCOUNTING // //////////////// /// @notice Calculates the gross asset value (GAV) of the fund /// @return gav_ The fund GAV function calcGav() public override returns (uint256 gav_) { address vaultProxyAddress = getVaultProxy(); address[] memory assets = IVault(vaultProxyAddress).getTrackedAssets(); address[] memory externalPositions = IVault(vaultProxyAddress) .getActiveExternalPositions(); if (assets.length == 0 && externalPositions.length == 0) { return 0; } uint256[] memory balances = new uint256[](assets.length); for (uint256 i; i < assets.length; i++) { balances[i] = ERC20(assets[i]).balanceOf(vaultProxyAddress); } gav_ = IValueInterpreter(getValueInterpreter()).calcCanonicalAssetsTotalValue( assets, balances, getDenominationAsset() ); if (externalPositions.length > 0) { for (uint256 i; i < externalPositions.length; i++) { uint256 externalPositionValue = __calcExternalPositionValue(externalPositions[i]); gav_ = gav_.add(externalPositionValue); } } return gav_; } /// @notice Calculates the gross value of 1 unit of shares in the fund's denomination asset /// @return grossShareValue_ The amount of the denomination asset per share /// @dev Does not account for any fees outstanding. function calcGrossShareValue() external override returns (uint256 grossShareValue_) { uint256 gav = calcGav(); grossShareValue_ = __calcGrossShareValue( gav, ERC20(getVaultProxy()).totalSupply(), 10**uint256(ERC20(getDenominationAsset()).decimals()) ); return grossShareValue_; } // @dev Helper for calculating a external position value. Prevents from stack too deep function __calcExternalPositionValue(address _externalPosition) private returns (uint256 value_) { (address[] memory managedAssets, uint256[] memory managedAmounts) = IExternalPosition( _externalPosition ) .getManagedAssets(); uint256 managedValue = IValueInterpreter(getValueInterpreter()) .calcCanonicalAssetsTotalValue(managedAssets, managedAmounts, getDenominationAsset()); (address[] memory debtAssets, uint256[] memory debtAmounts) = IExternalPosition( _externalPosition ) .getDebtAssets(); uint256 debtValue = IValueInterpreter(getValueInterpreter()).calcCanonicalAssetsTotalValue( debtAssets, debtAmounts, getDenominationAsset() ); if (managedValue > debtValue) { value_ = managedValue.sub(debtValue); } return value_; } /// @dev Helper for calculating the gross share value function __calcGrossShareValue( uint256 _gav, uint256 _sharesSupply, uint256 _denominationAssetUnit ) private pure returns (uint256 grossShareValue_) { if (_sharesSupply == 0) { return _denominationAssetUnit; } return _gav.mul(SHARES_UNIT).div(_sharesSupply); } /////////////////// // PARTICIPATION // /////////////////// // BUY SHARES /// @notice Buys shares on behalf of another user /// @param _buyer The account on behalf of whom to buy shares /// @param _investmentAmount The amount of the fund's denomination asset with which to buy shares /// @param _minSharesQuantity The minimum quantity of shares to buy /// @return sharesReceived_ The actual amount of shares received /// @dev This function is freely callable if there is no sharesActionTimelock set, but it is /// limited to a list of trusted callers otherwise, in order to prevent a griefing attack /// where the caller buys shares for a _buyer, thereby resetting their lastSharesBought value. function buySharesOnBehalf( address _buyer, uint256 _investmentAmount, uint256 _minSharesQuantity ) external returns (uint256 sharesReceived_) { bool hasSharesActionTimelock = getSharesActionTimelock() > 0; address canonicalSender = __msgSender(); require( !hasSharesActionTimelock || IFundDeployer(getFundDeployer()).isAllowedBuySharesOnBehalfCaller(canonicalSender), "buySharesOnBehalf: Unauthorized" ); return __buyShares( _buyer, _investmentAmount, _minSharesQuantity, hasSharesActionTimelock, canonicalSender ); } /// @notice Buys shares /// @param _investmentAmount The amount of the fund's denomination asset /// with which to buy shares /// @param _minSharesQuantity The minimum quantity of shares to buy /// @return sharesReceived_ The actual amount of shares received function buyShares(uint256 _investmentAmount, uint256 _minSharesQuantity) external returns (uint256 sharesReceived_) { bool hasSharesActionTimelock = getSharesActionTimelock() > 0; address canonicalSender = __msgSender(); return __buyShares( canonicalSender, _investmentAmount, _minSharesQuantity, hasSharesActionTimelock, canonicalSender ); } /// @dev Helper for buy shares logic function __buyShares( address _buyer, uint256 _investmentAmount, uint256 _minSharesQuantity, bool _hasSharesActionTimelock, address _canonicalSender ) private locksReentrance allowsPermissionedVaultAction returns (uint256 sharesReceived_) { // Enforcing a _minSharesQuantity also validates `_investmentAmount > 0` // and guarantees the function cannot succeed while minting 0 shares require(_minSharesQuantity > 0, "__buyShares: _minSharesQuantity must be >0"); address vaultProxyCopy = getVaultProxy(); require( !_hasSharesActionTimelock || !__hasPendingMigrationOrReconfiguration(vaultProxyCopy), "__buyShares: Pending migration or reconfiguration" ); uint256 gav = calcGav(); // Gives Extensions a chance to run logic prior to the minting of bought shares. // Fees implementing this hook should be aware that // it might be the case that _investmentAmount != actualInvestmentAmount, // if the denomination asset charges a transfer fee, for example. __preBuySharesHook(_buyer, _investmentAmount, gav); // Pay the protocol fee after running other fees, but before minting new shares IVault(vaultProxyCopy).payProtocolFee(); if (doesAutoProtocolFeeSharesBuyback()) { __buyBackMaxProtocolFeeShares(vaultProxyCopy, gav); } // Transfer the investment asset to the fund. // Does not follow the checks-effects-interactions pattern, but it is necessary to // do this delta balance calculation before calculating shares to mint. uint256 receivedInvestmentAmount = __transferFromWithReceivedAmount( getDenominationAsset(), _canonicalSender, vaultProxyCopy, _investmentAmount ); // Calculate the amount of shares to issue with the investment amount uint256 sharePrice = __calcGrossShareValue( gav, ERC20(vaultProxyCopy).totalSupply(), 10**uint256(ERC20(getDenominationAsset()).decimals()) ); uint256 sharesIssued = receivedInvestmentAmount.mul(SHARES_UNIT).div(sharePrice); // Mint shares to the buyer uint256 prevBuyerShares = ERC20(vaultProxyCopy).balanceOf(_buyer); IVault(vaultProxyCopy).mintShares(_buyer, sharesIssued); // Gives Extensions a chance to run logic after shares are issued __postBuySharesHook(_buyer, receivedInvestmentAmount, sharesIssued, gav); // The number of actual shares received may differ from shares issued due to // how the PostBuyShares hooks are invoked by Extensions (i.e., fees) sharesReceived_ = ERC20(vaultProxyCopy).balanceOf(_buyer).sub(prevBuyerShares); require( sharesReceived_ >= _minSharesQuantity, "__buyShares: Shares received < _minSharesQuantity" ); if (_hasSharesActionTimelock) { acctToLastSharesBoughtTimestamp[_buyer] = block.timestamp; } emit SharesBought(_buyer, receivedInvestmentAmount, sharesIssued, sharesReceived_); return sharesReceived_; } /// @dev Helper for Extension actions immediately prior to issuing shares function __preBuySharesHook( address _buyer, uint256 _investmentAmount, uint256 _gav ) private { IFeeManager(getFeeManager()).invokeHook( IFeeManager.FeeHook.PreBuyShares, abi.encode(_buyer, _investmentAmount), _gav ); } /// @dev Helper for Extension actions immediately after issuing shares. /// This could be cleaned up so both Extensions take the same encoded args and handle GAV /// in the same way, but there is not the obvious need for gas savings of recycling /// the GAV value for the current policies as there is for the fees. function __postBuySharesHook( address _buyer, uint256 _investmentAmount, uint256 _sharesIssued, uint256 _preBuySharesGav ) private { uint256 gav = _preBuySharesGav.add(_investmentAmount); IFeeManager(getFeeManager()).invokeHook( IFeeManager.FeeHook.PostBuyShares, abi.encode(_buyer, _investmentAmount, _sharesIssued), gav ); IPolicyManager(getPolicyManager()).validatePolicies( address(this), IPolicyManager.PolicyHook.PostBuyShares, abi.encode(_buyer, _investmentAmount, _sharesIssued, gav) ); } /// @dev Helper to execute ERC20.transferFrom() while calculating the actual amount received function __transferFromWithReceivedAmount( address _asset, address _sender, address _recipient, uint256 _transferAmount ) private returns (uint256 receivedAmount_) { uint256 preTransferRecipientBalance = ERC20(_asset).balanceOf(_recipient); ERC20(_asset).safeTransferFrom(_sender, _recipient, _transferAmount); return ERC20(_asset).balanceOf(_recipient).sub(preTransferRecipientBalance); } // REDEEM SHARES /// @notice Redeems a specified amount of the sender's shares for specified asset proportions /// @param _recipient The account that will receive the specified assets /// @param _sharesQuantity The quantity of shares to redeem /// @param _payoutAssets The assets to payout /// @param _payoutAssetPercentages The percentage of the owed amount to pay out in each asset /// @return payoutAmounts_ The amount of each asset paid out to the _recipient /// @dev Redeem all shares of the sender by setting _sharesQuantity to the max uint value. /// _payoutAssetPercentages must total exactly 100%. In order to specify less and forgo the /// remaining gav owed on the redeemed shares, pass in address(0) with the percentage to forego. /// Unlike redeemSharesInKind(), this function allows policies to run and prevent redemption. function redeemSharesForSpecificAssets( address _recipient, uint256 _sharesQuantity, address[] calldata _payoutAssets, uint256[] calldata _payoutAssetPercentages ) external locksReentrance returns (uint256[] memory payoutAmounts_) { address canonicalSender = __msgSender(); require( _payoutAssets.length == _payoutAssetPercentages.length, "redeemSharesForSpecificAssets: Unequal arrays" ); require( _payoutAssets.isUniqueSet(), "redeemSharesForSpecificAssets: Duplicate payout asset" ); uint256 gav = calcGav(); IVault vaultProxyContract = IVault(getVaultProxy()); (uint256 sharesToRedeem, uint256 sharesSupply) = __redeemSharesSetup( vaultProxyContract, canonicalSender, _sharesQuantity, true, gav ); payoutAmounts_ = __payoutSpecifiedAssetPercentages( vaultProxyContract, _recipient, _payoutAssets, _payoutAssetPercentages, gav.mul(sharesToRedeem).div(sharesSupply) ); // Run post-redemption in order to have access to the payoutAmounts __postRedeemSharesForSpecificAssetsHook( canonicalSender, _recipient, sharesToRedeem, _payoutAssets, payoutAmounts_, gav ); emit SharesRedeemed( canonicalSender, _recipient, sharesToRedeem, _payoutAssets, payoutAmounts_ ); return payoutAmounts_; } /// @notice Redeems a specified amount of the sender's shares /// for a proportionate slice of the vault's assets /// @param _recipient The account that will receive the proportionate slice of assets /// @param _sharesQuantity The quantity of shares to redeem /// @param _additionalAssets Additional (non-tracked) assets to claim /// @param _assetsToSkip Tracked assets to forfeit /// @return payoutAssets_ The assets paid out to the _recipient /// @return payoutAmounts_ The amount of each asset paid out to the _recipient /// @dev Redeem all shares of the sender by setting _sharesQuantity to the max uint value. /// Any claim to passed _assetsToSkip will be forfeited entirely. This should generally /// only be exercised if a bad asset is causing redemption to fail. /// This function should never fail without a way to bypass the failure, which is assured /// through two mechanisms: /// 1. The FeeManager is called with the try/catch pattern to assure that calls to it /// can never block redemption. /// 2. If a token fails upon transfer(), that token can be skipped (and its balance forfeited) /// by explicitly specifying _assetsToSkip. /// Because of these assurances, shares should always be redeemable, with the exception /// of the timelock period on shares actions that must be respected. function redeemSharesInKind( address _recipient, uint256 _sharesQuantity, address[] calldata _additionalAssets, address[] calldata _assetsToSkip ) external locksReentrance returns (address[] memory payoutAssets_, uint256[] memory payoutAmounts_) { address canonicalSender = __msgSender(); require( _additionalAssets.isUniqueSet(), "redeemSharesInKind: _additionalAssets contains duplicates" ); require( _assetsToSkip.isUniqueSet(), "redeemSharesInKind: _assetsToSkip contains duplicates" ); // Parse the payout assets given optional params to add or skip assets. // Note that there is no validation that the _additionalAssets are known assets to // the protocol. This means that the redeemer could specify a malicious asset, // but since all state-changing, user-callable functions on this contract share the // non-reentrant modifier, there is nowhere to perform a reentrancy attack. payoutAssets_ = __parseRedemptionPayoutAssets( IVault(vaultProxy).getTrackedAssets(), _additionalAssets, _assetsToSkip ); // If protocol fee shares will be auto-bought back, attempt to calculate GAV to pass into fees, // as we will require GAV later during the buyback. uint256 gavOrZero; if (doesAutoProtocolFeeSharesBuyback()) { // Since GAV calculation can fail with a revering price or a no-longer-supported asset, // we must try/catch GAV calculation to ensure that in-kind redemption can still succeed try this.calcGav() returns (uint256 gav) { gavOrZero = gav; } catch { emit RedeemSharesInKindCalcGavFailed(); } } (uint256 sharesToRedeem, uint256 sharesSupply) = __redeemSharesSetup( IVault(vaultProxy), canonicalSender, _sharesQuantity, false, gavOrZero ); // Calculate and transfer payout asset amounts due to _recipient payoutAmounts_ = new uint256[](payoutAssets_.length); for (uint256 i; i < payoutAssets_.length; i++) { payoutAmounts_[i] = ERC20(payoutAssets_[i]) .balanceOf(vaultProxy) .mul(sharesToRedeem) .div(sharesSupply); // Transfer payout asset to _recipient if (payoutAmounts_[i] > 0) { IVault(vaultProxy).withdrawAssetTo( payoutAssets_[i], _recipient, payoutAmounts_[i] ); } } emit SharesRedeemed( canonicalSender, _recipient, sharesToRedeem, payoutAssets_, payoutAmounts_ ); return (payoutAssets_, payoutAmounts_); } /// @dev Helper to parse an array of payout assets during redemption, taking into account /// additional assets and assets to skip. _assetsToSkip ignores _additionalAssets. /// All input arrays are assumed to be unique. function __parseRedemptionPayoutAssets( address[] memory _trackedAssets, address[] memory _additionalAssets, address[] memory _assetsToSkip ) private pure returns (address[] memory payoutAssets_) { address[] memory trackedAssetsToPayout = _trackedAssets.removeItems(_assetsToSkip); if (_additionalAssets.length == 0) { return trackedAssetsToPayout; } // Add additional assets. Duplicates of trackedAssets are ignored. bool[] memory indexesToAdd = new bool[](_additionalAssets.length); uint256 additionalItemsCount; for (uint256 i; i < _additionalAssets.length; i++) { if (!trackedAssetsToPayout.contains(_additionalAssets[i])) { indexesToAdd[i] = true; additionalItemsCount++; } } if (additionalItemsCount == 0) { return trackedAssetsToPayout; } payoutAssets_ = new address[](trackedAssetsToPayout.length.add(additionalItemsCount)); for (uint256 i; i < trackedAssetsToPayout.length; i++) { payoutAssets_[i] = trackedAssetsToPayout[i]; } uint256 payoutAssetsIndex = trackedAssetsToPayout.length; for (uint256 i; i < _additionalAssets.length; i++) { if (indexesToAdd[i]) { payoutAssets_[payoutAssetsIndex] = _additionalAssets[i]; payoutAssetsIndex++; } } return payoutAssets_; } /// @dev Helper to payout specified asset percentages during redeemSharesForSpecificAssets() function __payoutSpecifiedAssetPercentages( IVault vaultProxyContract, address _recipient, address[] calldata _payoutAssets, uint256[] calldata _payoutAssetPercentages, uint256 _owedGav ) private returns (uint256[] memory payoutAmounts_) { address denominationAssetCopy = getDenominationAsset(); uint256 percentagesTotal; payoutAmounts_ = new uint256[](_payoutAssets.length); for (uint256 i; i < _payoutAssets.length; i++) { percentagesTotal = percentagesTotal.add(_payoutAssetPercentages[i]); // Used to explicitly specify less than 100% in total _payoutAssetPercentages if (_payoutAssets[i] == SPECIFIC_ASSET_REDEMPTION_DUMMY_FORFEIT_ADDRESS) { continue; } payoutAmounts_[i] = IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAssetCopy, _owedGav.mul(_payoutAssetPercentages[i]).div(ONE_HUNDRED_PERCENT), _payoutAssets[i] ); // Guards against corner case of primitive-to-derivative asset conversion that floors to 0, // or redeeming a very low shares amount and/or percentage where asset value owed is 0 require( payoutAmounts_[i] > 0, "__payoutSpecifiedAssetPercentages: Zero amount for asset" ); vaultProxyContract.withdrawAssetTo(_payoutAssets[i], _recipient, payoutAmounts_[i]); } require( percentagesTotal == ONE_HUNDRED_PERCENT, "__payoutSpecifiedAssetPercentages: Percents must total 100%" ); return payoutAmounts_; } /// @dev Helper for system actions immediately prior to redeeming shares. /// Policy validation is not currently allowed on redemption, to ensure continuous redeemability. function __preRedeemSharesHook( address _redeemer, uint256 _sharesToRedeem, bool _forSpecifiedAssets, uint256 _gavIfCalculated ) private allowsPermissionedVaultAction { try IFeeManager(getFeeManager()).invokeHook( IFeeManager.FeeHook.PreRedeemShares, abi.encode(_redeemer, _sharesToRedeem, _forSpecifiedAssets), _gavIfCalculated ) {} catch (bytes memory reason) { emit PreRedeemSharesHookFailed(reason, _redeemer, _sharesToRedeem); } } /// @dev Helper to run policy validation after other logic for redeeming shares for specific assets. /// Avoids stack-too-deep error. function __postRedeemSharesForSpecificAssetsHook( address _redeemer, address _recipient, uint256 _sharesToRedeemPostFees, address[] memory _assets, uint256[] memory _assetAmounts, uint256 _gavPreRedeem ) private { IPolicyManager(getPolicyManager()).validatePolicies( address(this), IPolicyManager.PolicyHook.RedeemSharesForSpecificAssets, abi.encode( _redeemer, _recipient, _sharesToRedeemPostFees, _assets, _assetAmounts, _gavPreRedeem ) ); } /// @dev Helper to execute common pre-shares redemption logic function __redeemSharesSetup( IVault vaultProxyContract, address _redeemer, uint256 _sharesQuantityInput, bool _forSpecifiedAssets, uint256 _gavIfCalculated ) private returns (uint256 sharesToRedeem_, uint256 sharesSupply_) { __assertSharesActionNotTimelocked(address(vaultProxyContract), _redeemer); ERC20 sharesContract = ERC20(address(vaultProxyContract)); uint256 preFeesRedeemerSharesBalance = sharesContract.balanceOf(_redeemer); if (_sharesQuantityInput == type(uint256).max) { sharesToRedeem_ = preFeesRedeemerSharesBalance; } else { sharesToRedeem_ = _sharesQuantityInput; } require(sharesToRedeem_ > 0, "__redeemSharesSetup: No shares to redeem"); __preRedeemSharesHook(_redeemer, sharesToRedeem_, _forSpecifiedAssets, _gavIfCalculated); // Update the redemption amount if fees were charged (or accrued) to the redeemer uint256 postFeesRedeemerSharesBalance = sharesContract.balanceOf(_redeemer); if (_sharesQuantityInput == type(uint256).max) { sharesToRedeem_ = postFeesRedeemerSharesBalance; } else if (postFeesRedeemerSharesBalance < preFeesRedeemerSharesBalance) { sharesToRedeem_ = sharesToRedeem_.sub( preFeesRedeemerSharesBalance.sub(postFeesRedeemerSharesBalance) ); } // Pay the protocol fee after running other fees, but before burning shares vaultProxyContract.payProtocolFee(); if (_gavIfCalculated > 0 && doesAutoProtocolFeeSharesBuyback()) { __buyBackMaxProtocolFeeShares(address(vaultProxyContract), _gavIfCalculated); } // Destroy the shares after getting the shares supply sharesSupply_ = sharesContract.totalSupply(); vaultProxyContract.burnShares(_redeemer, sharesToRedeem_); return (sharesToRedeem_, sharesSupply_); } // TRANSFER SHARES /// @notice Runs logic prior to transferring shares that are not freely transferable /// @param _sender The sender of the shares /// @param _recipient The recipient of the shares /// @param _amount The amount of shares function preTransferSharesHook( address _sender, address _recipient, uint256 _amount ) external override { address vaultProxyCopy = getVaultProxy(); require(msg.sender == vaultProxyCopy, "preTransferSharesHook: Only VaultProxy callable"); __assertSharesActionNotTimelocked(vaultProxyCopy, _sender); IPolicyManager(getPolicyManager()).validatePolicies( address(this), IPolicyManager.PolicyHook.PreTransferShares, abi.encode(_sender, _recipient, _amount) ); } /// @notice Runs logic prior to transferring shares that are freely transferable /// @param _sender The sender of the shares /// @dev No need to validate caller, as policies are not run function preTransferSharesHookFreelyTransferable(address _sender) external view override { __assertSharesActionNotTimelocked(getVaultProxy(), _sender); } ///////////////// // GAS RELAYER // ///////////////// /// @notice Deploys a paymaster contract and deposits WETH, enabling gas relaying function deployGasRelayPaymaster() external onlyOwnerNotRelayable { require( getGasRelayPaymaster() == address(0), "deployGasRelayPaymaster: Paymaster already deployed" ); bytes memory constructData = abi.encodeWithSignature("init(address)", getVaultProxy()); address paymaster = IBeaconProxyFactory(getGasRelayPaymasterFactory()).deployProxy( constructData ); __setGasRelayPaymaster(paymaster); __depositToGasRelayPaymaster(paymaster); } /// @notice Tops up the gas relay paymaster deposit function depositToGasRelayPaymaster() external onlyOwner { __depositToGasRelayPaymaster(getGasRelayPaymaster()); } /// @notice Pull WETH from vault to gas relay paymaster /// @param _amount Amount of the WETH to pull from the vault function pullWethForGasRelayer(uint256 _amount) external override onlyGasRelayPaymaster { IVault(getVaultProxy()).withdrawAssetTo(getWethToken(), getGasRelayPaymaster(), _amount); } /// @notice Sets the gasRelayPaymaster variable value /// @param _nextGasRelayPaymaster The next gasRelayPaymaster value function setGasRelayPaymaster(address _nextGasRelayPaymaster) external override onlyFundDeployer { __setGasRelayPaymaster(_nextGasRelayPaymaster); } /// @notice Removes the gas relay paymaster, withdrawing the remaining WETH balance /// and disabling gas relaying function shutdownGasRelayPaymaster() external onlyOwnerNotRelayable { IGasRelayPaymaster(gasRelayPaymaster).withdrawBalance(); IVault(vaultProxy).addTrackedAsset(getWethToken()); delete gasRelayPaymaster; emit GasRelayPaymasterSet(address(0)); } /// @dev Helper to deposit to the gas relay paymaster function __depositToGasRelayPaymaster(address _paymaster) private { IGasRelayPaymaster(_paymaster).deposit(); } /// @dev Helper to set the next `gasRelayPaymaster` variable function __setGasRelayPaymaster(address _nextGasRelayPaymaster) private { gasRelayPaymaster = _nextGasRelayPaymaster; emit GasRelayPaymasterSet(_nextGasRelayPaymaster); } /////////////////// // STATE GETTERS // /////////////////// // LIB IMMUTABLES /// @notice Gets the `DISPATCHER` variable /// @return dispatcher_ The `DISPATCHER` variable value function getDispatcher() public view returns (address dispatcher_) { return DISPATCHER; } /// @notice Gets the `EXTERNAL_POSITION_MANAGER` variable /// @return externalPositionManager_ The `EXTERNAL_POSITION_MANAGER` variable value function getExternalPositionManager() public view override returns (address externalPositionManager_) { return EXTERNAL_POSITION_MANAGER; } /// @notice Gets the `FEE_MANAGER` variable /// @return feeManager_ The `FEE_MANAGER` variable value function getFeeManager() public view override returns (address feeManager_) { return FEE_MANAGER; } /// @notice Gets the `FUND_DEPLOYER` variable /// @return fundDeployer_ The `FUND_DEPLOYER` variable value function getFundDeployer() public view override returns (address fundDeployer_) { return FUND_DEPLOYER; } /// @notice Gets the `INTEGRATION_MANAGER` variable /// @return integrationManager_ The `INTEGRATION_MANAGER` variable value function getIntegrationManager() public view override returns (address integrationManager_) { return INTEGRATION_MANAGER; } /// @notice Gets the `MLN_TOKEN` variable /// @return mlnToken_ The `MLN_TOKEN` variable value function getMlnToken() public view returns (address mlnToken_) { return MLN_TOKEN; } /// @notice Gets the `POLICY_MANAGER` variable /// @return policyManager_ The `POLICY_MANAGER` variable value function getPolicyManager() public view override returns (address policyManager_) { return POLICY_MANAGER; } /// @notice Gets the `PROTOCOL_FEE_RESERVE` variable /// @return protocolFeeReserve_ The `PROTOCOL_FEE_RESERVE` variable value function getProtocolFeeReserve() public view returns (address protocolFeeReserve_) { return PROTOCOL_FEE_RESERVE; } /// @notice Gets the `VALUE_INTERPRETER` variable /// @return valueInterpreter_ The `VALUE_INTERPRETER` variable value function getValueInterpreter() public view returns (address valueInterpreter_) { return VALUE_INTERPRETER; } /// @notice Gets the `WETH_TOKEN` variable /// @return wethToken_ The `WETH_TOKEN` variable value function getWethToken() public view returns (address wethToken_) { return WETH_TOKEN; } // PROXY STORAGE /// @notice Checks if collected protocol fee shares are automatically bought back /// while buying or redeeming shares /// @return doesAutoBuyback_ True if shares are automatically bought back function doesAutoProtocolFeeSharesBuyback() public view returns (bool doesAutoBuyback_) { return autoProtocolFeeSharesBuyback; } /// @notice Gets the `denominationAsset` variable /// @return denominationAsset_ The `denominationAsset` variable value function getDenominationAsset() public view override returns (address denominationAsset_) { return denominationAsset; } /// @notice Gets the `gasRelayPaymaster` variable /// @return gasRelayPaymaster_ The `gasRelayPaymaster` variable value function getGasRelayPaymaster() public view override returns (address gasRelayPaymaster_) { return gasRelayPaymaster; } /// @notice Gets the timestamp of the last time shares were bought for a given account /// @param _who The account for which to get the timestamp /// @return lastSharesBoughtTimestamp_ The timestamp of the last shares bought function getLastSharesBoughtTimestampForAccount(address _who) public view returns (uint256 lastSharesBoughtTimestamp_) { return acctToLastSharesBoughtTimestamp[_who]; } /// @notice Gets the `sharesActionTimelock` variable /// @return sharesActionTimelock_ The `sharesActionTimelock` variable value function getSharesActionTimelock() public view returns (uint256 sharesActionTimelock_) { return sharesActionTimelock; } /// @notice Gets the `vaultProxy` variable /// @return vaultProxy_ The `vaultProxy` variable value function getVaultProxy() public view override returns (address vaultProxy_) { return vaultProxy; } }
// 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 IDispatcher Interface /// @author Enzyme Council <[email protected]> interface IDispatcher { function cancelMigration(address _vaultProxy, bool _bypassFailure) external; function claimOwnership() external; function deployVaultProxy( address _vaultLib, address _owner, address _vaultAccessor, string calldata _fundName ) external returns (address vaultProxy_); function executeMigration(address _vaultProxy, bool _bypassFailure) external; function getCurrentFundDeployer() external view returns (address currentFundDeployer_); function getFundDeployerForVaultProxy(address _vaultProxy) external view returns (address fundDeployer_); function getMigrationRequestDetailsForVaultProxy(address _vaultProxy) external view returns ( address nextFundDeployer_, address nextVaultAccessor_, address nextVaultLib_, uint256 executableTimestamp_ ); function getMigrationTimelock() external view returns (uint256 migrationTimelock_); function getNominatedOwner() external view returns (address nominatedOwner_); function getOwner() external view returns (address owner_); function getSharesTokenSymbol() external view returns (string memory sharesTokenSymbol_); function getTimelockRemainingForMigrationRequest(address _vaultProxy) external view returns (uint256 secondsRemaining_); function hasExecutableMigrationRequest(address _vaultProxy) external view returns (bool hasExecutableRequest_); function hasMigrationRequest(address _vaultProxy) external view returns (bool hasMigrationRequest_); function removeNominatedOwner() external; function setCurrentFundDeployer(address _nextFundDeployer) external; function setMigrationTimelock(uint256 _nextTimelock) external; function setNominatedOwner(address _nextNominatedOwner) external; function setSharesTokenSymbol(string calldata _nextSymbol) external; function signalMigration( address _vaultProxy, address _nextVaultAccessor, address _nextVaultLib, bool _bypassFailure ) external; }
// 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 IExternalPosition Contract /// @author Enzyme Council <[email protected]> interface IExternalPosition { function getDebtAssets() external returns (address[] memory, uint256[] memory); function getManagedAssets() external returns (address[] memory, uint256[] memory); function init(bytes memory) external; function receiveCallFromVault(bytes memory) external; }
// 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 IExternalPositionVault interface /// @author Enzyme Council <[email protected]> /// Provides an interface to get the externalPositionLib for a given type from the Vault interface IExternalPositionVault { function getExternalPositionLibForType(uint256) external view returns (address); }
// 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 IFreelyTransferableSharesVault Interface /// @author Enzyme Council <[email protected]> /// @notice Provides the interface for determining whether a vault's shares /// are guaranteed to be freely transferable. /// @dev DO NOT EDIT CONTRACT interface IFreelyTransferableSharesVault { function sharesAreFreelyTransferable() external view returns (bool sharesAreFreelyTransferable_); }
// 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 IMigratableVault Interface /// @author Enzyme Council <[email protected]> /// @dev DO NOT EDIT CONTRACT interface IMigratableVault { function canMigrate(address _who) external view returns (bool canMigrate_); function init( address _owner, address _accessor, string calldata _fundName ) external; function setAccessor(address _nextAccessor) external; function setVaultLib(address _nextVaultLib) external; }
// 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; import "../vault/IVault.sol"; /// @title IComptroller Interface /// @author Enzyme Council <[email protected]> interface IComptroller { function activate(bool) external; function calcGav() external returns (uint256); function calcGrossShareValue() external returns (uint256); function callOnExtension( address, uint256, bytes calldata ) external; function destructActivated(uint256, uint256) external; function destructUnactivated() external; function getDenominationAsset() external view returns (address); function getExternalPositionManager() external view returns (address); function getFeeManager() external view returns (address); function getFundDeployer() external view returns (address); function getGasRelayPaymaster() external view returns (address); function getIntegrationManager() external view returns (address); function getPolicyManager() external view returns (address); function getVaultProxy() external view returns (address); function init(address, uint256) external; function permissionedVaultAction(IVault.VaultAction, bytes calldata) external; function preTransferSharesHook( address, address, uint256 ) external; function preTransferSharesHookFreelyTransferable(address) external view; function setGasRelayPaymaster(address) external; function setVaultProxy(address) external; }
// 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 "../../../../persistent/vault/interfaces/IExternalPositionVault.sol"; import "../../../../persistent/vault/interfaces/IFreelyTransferableSharesVault.sol"; import "../../../../persistent/vault/interfaces/IMigratableVault.sol"; /// @title IVault Interface /// @author Enzyme Council <[email protected]> interface IVault is IMigratableVault, IFreelyTransferableSharesVault, IExternalPositionVault { enum VaultAction { None, // Shares management BurnShares, MintShares, TransferShares, // Asset management AddTrackedAsset, ApproveAssetSpender, RemoveTrackedAsset, WithdrawAssetTo, // External position management AddExternalPosition, CallOnExternalPosition, RemoveExternalPosition } function addTrackedAsset(address) external; function burnShares(address, uint256) external; function buyBackProtocolFeeShares( uint256, uint256, uint256 ) external; function callOnContract(address, bytes calldata) external returns (bytes memory); function canManageAssets(address) external view returns (bool); function canRelayCalls(address) external view returns (bool); function getAccessor() external view returns (address); function getOwner() external view returns (address); function getActiveExternalPositions() external view returns (address[] memory); function getTrackedAssets() external view returns (address[] memory); function isActiveExternalPosition(address) external view returns (bool); function isTrackedAsset(address) external view returns (bool); function mintShares(address, uint256) external; function payProtocolFee() external; function receiveValidatedVaultAction(VaultAction, bytes calldata) external; function setAccessorForFundReconfiguration(address) external; function setSymbol(string calldata) external; function transferShares( address, address, uint256 ) external; function withdrawAssetTo( address, address, uint256 ) external; }
// 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 IExtension Interface /// @author Enzyme Council <[email protected]> /// @notice Interface for all extensions interface IExtension { function activateForFund(bool _isMigration) external; function deactivateForFund() external; function receiveCallFromComptroller( address _caller, uint256 _actionId, bytes calldata _callArgs ) external; function setConfigForFund( address _comptrollerProxy, address _vaultProxy, bytes calldata _configData ) external; }
// 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; /// @title FeeManager Interface /// @author Enzyme Council <[email protected]> /// @notice Interface for the FeeManager interface IFeeManager { // No fees for the current release are implemented post-redeemShares enum FeeHook {Continuous, PreBuyShares, PostBuyShares, PreRedeemShares} enum SettlementType {None, Direct, Mint, Burn, MintSharesOutstanding, BurnSharesOutstanding} function invokeHook( FeeHook, bytes calldata, uint256 ) external; }
// 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; /// @title PolicyManager Interface /// @author Enzyme Council <[email protected]> /// @notice Interface for the PolicyManager interface IPolicyManager { // When updating PolicyHook, also update these functions in PolicyManager: // 1. __getAllPolicyHooks() // 2. __policyHookRestrictsCurrentInvestorActions() enum PolicyHook { PostBuyShares, PostCallOnIntegration, PreTransferShares, RedeemSharesForSpecificAssets, AddTrackedAssets, RemoveTrackedAssets, CreateExternalPosition, PostCallOnExternalPosition, RemoveExternalPosition, ReactivateExternalPosition } function validatePolicies( address, PolicyHook, bytes calldata ) external; }
// 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. */ import "../../utils/beacon-proxy/IBeaconProxyFactory.sol"; import "./IGasRelayPaymaster.sol"; pragma solidity 0.6.12; /// @title GasRelayRecipientMixin Contract /// @author Enzyme Council <[email protected]> /// @notice A mixin that enables receiving GSN-relayed calls /// @dev IMPORTANT: Do not use storage var in this contract, /// unless it is no longer inherited by the VaultLib abstract contract GasRelayRecipientMixin { address internal immutable GAS_RELAY_PAYMASTER_FACTORY; constructor(address _gasRelayPaymasterFactory) internal { GAS_RELAY_PAYMASTER_FACTORY = _gasRelayPaymasterFactory; } /// @dev Helper to parse the canonical sender of a tx based on whether it has been relayed function __msgSender() internal view returns (address payable canonicalSender_) { if (msg.data.length >= 24 && msg.sender == getGasRelayTrustedForwarder()) { assembly { canonicalSender_ := shr(96, calldataload(sub(calldatasize(), 20))) } return canonicalSender_; } return msg.sender; } /////////////////// // STATE GETTERS // /////////////////// /// @notice Gets the `GAS_RELAY_PAYMASTER_FACTORY` variable /// @return gasRelayPaymasterFactory_ The `GAS_RELAY_PAYMASTER_FACTORY` variable value function getGasRelayPaymasterFactory() public view returns (address gasRelayPaymasterFactory_) { return GAS_RELAY_PAYMASTER_FACTORY; } /// @notice Gets the trusted forwarder for GSN relaying /// @return trustedForwarder_ The trusted forwarder function getGasRelayTrustedForwarder() public view returns (address trustedForwarder_) { return IGasRelayPaymaster( IBeaconProxyFactory(getGasRelayPaymasterFactory()).getCanonicalLib() ) .trustedForwarder(); } }
// 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/IGsnPaymaster.sol"; /// @title IGasRelayPaymaster Interface /// @author Enzyme Council <[email protected]> interface IGasRelayPaymaster is IGsnPaymaster { function deposit() external; function withdrawBalance() external; }
// 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 IGasRelayPaymasterDepositor Interface /// @author Enzyme Council <[email protected]> interface IGasRelayPaymasterDepositor { function pullWethForGasRelayer(uint256) external; }
// 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 IValueInterpreter interface /// @author Enzyme Council <[email protected]> /// @notice Interface for ValueInterpreter interface IValueInterpreter { function calcCanonicalAssetValue( address, uint256, address ) external returns (uint256); function calcCanonicalAssetsTotalValue( address[] calldata, uint256[] calldata, address ) external returns (uint256); function isSupportedAsset(address) external view returns (bool); function isSupportedDerivativeAsset(address) external view returns (bool); function isSupportedPrimitiveAsset(address) 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 IGsnForwarder interface /// @author Enzyme Council <[email protected]> interface IGsnForwarder { struct ForwardRequest { address from; address to; uint256 value; uint256 gas; uint256 nonce; bytes data; uint256 validUntil; } }
// 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 "./IGsnTypes.sol"; /// @title IGsnPaymaster interface /// @author Enzyme Council <[email protected]> interface IGsnPaymaster { struct GasAndDataLimits { uint256 acceptanceBudget; uint256 preRelayedCallGasLimit; uint256 postRelayedCallGasLimit; uint256 calldataSizeLimit; } function getGasAndDataLimits() external view returns (GasAndDataLimits memory limits); function getHubAddr() external view returns (address); function getRelayHubDeposit() external view returns (uint256); function preRelayedCall( IGsnTypes.RelayRequest calldata relayRequest, bytes calldata signature, bytes calldata approvalData, uint256 maxPossibleGas ) external returns (bytes memory context, bool rejectOnRecipientRevert); function postRelayedCall( bytes calldata context, bool success, uint256 gasUseWithoutPost, IGsnTypes.RelayData calldata relayData ) external; function trustedForwarder() external view returns (address); function versionPaymaster() external view returns (string 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; pragma experimental ABIEncoderV2; import "./IGsnForwarder.sol"; /// @title IGsnTypes Interface /// @author Enzyme Council <[email protected]> interface IGsnTypes { struct RelayData { uint256 gasPrice; uint256 pctRelayFee; uint256 baseRelayFee; address relayWorker; address paymaster; address forwarder; bytes paymasterData; uint256 clientId; } struct RelayRequest { IGsnForwarder.ForwardRequest request; RelayData relayData; } }
// 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 AddressArray Library /// @author Enzyme Council <[email protected]> /// @notice A library to extend the address array data type library AddressArrayLib { ///////////// // STORAGE // ///////////// /// @dev Helper to remove an item from a storage array function removeStorageItem(address[] storage _self, address _itemToRemove) internal returns (bool removed_) { uint256 itemCount = _self.length; for (uint256 i; i < itemCount; i++) { if (_self[i] == _itemToRemove) { if (i < itemCount - 1) { _self[i] = _self[itemCount - 1]; } _self.pop(); removed_ = true; break; } } return removed_; } //////////// // MEMORY // //////////// /// @dev Helper to add an item to an array. Does not assert uniqueness of the new item. function addItem(address[] memory _self, address _itemToAdd) internal pure returns (address[] memory nextArray_) { nextArray_ = new address[](_self.length + 1); for (uint256 i; i < _self.length; i++) { nextArray_[i] = _self[i]; } nextArray_[_self.length] = _itemToAdd; return nextArray_; } /// @dev Helper to add an item to an array, only if it is not already in the array. function addUniqueItem(address[] memory _self, address _itemToAdd) internal pure returns (address[] memory nextArray_) { if (contains(_self, _itemToAdd)) { return _self; } return addItem(_self, _itemToAdd); } /// @dev Helper to verify if an array contains a particular value function contains(address[] memory _self, address _target) internal pure returns (bool doesContain_) { for (uint256 i; i < _self.length; i++) { if (_target == _self[i]) { return true; } } return false; } /// @dev Helper to merge the unique items of a second array. /// Does not consider uniqueness of either array, only relative uniqueness. /// Preserves ordering. function mergeArray(address[] memory _self, address[] memory _arrayToMerge) internal pure returns (address[] memory nextArray_) { uint256 newUniqueItemCount; for (uint256 i; i < _arrayToMerge.length; i++) { if (!contains(_self, _arrayToMerge[i])) { newUniqueItemCount++; } } if (newUniqueItemCount == 0) { return _self; } nextArray_ = new address[](_self.length + newUniqueItemCount); for (uint256 i; i < _self.length; i++) { nextArray_[i] = _self[i]; } uint256 nextArrayIndex = _self.length; for (uint256 i; i < _arrayToMerge.length; i++) { if (!contains(_self, _arrayToMerge[i])) { nextArray_[nextArrayIndex] = _arrayToMerge[i]; nextArrayIndex++; } } return nextArray_; } /// @dev Helper to verify if array is a set of unique values. /// Does not assert length > 0. function isUniqueSet(address[] memory _self) internal pure returns (bool isUnique_) { if (_self.length <= 1) { return true; } uint256 arrayLength = _self.length; for (uint256 i; i < arrayLength; i++) { for (uint256 j = i + 1; j < arrayLength; j++) { if (_self[i] == _self[j]) { return false; } } } return true; } /// @dev Helper to remove items from an array. Removes all matching occurrences of each item. /// Does not assert uniqueness of either array. function removeItems(address[] memory _self, address[] memory _itemsToRemove) internal pure returns (address[] memory nextArray_) { if (_itemsToRemove.length == 0) { return _self; } bool[] memory indexesToRemove = new bool[](_self.length); uint256 remainingItemsCount = _self.length; for (uint256 i; i < _self.length; i++) { if (contains(_itemsToRemove, _self[i])) { indexesToRemove[i] = true; remainingItemsCount--; } } if (remainingItemsCount == _self.length) { nextArray_ = _self; } else if (remainingItemsCount > 0) { nextArray_ = new address[](remainingItemsCount); uint256 nextArrayIndex; for (uint256 i; i < _self.length; i++) { if (!indexesToRemove[i]) { nextArray_[nextArrayIndex] = _self[i]; nextArrayIndex++; } } } return nextArray_; } }
// 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 IBeacon interface /// @author Enzyme Council <[email protected]> interface IBeacon { function getCanonicalLib() external view returns (address); }
// 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. */ import "./IBeacon.sol"; pragma solidity 0.6.12; /// @title IBeaconProxyFactory interface /// @author Enzyme Council <[email protected]> interface IBeaconProxyFactory is IBeacon { function deployProxy(bytes memory _constructData) external returns (address proxy_); function setCanonicalLib(address _canonicalLib) external; }
{ "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":"_dispatcher","type":"address"},{"internalType":"address","name":"_protocolFeeReserve","type":"address"},{"internalType":"address","name":"_fundDeployer","type":"address"},{"internalType":"address","name":"_valueInterpreter","type":"address"},{"internalType":"address","name":"_externalPositionManager","type":"address"},{"internalType":"address","name":"_feeManager","type":"address"},{"internalType":"address","name":"_integrationManager","type":"address"},{"internalType":"address","name":"_policyManager","type":"address"},{"internalType":"address","name":"_gasRelayPaymasterFactory","type":"address"},{"internalType":"address","name":"_mlnToken","type":"address"},{"internalType":"address","name":"_wethToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"autoProtocolFeeSharesBuyback","type":"bool"}],"name":"AutoProtocolFeeSharesBuybackSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"failureReturnData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buybackValueInMln","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gav","type":"uint256"}],"name":"BuyBackMaxProtocolFeeSharesFailed","type":"event"},{"anonymous":false,"inputs":[],"name":"DeactivateFeeManagerFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"gasRelayPaymaster","type":"address"}],"name":"GasRelayPaymasterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"sharesDue","type":"uint256"}],"name":"MigratedSharesDuePaid","type":"event"},{"anonymous":false,"inputs":[],"name":"PayProtocolFeeDuringDestructFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"failureReturnData","type":"bytes"},{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"PreRedeemSharesHookFailed","type":"event"},{"anonymous":false,"inputs":[],"name":"RedeemSharesInKindCalcGavFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"investmentAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesIssued","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesReceived","type":"uint256"}],"name":"SharesBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"receivedAssets","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"receivedAssetAmounts","type":"uint256[]"}],"name":"SharesRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vaultProxy","type":"address"}],"name":"VaultProxySet","type":"event"},{"inputs":[{"internalType":"bool","name":"_isMigration","type":"bool"}],"name":"activate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sharesAmount","type":"uint256"}],"name":"buyBackProtocolFeeShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_investmentAmount","type":"uint256"},{"internalType":"uint256","name":"_minSharesQuantity","type":"uint256"}],"name":"buyShares","outputs":[{"internalType":"uint256","name":"sharesReceived_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"uint256","name":"_investmentAmount","type":"uint256"},{"internalType":"uint256","name":"_minSharesQuantity","type":"uint256"}],"name":"buySharesOnBehalf","outputs":[{"internalType":"uint256","name":"sharesReceived_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"calcGav","outputs":[{"internalType":"uint256","name":"gav_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"calcGrossShareValue","outputs":[{"internalType":"uint256","name":"grossShareValue_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"},{"internalType":"uint256","name":"_actionId","type":"uint256"},{"internalType":"bytes","name":"_callArgs","type":"bytes"}],"name":"callOnExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployGasRelayPaymaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToGasRelayPaymaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_deactivateFeeManagerGasLimit","type":"uint256"},{"internalType":"uint256","name":"_payProtocolFeeGasLimit","type":"uint256"}],"name":"destructActivated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"destructUnactivated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"doesAutoProtocolFeeSharesBuyback","outputs":[{"internalType":"bool","name":"doesAutoBuyback_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDenominationAsset","outputs":[{"internalType":"address","name":"denominationAsset_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDispatcher","outputs":[{"internalType":"address","name":"dispatcher_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExternalPositionManager","outputs":[{"internalType":"address","name":"externalPositionManager_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeeManager","outputs":[{"internalType":"address","name":"feeManager_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFundDeployer","outputs":[{"internalType":"address","name":"fundDeployer_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasRelayPaymaster","outputs":[{"internalType":"address","name":"gasRelayPaymaster_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasRelayPaymasterFactory","outputs":[{"internalType":"address","name":"gasRelayPaymasterFactory_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasRelayTrustedForwarder","outputs":[{"internalType":"address","name":"trustedForwarder_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIntegrationManager","outputs":[{"internalType":"address","name":"integrationManager_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_who","type":"address"}],"name":"getLastSharesBoughtTimestampForAccount","outputs":[{"internalType":"uint256","name":"lastSharesBoughtTimestamp_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMlnToken","outputs":[{"internalType":"address","name":"mlnToken_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPolicyManager","outputs":[{"internalType":"address","name":"policyManager_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeeReserve","outputs":[{"internalType":"address","name":"protocolFeeReserve_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSharesActionTimelock","outputs":[{"internalType":"uint256","name":"sharesActionTimelock_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getValueInterpreter","outputs":[{"internalType":"address","name":"valueInterpreter_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultProxy","outputs":[{"internalType":"address","name":"vaultProxy_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWethToken","outputs":[{"internalType":"address","name":"wethToken_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_denominationAsset","type":"address"},{"internalType":"uint256","name":"_sharesActionTimelock","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IVault.VaultAction","name":"_action","type":"uint8"},{"internalType":"bytes","name":"_actionData","type":"bytes"}],"name":"permissionedVaultAction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"preTransferSharesHook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"preTransferSharesHookFreelyTransferable","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"pullWethForGasRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_sharesQuantity","type":"uint256"},{"internalType":"address[]","name":"_payoutAssets","type":"address[]"},{"internalType":"uint256[]","name":"_payoutAssetPercentages","type":"uint256[]"}],"name":"redeemSharesForSpecificAssets","outputs":[{"internalType":"uint256[]","name":"payoutAmounts_","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_sharesQuantity","type":"uint256"},{"internalType":"address[]","name":"_additionalAssets","type":"address[]"},{"internalType":"address[]","name":"_assetsToSkip","type":"address[]"}],"name":"redeemSharesInKind","outputs":[{"internalType":"address[]","name":"payoutAssets_","type":"address[]"},{"internalType":"uint256[]","name":"payoutAmounts_","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_nextAutoProtocolFeeSharesBuyback","type":"bool"}],"name":"setAutoProtocolFeeSharesBuyback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nextGasRelayPaymaster","type":"address"}],"name":"setGasRelayPaymaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultProxy","type":"address"}],"name":"setVaultProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shutdownGasRelayPaymaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"bytes4","name":"_selector","type":"bytes4"},{"internalType":"bytes","name":"_encodedArgs","type":"bytes"}],"name":"vaultCallOnContract","outputs":[{"internalType":"bytes","name":"returnData_","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101e06040523480156200001257600080fd5b5060405162005ec238038062005ec283398181016040526101608110156200003957600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505082806001600160a01b03166080816001600160a01b031660601b81525050508a6001600160a01b031660a0816001600160a01b031660601b81525050866001600160a01b031660c0816001600160a01b031660601b81525050856001600160a01b0316610100816001600160a01b031660601b81525050886001600160a01b031660e0816001600160a01b031660601b81525050846001600160a01b0316610120816001600160a01b031660601b81525050816001600160a01b0316610140816001600160a01b031660601b81525050836001600160a01b0316610160816001600160a01b031660601b81525050896001600160a01b0316610180816001600160a01b031660601b81525050876001600160a01b03166101a0816001600160a01b031660601b81525050806001600160a01b03166101c0816001600160a01b031660601b8152505060018060146101000a81548160ff021916908315150217905550505050505050505050505060805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c6101405160601c6101605160601c6101805160601c6101a05160601c6101c05160601c615c0a620002b860003980611269525080611f2152508061269a525080612676525080612c78525080612c9c525080612ce4525080612196525080612318525080612cc05250806121ca5250615c0a6000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c8063a01fd15711610146578063db69681f116100c3578063e7c4569011610087578063e7c456901461097c578063ebb3d58914610984578063f2d638261461098c578063f9005af314610994578063f9d5fe781461099c578063faf9096b146109c257610253565b8063db69681f1461085a578063e269c3d614610862578063e53a73b91461086a578063e572ced114610872578063e70e605e1461097457610253565b8063c98091871161010a578063c98091871461081b578063ce5e84a314610823578063d44ad6cb14610842578063da41962e1461084a578063da72503c1461085257610253565b8063a01fd157146107af578063ac259456146107cb578063b10ea2b0146107d3578063b3fc38e9146107f0578063beebc5da146107f857610253565b80636af8e7eb116101d45780637f20170d116101985780637f20170d14610724578063875fb4b31461074a578063877fd8941461075257806392b575b61461078457806397c0ac87146107a757610253565b80636af8e7eb146105655780636ea21143146106d1578063716d4da4146106d957806373eecf47146106e157806379951f0f1461070757610253565b8063399ae7241161021b578063399ae7241461047057806339bf70d11461049c5780634c252f911461051f5780634da471b71461054357806356cff99f1461055d57610253565b806310acd06d1461025857806312f20526146102d25780632dc7a3a0146103085780633462fcc114610327578063397bfe551461044a575b600080fd5b6102d06004803603604081101561026e57600080fd5b60ff8235169190810190604081016020820135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460018302840111600160201b831117156102c557600080fd5b5090925090506109ca565b005b6102d0600480360360608110156102e857600080fd5b506001600160a01b03813581169160208101359091169060400135610afa565b6102d06004803603602081101561031e57600080fd5b50351515610c67565b6103fa6004803603608081101561033d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561036c57600080fd5b82018360208201111561037e57600080fd5b803590602001918460208302840111600160201b8311171561039f57600080fd5b919390929091602081019035600160201b8111156103bc57600080fd5b8201836020820111156103ce57600080fd5b803590602001918460208302840111600160201b831117156103ef57600080fd5b509092509050610cca565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561043657818101518382015260200161041e565b505050509050019250505060405180910390f35b6102d06004803603602081101561046057600080fd5b50356001600160a01b0316610f1e565b6102d06004803603604081101561048657600080fd5b506001600160a01b038135169060200135610f7a565b6102d0600480360360608110156104b257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104e157600080fd5b8201836020820111156104f357600080fd5b803590602001918460018302840111600160201b8311171561051457600080fd5b5090925090506110d6565b610527611267565b604080516001600160a01b039092168252519081900360200190f35b61054b61128c565b60408051918252519081900360200190f35b61054b611292565b6106386004803603608081101561057b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111600160201b831117156105dd57600080fd5b919390929091602081019035600160201b8111156105fa57600080fd5b82018360208201111561060c57600080fd5b803590602001918460208302840111600160201b8311171561062d57600080fd5b509092509050611732565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561067c578181015183820152602001610664565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106bb5781810151838201526020016106a3565b5050505090500194505050505060405180910390f35b610527611d4e565b6102d0611e2f565b6102d0600480360360208110156106f757600080fd5b50356001600160a01b0316611e4c565b6102d06004803603602081101561071d57600080fd5b5035611e60565b61054b6004803603602081101561073a57600080fd5b50356001600160a01b0316611f00565b610527611f1f565b61054b6004803603606081101561076857600080fd5b506001600160a01b038135169060208101359060400135611f43565b6102d06004803603604081101561079a57600080fd5b5080359060200135612052565b610527612194565b6107b76121b8565b604080519115158252519081900360200190f35b6105276121c8565b6102d0600480360360208110156107e957600080fd5b50356121ec565b610527612316565b61054b6004803603604081101561080e57600080fd5b508035906020013561233a565b61052761236e565b6102d06004803603602081101561083957600080fd5b5035151561237d565b610527612674565b610527612698565b61054b6126bc565b6102d06127b6565b610527612952565b6102d0612961565b6108ff6004803603606081101561088857600080fd5b6001600160a01b03823516916001600160e01b031960208201351691810190606081016040820135600160201b8111156108c157600080fd5b8201836020820111156108d357600080fd5b803590602001918460018302840111600160201b831117156108f457600080fd5b509092509050612971565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610939578181015183820152602001610921565b50505050905090810190601f1680156109665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610527612c76565b610527612c9a565b610527612cbe565b610527612ce2565b6102d0612d06565b6102d0600480360360208110156109b257600080fd5b50356001600160a01b0316612e22565b610527612e33565b6109d43384612e42565b600683600a8111156109e257fe5b1415610a51576109f0612952565b6001600160a01b031682826020811015610a0957600080fd5b50356001600160a01b03161415610a515760405162461bcd60e51b815260040180806020018281038252603a815260200180615b1b603a913960400191505060405180910390fd5b610a5961236e565b6001600160a01b03166324e600128484846040518463ffffffff1660e01b81526004018084600a811115610a8957fe5b8152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610add57600080fd5b505af1158015610af1573d6000803e3d6000fd5b50505050505050565b6000610b0461236e565b9050336001600160a01b03821614610b4d5760405162461bcd60e51b815260040180806020018281038252602f815260200180615ac6602f913960400191505060405180910390fd5b610b578185612fd1565b610b5f612674565b604080516001600160a01b038781166020830152868116828401526060808301879052835180840390910181526080830193849052630442bad560e01b90935230608483018181529490911693630442bad5939192600292919060a40183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bfb578181015183820152602001610be3565b50505050905090810190601f168015610c285780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610c4957600080fd5b505af1158015610c5d573d6000803e3d6000fd5b5050505050505050565b610c77610c7261305b565b61309f565b60018054821515600160a81b810260ff60a81b199092169190911790915560408051918252517f8ccd4cc3a51ed6f61f2b34b8d0a1ac137376931714380a7702b410ed174d6a739181900360200190a150565b6060610cd461316a565b6001805460ff60b81b1916600160b81b1790556000610cf161305b565b9050848314610d315760405162461bcd60e51b815260040180806020018281038252602d8152602001806158a0602d913960400191505060405180910390fd5b610d6d8686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b610da85760405162461bcd60e51b81526004018080602001828103825260358152602001806158cd6035913960400191505060405180910390fd5b6000610db2611292565b90506000610dbe61236e565b9050600080610dd183868d60018861324b565b9092509050610df8838d8c8c8c8c610df388610ded8d8c61353d565b90613596565b6135fd565b9550610e3d858d848d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508d92508b91506139079050565b8b6001600160a01b0316856001600160a01b03167fbf88879a1555e4d7d38ebeffabce61fdf5e12ea0468abf855a72ec17b432bed5848d8d8b60405180858152602001806020018060200183810383528686828181526020019250602002808284376000838201819052601f909101601f1916909201858103845286518152865160209182019382890193509102908190849084905b83811015610eeb578181015183820152602001610ed3565b50505050905001965050505050505060405180910390a350505050506001805460ff60b81b191690559695505050505050565b610f26613ad0565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5be181178e61e61e33f79c396c7194b8f3c80f77899da7bd96fe537411300bcb9181900360200190a150565b6000610f84612952565b6001600160a01b031614610fdf576040805162461bcd60e51b815260206004820152601960248201527f696e69743a20416c726561647920696e697469616c697a656400000000000000604482015290519081900360640190fd5b610fe7611f1f565b6001600160a01b031663c496f8e8836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561103357600080fd5b505afa158015611047573d6000803e3d6000fd5b505050506040513d602081101561105d57600080fd5b50516110b0576040805162461bcd60e51b815260206004820152601c60248201527f696e69743a204261642064656e6f6d696e6174696f6e20617373657400000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039390931692909217909155600255565b6110de61316a565b6001805460ff60b81b1916600160b81b1790556110f9613b3d565b6001805460ff60b01b1916600160b01b179055611114612ce2565b6001600160a01b0316846001600160a01b0316148061114b5750611136612c9a565b6001600160a01b0316846001600160a01b0316145b8061116e5750611159612316565b6001600160a01b0316846001600160a01b0316145b6111a95760405162461bcd60e51b81526004018080602001828103825260238152602001806159956023913960400191505060405180910390fd5b836001600160a01b0316631bee801e6111c061305b565b8585856040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b50506001805461ffff60b01b19169055505050505050565b7f00000000000000000000000000000000000000000000000000000000000000005b90565b60025490565b60008061129d61236e565b90506060816001600160a01b031663c4b973706040518163ffffffff1660e01b815260040160006040518083038186803b1580156112da57600080fd5b505afa1580156112ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561131757600080fd5b8101908080516040519392919084600160201b82111561133657600080fd5b90830190602082018581111561134b57600080fd5b82518660208202830111600160201b8211171561136757600080fd5b82525081516020918201928201910280838360005b8381101561139457818101518382015260200161137c565b5050505090500160405250505090506060826001600160a01b031663b8b7f1476040518163ffffffff1660e01b815260040160006040518083038186803b1580156113de57600080fd5b505afa1580156113f2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561141b57600080fd5b8101908080516040519392919084600160201b82111561143a57600080fd5b90830190602082018581111561144f57600080fd5b82518660208202830111600160201b8211171561146b57600080fd5b82525081516020918201928201910280838360005b83811015611498578181015183820152602001611480565b505050509050016040525050509050815160001480156114b757508051155b156114c85760009350505050611289565b6060825167ffffffffffffffff811180156114e257600080fd5b5060405190808252806020026020018201604052801561150c578160200160208202803683370190505b50905060005b83518110156115c85783818151811061152757fe5b60200260200101516001600160a01b03166370a08231866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b505050506040513d60208110156115a557600080fd5b505182518390839081106115b557fe5b6020908102919091010152600101611512565b506115d1611f1f565b6001600160a01b031663ae6f52ad84836115e9612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b8381101561164b578181015183820152602001611633565b50505050905001838103825285818151815260200191508051906020019060200280838360005b8381101561168a578181015183820152602001611672565b5050505090500195505050505050602060405180830381600087803b1580156116b257600080fd5b505af11580156116c6573d6000803e3d6000fd5b505050506040513d60208110156116dc57600080fd5b505182519095501561172b5760005b825181101561172957600061171284838151811061170557fe5b6020026020010151613b9c565b905061171e8782614118565b9650506001016116eb565b505b5050505090565b60608061173d61316a565b6001805460ff60b81b1916600160b81b179055600061175a61305b565b90506117988787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b6117d35760405162461bcd60e51b81526004018080602001828103825260398152602001806159b86039913960400191505060405180910390fd5b61180f8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b61184a5760405162461bcd60e51b8152600401808060200182810382526035815260200180615ba06035913960400191505060405180910390fd5b60015460408051630c4b973760e41b815290516119b9926001600160a01b03169163c4b97370916004808301926000929190829003018186803b15801561189057600080fd5b505afa1580156118a4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156118cd57600080fd5b8101908080516040519392919084600160201b8211156118ec57600080fd5b90830190602082018581111561190157600080fd5b82518660208202830111600160201b8211171561191d57600080fd5b82525081516020918201928201910280838360005b8381101561194a578181015183820152602001611932565b5050505090910160208d810282810182016040528e83529195508e94508d935083925085019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061417292505050565b925060006119c56121b8565b15611a5f57306001600160a01b03166356cff99f6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611a0557600080fd5b505af1925050508015611a2a57506040513d6020811015611a2557600080fd5b505160015b611a5c576040517ff5939ff9a66cf6d21ec93b246060bc17f5c062847e28d967d3dd617636b238d490600090a1611a5f565b90505b6001546000908190611a7d906001600160a01b0316858d848761324b565b91509150855167ffffffffffffffff81118015611a9957600080fd5b50604051908082528060200260200182016040528015611ac3578160200160208202803683370190505b50945060005b8651811015611c5857611b6d82610ded858a8581518110611ae657fe5b602090810291909101810151600154604080516370a0823160e01b81526001600160a01b039283166004820152905191909216926370a082319260248082019391829003018186803b158015611b3b57600080fd5b505afa158015611b4f573d6000803e3d6000fd5b505050506040513d6020811015611b6557600080fd5b50519061353d565b868281518110611b7957fe5b6020026020010181815250506000868281518110611b9357fe5b60200260200101511115611c505760015487516001600160a01b039091169063495d753c90899084908110611bc457fe5b60200260200101518f898581518110611bd957fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611c3757600080fd5b505af1158015611c4b573d6000803e3d6000fd5b505050505b600101611ac9565b508b6001600160a01b0316846001600160a01b03167fbf88879a1555e4d7d38ebeffabce61fdf5e12ea0468abf855a72ec17b432bed5848989604051808481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015611cdb578181015183820152602001611cc3565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611d1a578181015183820152602001611d02565b505050509050019550505050505060405180910390a3505050506001805460ff60b81b191690559097909650945050505050565b6000611d586121c8565b6001600160a01b03166398a7c4c76040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6020811015611dba57600080fd5b505160408051637da0a87760e01b815290516001600160a01b0390921691637da0a87791600480820192602092909190829003018186803b158015611dfe57600080fd5b505afa158015611e12573d6000803e3d6000fd5b505050506040513d6020811015611e2857600080fd5b5051905090565b611e3a610c7261305b565b611e4a611e45612e33565b614364565b565b611e54613ad0565b611e5d8161439f565b50565b611e686143f3565b611e7061236e565b6001600160a01b031663495d753c611e86611267565b611e8e612e33565b846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611ee557600080fd5b505af1158015611ef9573d6000803e3d6000fd5b5050505050565b6001600160a01b0381166000908152600360205260409020545b919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000806000611f5061128c565b1190506000611f5d61305b565b9050811580611fe85750611f6f612194565b6001600160a01b03166354391f09826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611fbb57600080fd5b505afa158015611fcf573d6000803e3d6000fd5b505050506040513d6020811015611fe557600080fd5b50515b612039576040805162461bcd60e51b815260206004820152601f60248201527f6275795368617265734f6e426568616c663a20556e617574686f72697a656400604482015290519081900360640190fd5b612046868686858561444a565b925050505b9392505050565b61205a613ad0565b612062613b3d565b6001805460ff60b01b1916600160b01b17905561207d61236e565b6001600160a01b031663d5c20fa2826040518263ffffffff1660e01b8152600401600060405180830381600088803b1580156120b857600080fd5b5087f1935050505080156120ca575060015b6120f8576040517f8a7579328a911284dedef6a7e68bbb1eae7d59418f2699cb5a3c26f6e57e4d7790600090a15b612100612ce2565b6001600160a01b031663bd8e959a836040518263ffffffff1660e01b8152600401600060405180830381600088803b15801561213b57600080fd5b5087f19350505050801561214d575060015b61217b576040517f681c534f5c2e473c9cc8ab1693257fb2b0e19a5c5ecd7d040201f1cf2a190c8790600090a15b61218361484e565b50506001805460ff60b01b19169055565b7f000000000000000000000000000000000000000000000000000000000000000090565b600154600160a81b900460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001546001600160a01b03168063714ca2d161220661305b565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561224357600080fd5b505afa158015612257573d6000803e3d6000fd5b505050506040513d602081101561226d57600080fd5b50516122aa5760405162461bcd60e51b8152600401808060200182810382526026815260200180615af56026913960400191505060405180910390fd5b60006122b4611292565b9050816001600160a01b0316631ff46bfa846122d185878661489a565b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610add57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000090565b600080600061234761128c565b119050600061235461305b565b9050612363818686858561444a565b925050505b92915050565b6001546001600160a01b031690565b612385613ad0565b600061238f61236e565b90508115612534576000816001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156123e657600080fd5b505afa1580156123fa573d6000803e3d6000fd5b505050506040513d602081101561241057600080fd5b50519050801561253257816001600160a01b031663bfc77beb83846001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b15801561246357600080fd5b505afa158015612477573d6000803e3d6000fd5b505050506040513d602081101561248d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820185905251606480830192600092919082900301818387803b1580156124e557600080fd5b505af11580156124f9573d6000803e3d6000fd5b50506040805184815290517f8f9ec2c1cf1f95fcb5d89d3141949092850c5cfe04da4d9425dd840bf18cdc709350908190036020019150a15b505b806001600160a01b0316634ef0762e61254b612952565b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b505050506125aa612ce2565b6001600160a01b03166380d57063836040518263ffffffff1660e01b8152600401808215158152602001915050600060405180830381600087803b1580156125f157600080fd5b505af1158015612605573d6000803e3d6000fd5b50505050612611612674565b6001600160a01b03166380d57063836040518263ffffffff1660e01b8152600401808215158152602001915050600060405180830381600087803b15801561265857600080fd5b505af115801561266c573d6000803e3d6000fd5b505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000806126c7611292565b90506127b0816126d561236e565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561270d57600080fd5b505afa158015612721573d6000803e3d6000fd5b505050506040513d602081101561273757600080fd5b5051612741612952565b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561277957600080fd5b505afa15801561278d573d6000803e3d6000fd5b505050506040513d60208110156127a357600080fd5b505160ff16600a0a614a1b565b91505090565b6127bf3361309f565b60006127c9612e33565b6001600160a01b03161461280e5760405162461bcd60e51b81526004018080602001828103825260338152602001806159626033913960400191505060405180910390fd5b606061281861236e565b604080516001600160a01b0390921660248084019190915281518084039091018152604490920190526020810180516001600160e01b031663066ad14f60e21b179052905060006128676121c8565b6001600160a01b0316630c0872f5836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128c25781810151838201526020016128aa565b50505050905090810190601f1680156128ef5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561290e57600080fd5b505af1158015612922573d6000803e3d6000fd5b505050506040513d602081101561293857600080fd5b505190506129458161439f565b61294e81614364565b5050565b6000546001600160a01b031690565b612969613ad0565b611e4a61484e565b606061297e610c7261305b565b612986612194565b6001600160a01b0316638c500ea38686868660405180838380828437808301925050509250505060405180910390206040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160e01b0319168152602001828152602001935050505060206040518083038186803b158015612a0a57600080fd5b505afa158015612a1e573d6000803e3d6000fd5b505050506040513d6020811015612a3457600080fd5b5051612a87576040805162461bcd60e51b815260206004820181905260248201527f7661756c7443616c6c4f6e436f6e74726163743a204e6f7420616c6c6f776564604482015290519081900360640190fd5b612a8f61236e565b6001600160a01b031663a90cce4b8686868660405160200180846001600160e01b03191681526004018383808284378083019250505093505050506040516020818303038152906040526040518363ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612b34578181015183820152602001612b1c565b50505050905090810190601f168015612b615780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612b8157600080fd5b505af1158015612b95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612bbe57600080fd5b8101908080516040519392919084600160201b821115612bdd57600080fd5b908301906020820185811115612bf257600080fd5b8251600160201b811182820188101715612c0b57600080fd5b82525081516020918201929091019080838360005b83811015612c38578181015183820152602001612c20565b50505050905090810190601f168015612c655780820380516001836020036101000a031916815260200191505b506040525050509050949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b612d0f3361309f565b60048054604080516305fd8c7160e41b815290516001600160a01b0390921692635fd8c71092828201926000929082900301818387803b158015612d5257600080fd5b505af1158015612d66573d6000803e3d6000fd5b50506001546001600160a01b03169150634ef0762e9050612d85611267565b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015612dc457600080fd5b505af1158015612dd8573d6000803e3d6000fd5b5050600480546001600160a01b03191690555050604080516000815290517f66756eda85190d0bcec058815fd7e2154167d102e21d96cab701630af02f24739181900360200190a1565b611e5d612e2d61236e565b82612fd1565b6004546001600160a01b031690565b600154600090600160b01b900460ff1615612f9057612e5f612c9a565b6001600160a01b0316836001600160a01b03161415612ed857600482600a811115612e8657fe5b1480612e9d5750600682600a811115612e9b57fe5b145b80612eb35750600782600a811115612eb157fe5b145b80612eca575060055b82600a811115612ec857fe5b145b15612ed3575060015b612f90565b612ee0612ce2565b6001600160a01b0316836001600160a01b03161415612f2b57600282600a811115612f0757fe5b1480612f1e5750600182600a811115612f1c57fe5b145b80612eca57506003612ebc565b612f33612316565b6001600160a01b0316836001600160a01b03161415612f9057600982600a811115612f5a57fe5b1480612f715750600882600a811115612f6f57fe5b145b80612f875750600a82600a811115612f8557fe5b145b15612f90575060015b80612fcc5760405162461bcd60e51b8152600401808060200182810382526033815260200180615a936033913960400191505060405180910390fd5b505050565b6000612fdc82611f00565b9050801580612ffb5750612fee61128c565b612ff84283614a47565b10155b8061300a575061300a83614aa4565b612fcc576040805162461bcd60e51b815260206004820152601860248201527f53686172657320616374696f6e2074696d656c6f636b65640000000000000000604482015290519081900360640190fd5b6000601836108015906130865750613071611d4e565b6001600160a01b0316336001600160a01b0316145b1561309a575060131936013560601c611289565b503390565b6130a761236e565b6001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b1580156130df57600080fd5b505afa1580156130f3573d6000803e3d6000fd5b505050506040513d602081101561310957600080fd5b50516001600160a01b03828116911614611e5d576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c792066756e64206f776e65722063616c6c61626c650000000000000000604482015290519081900360640190fd5b600154600160b81b900460ff1615611e4a576040805162461bcd60e51b815260206004820152600b60248201526a52652d656e7472616e636560a81b604482015290519081900360640190fd5b600060018251116131ca57506001611f1a565b815160005b8181101561324157600181015b82811015613238578481815181106131f057fe5b60200260200101516001600160a01b031685838151811061320d57fe5b60200260200101516001600160a01b031614156132305760009350505050611f1a565b6001016131dc565b506001016131cf565b5060019392505050565b6000806132588787612fd1565b60008790506000816001600160a01b03166370a08231896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156132ac57600080fd5b505afa1580156132c0573d6000803e3d6000fd5b505050506040513d60208110156132d657600080fd5b505190506000198714156132ec578093506132f0565b8693505b6000841161332f5760405162461bcd60e51b815260040180806020018281038252602881526020018061593a6028913960400191505060405180910390fd5b61333b88858888614bb2565b6000826001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561338a57600080fd5b505afa15801561339e573d6000803e3d6000fd5b505050506040513d60208110156133b457600080fd5b505190506000198814156133ca578094506133e9565b818110156133e9576133e66133df8383614a47565b8690614a47565b94505b896001600160a01b031663d5c20fa26040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561342457600080fd5b505af1158015613438573d6000803e3d6000fd5b5050505060008611801561344f575061344f6121b8565b1561345e5761345e8a87614dae565b826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561349757600080fd5b505afa1580156134ab573d6000803e3d6000fd5b505050506040513d60208110156134c157600080fd5b505160408051633b9e9f0160e21b81526001600160a01b038c81166004830152602482018990529151929650908c169163ee7a7c049160448082019260009290919082900301818387803b15801561351857600080fd5b505af115801561352c573d6000803e3d6000fd5b505050505050509550959350505050565b60008261354c57506000612368565b8282028284828161355957fe5b041461204b5760405162461bcd60e51b81526004018080602001828103825260218152602001806159f16021913960400191505060405180910390fd5b60008082116135ec576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816135f557fe5b049392505050565b60606000613609612952565b905060008667ffffffffffffffff8111801561362457600080fd5b5060405190808252806020026020018201604052801561364e578160200160208202803683370190505b50925060005b878110156138b95761368187878381811061366b57fe5b905060200201358361411890919063ffffffff16565b915061aaaa89898381811061369257fe5b905060200201356001600160a01b03166001600160a01b031614156136b6576138b1565b6136be611f1f565b6001600160a01b0316634c67e106846136f8612710610ded8c8c888181106136e257fe5b905060200201358b61353d90919063ffffffff16565b8c8c8681811061370457fe5b905060200201356001600160a01b03166040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b15801561376a57600080fd5b505af115801561377e573d6000803e3d6000fd5b505050506040513d602081101561379457600080fd5b505184518590839081106137a457fe5b60200260200101818152505060008482815181106137be57fe5b6020026020010151116138025760405162461bcd60e51b81526004018080602001828103825260388152602001806159026038913960400191505060405180910390fd5b8a6001600160a01b031663495d753c8a8a8481811061381d57fe5b905060200201356001600160a01b03168c87858151811061383a57fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561389857600080fd5b505af11580156138ac573d6000803e3d6000fd5b505050505b600101613654565b5061271081146138fa5760405162461bcd60e51b815260040180806020018281038252603b815260200180615834603b913960400191505060405180910390fd5b5050979650505050505050565b61390f612674565b6001600160a01b0316630442bad530600389898989898960405160200180876001600160a01b03168152602001866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019060200280838360005b8381101561399757818101518382015260200161397f565b50505050905001838103825285818151815260200191508051906020019060200280838360005b838110156139d65781810151838201526020016139be565b50505050905001985050505050505050506040516020818303038152906040526040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836009811115613a2457fe5b815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613a62578181015183820152602001613a4a565b50505050905090810190601f168015613a8f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015613ab057600080fd5b505af1158015613ac4573d6000803e3d6000fd5b50505050505050505050565b613ad8612194565b6001600160a01b0316336001600160a01b031614611e4a576040805162461bcd60e51b815260206004820152601a60248201527f4f6e6c792046756e644465706c6f7965722063616c6c61626c65000000000000604482015290519081900360640190fd5b600154600160b01b900460ff1615611e4a576040805162461bcd60e51b815260206004820152601860248201527f5661756c7420616374696f6e2072652d656e7472616e63650000000000000000604482015290519081900360640190fd5b6000606080836001600160a01b03166380daddb86040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613bdc57600080fd5b505af1158015613bf0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015613c1957600080fd5b8101908080516040519392919084600160201b821115613c3857600080fd5b908301906020820185811115613c4d57600080fd5b82518660208202830111600160201b82111715613c6957600080fd5b82525081516020918201928201910280838360005b83811015613c96578181015183820152602001613c7e565b5050505090500160405260200180516040519392919084600160201b821115613cbe57600080fd5b908301906020820185811115613cd357600080fd5b82518660208202830111600160201b82111715613cef57600080fd5b82525081516020918201928201910280838360005b83811015613d1c578181015183820152602001613d04565b50505050905001604052505050915091506000613d37611f1f565b6001600160a01b031663ae6f52ad8484613d4f612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b83811015613db1578181015183820152602001613d99565b50505050905001838103825285818151815260200191508051906020019060200280838360005b83811015613df0578181015183820152602001613dd8565b5050505090500195505050505050602060405180830381600087803b158015613e1857600080fd5b505af1158015613e2c573d6000803e3d6000fd5b505050506040513d6020811015613e4257600080fd5b505160408051633b35962d60e21b8152905191925060609182916001600160a01b0389169163ecd658b49160048082019260009290919082900301818387803b158015613e8e57600080fd5b505af1158015613ea2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015613ecb57600080fd5b8101908080516040519392919084600160201b821115613eea57600080fd5b908301906020820185811115613eff57600080fd5b82518660208202830111600160201b82111715613f1b57600080fd5b82525081516020918201928201910280838360005b83811015613f48578181015183820152602001613f30565b5050505090500160405260200180516040519392919084600160201b821115613f7057600080fd5b908301906020820185811115613f8557600080fd5b82518660208202830111600160201b82111715613fa157600080fd5b82525081516020918201928201910280838360005b83811015613fce578181015183820152602001613fb6565b50505050905001604052505050915091506000613fe9611f1f565b6001600160a01b031663ae6f52ad8484614001612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b8381101561406357818101518382015260200161404b565b50505050905001838103825285818151815260200191508051906020019060200280838360005b838110156140a257818101518382015260200161408a565b5050505090500195505050505050602060405180830381600087803b1580156140ca57600080fd5b505af11580156140de573d6000803e3d6000fd5b505050506040513d60208110156140f457600080fd5b505190508084111561410d5761410a8482614a47565b96505b505050505050919050565b60008282018381101561204b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60608061417f8584614f7d565b905083516000141561419257905061204b565b6060845167ffffffffffffffff811180156141ac57600080fd5b506040519080825280602002602001820160405280156141d6578160200160208202803683370190505b5090506000805b865181101561423d5761420c8782815181106141f557fe5b60200260200101518561510990919063ffffffff16565b61423557600183828151811061421e57fe5b911515602092830291909101909101526001909101905b6001016141dd565b508061424e5782935050505061204b565b825161425a9082614118565b67ffffffffffffffff8111801561427057600080fd5b5060405190808252806020026020018201604052801561429a578160200160208202803683370190505b50935060005b83518110156142e9578381815181106142b557fe5b60200260200101518582815181106142c957fe5b6001600160a01b03909216602092830291909101909101526001016142a0565b50825160005b87518110156143585783818151811061430457fe5b6020026020010151156143505787818151811061431d57fe5b602002602001015186838151811061433157fe5b6001600160a01b03909216602092830291909101909101526001909101905b6001016142ef565b50505050509392505050565b806001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611ee557600080fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f66756eda85190d0bcec058815fd7e2154167d102e21d96cab701630af02f24739181900360200190a150565b6143fb612e33565b6001600160a01b0316336001600160a01b031614611e4a5760405162461bcd60e51b8152600401808060200182810382526021815260200180615b7f6021913960400191505060405180910390fd5b600061445461316a565b6001805460ff60b81b1916600160b81b17905561446f613b3d565b6001805460ff60b01b1916600160b01b179055836144be5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a38602a913960400191505060405180910390fd5b60006144c861236e565b90508315806144dd57506144db81614aa4565b155b6145185760405162461bcd60e51b8152600401808060200182810382526031815260200180615a626031913960400191505060405180910390fd5b6000614522611292565b905061452f88888361515f565b816001600160a01b031663d5c20fa26040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561456a57600080fd5b505af115801561457e573d6000803e3d6000fd5b5050505061458a6121b8565b15614599576145998282614dae565b60006145ae6145a6612952565b86858b615244565b905060006145ef83856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561270d57600080fd5b9050600061460982610ded85670de0b6b3a764000061353d565b90506000856001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561465a57600080fd5b505afa15801561466e573d6000803e3d6000fd5b505050506040513d602081101561468457600080fd5b5051604080516329460cc560e11b81526001600160a01b038f811660048301526024820186905291519293509088169163528c198a9160448082019260009290919082900301818387803b1580156146db57600080fd5b505af11580156146ef573d6000803e3d6000fd5b505050506146ff8c858488615332565b61478281876001600160a01b03166370a082318f6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561475057600080fd5b505afa158015614764573d6000803e3d6000fd5b505050506040513d602081101561477a57600080fd5b505190614a47565b9650898710156147c35760405162461bcd60e51b815260040180806020018281038252603181526020018061586f6031913960400191505060405180910390fd5b88156147e5576001600160a01b038c1660009081526003602052604090204290555b604080518581526020810184905280820189905290516001600160a01b038e16917f849165c18b9d0fb161bcb145e4ab523d350e5c98f1dbbb1960331e7ee3ca6767919081900360600190a25050505050506001805461ffff60b01b1916905595945050505050565b600154600160a01b900460ff16156148975760405162461bcd60e51b8152600401808060200182810382526026815260200180615a126026913960400191505060405180910390fd5b30ff5b6000806148a5612952565b9050600061495284876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156148e657600080fd5b505afa1580156148fa573d6000803e3d6000fd5b505050506040513d602081101561491057600080fd5b50516040805163313ce56760e01b815290516001600160a01b0387169163313ce567916004808301926020929190829003018186803b15801561277957600080fd5b9050600061496c670de0b6b3a7640000610ded848961353d565b9050614976611f1f565b6001600160a01b0316634c67e106848361498e612c76565b6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b1580156149e457600080fd5b505af11580156149f8573d6000803e3d6000fd5b505050506040513d6020811015614a0e57600080fd5b5051979650505050505050565b600082614a2957508061204b565b614a3f83610ded86670de0b6b3a764000061353d565b949350505050565b600082821115614a9e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000614aae612cbe565b6001600160a01b031663d0449d3d836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614afa57600080fd5b505afa158015614b0e573d6000803e3d6000fd5b505050506040513d6020811015614b2457600080fd5b5051806123685750614b34612194565b6001600160a01b0316636c579e57836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614b8057600080fd5b505afa158015614b94573d6000803e3d6000fd5b505050506040513d6020811015614baa57600080fd5b505192915050565b614bba613b3d565b6001805460ff60b01b1916600160b01b179055614bd5612ce2565b604080516001600160a01b038781166020830152818301879052851515606080840191909152835180840390910181526080830193849052631dd6705960e21b9093529290921691637759c1649160039185906084018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614c71578181015183820152602001614c59565b50505050905090810190601f168015614c9e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015614cbf57600080fd5b505af1925050508015614cd0575060015b614d9b573d808015614cfe576040519150601f19603f3d011682016040523d82523d6000602084013e614d03565b606091505b50846001600160a01b0316816040518082805190602001908083835b60208310614d3e5780518252601f199092019160209182019101614d1f565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208b835293519395507fb3ea7e5141baf21804d12f5a635e83e0cb869c8b06b88648364769f85aa73fc294509083900301919050a3505b50506001805460ff60b01b191690555050565b6000826001600160a01b03166370a08231614dc7612698565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614e0457600080fd5b505afa158015614e18573d6000803e3d6000fd5b505050506040513d6020811015614e2e57600080fd5b505190506000614e3f84838561489a565b9050836001600160a01b0316631ff46bfa8383866040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015614e9757600080fd5b505af1925050508015614ea8575060015b614f77573d808015614ed6576040519150601f19603f3d011682016040523d82523d6000602084013e614edb565b606091505b50806040518082805190602001908083835b60208310614f0c5780518252601f199092019160209182019101614eed565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529082018890528184018a905292519294507f0917b727c8497d0fc305acafacb424e8c9b12715d2b9b19bee777ef9d134f08f935060609083900301919050a2505b50505050565b6060815160001415614f90575081612368565b6060835167ffffffffffffffff81118015614faa57600080fd5b50604051908082528060200260200182016040528015614fd4578160200160208202803683370190505b50845190915060005b85518110156150365761500385878381518110614ff657fe5b6020026020010151615109565b1561502e57600183828151811061501657fe5b91151560209283029190910190910152600019909101905b600101614fdd565b50845181141561504857849250615101565b8015615101578067ffffffffffffffff8111801561506557600080fd5b5060405190808252806020026020018201604052801561508f578160200160208202803683370190505b5092506000805b86518110156150fe578381815181106150ab57fe5b60200260200101516150f6578681815181106150c357fe5b60200260200101518583815181106150d757fe5b6001600160a01b03909216602092830291909101909101526001909101905b600101615096565b50505b505092915050565b6000805b83518110156151555783818151811061512257fe5b60200260200101516001600160a01b0316836001600160a01b0316141561514d576001915050612368565b60010161510d565b5060009392505050565b615167612ce2565b604080516001600160a01b0386811660208301528183018690528251808303840181526060830193849052631dd6705960e21b9093529290921691637759c1649160019185906064018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156151f65781810151838201526020016151de565b50505050905090810190601f1680156152235780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610add57600080fd5b600080856001600160a01b03166370a08231856040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561529457600080fd5b505afa1580156152a8573d6000803e3d6000fd5b505050506040513d60208110156152be57600080fd5b505190506152d76001600160a01b03871686868661555d565b61532881876001600160a01b03166370a08231876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561475057600080fd5b9695505050505050565b600061533e8285614118565b9050615348612ce2565b604080516001600160a01b0388811660208301528183018890526060808301889052835180840390910181526080830193849052631dd6705960e21b9093529290921691637759c1649160029185906084018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156153e05781810151838201526020016153c8565b50505050905090810190601f16801561540d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561542e57600080fd5b505af1158015615442573d6000803e3d6000fd5b5050505061544e612674565b604080516001600160a01b0388811660208301528183018890526060820187905260808083018690528351808403909101815260a0830193849052630442bad560e01b9093523060a483018181529490911693630442bad5939192600092919060c40183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156154f05781810151838201526020016154d8565b50505050905090810190601f16801561551d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561553e57600080fd5b505af1158015615552573d6000803e3d6000fd5b505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052614f779085906060615607826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166156639092919063ffffffff16565b805190915015612fcc5780806020019051602081101561562657600080fd5b5051612fcc5760405162461bcd60e51b815260040180806020018281038252602a815260200180615b55602a913960400191505060405180910390fd5b6060614a3f84846000858561567785615789565b6156c8576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106157075780518252601f1990920191602091820191016156e8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615769576040519150601f19603f3d011682016040523d82523d6000602084013e61576e565b606091505b509150915061577e82828661578f565b979650505050505050565b3b151590565b6060831561579e57508161204b565b8251156157ae5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156157f85781810151838201526020016157e0565b50505050905090810190601f1680156158255780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5f5f7061796f7574537065636966696564417373657450657263656e74616765733a2050657263656e7473206d75737420746f74616c20313030255f5f6275795368617265733a20536861726573207265636569766564203c205f6d696e5368617265735175616e7469747972656465656d536861726573466f7253706563696669634173736574733a20556e657175616c2061727261797372656465656d536861726573466f7253706563696669634173736574733a204475706c6963617465207061796f75742061737365745f5f7061796f7574537065636966696564417373657450657263656e74616765733a205a65726f20616d6f756e7420666f722061737365745f5f72656465656d53686172657353657475703a204e6f2073686172657320746f2072656465656d6465706c6f7947617352656c61795061796d61737465723a205061796d617374657220616c7265616479206465706c6f79656463616c6c4f6e457874656e73696f6e3a205f657874656e73696f6e20696e76616c696472656465656d536861726573496e4b696e643a205f6164646974696f6e616c41737365747320636f6e7461696e73206475706c696361746573536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f5f73656c6644657374727563743a204f6e6c792064656c65676174652063616c6c61626c655f5f6275795368617265733a205f6d696e5368617265735175616e74697479206d757374206265203e305f5f6275795368617265733a2050656e64696e67206d6967726174696f6e206f72207265636f6e66696775726174696f6e5f5f6173736572745065726d697373696f6e65645661756c74416374696f6e3a20416374696f6e206e6f7420616c6c6f7765647072655472616e73666572536861726573486f6f6b3a204f6e6c79205661756c7450726f78792063616c6c61626c656275794261636b50726f746f636f6c4665655368617265733a20556e617574686f72697a65647065726d697373696f6e65645661756c74416374696f6e3a2043616e6e6f7420756e747261636b2064656e6f6d696e6174696f6e2061737365745361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644f6e6c79204761732052656c6179205061796d61737465722063616c6c61626c6572656465656d536861726573496e4b696e643a205f617373657473546f536b697020636f6e7461696e73206475706c696361746573a2646970667358221220192b69bab9e4a15fbfccc315a6415b96ee8aa7229f858882200d9169bd519ea264736f6c634300060c0033000000000000000000000000c3dc853dd716bd5754f421ef94fdcbac3902ab32000000000000000000000000b7460593bd222e24a2bf4393aa6416bd373995e00000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc6360000000000000000000000000d7b0610db501b15bfb9b7ddad8b3869de262a3270000000000000000000000001e3da40f999cf47091f869ebac477d84b0827cf4000000000000000000000000af0dffac1ce85c3fce4c2bf50073251f615eefc400000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e000000000000000000000000adf5a8db090627b153ef0c5726ccfdc1c7aed7bd000000000000000000000000846bbe1925047023651de7ec289f329c24ded3a8000000000000000000000000ec67005c4e498ec7f55e092bd1d35cbc47c91892000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102535760003560e01c8063a01fd15711610146578063db69681f116100c3578063e7c4569011610087578063e7c456901461097c578063ebb3d58914610984578063f2d638261461098c578063f9005af314610994578063f9d5fe781461099c578063faf9096b146109c257610253565b8063db69681f1461085a578063e269c3d614610862578063e53a73b91461086a578063e572ced114610872578063e70e605e1461097457610253565b8063c98091871161010a578063c98091871461081b578063ce5e84a314610823578063d44ad6cb14610842578063da41962e1461084a578063da72503c1461085257610253565b8063a01fd157146107af578063ac259456146107cb578063b10ea2b0146107d3578063b3fc38e9146107f0578063beebc5da146107f857610253565b80636af8e7eb116101d45780637f20170d116101985780637f20170d14610724578063875fb4b31461074a578063877fd8941461075257806392b575b61461078457806397c0ac87146107a757610253565b80636af8e7eb146105655780636ea21143146106d1578063716d4da4146106d957806373eecf47146106e157806379951f0f1461070757610253565b8063399ae7241161021b578063399ae7241461047057806339bf70d11461049c5780634c252f911461051f5780634da471b71461054357806356cff99f1461055d57610253565b806310acd06d1461025857806312f20526146102d25780632dc7a3a0146103085780633462fcc114610327578063397bfe551461044a575b600080fd5b6102d06004803603604081101561026e57600080fd5b60ff8235169190810190604081016020820135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460018302840111600160201b831117156102c557600080fd5b5090925090506109ca565b005b6102d0600480360360608110156102e857600080fd5b506001600160a01b03813581169160208101359091169060400135610afa565b6102d06004803603602081101561031e57600080fd5b50351515610c67565b6103fa6004803603608081101561033d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561036c57600080fd5b82018360208201111561037e57600080fd5b803590602001918460208302840111600160201b8311171561039f57600080fd5b919390929091602081019035600160201b8111156103bc57600080fd5b8201836020820111156103ce57600080fd5b803590602001918460208302840111600160201b831117156103ef57600080fd5b509092509050610cca565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561043657818101518382015260200161041e565b505050509050019250505060405180910390f35b6102d06004803603602081101561046057600080fd5b50356001600160a01b0316610f1e565b6102d06004803603604081101561048657600080fd5b506001600160a01b038135169060200135610f7a565b6102d0600480360360608110156104b257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104e157600080fd5b8201836020820111156104f357600080fd5b803590602001918460018302840111600160201b8311171561051457600080fd5b5090925090506110d6565b610527611267565b604080516001600160a01b039092168252519081900360200190f35b61054b61128c565b60408051918252519081900360200190f35b61054b611292565b6106386004803603608081101561057b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111600160201b831117156105dd57600080fd5b919390929091602081019035600160201b8111156105fa57600080fd5b82018360208201111561060c57600080fd5b803590602001918460208302840111600160201b8311171561062d57600080fd5b509092509050611732565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561067c578181015183820152602001610664565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106bb5781810151838201526020016106a3565b5050505090500194505050505060405180910390f35b610527611d4e565b6102d0611e2f565b6102d0600480360360208110156106f757600080fd5b50356001600160a01b0316611e4c565b6102d06004803603602081101561071d57600080fd5b5035611e60565b61054b6004803603602081101561073a57600080fd5b50356001600160a01b0316611f00565b610527611f1f565b61054b6004803603606081101561076857600080fd5b506001600160a01b038135169060208101359060400135611f43565b6102d06004803603604081101561079a57600080fd5b5080359060200135612052565b610527612194565b6107b76121b8565b604080519115158252519081900360200190f35b6105276121c8565b6102d0600480360360208110156107e957600080fd5b50356121ec565b610527612316565b61054b6004803603604081101561080e57600080fd5b508035906020013561233a565b61052761236e565b6102d06004803603602081101561083957600080fd5b5035151561237d565b610527612674565b610527612698565b61054b6126bc565b6102d06127b6565b610527612952565b6102d0612961565b6108ff6004803603606081101561088857600080fd5b6001600160a01b03823516916001600160e01b031960208201351691810190606081016040820135600160201b8111156108c157600080fd5b8201836020820111156108d357600080fd5b803590602001918460018302840111600160201b831117156108f457600080fd5b509092509050612971565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610939578181015183820152602001610921565b50505050905090810190601f1680156109665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610527612c76565b610527612c9a565b610527612cbe565b610527612ce2565b6102d0612d06565b6102d0600480360360208110156109b257600080fd5b50356001600160a01b0316612e22565b610527612e33565b6109d43384612e42565b600683600a8111156109e257fe5b1415610a51576109f0612952565b6001600160a01b031682826020811015610a0957600080fd5b50356001600160a01b03161415610a515760405162461bcd60e51b815260040180806020018281038252603a815260200180615b1b603a913960400191505060405180910390fd5b610a5961236e565b6001600160a01b03166324e600128484846040518463ffffffff1660e01b81526004018084600a811115610a8957fe5b8152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610add57600080fd5b505af1158015610af1573d6000803e3d6000fd5b50505050505050565b6000610b0461236e565b9050336001600160a01b03821614610b4d5760405162461bcd60e51b815260040180806020018281038252602f815260200180615ac6602f913960400191505060405180910390fd5b610b578185612fd1565b610b5f612674565b604080516001600160a01b038781166020830152868116828401526060808301879052835180840390910181526080830193849052630442bad560e01b90935230608483018181529490911693630442bad5939192600292919060a40183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bfb578181015183820152602001610be3565b50505050905090810190601f168015610c285780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610c4957600080fd5b505af1158015610c5d573d6000803e3d6000fd5b5050505050505050565b610c77610c7261305b565b61309f565b60018054821515600160a81b810260ff60a81b199092169190911790915560408051918252517f8ccd4cc3a51ed6f61f2b34b8d0a1ac137376931714380a7702b410ed174d6a739181900360200190a150565b6060610cd461316a565b6001805460ff60b81b1916600160b81b1790556000610cf161305b565b9050848314610d315760405162461bcd60e51b815260040180806020018281038252602d8152602001806158a0602d913960400191505060405180910390fd5b610d6d8686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b610da85760405162461bcd60e51b81526004018080602001828103825260358152602001806158cd6035913960400191505060405180910390fd5b6000610db2611292565b90506000610dbe61236e565b9050600080610dd183868d60018861324b565b9092509050610df8838d8c8c8c8c610df388610ded8d8c61353d565b90613596565b6135fd565b9550610e3d858d848d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508d92508b91506139079050565b8b6001600160a01b0316856001600160a01b03167fbf88879a1555e4d7d38ebeffabce61fdf5e12ea0468abf855a72ec17b432bed5848d8d8b60405180858152602001806020018060200183810383528686828181526020019250602002808284376000838201819052601f909101601f1916909201858103845286518152865160209182019382890193509102908190849084905b83811015610eeb578181015183820152602001610ed3565b50505050905001965050505050505060405180910390a350505050506001805460ff60b81b191690559695505050505050565b610f26613ad0565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f5be181178e61e61e33f79c396c7194b8f3c80f77899da7bd96fe537411300bcb9181900360200190a150565b6000610f84612952565b6001600160a01b031614610fdf576040805162461bcd60e51b815260206004820152601960248201527f696e69743a20416c726561647920696e697469616c697a656400000000000000604482015290519081900360640190fd5b610fe7611f1f565b6001600160a01b031663c496f8e8836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561103357600080fd5b505afa158015611047573d6000803e3d6000fd5b505050506040513d602081101561105d57600080fd5b50516110b0576040805162461bcd60e51b815260206004820152601c60248201527f696e69743a204261642064656e6f6d696e6174696f6e20617373657400000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039390931692909217909155600255565b6110de61316a565b6001805460ff60b81b1916600160b81b1790556110f9613b3d565b6001805460ff60b01b1916600160b01b179055611114612ce2565b6001600160a01b0316846001600160a01b0316148061114b5750611136612c9a565b6001600160a01b0316846001600160a01b0316145b8061116e5750611159612316565b6001600160a01b0316846001600160a01b0316145b6111a95760405162461bcd60e51b81526004018080602001828103825260238152602001806159956023913960400191505060405180910390fd5b836001600160a01b0316631bee801e6111c061305b565b8585856040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b50506001805461ffff60b01b19169055505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90565b60025490565b60008061129d61236e565b90506060816001600160a01b031663c4b973706040518163ffffffff1660e01b815260040160006040518083038186803b1580156112da57600080fd5b505afa1580156112ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561131757600080fd5b8101908080516040519392919084600160201b82111561133657600080fd5b90830190602082018581111561134b57600080fd5b82518660208202830111600160201b8211171561136757600080fd5b82525081516020918201928201910280838360005b8381101561139457818101518382015260200161137c565b5050505090500160405250505090506060826001600160a01b031663b8b7f1476040518163ffffffff1660e01b815260040160006040518083038186803b1580156113de57600080fd5b505afa1580156113f2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561141b57600080fd5b8101908080516040519392919084600160201b82111561143a57600080fd5b90830190602082018581111561144f57600080fd5b82518660208202830111600160201b8211171561146b57600080fd5b82525081516020918201928201910280838360005b83811015611498578181015183820152602001611480565b505050509050016040525050509050815160001480156114b757508051155b156114c85760009350505050611289565b6060825167ffffffffffffffff811180156114e257600080fd5b5060405190808252806020026020018201604052801561150c578160200160208202803683370190505b50905060005b83518110156115c85783818151811061152757fe5b60200260200101516001600160a01b03166370a08231866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b505050506040513d60208110156115a557600080fd5b505182518390839081106115b557fe5b6020908102919091010152600101611512565b506115d1611f1f565b6001600160a01b031663ae6f52ad84836115e9612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b8381101561164b578181015183820152602001611633565b50505050905001838103825285818151815260200191508051906020019060200280838360005b8381101561168a578181015183820152602001611672565b5050505090500195505050505050602060405180830381600087803b1580156116b257600080fd5b505af11580156116c6573d6000803e3d6000fd5b505050506040513d60208110156116dc57600080fd5b505182519095501561172b5760005b825181101561172957600061171284838151811061170557fe5b6020026020010151613b9c565b905061171e8782614118565b9650506001016116eb565b505b5050505090565b60608061173d61316a565b6001805460ff60b81b1916600160b81b179055600061175a61305b565b90506117988787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b6117d35760405162461bcd60e51b81526004018080602001828103825260398152602001806159b86039913960400191505060405180910390fd5b61180f8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506131b792505050565b61184a5760405162461bcd60e51b8152600401808060200182810382526035815260200180615ba06035913960400191505060405180910390fd5b60015460408051630c4b973760e41b815290516119b9926001600160a01b03169163c4b97370916004808301926000929190829003018186803b15801561189057600080fd5b505afa1580156118a4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156118cd57600080fd5b8101908080516040519392919084600160201b8211156118ec57600080fd5b90830190602082018581111561190157600080fd5b82518660208202830111600160201b8211171561191d57600080fd5b82525081516020918201928201910280838360005b8381101561194a578181015183820152602001611932565b5050505090910160208d810282810182016040528e83529195508e94508d935083925085019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061417292505050565b925060006119c56121b8565b15611a5f57306001600160a01b03166356cff99f6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611a0557600080fd5b505af1925050508015611a2a57506040513d6020811015611a2557600080fd5b505160015b611a5c576040517ff5939ff9a66cf6d21ec93b246060bc17f5c062847e28d967d3dd617636b238d490600090a1611a5f565b90505b6001546000908190611a7d906001600160a01b0316858d848761324b565b91509150855167ffffffffffffffff81118015611a9957600080fd5b50604051908082528060200260200182016040528015611ac3578160200160208202803683370190505b50945060005b8651811015611c5857611b6d82610ded858a8581518110611ae657fe5b602090810291909101810151600154604080516370a0823160e01b81526001600160a01b039283166004820152905191909216926370a082319260248082019391829003018186803b158015611b3b57600080fd5b505afa158015611b4f573d6000803e3d6000fd5b505050506040513d6020811015611b6557600080fd5b50519061353d565b868281518110611b7957fe5b6020026020010181815250506000868281518110611b9357fe5b60200260200101511115611c505760015487516001600160a01b039091169063495d753c90899084908110611bc457fe5b60200260200101518f898581518110611bd957fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611c3757600080fd5b505af1158015611c4b573d6000803e3d6000fd5b505050505b600101611ac9565b508b6001600160a01b0316846001600160a01b03167fbf88879a1555e4d7d38ebeffabce61fdf5e12ea0468abf855a72ec17b432bed5848989604051808481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015611cdb578181015183820152602001611cc3565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611d1a578181015183820152602001611d02565b505050509050019550505050505060405180910390a3505050506001805460ff60b81b191690559097909650945050505050565b6000611d586121c8565b6001600160a01b03166398a7c4c76040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6020811015611dba57600080fd5b505160408051637da0a87760e01b815290516001600160a01b0390921691637da0a87791600480820192602092909190829003018186803b158015611dfe57600080fd5b505afa158015611e12573d6000803e3d6000fd5b505050506040513d6020811015611e2857600080fd5b5051905090565b611e3a610c7261305b565b611e4a611e45612e33565b614364565b565b611e54613ad0565b611e5d8161439f565b50565b611e686143f3565b611e7061236e565b6001600160a01b031663495d753c611e86611267565b611e8e612e33565b846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611ee557600080fd5b505af1158015611ef9573d6000803e3d6000fd5b5050505050565b6001600160a01b0381166000908152600360205260409020545b919050565b7f000000000000000000000000d7b0610db501b15bfb9b7ddad8b3869de262a32790565b6000806000611f5061128c565b1190506000611f5d61305b565b9050811580611fe85750611f6f612194565b6001600160a01b03166354391f09826040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611fbb57600080fd5b505afa158015611fcf573d6000803e3d6000fd5b505050506040513d6020811015611fe557600080fd5b50515b612039576040805162461bcd60e51b815260206004820152601f60248201527f6275795368617265734f6e426568616c663a20556e617574686f72697a656400604482015290519081900360640190fd5b612046868686858561444a565b925050505b9392505050565b61205a613ad0565b612062613b3d565b6001805460ff60b01b1916600160b01b17905561207d61236e565b6001600160a01b031663d5c20fa2826040518263ffffffff1660e01b8152600401600060405180830381600088803b1580156120b857600080fd5b5087f1935050505080156120ca575060015b6120f8576040517f8a7579328a911284dedef6a7e68bbb1eae7d59418f2699cb5a3c26f6e57e4d7790600090a15b612100612ce2565b6001600160a01b031663bd8e959a836040518263ffffffff1660e01b8152600401600060405180830381600088803b15801561213b57600080fd5b5087f19350505050801561214d575060015b61217b576040517f681c534f5c2e473c9cc8ab1693257fb2b0e19a5c5ecd7d040201f1cf2a190c8790600090a15b61218361484e565b50506001805460ff60b01b19169055565b7f0000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc636090565b600154600160a81b900460ff1690565b7f000000000000000000000000846bbe1925047023651de7ec289f329c24ded3a890565b6001546001600160a01b03168063714ca2d161220661305b565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561224357600080fd5b505afa158015612257573d6000803e3d6000fd5b505050506040513d602081101561226d57600080fd5b50516122aa5760405162461bcd60e51b8152600401808060200182810382526026815260200180615af56026913960400191505060405180910390fd5b60006122b4611292565b9050816001600160a01b0316631ff46bfa846122d185878661489a565b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610add57600080fd5b7f0000000000000000000000001e3da40f999cf47091f869ebac477d84b0827cf490565b600080600061234761128c565b119050600061235461305b565b9050612363818686858561444a565b925050505b92915050565b6001546001600160a01b031690565b612385613ad0565b600061238f61236e565b90508115612534576000816001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156123e657600080fd5b505afa1580156123fa573d6000803e3d6000fd5b505050506040513d602081101561241057600080fd5b50519050801561253257816001600160a01b031663bfc77beb83846001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b15801561246357600080fd5b505afa158015612477573d6000803e3d6000fd5b505050506040513d602081101561248d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820185905251606480830192600092919082900301818387803b1580156124e557600080fd5b505af11580156124f9573d6000803e3d6000fd5b50506040805184815290517f8f9ec2c1cf1f95fcb5d89d3141949092850c5cfe04da4d9425dd840bf18cdc709350908190036020019150a15b505b806001600160a01b0316634ef0762e61254b612952565b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b505050506125aa612ce2565b6001600160a01b03166380d57063836040518263ffffffff1660e01b8152600401808215158152602001915050600060405180830381600087803b1580156125f157600080fd5b505af1158015612605573d6000803e3d6000fd5b50505050612611612674565b6001600160a01b03166380d57063836040518263ffffffff1660e01b8152600401808215158152602001915050600060405180830381600087803b15801561265857600080fd5b505af115801561266c573d6000803e3d6000fd5b505050505050565b7f000000000000000000000000adf5a8db090627b153ef0c5726ccfdc1c7aed7bd90565b7f000000000000000000000000b7460593bd222e24a2bf4393aa6416bd373995e090565b6000806126c7611292565b90506127b0816126d561236e565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561270d57600080fd5b505afa158015612721573d6000803e3d6000fd5b505050506040513d602081101561273757600080fd5b5051612741612952565b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561277957600080fd5b505afa15801561278d573d6000803e3d6000fd5b505050506040513d60208110156127a357600080fd5b505160ff16600a0a614a1b565b91505090565b6127bf3361309f565b60006127c9612e33565b6001600160a01b03161461280e5760405162461bcd60e51b81526004018080602001828103825260338152602001806159626033913960400191505060405180910390fd5b606061281861236e565b604080516001600160a01b0390921660248084019190915281518084039091018152604490920190526020810180516001600160e01b031663066ad14f60e21b179052905060006128676121c8565b6001600160a01b0316630c0872f5836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128c25781810151838201526020016128aa565b50505050905090810190601f1680156128ef5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561290e57600080fd5b505af1158015612922573d6000803e3d6000fd5b505050506040513d602081101561293857600080fd5b505190506129458161439f565b61294e81614364565b5050565b6000546001600160a01b031690565b612969613ad0565b611e4a61484e565b606061297e610c7261305b565b612986612194565b6001600160a01b0316638c500ea38686868660405180838380828437808301925050509250505060405180910390206040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160e01b0319168152602001828152602001935050505060206040518083038186803b158015612a0a57600080fd5b505afa158015612a1e573d6000803e3d6000fd5b505050506040513d6020811015612a3457600080fd5b5051612a87576040805162461bcd60e51b815260206004820181905260248201527f7661756c7443616c6c4f6e436f6e74726163743a204e6f7420616c6c6f776564604482015290519081900360640190fd5b612a8f61236e565b6001600160a01b031663a90cce4b8686868660405160200180846001600160e01b03191681526004018383808284378083019250505093505050506040516020818303038152906040526040518363ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612b34578181015183820152602001612b1c565b50505050905090810190601f168015612b615780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612b8157600080fd5b505af1158015612b95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612bbe57600080fd5b8101908080516040519392919084600160201b821115612bdd57600080fd5b908301906020820185811115612bf257600080fd5b8251600160201b811182820188101715612c0b57600080fd5b82525081516020918201929091019080838360005b83811015612c38578181015183820152602001612c20565b50505050905090810190601f168015612c655780820380516001836020036101000a031916815260200191505b506040525050509050949350505050565b7f000000000000000000000000ec67005c4e498ec7f55e092bd1d35cbc47c9189290565b7f00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e90565b7f000000000000000000000000c3dc853dd716bd5754f421ef94fdcbac3902ab3290565b7f000000000000000000000000af0dffac1ce85c3fce4c2bf50073251f615eefc490565b612d0f3361309f565b60048054604080516305fd8c7160e41b815290516001600160a01b0390921692635fd8c71092828201926000929082900301818387803b158015612d5257600080fd5b505af1158015612d66573d6000803e3d6000fd5b50506001546001600160a01b03169150634ef0762e9050612d85611267565b6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015612dc457600080fd5b505af1158015612dd8573d6000803e3d6000fd5b5050600480546001600160a01b03191690555050604080516000815290517f66756eda85190d0bcec058815fd7e2154167d102e21d96cab701630af02f24739181900360200190a1565b611e5d612e2d61236e565b82612fd1565b6004546001600160a01b031690565b600154600090600160b01b900460ff1615612f9057612e5f612c9a565b6001600160a01b0316836001600160a01b03161415612ed857600482600a811115612e8657fe5b1480612e9d5750600682600a811115612e9b57fe5b145b80612eb35750600782600a811115612eb157fe5b145b80612eca575060055b82600a811115612ec857fe5b145b15612ed3575060015b612f90565b612ee0612ce2565b6001600160a01b0316836001600160a01b03161415612f2b57600282600a811115612f0757fe5b1480612f1e5750600182600a811115612f1c57fe5b145b80612eca57506003612ebc565b612f33612316565b6001600160a01b0316836001600160a01b03161415612f9057600982600a811115612f5a57fe5b1480612f715750600882600a811115612f6f57fe5b145b80612f875750600a82600a811115612f8557fe5b145b15612f90575060015b80612fcc5760405162461bcd60e51b8152600401808060200182810382526033815260200180615a936033913960400191505060405180910390fd5b505050565b6000612fdc82611f00565b9050801580612ffb5750612fee61128c565b612ff84283614a47565b10155b8061300a575061300a83614aa4565b612fcc576040805162461bcd60e51b815260206004820152601860248201527f53686172657320616374696f6e2074696d656c6f636b65640000000000000000604482015290519081900360640190fd5b6000601836108015906130865750613071611d4e565b6001600160a01b0316336001600160a01b0316145b1561309a575060131936013560601c611289565b503390565b6130a761236e565b6001600160a01b031663893d20e86040518163ffffffff1660e01b815260040160206040518083038186803b1580156130df57600080fd5b505afa1580156130f3573d6000803e3d6000fd5b505050506040513d602081101561310957600080fd5b50516001600160a01b03828116911614611e5d576040805162461bcd60e51b815260206004820152601860248201527f4f6e6c792066756e64206f776e65722063616c6c61626c650000000000000000604482015290519081900360640190fd5b600154600160b81b900460ff1615611e4a576040805162461bcd60e51b815260206004820152600b60248201526a52652d656e7472616e636560a81b604482015290519081900360640190fd5b600060018251116131ca57506001611f1a565b815160005b8181101561324157600181015b82811015613238578481815181106131f057fe5b60200260200101516001600160a01b031685838151811061320d57fe5b60200260200101516001600160a01b031614156132305760009350505050611f1a565b6001016131dc565b506001016131cf565b5060019392505050565b6000806132588787612fd1565b60008790506000816001600160a01b03166370a08231896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156132ac57600080fd5b505afa1580156132c0573d6000803e3d6000fd5b505050506040513d60208110156132d657600080fd5b505190506000198714156132ec578093506132f0565b8693505b6000841161332f5760405162461bcd60e51b815260040180806020018281038252602881526020018061593a6028913960400191505060405180910390fd5b61333b88858888614bb2565b6000826001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561338a57600080fd5b505afa15801561339e573d6000803e3d6000fd5b505050506040513d60208110156133b457600080fd5b505190506000198814156133ca578094506133e9565b818110156133e9576133e66133df8383614a47565b8690614a47565b94505b896001600160a01b031663d5c20fa26040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561342457600080fd5b505af1158015613438573d6000803e3d6000fd5b5050505060008611801561344f575061344f6121b8565b1561345e5761345e8a87614dae565b826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561349757600080fd5b505afa1580156134ab573d6000803e3d6000fd5b505050506040513d60208110156134c157600080fd5b505160408051633b9e9f0160e21b81526001600160a01b038c81166004830152602482018990529151929650908c169163ee7a7c049160448082019260009290919082900301818387803b15801561351857600080fd5b505af115801561352c573d6000803e3d6000fd5b505050505050509550959350505050565b60008261354c57506000612368565b8282028284828161355957fe5b041461204b5760405162461bcd60e51b81526004018080602001828103825260218152602001806159f16021913960400191505060405180910390fd5b60008082116135ec576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816135f557fe5b049392505050565b60606000613609612952565b905060008667ffffffffffffffff8111801561362457600080fd5b5060405190808252806020026020018201604052801561364e578160200160208202803683370190505b50925060005b878110156138b95761368187878381811061366b57fe5b905060200201358361411890919063ffffffff16565b915061aaaa89898381811061369257fe5b905060200201356001600160a01b03166001600160a01b031614156136b6576138b1565b6136be611f1f565b6001600160a01b0316634c67e106846136f8612710610ded8c8c888181106136e257fe5b905060200201358b61353d90919063ffffffff16565b8c8c8681811061370457fe5b905060200201356001600160a01b03166040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b15801561376a57600080fd5b505af115801561377e573d6000803e3d6000fd5b505050506040513d602081101561379457600080fd5b505184518590839081106137a457fe5b60200260200101818152505060008482815181106137be57fe5b6020026020010151116138025760405162461bcd60e51b81526004018080602001828103825260388152602001806159026038913960400191505060405180910390fd5b8a6001600160a01b031663495d753c8a8a8481811061381d57fe5b905060200201356001600160a01b03168c87858151811061383a57fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561389857600080fd5b505af11580156138ac573d6000803e3d6000fd5b505050505b600101613654565b5061271081146138fa5760405162461bcd60e51b815260040180806020018281038252603b815260200180615834603b913960400191505060405180910390fd5b5050979650505050505050565b61390f612674565b6001600160a01b0316630442bad530600389898989898960405160200180876001600160a01b03168152602001866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019060200280838360005b8381101561399757818101518382015260200161397f565b50505050905001838103825285818151815260200191508051906020019060200280838360005b838110156139d65781810151838201526020016139be565b50505050905001985050505050505050506040516020818303038152906040526040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836009811115613a2457fe5b815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613a62578181015183820152602001613a4a565b50505050905090810190601f168015613a8f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015613ab057600080fd5b505af1158015613ac4573d6000803e3d6000fd5b50505050505050505050565b613ad8612194565b6001600160a01b0316336001600160a01b031614611e4a576040805162461bcd60e51b815260206004820152601a60248201527f4f6e6c792046756e644465706c6f7965722063616c6c61626c65000000000000604482015290519081900360640190fd5b600154600160b01b900460ff1615611e4a576040805162461bcd60e51b815260206004820152601860248201527f5661756c7420616374696f6e2072652d656e7472616e63650000000000000000604482015290519081900360640190fd5b6000606080836001600160a01b03166380daddb86040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613bdc57600080fd5b505af1158015613bf0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015613c1957600080fd5b8101908080516040519392919084600160201b821115613c3857600080fd5b908301906020820185811115613c4d57600080fd5b82518660208202830111600160201b82111715613c6957600080fd5b82525081516020918201928201910280838360005b83811015613c96578181015183820152602001613c7e565b5050505090500160405260200180516040519392919084600160201b821115613cbe57600080fd5b908301906020820185811115613cd357600080fd5b82518660208202830111600160201b82111715613cef57600080fd5b82525081516020918201928201910280838360005b83811015613d1c578181015183820152602001613d04565b50505050905001604052505050915091506000613d37611f1f565b6001600160a01b031663ae6f52ad8484613d4f612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b83811015613db1578181015183820152602001613d99565b50505050905001838103825285818151815260200191508051906020019060200280838360005b83811015613df0578181015183820152602001613dd8565b5050505090500195505050505050602060405180830381600087803b158015613e1857600080fd5b505af1158015613e2c573d6000803e3d6000fd5b505050506040513d6020811015613e4257600080fd5b505160408051633b35962d60e21b8152905191925060609182916001600160a01b0389169163ecd658b49160048082019260009290919082900301818387803b158015613e8e57600080fd5b505af1158015613ea2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015613ecb57600080fd5b8101908080516040519392919084600160201b821115613eea57600080fd5b908301906020820185811115613eff57600080fd5b82518660208202830111600160201b82111715613f1b57600080fd5b82525081516020918201928201910280838360005b83811015613f48578181015183820152602001613f30565b5050505090500160405260200180516040519392919084600160201b821115613f7057600080fd5b908301906020820185811115613f8557600080fd5b82518660208202830111600160201b82111715613fa157600080fd5b82525081516020918201928201910280838360005b83811015613fce578181015183820152602001613fb6565b50505050905001604052505050915091506000613fe9611f1f565b6001600160a01b031663ae6f52ad8484614001612952565b6040518463ffffffff1660e01b8152600401808060200180602001846001600160a01b03168152602001838103835286818151815260200191508051906020019060200280838360005b8381101561406357818101518382015260200161404b565b50505050905001838103825285818151815260200191508051906020019060200280838360005b838110156140a257818101518382015260200161408a565b5050505090500195505050505050602060405180830381600087803b1580156140ca57600080fd5b505af11580156140de573d6000803e3d6000fd5b505050506040513d60208110156140f457600080fd5b505190508084111561410d5761410a8482614a47565b96505b505050505050919050565b60008282018381101561204b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60608061417f8584614f7d565b905083516000141561419257905061204b565b6060845167ffffffffffffffff811180156141ac57600080fd5b506040519080825280602002602001820160405280156141d6578160200160208202803683370190505b5090506000805b865181101561423d5761420c8782815181106141f557fe5b60200260200101518561510990919063ffffffff16565b61423557600183828151811061421e57fe5b911515602092830291909101909101526001909101905b6001016141dd565b508061424e5782935050505061204b565b825161425a9082614118565b67ffffffffffffffff8111801561427057600080fd5b5060405190808252806020026020018201604052801561429a578160200160208202803683370190505b50935060005b83518110156142e9578381815181106142b557fe5b60200260200101518582815181106142c957fe5b6001600160a01b03909216602092830291909101909101526001016142a0565b50825160005b87518110156143585783818151811061430457fe5b6020026020010151156143505787818151811061431d57fe5b602002602001015186838151811061433157fe5b6001600160a01b03909216602092830291909101909101526001909101905b6001016142ef565b50505050509392505050565b806001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611ee557600080fd5b600480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f66756eda85190d0bcec058815fd7e2154167d102e21d96cab701630af02f24739181900360200190a150565b6143fb612e33565b6001600160a01b0316336001600160a01b031614611e4a5760405162461bcd60e51b8152600401808060200182810382526021815260200180615b7f6021913960400191505060405180910390fd5b600061445461316a565b6001805460ff60b81b1916600160b81b17905561446f613b3d565b6001805460ff60b01b1916600160b01b179055836144be5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a38602a913960400191505060405180910390fd5b60006144c861236e565b90508315806144dd57506144db81614aa4565b155b6145185760405162461bcd60e51b8152600401808060200182810382526031815260200180615a626031913960400191505060405180910390fd5b6000614522611292565b905061452f88888361515f565b816001600160a01b031663d5c20fa26040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561456a57600080fd5b505af115801561457e573d6000803e3d6000fd5b5050505061458a6121b8565b15614599576145998282614dae565b60006145ae6145a6612952565b86858b615244565b905060006145ef83856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561270d57600080fd5b9050600061460982610ded85670de0b6b3a764000061353d565b90506000856001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561465a57600080fd5b505afa15801561466e573d6000803e3d6000fd5b505050506040513d602081101561468457600080fd5b5051604080516329460cc560e11b81526001600160a01b038f811660048301526024820186905291519293509088169163528c198a9160448082019260009290919082900301818387803b1580156146db57600080fd5b505af11580156146ef573d6000803e3d6000fd5b505050506146ff8c858488615332565b61478281876001600160a01b03166370a082318f6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561475057600080fd5b505afa158015614764573d6000803e3d6000fd5b505050506040513d602081101561477a57600080fd5b505190614a47565b9650898710156147c35760405162461bcd60e51b815260040180806020018281038252603181526020018061586f6031913960400191505060405180910390fd5b88156147e5576001600160a01b038c1660009081526003602052604090204290555b604080518581526020810184905280820189905290516001600160a01b038e16917f849165c18b9d0fb161bcb145e4ab523d350e5c98f1dbbb1960331e7ee3ca6767919081900360600190a25050505050506001805461ffff60b01b1916905595945050505050565b600154600160a01b900460ff16156148975760405162461bcd60e51b8152600401808060200182810382526026815260200180615a126026913960400191505060405180910390fd5b30ff5b6000806148a5612952565b9050600061495284876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156148e657600080fd5b505afa1580156148fa573d6000803e3d6000fd5b505050506040513d602081101561491057600080fd5b50516040805163313ce56760e01b815290516001600160a01b0387169163313ce567916004808301926020929190829003018186803b15801561277957600080fd5b9050600061496c670de0b6b3a7640000610ded848961353d565b9050614976611f1f565b6001600160a01b0316634c67e106848361498e612c76565b6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b1580156149e457600080fd5b505af11580156149f8573d6000803e3d6000fd5b505050506040513d6020811015614a0e57600080fd5b5051979650505050505050565b600082614a2957508061204b565b614a3f83610ded86670de0b6b3a764000061353d565b949350505050565b600082821115614a9e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000614aae612cbe565b6001600160a01b031663d0449d3d836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614afa57600080fd5b505afa158015614b0e573d6000803e3d6000fd5b505050506040513d6020811015614b2457600080fd5b5051806123685750614b34612194565b6001600160a01b0316636c579e57836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614b8057600080fd5b505afa158015614b94573d6000803e3d6000fd5b505050506040513d6020811015614baa57600080fd5b505192915050565b614bba613b3d565b6001805460ff60b01b1916600160b01b179055614bd5612ce2565b604080516001600160a01b038781166020830152818301879052851515606080840191909152835180840390910181526080830193849052631dd6705960e21b9093529290921691637759c1649160039185906084018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015614c71578181015183820152602001614c59565b50505050905090810190601f168015614c9e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015614cbf57600080fd5b505af1925050508015614cd0575060015b614d9b573d808015614cfe576040519150601f19603f3d011682016040523d82523d6000602084013e614d03565b606091505b50846001600160a01b0316816040518082805190602001908083835b60208310614d3e5780518252601f199092019160209182019101614d1f565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208b835293519395507fb3ea7e5141baf21804d12f5a635e83e0cb869c8b06b88648364769f85aa73fc294509083900301919050a3505b50506001805460ff60b01b191690555050565b6000826001600160a01b03166370a08231614dc7612698565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015614e0457600080fd5b505afa158015614e18573d6000803e3d6000fd5b505050506040513d6020811015614e2e57600080fd5b505190506000614e3f84838561489a565b9050836001600160a01b0316631ff46bfa8383866040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015614e9757600080fd5b505af1925050508015614ea8575060015b614f77573d808015614ed6576040519150601f19603f3d011682016040523d82523d6000602084013e614edb565b606091505b50806040518082805190602001908083835b60208310614f0c5780518252601f199092019160209182019101614eed565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529082018890528184018a905292519294507f0917b727c8497d0fc305acafacb424e8c9b12715d2b9b19bee777ef9d134f08f935060609083900301919050a2505b50505050565b6060815160001415614f90575081612368565b6060835167ffffffffffffffff81118015614faa57600080fd5b50604051908082528060200260200182016040528015614fd4578160200160208202803683370190505b50845190915060005b85518110156150365761500385878381518110614ff657fe5b6020026020010151615109565b1561502e57600183828151811061501657fe5b91151560209283029190910190910152600019909101905b600101614fdd565b50845181141561504857849250615101565b8015615101578067ffffffffffffffff8111801561506557600080fd5b5060405190808252806020026020018201604052801561508f578160200160208202803683370190505b5092506000805b86518110156150fe578381815181106150ab57fe5b60200260200101516150f6578681815181106150c357fe5b60200260200101518583815181106150d757fe5b6001600160a01b03909216602092830291909101909101526001909101905b600101615096565b50505b505092915050565b6000805b83518110156151555783818151811061512257fe5b60200260200101516001600160a01b0316836001600160a01b0316141561514d576001915050612368565b60010161510d565b5060009392505050565b615167612ce2565b604080516001600160a01b0386811660208301528183018690528251808303840181526060830193849052631dd6705960e21b9093529290921691637759c1649160019185906064018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156151f65781810151838201526020016151de565b50505050905090810190601f1680156152235780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610add57600080fd5b600080856001600160a01b03166370a08231856040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561529457600080fd5b505afa1580156152a8573d6000803e3d6000fd5b505050506040513d60208110156152be57600080fd5b505190506152d76001600160a01b03871686868661555d565b61532881876001600160a01b03166370a08231876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561475057600080fd5b9695505050505050565b600061533e8285614118565b9050615348612ce2565b604080516001600160a01b0388811660208301528183018890526060808301889052835180840390910181526080830193849052631dd6705960e21b9093529290921691637759c1649160029185906084018084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156153e05781810151838201526020016153c8565b50505050905090810190601f16801561540d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561542e57600080fd5b505af1158015615442573d6000803e3d6000fd5b5050505061544e612674565b604080516001600160a01b0388811660208301528183018890526060820187905260808083018690528351808403909101815260a0830193849052630442bad560e01b9093523060a483018181529490911693630442bad5939192600092919060c40183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156154f05781810151838201526020016154d8565b50505050905090810190601f16801561551d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561553e57600080fd5b505af1158015615552573d6000803e3d6000fd5b505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052614f779085906060615607826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166156639092919063ffffffff16565b805190915015612fcc5780806020019051602081101561562657600080fd5b5051612fcc5760405162461bcd60e51b815260040180806020018281038252602a815260200180615b55602a913960400191505060405180910390fd5b6060614a3f84846000858561567785615789565b6156c8576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106157075780518252601f1990920191602091820191016156e8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615769576040519150601f19603f3d011682016040523d82523d6000602084013e61576e565b606091505b509150915061577e82828661578f565b979650505050505050565b3b151590565b6060831561579e57508161204b565b8251156157ae5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156157f85781810151838201526020016157e0565b50505050905090810190601f1680156158255780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5f5f7061796f7574537065636966696564417373657450657263656e74616765733a2050657263656e7473206d75737420746f74616c20313030255f5f6275795368617265733a20536861726573207265636569766564203c205f6d696e5368617265735175616e7469747972656465656d536861726573466f7253706563696669634173736574733a20556e657175616c2061727261797372656465656d536861726573466f7253706563696669634173736574733a204475706c6963617465207061796f75742061737365745f5f7061796f7574537065636966696564417373657450657263656e74616765733a205a65726f20616d6f756e7420666f722061737365745f5f72656465656d53686172657353657475703a204e6f2073686172657320746f2072656465656d6465706c6f7947617352656c61795061796d61737465723a205061796d617374657220616c7265616479206465706c6f79656463616c6c4f6e457874656e73696f6e3a205f657874656e73696f6e20696e76616c696472656465656d536861726573496e4b696e643a205f6164646974696f6e616c41737365747320636f6e7461696e73206475706c696361746573536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f5f73656c6644657374727563743a204f6e6c792064656c65676174652063616c6c61626c655f5f6275795368617265733a205f6d696e5368617265735175616e74697479206d757374206265203e305f5f6275795368617265733a2050656e64696e67206d6967726174696f6e206f72207265636f6e66696775726174696f6e5f5f6173736572745065726d697373696f6e65645661756c74416374696f6e3a20416374696f6e206e6f7420616c6c6f7765647072655472616e73666572536861726573486f6f6b3a204f6e6c79205661756c7450726f78792063616c6c61626c656275794261636b50726f746f636f6c4665655368617265733a20556e617574686f72697a65647065726d697373696f6e65645661756c74416374696f6e3a2043616e6e6f7420756e747261636b2064656e6f6d696e6174696f6e2061737365745361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644f6e6c79204761732052656c6179205061796d61737465722063616c6c61626c6572656465656d536861726573496e4b696e643a205f617373657473546f536b697020636f6e7461696e73206475706c696361746573a2646970667358221220192b69bab9e4a15fbfccc315a6415b96ee8aa7229f858882200d9169bd519ea264736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c3dc853dd716bd5754f421ef94fdcbac3902ab32000000000000000000000000b7460593bd222e24a2bf4393aa6416bd373995e00000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc6360000000000000000000000000d7b0610db501b15bfb9b7ddad8b3869de262a3270000000000000000000000001e3da40f999cf47091f869ebac477d84b0827cf4000000000000000000000000af0dffac1ce85c3fce4c2bf50073251f615eefc400000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e000000000000000000000000adf5a8db090627b153ef0c5726ccfdc1c7aed7bd000000000000000000000000846bbe1925047023651de7ec289f329c24ded3a8000000000000000000000000ec67005c4e498ec7f55e092bd1d35cbc47c91892000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _dispatcher (address): 0xC3DC853dD716bd5754f421ef94fdCbac3902ab32
Arg [1] : _protocolFeeReserve (address): 0xB7460593BD222E24a2bF4393aa6416bD373995E0
Arg [2] : _fundDeployer (address): 0x4f1C53F096533C04d8157EFB6Bca3eb22ddC6360
Arg [3] : _valueInterpreter (address): 0xD7B0610dB501b15Bfb9B7DDad8b3869de262a327
Arg [4] : _externalPositionManager (address): 0x1e3dA40f999Cf47091F869EbAc477d84b0827Cf4
Arg [5] : _feeManager (address): 0xAf0DFFAC1CE85c3fCe4c2BF50073251F615EefC4
Arg [6] : _integrationManager (address): 0x31329024f1a3E4a4B3336E0b1DfA74CC3FEc633e
Arg [7] : _policyManager (address): 0xADF5A8DB090627b153Ef0c5726ccfdc1c7aED7bd
Arg [8] : _gasRelayPaymasterFactory (address): 0x846bbe1925047023651de7EC289f329c24ded3a8
Arg [9] : _mlnToken (address): 0xec67005c4E498Ec7f55E092bd1d35cbC47C91892
Arg [10] : _wethToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3dc853dd716bd5754f421ef94fdcbac3902ab32
Arg [1] : 000000000000000000000000b7460593bd222e24a2bf4393aa6416bd373995e0
Arg [2] : 0000000000000000000000004f1c53f096533c04d8157efb6bca3eb22ddc6360
Arg [3] : 000000000000000000000000d7b0610db501b15bfb9b7ddad8b3869de262a327
Arg [4] : 0000000000000000000000001e3da40f999cf47091f869ebac477d84b0827cf4
Arg [5] : 000000000000000000000000af0dffac1ce85c3fce4c2bf50073251f615eefc4
Arg [6] : 00000000000000000000000031329024f1a3e4a4b3336e0b1dfa74cc3fec633e
Arg [7] : 000000000000000000000000adf5a8db090627b153ef0c5726ccfdc1c7aed7bd
Arg [8] : 000000000000000000000000846bbe1925047023651de7ec289f329c24ded3a8
Arg [9] : 000000000000000000000000ec67005c4e498ec7f55e092bd1d35cbc47c91892
Arg [10] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.