More Info
Private Name Tags
ContractCreator
TokenTracker
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
11899164 | 1473 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x9D4Ed905...3a246e76d The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
VaultProxy
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./utils/ProxiableVaultLib.sol";/// @title VaultProxy Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A proxy contract for all VaultProxy instances, slightly modified from EIP-1822/// @dev Adapted from the recommended implementation of a Proxy in EIP-1822, updated for solc 0.6.12,/// and using the EIP-1967 storage slot for the proxiable implementation./// i.e., `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)`, which is/// "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"/// See: https://eips.ethereum.org/EIPS/eip-1822contract VaultProxy {constructor(bytes memory _constructData, address _vaultLib) public {// "0x027b9570e9fedc1a80b937ae9a06861e5faef3992491af30b684a64b3fbec7a5" corresponds to
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../release/extensions/integration-manager/integrations/utils/AdapterBase.sol";/// @title IMockGenericIntegratee Interface/// @author Enzyme Council <security@enzyme.finance>interface IMockGenericIntegratee {function swap(address[] calldata,uint256[] calldata,address[] calldata,uint256[] calldata) external payable;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.0;import "../../GSN/Context.sol";import "./IERC20.sol";import "../../math/SafeMath.sol";import "../../utils/Address.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
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../IIntegrationAdapter.sol";import "./IntegrationSelectors.sol";/// @title AdapterBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A base contract for integration adaptersabstract contract AdapterBase is IIntegrationAdapter, IntegrationSelectors {using SafeERC20 for ERC20;address internal immutable INTEGRATION_MANAGER;
123456789101112131415161718192021222324// SPDX-License-Identifier: MITpragma solidity ^0.6.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/2691return msg.data;}}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.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);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.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, reverting on* overflow.** Counterpart to Solidity's `+` operator.** Requirements:*
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.2;/*** @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) {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.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 {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../IIntegrationManager.sol";/// @title Integration Adapter interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for all integration adaptersinterface IIntegrationAdapter {function identifier() external pure returns (string memory identifier_);function parseAssetsForMethod(bytes4 _selector, bytes calldata _encodedCallArgs)externalviewreturns (IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IntegrationSelectors Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Selectors for integration actions/// @dev Selectors are created from their signatures rather than hardcoded for easy verificationabstract contract IntegrationSelectors {bytes4 public constant ADD_TRACKED_ASSETS_SELECTOR = bytes4(keccak256("addTrackedAssets(address,bytes,bytes)"));// Tradingbytes4 public constant TAKE_ORDER_SELECTOR = bytes4(keccak256("takeOrder(address,bytes,bytes)"));
12345678910111213141516171819// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IIntegrationManager interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for the IntegrationManagerinterface IIntegrationManager {enum SpendAssetsHandleType {None, Approve, Transfer, Remove}}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/IZeroExV2.sol";import "../../../../utils/MathHelpers.sol";import "../../../../utils/AddressArrayLib.sol";import "../../../utils/FundDeployerOwnerMixin.sol";import "../utils/AdapterBase.sol";/// @title ZeroExV2Adapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter to 0xV2 Exchange Contractcontract ZeroExV2Adapter is AdapterBase, FundDeployerOwnerMixin, MathHelpers {using AddressArrayLib for address[];
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;/// @dev Minimal interface for our interactions with the ZeroEx Exchange contractinterface IZeroExV2 {struct Order {address makerAddress;address takerAddress;address feeRecipientAddress;address senderAddress;uint256 makerAssetAmount;uint256 takerAssetAmount;uint256 makerFee;uint256 takerFee;uint256 expirationTimeSeconds;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";/// @title MathHelpers Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Helper functions for common math operationsabstract contract MathHelpers {using SafeMath for uint256;/// @dev Calculates a proportional value relative to a known ratiofunction __calcRelativeQuantity(uint256 _quantity1,uint256 _quantity2,uint256 _relativeQuantity1
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title AddressArray Library/// @author Enzyme Council <security@enzyme.finance>/// @notice A library to extend the address array data typelibrary AddressArrayLib {/// @dev Helper to verify if an array contains a particular valuefunction contains(address[] memory _self, address _target)internalpurereturns (bool doesContain_){for (uint256 i; i < _self.length; i++) {if (_target == _self[i]) {return true;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../core/fund-deployer/IFundDeployer.sol";/// @title FundDeployerOwnerMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract that defers ownership to the owner of FundDeployerabstract contract FundDeployerOwnerMixin {address internal immutable FUND_DEPLOYER;modifier onlyFundDeployerOwner() {require(msg.sender == getOwner(),"onlyFundDeployerOwner: Only the FundDeployer owner can call this function");
123456789101112131415161718192021222324// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IFundDeployer Interface/// @author Enzyme Council <security@enzyme.finance>interface IFundDeployer {enum ReleaseStatus {PreLaunch, Live, Paused}function getOwner() external view returns (address);function getReleaseStatus() external view returns (ReleaseStatus);function isRegisteredVaultCall(address, bytes4) external view returns (bool);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/utils/EnumerableSet.sol";import "../../core/fund/vault/IVault.sol";import "../utils/ExtensionBase.sol";import "../utils/FundDeployerOwnerMixin.sol";import "./IPolicy.sol";import "./IPolicyManager.sol";/// @title PolicyManager Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Manages policies for fundscontract PolicyManager is IPolicyManager, ExtensionBase, FundDeployerOwnerMixin {using EnumerableSet for EnumerableSet.AddressSet;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.0;/*** @dev Library for managing* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive* types.** Sets have the following properties:** - Elements are added, removed, and checked for existence in constant time* (O(1)).* - Elements are enumerated in O(n). No guarantees are made on the ordering.** ```* contract Example {* // Add the library methods* using EnumerableSet for EnumerableSet.AddressSet;** // Declare a set state variable* EnumerableSet.AddressSet private mySet;* }* ```** As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../persistent/utils/IMigratableVault.sol";/// @title IVault Interface/// @author Enzyme Council <security@enzyme.finance>interface IVault is IMigratableVault {function addTrackedAsset(address) external;function approveAssetSpender(address,address,uint256) external;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../core/fund/comptroller/IComptroller.sol";import "../../core/fund/vault/IVault.sol";import "../IExtension.sol";/// @title ExtensionBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Base class for an extensionabstract contract ExtensionBase is IExtension {mapping(address => address) internal comptrollerProxyToVaultProxy;/// @notice Allows extension to run logic during fund activation/// @dev Unimplemented by default, may be overridden.function activateForFund(bool) external virtual override {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./IPolicyManager.sol";/// @title Policy Interface/// @author Enzyme Council <security@enzyme.finance>interface IPolicy {function activateForFund(address _comptrollerProxy, address _vaultProxy) external;function addFundSettings(address _comptrollerProxy, bytes calldata _encodedSettings) external;function identifier() external pure returns (string memory identifier_);function implementedHooks()external
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;/// @title PolicyManager Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for the PolicyManagerinterface IPolicyManager {enum PolicyHook {BuySharesSetup,PreBuyShares,PostBuyShares,BuySharesCompleted,PreCallOnIntegration,PostCallOnIntegration}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IMigratableVault Interface/// @author Enzyme Council <security@enzyme.finance>/// @dev DO NOT EDIT CONTRACTinterface 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;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IComptroller Interface/// @author Enzyme Council <security@enzyme.finance>interface IComptroller {enum VaultAction {None,BurnShares,MintShares,TransferShares,ApproveAssetSpender,WithdrawAssetTo,AddTrackedAsset,RemoveTrackedAsset}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IExtension Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for all extensionsinterface IExtension {function activateForFund(bool _isMigration) external;function deactivateForFund() external;function receiveCallFromComptroller(address _comptrollerProxy,uint256 _actionId,bytes calldata _callArgs) external;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../IPolicy.sol";/// @title PolicyBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Abstract base contract for all policiesabstract contract PolicyBase is IPolicy {address internal immutable POLICY_MANAGER;modifier onlyPolicyManager {require(msg.sender == POLICY_MANAGER, "Only the PolicyManager can make this call");_;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/PolicyBase.sol";/// @title CallOnIntegrationPostValidatePolicyMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract for policies that only implement the PostCallOnIntegration policy hookabstract contract PostCallOnIntegrationValidatePolicyBase is PolicyBase {/// @notice Gets the implemented PolicyHooks for a policy/// @return implementedHooks_ The implemented PolicyHooksfunction implementedHooks()externalviewoverridereturns (IPolicyManager.PolicyHook[] memory implementedHooks_)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile 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 "../../../../core/fund/comptroller/ComptrollerLib.sol";import "../../../../core/fund/vault/VaultLib.sol";import "../../../../infrastructure/value-interpreter/ValueInterpreter.sol";import "./utils/PostCallOnIntegrationValidatePolicyBase.sol";/// @title MaxConcentration Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that defines a configurable threshold for the concentration of any one asset/// in a fund's holdingscontract MaxConcentration is PostCallOnIntegrationValidatePolicyBase {using SafeMath for uint256;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile 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 "../../../extensions/IExtension.sol";import "../../../extensions/fee-manager/IFeeManager.sol";import "../../../extensions/policy-manager/IPolicyManager.sol";import "../../../infrastructure/price-feeds/primitives/IPrimitivePriceFeed.sol";import "../../../infrastructure/value-interpreter/IValueInterpreter.sol";import "../../../utils/AddressArrayLib.sol";import "../../../utils/AssetFinalityResolver.sol";import "../../fund-deployer/IFundDeployer.sol";import "../vault/IVault.sol";
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";import "../../../../persistent/dispatcher/IDispatcher.sol";import "../../../../persistent/vault/VaultLibBase1.sol";import "./IVault.sol";/// @title VaultLib Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice The per-release proxiable library contract for VaultProxy/// @dev The difference in terminology between "asset" and "trackedAsset" is intentional./// A fund might actually have asset balances of un-tracked assets,/// but only tracked assets are used in gav calculations./// Note that this contract inherits VaultLibSafeMath (a verbatim Open Zeppelin SafeMath copy)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../price-feeds/derivatives/IAggregatedDerivativePriceFeed.sol";import "../price-feeds/derivatives/IDerivativePriceFeed.sol";import "../price-feeds/primitives/IPrimitivePriceFeed.sol";import "./IValueInterpreter.sol";/// @title ValueInterpreter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Interprets price feeds to provide covert value between asset pairs/// @dev This contract contains several "live" value calculations, which for this release are simply/// aliases to their "canonical" value counterparts since the only primitive price feed (Chainlink)/// is immutable in this contract and only has one type of value. Including the "live" versions of/// functions only serves as a placeholder for infrastructural components and plugins (e.g., policies)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IDispatcher Interface/// @author Enzyme Council <security@enzyme.finance>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_);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;/// @title FeeManager Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for the FeeManagerinterface IFeeManager {// No fees for the current release are implemented post-redeemSharesenum FeeHook {Continuous,BuySharesSetup,PreBuyShares,PostBuyShares,BuySharesCompleted,PreRedeemShares
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IPrimitivePriceFeed Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for primitive price feedsinterface IPrimitivePriceFeed {function calcCanonicalValue(address,uint256,address) external view returns (uint256, bool);function calcLiveValue(address,uint256,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IValueInterpreter interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for ValueInterpreterinterface IValueInterpreter {function calcCanonicalAssetValue(address,uint256,address) external returns (uint256, bool);function calcCanonicalAssetsTotalValue(address[] calldata,uint256[] calldata,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../infrastructure/price-feeds/derivatives/feeds/SynthetixPriceFeed.sol";import "../interfaces/ISynthetixAddressResolver.sol";import "../interfaces/ISynthetixExchanger.sol";/// @title AssetFinalityResolver Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A contract that helps achieve asset finalityabstract contract AssetFinalityResolver {address internal immutable SYNTHETIX_ADDRESS_RESOLVER;address internal immutable SYNTHETIX_PRICE_FEED;constructor(address _synthetixPriceFeed, address _synthetixAddressResolver) public {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/ISynthetix.sol";import "../../../../interfaces/ISynthetixAddressResolver.sol";import "../../../../interfaces/ISynthetixExchangeRates.sol";import "../../../../interfaces/ISynthetixProxyERC20.sol";import "../../../../interfaces/ISynthetixSynth.sol";import "../../../utils/DispatcherOwnerMixin.sol";import "../IDerivativePriceFeed.sol";/// @title SynthetixPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A price feed that uses Synthetix oracles as price sourcescontract SynthetixPriceFeed is IDerivativePriceFeed, DispatcherOwnerMixin {
123456789101112131415161718// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetixAddressResolver Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetixAddressResolver {function requireAndGetAddress(bytes32, string calldata) external view returns (address);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetixExchanger Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetixExchanger {function getAmountsForExchange(uint256,bytes32,bytes32)externalviewreturns (uint256,uint256,
12345678910111213141516171819202122232425// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetix Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetix {function exchangeOnBehalfWithTracking(address,bytes32,uint256,bytes32,address,bytes32) external returns (uint256);}
123456789101112131415161718// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetixExchangeRates Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetixExchangeRates {function rateAndInvalid(bytes32) external view returns (uint256, bool);}
123456789101112131415161718// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetixProxyERC20 Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetixProxyERC20 {function target() external view returns (address);}
123456789101112131415161718// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ISynthetixSynth Interface/// @author Enzyme Council <security@enzyme.finance>interface ISynthetixSynth {function currencyKey() external view returns (bytes32);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../persistent/dispatcher/IDispatcher.sol";/// @title DispatcherOwnerMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract that defers ownership to the owner of Dispatcherabstract contract DispatcherOwnerMixin {address internal immutable DISPATCHER;modifier onlyDispatcherOwner() {require(msg.sender == getOwner(),"onlyDispatcherOwner: Only the Dispatcher owner can call this function");
1234567891011121314151617181920212223// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IDerivativePriceFeed Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Simple interface for derivative price source oracle implementationsinterface IDerivativePriceFeed {function calcUnderlyingValues(address, uint256)externalreturns (address[] memory, uint256[] memory);function isSupportedAsset(address) external view returns (bool);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./VaultLibBaseCore.sol";/// @title VaultLibBase1 Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice The first implementation of VaultLibBaseCore, with additional events and storage/// @dev All subsequent implementations should inherit the previous implementation,/// e.g., `VaultLibBase2 is VaultLibBase1`/// DO NOT EDIT CONTRACT.abstract contract VaultLibBase1 is VaultLibBaseCore {event AssetWithdrawn(address indexed asset, address indexed target, uint256 amount);event TrackedAssetAdded(address asset);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/IMigratableVault.sol";import "./utils/ProxiableVaultLib.sol";import "./utils/SharesTokenBase.sol";/// @title VaultLibBaseCore Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A persistent contract containing all required storage variables and/// required functions for a VaultLib implementation/// @dev DO NOT EDIT CONTRACT. If new events or storage are necessary, they should be added to/// a numbered VaultLibBaseXXX that inherits the previous base. See VaultLibBase1.abstract contract VaultLibBaseCore is IMigratableVault, ProxiableVaultLib, SharesTokenBase {event AccessorSet(address prevAccessor, address nextAccessor);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title ProxiableVaultLib Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A contract that defines the upgrade behavior for VaultLib instances/// @dev The recommended implementation of the target of a proxy according to EIP-1822 and EIP-1967/// Code position in storage is `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)`,/// which is "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc".abstract contract ProxiableVaultLib {/// @dev Updates the target of the proxy to be the contract at _nextVaultLibfunction __updateCodeAddress(address _nextVaultLib) internal {require(bytes32(0x027b9570e9fedc1a80b937ae9a06861e5faef3992491af30b684a64b3fbec7a5) ==ProxiableVaultLib(_nextVaultLib).proxiableUUID(),"__updateCodeAddress: _nextVaultLib not compatible"
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./VaultLibSafeMath.sol";/// @title StandardERC20 Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Contains the storage, events, and default logic of an ERC20-compliant contract./// @dev The logic can be overridden by VaultLib implementations./// Adapted from OpenZeppelin 3.2.0./// DO NOT EDIT THIS CONTRACT.abstract contract SharesTokenBase {using VaultLibSafeMath for uint256;event Approval(address indexed owner, address indexed spender, uint256 value);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title VaultLibSafeMath library/// @notice A narrowed, verbatim implementation of OpenZeppelin 3.2.0 SafeMath/// for use with VaultLib/// @dev Preferred to importing from npm to guarantee consistent logic and revert reasons/// between VaultLib implementations/// DO NOT EDIT THIS CONTRACTlibrary VaultLibSafeMath {function add(uint256 a, uint256 b) internal pure returns (uint256) {uint256 c = a + b;require(c >= a, "VaultLibSafeMath: addition overflow");return c;}
1234567891011121314151617181920// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./IDerivativePriceFeed.sol";/// @title IDerivativePriceFeed Interface/// @author Enzyme Council <security@enzyme.finance>interface IAggregatedDerivativePriceFeed is IDerivativePriceFeed {function getPriceFeedForDerivative(address) external view returns (address);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../../../interfaces/IUniswapV2Pair.sol";import "../../../../utils/MathHelpers.sol";import "../../../utils/DispatcherOwnerMixin.sol";import "../../../value-interpreter/ValueInterpreter.sol";import "../../primitives/IPrimitivePriceFeed.sol";import "../../utils/UniswapV2PoolTokenValueCalculator.sol";import "../IDerivativePriceFeed.sol";/// @title UniswapV2PoolPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Price feed for Uniswap lending pool tokens
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IUniswapV2Pair Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Minimal interface for our interactions with the Uniswap V2's Pair contractinterface IUniswapV2Pair {function getReserves()externalviewreturns (uint112,uint112,uint32);
12345678910111213141516171819202122232425// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../interfaces/IUniswapV2Factory.sol";import "../../../interfaces/IUniswapV2Pair.sol";/// @title UniswapV2PoolTokenValueCalculator Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Abstract contract for computing the value of Uniswap liquidity pool tokens/// @dev Unless otherwise noted, these functions are adapted to our needs and style guide from/// an un-merged Uniswap branch:/// https://github.com/Uniswap/uniswap-v2-periphery/blob/267ba44471f3357071a2fe2573fe4da42d5ad969/contracts/libraries/UniswapV2LiquidityMathLibrary.solabstract contract UniswapV2PoolTokenValueCalculator {using SafeMath for uint256;
123456789101112131415161718192021// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IUniswapV2Factory Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Minimal interface for our interactions with the Uniswap V2's Factory contractinterface IUniswapV2Factory {function feeTo() external view returns (address);function getPair(address, address) external view returns (address);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/IChainlinkAggregator.sol";import "../../../../utils/MakerDaoMath.sol";import "../IDerivativePriceFeed.sol";/// @title WdgldPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Price source oracle for WDGLD <https://dgld.ch/>contract WdgldPriceFeed is IDerivativePriceFeed, MakerDaoMath {using SafeMath for uint256;address private immutable XAU_AGGREGATOR;address private immutable ETH_AGGREGATOR;
1234567891011121314151617181920// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IChainlinkAggregator Interface/// @author Enzyme Council <security@enzyme.finance>interface IChainlinkAggregator {function latestAnswer() external view returns (int256);function latestTimestamp() external view returns (uint256);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0-or-later// Copyright (C) 2018 Rain <rainbreak@riseup.net>//// This program is free software: you can redistribute it and/or modify// it under the terms of the GNU Affero General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU Affero General Public License for more details.//// You should have received a copy of the GNU Affero General Public License// along with this program. If not, see <https://www.gnu.org/licenses/>.pragma solidity 0.6.12;/// @title MakerDaoMath Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Helper functions for math operations adapted from MakerDao contractsabstract contract MakerDaoMath {/// @dev Performs scaled, fixed-point exponentiation./// Verbatim code, adapted to our style guide for variable naming only, see:/// https://github.com/makerdao/dss/blob/master/src/pot.sol#L83-L105
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../core/fund/vault/VaultLib.sol";import "../../../utils/MakerDaoMath.sol";import "./utils/FeeBase.sol";/// @title ManagementFee Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A management fee with a configurable annual ratecontract ManagementFee is FeeBase, MakerDaoMath {using SafeMath for uint256;event FundSettingsAdded(address indexed comptrollerProxy, uint256 scaledPerSecondRate);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../IFee.sol";/// @title FeeBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Abstract base contract for all feesabstract contract FeeBase is IFee {address internal immutable FEE_MANAGER;modifier onlyFeeManager {require(msg.sender == FEE_MANAGER, "Only the FeeManger can make this call");_;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./IFeeManager.sol";/// @title Fee Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Interface for all feesinterface IFee {function activateForFund(address _comptrollerProxy, address _vaultProxy) external;function addFundSettings(address _comptrollerProxy, bytes calldata _settingsData) external;function identifier() external pure returns (string memory identifier_);function implementedHooks()
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "@openzeppelin/contracts/math/SignedSafeMath.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../../core/fund/comptroller/ComptrollerLib.sol";import "../FeeManager.sol";import "./utils/FeeBase.sol";/// @title PerformanceFee Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A performance-based fee with configurable rate and crystallization period, using/// a high watermark/// @dev This contract assumes that all shares in the VaultProxy are shares outstanding,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.0;/*** @title SignedSafeMath* @dev Signed math operations with safety checks that revert on error.*/library SignedSafeMath {int256 constant private _INT256_MIN = -2**255;/*** @dev Returns the multiplication of two signed integers, reverting on* overflow.** Counterpart to Solidity's `*` operator.** Requirements:** - Multiplication cannot overflow.*/function mul(int256 a, int256 b) internal pure returns (int256) {// 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/522if (a == 0) {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "@openzeppelin/contracts/utils/EnumerableSet.sol";import "../../core/fund/comptroller/IComptroller.sol";import "../../core/fund/vault/IVault.sol";import "../../utils/AddressArrayLib.sol";import "../utils/ExtensionBase.sol";import "../utils/FundDeployerOwnerMixin.sol";import "../utils/PermissionedVaultActionMixin.sol";import "./IFee.sol";import "./IFeeManager.sol";
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../core/fund/comptroller/IComptroller.sol";/// @title PermissionedVaultActionMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract for extensions that can make permissioned vault callsabstract contract PermissionedVaultActionMixin {/// @notice Adds a tracked asset to the fund/// @param _comptrollerProxy The ComptrollerProxy of the fund/// @param _asset The asset to addfunction __addTrackedAsset(address _comptrollerProxy, address _asset) internal {IComptroller(_comptrollerProxy).permissionedVaultAction(IComptroller.VaultAction.AddTrackedAsset,abi.encode(_asset)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../core/fund/comptroller/ComptrollerLib.sol";import "../extensions/fee-manager/FeeManager.sol";/// @title FundActionsWrapper Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Logic related to funds, not necessary in the core protocol/// @dev This contract is currently unaudited, as it does not involve any/// exchange in value, and simply wraps other functions for conveniencecontract FundActionsWrapper {address private immutable FEE_MANAGER;constructor(address _feeManager) public {FEE_MANAGER = _feeManager;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";import "../../core/fund/comptroller/ComptrollerLib.sol";import "../../core/fund/vault/VaultLib.sol";import "./IAuthUserExecutedSharesRequestor.sol";/// @title AuthUserExecutedSharesRequestorLib Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Provides the logic for AuthUserExecutedSharesRequestorProxy instances,/// in which shares requests are manually executed by a permissioned user/// @dev This will not work with a `denominationAsset` that does not transfer
123456789101112131415161718// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IAuthUserExecutedSharesRequestor Interface/// @author Enzyme Council <security@enzyme.finance>interface IAuthUserExecutedSharesRequestor {function init(address) external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../core/fund/comptroller/ComptrollerLib.sol";import "../../core/fund/vault/VaultLib.sol";import "./AuthUserExecutedSharesRequestorProxy.sol";import "./IAuthUserExecutedSharesRequestor.sol";/// @title AuthUserExecutedSharesRequestorFactory Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Deploys and maintains a record of AuthUserExecutedSharesRequestorProxy instancescontract AuthUserExecutedSharesRequestorFactory {event SharesRequestorProxyDeployed(address indexed comptrollerProxy,address sharesRequestorProxy);
123456789101112131415161718192021// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/Proxy.sol";contract AuthUserExecutedSharesRequestorProxy is Proxy {constructor(bytes memory _constructData, address _authUserExecutedSharesRequestorLib)publicProxy(_constructData, _authUserExecutedSharesRequestorLib){}}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title Proxy Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A proxy contract for all Proxy instances/// @dev The recommended implementation of a Proxy in EIP-1822, updated for solc 0.6.12,/// and using the EIP-1967 storage slot for the proxiable implementation./// i.e., `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)`, which is/// "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"/// See: https://eips.ethereum.org/EIPS/eip-1822contract Proxy {constructor(bytes memory _constructData, address _contractLogic) public {assembly {sstore(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,
123456789101112131415161718192021222324// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../utils/Proxy.sol";/// @title ComptrollerProxy Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A proxy contract for all ComptrollerProxy instancescontract ComptrollerProxy is Proxy {constructor(bytes memory _constructData, address _comptrollerLib)publicProxy(_constructData, _comptrollerLib){}}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "../../../persistent/dispatcher/IDispatcher.sol";import "../../../persistent/utils/IMigrationHookHandler.sol";import "../fund/comptroller/IComptroller.sol";import "../fund/comptroller/ComptrollerProxy.sol";import "../fund/vault/IVault.sol";import "./IFundDeployer.sol";/// @title FundDeployer Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice The top-level contract of the release./// It primarily coordinates fund deployment and fund migration, but/// it is also deferred to for contract access control and for allowed calls
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title IMigrationHookHandler Interface/// @author Enzyme Council <security@enzyme.finance>interface IMigrationHookHandler {enum MigrationOutHook {PreSignal, PostSignal, PreMigrate, PostMigrate, PostCancel}function invokeMigrationInCancelHook(address _vaultProxy,address _prevFundDeployer,address _nextVaultAccessor,address _nextVaultLib) external;function invokeMigrationOutHook(
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile 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/utils/EnumerableSet.sol";import "../../core/fund/vault/IVault.sol";import "../../infrastructure/price-feeds/derivatives/IDerivativePriceFeed.sol";import "../../infrastructure/price-feeds/primitives/IPrimitivePriceFeed.sol";import "../../utils/AddressArrayLib.sol";import "../../utils/AssetFinalityResolver.sol";import "../policy-manager/IPolicyManager.sol";import "../utils/ExtensionBase.sol";import "../utils/FundDeployerOwnerMixin.sol";import "../utils/PermissionedVaultActionMixin.sol";import "./integrations/IIntegrationAdapter.sol";
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../infrastructure/price-feeds/derivatives/feeds/SynthetixPriceFeed.sol";import "../../../../interfaces/ISynthetix.sol";import "../utils/AdapterBase.sol";/// @title SynthetixAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for interacting with Synthetixcontract SynthetixAdapter is AdapterBase {address private immutable ORIGINATOR;address private immutable SYNTHETIX;address private immutable SYNTHETIX_PRICE_FEED;bytes32 private immutable TRACKING_CODE;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../../interfaces/IChainlinkAggregator.sol";import "../../utils/DispatcherOwnerMixin.sol";import "./IPrimitivePriceFeed.sol";/// @title ChainlinkPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A price feed that uses Chainlink oracles as price sourcescontract ChainlinkPriceFeed is IPrimitivePriceFeed, DispatcherOwnerMixin {using SafeMath for uint256;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../release/infrastructure/value-interpreter/IValueInterpreter.sol";import "../../release/infrastructure/price-feeds/derivatives/IAggregatedDerivativePriceFeed.sol";import "../../release/infrastructure/price-feeds/primitives/IPrimitivePriceFeed.sol";/// @dev This contract acts as a centralized rate provider for mocks./// Suited for a dev environment, it doesn't take into account gas costs.contract CentralizedRateProvider is Ownable {using SafeMath for uint256;address private immutable WETH;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.0;import "../GSN/Context.sol";/*** @dev Contract module which provides a basic access control mechanism, where* there is an account (an owner) that can be granted exclusive access to* specific functions.** By default, the owner account will be the one that deploys the contract. This* can later be changed with {transferOwnership}.** This module is used through inheritance. It will make available the modifier* `onlyOwner`, which can be applied to your functions to restrict their use to* the owner.*/contract Ownable is Context {address private _owner;event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);/*** @dev Initializes the contract setting the deployer as the initial owner.*/constructor () internal {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "../prices/CentralizedRateProvider.sol";import "./utils/SimpleMockIntegrateeBase.sol";/// @dev Mocks the integration with `UniswapV2Router02` <https://uniswap.org/docs/v2/smart-contracts/router02/>/// Additionally mocks the integration with `UniswapV2Factory` <https://uniswap.org/docs/v2/smart-contracts/factory/>contract MockUniswapV2Integratee is SwapperBase, Ownable {using SafeMath for uint256;mapping(address => mapping(address => address)) private assetToAssetToPair;address private immutable CENTRALIZED_RATE_PROVIDER;uint256 private constant PRECISION = 18;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./MockIntegrateeBase.sol";abstract contract SimpleMockIntegrateeBase is MockIntegrateeBase {constructor(address[] memory _defaultRateAssets,address[] memory _specialAssets,uint8[] memory _specialAssetDecimals,uint256 _ratePrecision)publicMockIntegrateeBase(_defaultRateAssets,_specialAssets,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/NormalizedRateProviderBase.sol";import "../../utils/SwapperBase.sol";abstract contract MockIntegrateeBase is NormalizedRateProviderBase, SwapperBase {constructor(address[] memory _defaultRateAssets,address[] memory _specialAssets,uint8[] memory _specialAssetDecimals,uint256 _ratePrecision)publicNormalizedRateProviderBase(_defaultRateAssets,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "./RateProviderBase.sol";abstract contract NormalizedRateProviderBase is RateProviderBase {using SafeMath for uint256;uint256 public immutable RATE_PRECISION;constructor(address[] memory _defaultRateAssets,address[] memory _specialAssets,uint8[] memory _specialAssetDecimals,uint256 _ratePrecision
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "./EthConstantMixin.sol";abstract contract SwapperBase is EthConstantMixin {receive() external payable {}function __swapAssets(address payable _trader,address _srcToken,uint256 _srcAmount,address _destToken,uint256 _actualRate) internal returns (uint256 destAmount_) {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "./EthConstantMixin.sol";abstract contract RateProviderBase is EthConstantMixin {mapping(address => mapping(address => uint256)) public assetToAssetRate;// Handles non-ERC20 compliant assets like ETH and USDmapping(address => uint8) public specialAssetToDecimals;constructor(address[] memory _specialAssets, uint8[] memory _specialAssetDecimals) public {require(_specialAssets.length == _specialAssetDecimals.length,"constructor: _specialAssets and _specialAssetDecimals are uneven lengths"
12345678910111213141516// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;abstract contract EthConstantMixin {address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../release/interfaces/IParaSwapAugustusSwapper.sol";import "../prices/CentralizedRateProvider.sol";import "../utils/SwapperBase.sol";contract MockParaSwapIntegratee is SwapperBase {using SafeMath for uint256;address private immutable MOCK_CENTRALIZED_RATE_PROVIDER;// Deviation set in % defines the MAX deviation per block from the mean rateuint256 private blockNumberDeviation;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;/// @title ParaSwap IAugustusSwapper interfaceinterface IParaSwapAugustusSwapper {struct Route {address payable exchange;address targetExchange;uint256 percent;bytes payload;uint256 networkFee;}struct Path {address to;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/IParaSwapAugustusSwapper.sol";import "../../../../interfaces/IWETH.sol";import "../utils/AdapterBase.sol";/// @title ParaSwapAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for interacting with ParaSwapcontract ParaSwapAdapter is AdapterBase {using SafeMath for uint256;string private constant REFERRER = "enzyme";
1234567891011121314151617181920// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title WETH Interface/// @author Enzyme Council <security@enzyme.finance>interface IWETH {function deposit() external payable;function withdraw(uint256) external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "../../../../interfaces/IKyberNetworkProxy.sol";import "../../../../interfaces/IWETH.sol";import "../../../../utils/MathHelpers.sol";import "../utils/AdapterBase.sol";/// @title KyberAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for interacting with Kyber Networkcontract KyberAdapter is AdapterBase, MathHelpers {address private immutable EXCHANGE;address private immutable WETH_TOKEN;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title Kyber Network interfaceinterface IKyberNetworkProxy {function swapEtherToToken(address, uint256) external payable returns (uint256);function swapTokenToEther(address,uint256,uint256) external returns (uint256);function swapTokenToToken(address,uint256,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "../../release/interfaces/IUniswapV2Pair.sol";import "../tokens/MockToken.sol";/// @dev This price source mocks the integration with Uniswap Pair/// Docs of Uniswap Pair implementation: <https://uniswap.org/docs/v2/smart-contracts/pair/>contract MockUniswapV2PriceSource is MockToken("Uniswap V2", "UNI-V2", 18) {address private immutable TOKEN_0;address private immutable TOKEN_1;constructor(address _token0, address _token1) public {TOKEN_0 = _token0;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";contract MockToken is ERC20Burnable {using SafeMath for uint256;constructor(string memory _name,string memory _symbol,uint8 _decimals) public ERC20(_name, _symbol) {_setupDecimals(_decimals);_mint(msg.sender, uint256(100000000).mul(10**uint256(_decimals)));
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.6.0;import "../../GSN/Context.sol";import "./ERC20.sol";/*** @dev Extension of {ERC20} that allows token holders to destroy both their own* tokens and those that they have an allowance for, in a way that can be* recognized off-chain (via event analysis).*/abstract contract ERC20Burnable is Context, ERC20 {/*** @dev Destroys `amount` tokens from the caller.** See {ERC20-_burn}.*/function burn(uint256 amount) public virtual {_burn(_msgSender(), amount);}/*** @dev Destroys `amount` tokens from `account`, deducting from the caller's* allowance.*
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../release/core/fund/comptroller/ComptrollerLib.sol";import "./MockToken.sol";/// @title MockReentrancyToken Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mock ERC20 token implementation that is able to re-entrance redeemShares and buyShares functionscontract MockReentrancyToken is MockToken("Mock Reentrancy Token", "MRT", 18) {bool public bad;address public comptrollerProxy;function makeItReentracyToken(address _comptrollerProxy) external {bad = true;comptrollerProxy = _comptrollerProxy;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "./../../release/interfaces/ISynthetixProxyERC20.sol";import "./../../release/interfaces/ISynthetixSynth.sol";import "./MockToken.sol";contract MockSynthetixToken is ISynthetixProxyERC20, ISynthetixSynth, MockToken, Ownable {using SafeMath for uint256;bytes32 public override currencyKey;uint256 public constant WAITING_PERIOD_SECS = 3 * 60;mapping(address => uint256) public timelockByAccount;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "./../../release/interfaces/ISynthetixExchangeRates.sol";import "../prices/MockChainlinkPriceSource.sol";/// @dev This price source offers two different options getting prices/// The first one is getting a fixed rate, which can be useful for tests/// The second approach calculates dinamically the rate making use of a chainlink price source/// Mocks the functionality of the folllowing Synthetix contracts: { Exchanger, ExchangeRates }contract MockSynthetixPriceSource is Ownable, ISynthetixExchangeRates {using SafeMath for uint256;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;contract MockChainlinkPriceSource {event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);uint256 public DECIMALS;int256 public latestAnswer;uint256 public latestTimestamp;uint256 public roundId;address public aggregator;constructor(uint256 _decimals) public {DECIMALS = _decimals;latestAnswer = int256(10**_decimals);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "./../../release/interfaces/ISynthetixExchangeRates.sol";import "./../tokens/MockSynthetixToken.sol";/// @dev Synthetix Integratee. Mocks functionalities from the folllowing synthetix contracts/// Synthetix, SynthetixAddressResolver, SynthetixDelegateApprovals/// Link to contracts: <https://github.com/Synthetixio/synthetix/tree/develop/contracts>contract MockSynthetixIntegratee is Ownable {using SafeMath for uint256;mapping(address => mapping(address => bool)) private authorizerToDelegateToApproval;mapping(bytes32 => address) private currencyKeyToSynth;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/math/SafeMath.sol";import "../../release/utils/MathHelpers.sol";import "../prices/CentralizedRateProvider.sol";import "../utils/SwapperBase.sol";contract MockKyberIntegratee is SwapperBase, Ownable, MathHelpers {using SafeMath for uint256;address private immutable MOCK_CENTRALIZED_RATE_PROVIDER;address private immutable WETH;uint256 private constant PRECISION = 18;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../core/fund/comptroller/ComptrollerLib.sol";import "../../../../core/fund/vault/VaultLib.sol";import "../../../../utils/AddressArrayLib.sol";import "../utils/AddressListPolicyMixin.sol";import "./utils/PostCallOnIntegrationValidatePolicyBase.sol";/// @title AssetWhitelist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that only allows a configurable whitelist of assets in a fund's holdingscontract AssetWhitelist is PostCallOnIntegrationValidatePolicyBase, AddressListPolicyMixin {using AddressArrayLib for address[];constructor(address _policyManager) public PolicyBase(_policyManager) {}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/utils/EnumerableSet.sol";/// @title AddressListPolicyMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice An abstract mixin contract for policies that use an address listabstract contract AddressListPolicyMixin {using EnumerableSet for EnumerableSet.AddressSet;event AddressesAdded(address indexed comptrollerProxy, address[] items);event AddressesRemoved(address indexed comptrollerProxy, address[] items);mapping(address => EnumerableSet.AddressSet) private comptrollerProxyToList;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../core/fund/comptroller/ComptrollerLib.sol";import "../../../../core/fund/vault/VaultLib.sol";import "../../../../utils/AddressArrayLib.sol";import "../utils/AddressListPolicyMixin.sol";import "./utils/PostCallOnIntegrationValidatePolicyBase.sol";/// @title AssetBlacklist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that disallows a configurable blacklist of assets in a fund's holdingscontract AssetBlacklist is PostCallOnIntegrationValidatePolicyBase, AddressListPolicyMixin {using AddressArrayLib for address[];constructor(address _policyManager) public PolicyBase(_policyManager) {}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/AddressListPolicyMixin.sol";import "./utils/PreCallOnIntegrationValidatePolicyBase.sol";/// @title AdapterWhitelist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that only allows a configurable whitelist of adapters for use by a fundcontract AdapterWhitelist is PreCallOnIntegrationValidatePolicyBase, AddressListPolicyMixin {constructor(address _policyManager) public PolicyBase(_policyManager) {}/// @notice Add the initial policy settings for a fund/// @param _comptrollerProxy The fund's ComptrollerProxy address/// @param _encodedSettings Encoded settings to apply to a fundfunction addFundSettings(address _comptrollerProxy, bytes calldata _encodedSettings)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/PolicyBase.sol";/// @title CallOnIntegrationPreValidatePolicyMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract for policies that only implement the PreCallOnIntegration policy hookabstract contract PreCallOnIntegrationValidatePolicyBase is PolicyBase {/// @notice Gets the implemented PolicyHooks for a policy/// @return implementedHooks_ The implemented PolicyHooksfunction implementedHooks()externalviewoverridereturns (IPolicyManager.PolicyHook[] memory implementedHooks_)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../utils/FundDeployerOwnerMixin.sol";import "./utils/PreCallOnIntegrationValidatePolicyBase.sol";/// @title GuaranteedRedemption Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that guarantees that shares will either be continuously redeemable or/// redeemable within a predictable daily window by preventing trading during a configurable daily periodcontract GuaranteedRedemption is PreCallOnIntegrationValidatePolicyBase, FundDeployerOwnerMixin {using SafeMath for uint256;event AdapterAdded(address adapter);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/AddressListPolicyMixin.sol";import "./utils/PreCallOnIntegrationValidatePolicyBase.sol";/// @title AdapterBlacklist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that disallows a configurable blacklist of adapters from use by a fundcontract AdapterBlacklist is PreCallOnIntegrationValidatePolicyBase, AddressListPolicyMixin {constructor(address _policyManager) public PolicyBase(_policyManager) {}/// @notice Add the initial policy settings for a fund/// @param _comptrollerProxy The fund's ComptrollerProxy address/// @param _encodedSettings Encoded settings to apply to a fundfunction addFundSettings(address _comptrollerProxy, bytes calldata _encodedSettings)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/AddressListPolicyMixin.sol";import "./utils/PreBuySharesValidatePolicyBase.sol";/// @title InvestorWhitelist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that only allows a configurable whitelist of investors to buy shares in a fundcontract InvestorWhitelist is PreBuySharesValidatePolicyBase, AddressListPolicyMixin {constructor(address _policyManager) public PolicyBase(_policyManager) {}/// @notice Adds the initial policy settings for a fund/// @param _comptrollerProxy The fund's ComptrollerProxy address/// @param _encodedSettings Encoded settings to apply to a fundfunction addFundSettings(address _comptrollerProxy, bytes calldata _encodedSettings)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/PolicyBase.sol";/// @title BuySharesPolicyMixin Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract for policies that only implement the PreBuyShares policy hookabstract contract PreBuySharesValidatePolicyBase is PolicyBase {/// @notice Gets the implemented PolicyHooks for a policy/// @return implementedHooks_ The implemented PolicyHooksfunction implementedHooks()externalviewoverridereturns (IPolicyManager.PolicyHook[] memory implementedHooks_)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;pragma experimental ABIEncoderV2;import "./utils/PreBuySharesValidatePolicyBase.sol";/// @title MinMaxInvestment Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that restricts the amount of the fund's denomination asset that a user can/// send in a single call to buy shares in a fundcontract MinMaxInvestment is PreBuySharesValidatePolicyBase {event FundSettingsSet(address indexed comptrollerProxy,uint256 minInvestmentAmount,uint256 maxInvestmentAmount);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/AddressListPolicyMixin.sol";import "./utils/BuySharesSetupPolicyBase.sol";/// @title BuySharesCallerWhitelist Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A policy that only allows a configurable whitelist of buyShares callers for a fundcontract BuySharesCallerWhitelist is BuySharesSetupPolicyBase, AddressListPolicyMixin {constructor(address _policyManager) public PolicyBase(_policyManager) {}/// @notice Adds the initial policy settings for a fund/// @param _comptrollerProxy The fund's ComptrollerProxy address/// @param _encodedSettings Encoded settings to apply to a fundfunction addFundSettings(address _comptrollerProxy, bytes calldata _encodedSettings)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/PolicyBase.sol";/// @title BuySharesSetupPolicyBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mixin contract for policies that only implement the BuySharesSetup policy hookabstract contract BuySharesSetupPolicyBase is PolicyBase {/// @notice Gets the implemented PolicyHooks for a policy/// @return implementedHooks_ The implemented PolicyHooksfunction implementedHooks()externalviewoverridereturns (IPolicyManager.PolicyHook[] memory implementedHooks_)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../core/fund/vault/VaultLib.sol";import "../utils/AdapterBase.sol";/// @title TrackedAssetsAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter to add tracked assets to a fund (useful e.g. to handle token airdrops)contract TrackedAssetsAdapter is AdapterBase {constructor(address _integrationManager) public AdapterBase(_integrationManager) {}/// @notice Add multiple assets to the Vault's list of tracked assets/// @dev No need to perform any validation or implement any logicfunction addTrackedAssets(address,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/IMigrationHookHandler.sol";import "../utils/IMigratableVault.sol";import "../vault/VaultProxy.sol";import "./IDispatcher.sol";/// @title Dispatcher Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice The top-level contract linking multiple releases./// It handles the deployment of new VaultProxy instances,/// and the regulation of fund migration from a previous release to the current one./// It can also be referred to for access-control based on this contract's owner./// @dev DO NOT EDIT CONTRACTcontract Dispatcher is IDispatcher {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../persistent/vault/VaultLibBaseCore.sol";/// @title MockVaultLib Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice A mock VaultLib implementation that only extends VaultLibBaseCorecontract MockVaultLib is VaultLibBaseCore {function getAccessor() external view returns (address) {return accessor;}function getCreator() external view returns (address) {return creator;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity ^0.6.12;import "@openzeppelin/contracts/token/ERC20/IERC20.sol";/// @title ICERC20 Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Minimal interface for interactions with Compound tokens (cTokens)interface ICERC20 is IERC20 {function decimals() external view returns (uint8);function mint(uint256) external returns (uint256);function redeem(uint256) external returns (uint256);function exchangeRateStored() external view returns (uint256);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/ICERC20.sol";import "../../../utils/DispatcherOwnerMixin.sol";import "../IDerivativePriceFeed.sol";/// @title CompoundPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Price source oracle for Compound Tokens (cTokens)contract CompoundPriceFeed is IDerivativePriceFeed, DispatcherOwnerMixin {using SafeMath for uint256;event CTokenAdded(address indexed cToken, address indexed token);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol";import "../../../../interfaces/ICERC20.sol";import "../../../../interfaces/ICEther.sol";import "../../../../interfaces/IWETH.sol";import "../utils/AdapterBase.sol";/// @title CompoundAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for Compound <https://compound.finance/>contract CompoundAdapter is AdapterBase {address private immutable COMPOUND_PRICE_FEED;address private immutable WETH_TOKEN;
12345678910111213141516171819// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity ^0.6.12;/// @title ICEther Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Minimal interface for interactions with Compound Etherinterface ICEther {function mint() external payable;}
12345678910111213141516171819202122// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/token/ERC20/IERC20.sol";/// @title IChai Interface/// @author Enzyme Council <security@enzyme.finance>/// @notice Minimal interface for our interactions with the Chai contractinterface IChai is IERC20 {function exit(address, uint256) external;function join(address, uint256) external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../../../interfaces/IChai.sol";import "../utils/AdapterBase.sol";/// @title ChaiAdapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for Chai <https://github.com/dapphub/chai>contract ChaiAdapter is AdapterBase {address private immutable CHAI;address private immutable DAI;constructor(address _integrationManager,address _chai,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/access/Ownable.sol";import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";import "../../prices/CentralizedRateProvider.sol";import "../../utils/SwapperBase.sol";contract MockCTokenBase is ERC20, SwapperBase, Ownable {address internal immutable TOKEN;address internal immutable CENTRALIZED_RATE_PROVIDER;uint256 internal rate;mapping(address => mapping(address => uint256)) internal _allowances;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./MockCTokenBase.sol";contract MockCTokenIntegratee is MockCTokenBase {constructor(string memory _name,string memory _symbol,uint8 _decimals,address _token,address _centralizedRateProvider,uint256 _initialRate)publicMockCTokenBase(_name, _symbol, _decimals, _token, _centralizedRateProvider, _initialRate)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./MockCTokenBase.sol";contract MockCEtherIntegratee is MockCTokenBase {constructor(string memory _name,string memory _symbol,uint8 _decimals,address _weth,address _centralizedRateProvider,uint256 _initialRate)publicMockCTokenBase(_name, _symbol, _decimals, _weth, _centralizedRateProvider, _initialRate)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../prices/CentralizedRateProvider.sol";import "../tokens/MockToken.sol";import "../utils/SwapperBase.sol";contract MockChaiIntegratee is MockToken, SwapperBase {address private immutable CENTRALIZED_RATE_PROVIDER;address public immutable DAI;constructor(address _dai,address _centralizedRateProvider,uint8 _decimals) public MockToken("Chai", "CHAI", _decimals) {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/IUniswapV2Factory.sol";import "../../../../interfaces/IUniswapV2Router2.sol";import "../utils/AdapterBase.sol";/// @title UniswapV2Adapter Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Adapter for interacting with Uniswap v2contract UniswapV2Adapter is AdapterBase {using SafeMath for uint256;address private immutable FACTORY;address private immutable ROUTER;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @title UniswapV2Router2 Interface/// @author Enzyme Council <security@enzyme.finance>/// @dev Minimal interface for our interactions with Uniswap V2's Router2interface IUniswapV2Router2 {function addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "../../../../interfaces/IMakerDaoPot.sol";import "../IDerivativePriceFeed.sol";/// @title ChaiPriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Price source oracle for Chaicontract ChaiPriceFeed is IDerivativePriceFeed {using SafeMath for uint256;uint256 private constant CHI_DIVISOR = 10**27;address private immutable CHAI;address private immutable DAI;
12345678910111213141516171819202122// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;/// @notice Limited interface for Maker DSR's Pot contract/// @dev See DSR integration guide: https://github.com/makerdao/developerguides/blob/master/dai/dsr-integration-guide/dsr-integration-guide-01.mdinterface IMakerDaoPot {function chi() external view returns (uint256);function rho() external view returns (uint256);function drip() external returns (uint256);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";import "./FeeBase.sol";/// @title EntranceRateFeeBase Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Calculates a fee based on a rate to be charged to an investor upon entering a fundabstract contract EntranceRateFeeBase is FeeBase {using SafeMath for uint256;event FundSettingsAdded(address indexed comptrollerProxy, uint256 rate);event Settled(address indexed comptrollerProxy, address indexed payer, uint256 sharesQuantity);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./utils/EntranceRateFeeBase.sol";/// @title EntranceRateDirectFee Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice An EntranceRateFee that transfers the fee shares to the fund managercontract EntranceRateDirectFee is EntranceRateFeeBase {constructor(address _feeManager)publicEntranceRateFeeBase(_feeManager, IFeeManager.SettlementType.Direct){}/// @notice Provides a constant string identifier for a fee/// @return identifier_ The identifier string
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "./utils/EntranceRateFeeBase.sol";/// @title EntranceRateBurnFee Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice An EntranceRateFee that burns the fee sharescontract EntranceRateBurnFee is EntranceRateFeeBase {constructor(address _feeManager)publicEntranceRateFeeBase(_feeManager, IFeeManager.SettlementType.Burn){}/// @notice Provides a constant string identifier for a fee/// @return identifier_ The identifier string
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "@openzeppelin/contracts/math/SafeMath.sol";contract MockChaiPriceSource {using SafeMath for uint256;uint256 private chiStored = 10**27;uint256 private rhoStored = now;function drip() external returns (uint256) {require(now >= rhoStored, "drip: invalid now");rhoStored = now;chiStored = chiStored.mul(99).div(100);return chi();
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../utils/SwapperBase.sol";contract MockGenericIntegratee is SwapperBase {function swap(address[] calldata _assetsToIntegratee,uint256[] calldata _assetsToIntegrateeAmounts,address[] calldata _assetsFromIntegratee,uint256[] calldata _assetsFromIntegrateeAmounts) external payable {__swap(msg.sender,_assetsToIntegratee,_assetsToIntegrateeAmounts,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: GPL-3.0/*This file is part of the Enzyme Protocol.(c) Enzyme Council <council@enzyme.finance>For the full license information, please view the LICENSEfile that was distributed with this source code.*/pragma solidity 0.6.12;import "../../utils/DispatcherOwnerMixin.sol";import "./IAggregatedDerivativePriceFeed.sol";/// @title AggregatedDerivativePriceFeed Contract/// @author Enzyme Council <security@enzyme.finance>/// @notice Aggregates multiple derivative price feeds (e.g., Compound, Chai) and dispatches/// rate requests to the appropriate feedcontract AggregatedDerivativePriceFeed is IAggregatedDerivativePriceFeed, DispatcherOwnerMixin {event DerivativeAdded(address indexed derivative, address priceFeed);event DerivativeRemoved(address indexed derivative);event DerivativeUpdated(
123456789101112131415161718192021{"optimizer": {"enabled": true,"runs": 200,"details": {"yul": false}},"outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","abi"]}},"metadata": {"useLiteralContent": true}}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"bytes","name":"_constructData","type":"bytes"},{"internalType":"address","name":"_vaultLib","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}]
Deployed Bytecode
0x60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc543660008037600080366000846127105a03f43d806000803e818015604957816000f35b816000fdfea2646970667358221220bbf55cdae3dc46d2a5e7b99766dd55ccf780257e97c67bd8075873f6748a939264736f6c634300060c0033
Deployed Bytecode Sourcemap
880:1585:41:-:0;;;1835:66;1812:103;1951:14;1946:3;1941;1928:38;2162:1;2143;2111:14;2090:3;2059:13;2035:5;2028;2024:17;1994:183;2203:16;2253:5;2250:1;2247;2232:27;2279:7;2303:63;;;;2423:5;2420:1;2413:16;2303:63;2342:5;2339:1;2332:16
Swarm Source
ipfs://bbf55cdae3dc46d2a5e7b99766dd55ccf780257e97c67bd8075873f6748a9392
Loading...
Loading
Loading...
Loading
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.