Verified contractExactGPL-3.0
VaultProxy
Address0xfe68d7e5903f98a79b2d649cd0548a02e8ebdd67
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.6.12
- Same code
1,548 more contracts
Details
- Compiler
- solc 0.6.12+commit.27d51765
- Language
- solidity
- Optimization
- No
- EVM version
- istanbul
- License
- GPL-3.0
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 22,705,131
- Creation transaction
- 0x94ad6f5b04…bc02c6d48e
- Proxy implementation
- 0x891dee04…33468a38VaultLib
- Main copy (most transactions)
- 0x4819ac09…31fa6ab6
138 files
The source code is large: one file is shown at a time. Choose a file in the list.
- contracts/persistent/vault/VaultProxy.solmain2.47 KB
- @openzeppelin/contracts/GSN/Context.sol933 B
- @openzeppelin/contracts/access/Ownable.sol2.23 KB
- @openzeppelin/contracts/math/SafeMath.sol5.2 KB
- @openzeppelin/contracts/math/SignedSafeMath.sol2.66 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol10.79 KB
- @openzeppelin/contracts/token/ERC20/ERC20Burnable.sol1.17 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.7 KB
- @openzeppelin/contracts/token/ERC20/SafeERC20.sol3.71 KB
- @openzeppelin/contracts/utils/Address.sol5.88 KB
- @openzeppelin/contracts/utils/EnumerableSet.sol7.79 KB
- contracts/mocks/MockVaultLib.sol905 B
- contracts/mocks/adapters/MockGenericAdapter.sol6.22 KB
- contracts/mocks/integratees/MockChaiIntegratee.sol2.12 KB
- contracts/mocks/integratees/MockGenericIntegratee.sol1.32 KB
- contracts/mocks/integratees/MockKyberIntegratee.sol3.86 KB
- contracts/mocks/integratees/MockParaSwapIntegratee.sol3.93 KB
- contracts/mocks/integratees/MockSynthetixIntegratee.sol5.8 KB
- contracts/mocks/integratees/MockUniswapV2Integratee.sol9.59 KB
- contracts/mocks/integratees/compound/MockCEtherIntegratee.sol1.26 KB
- contracts/mocks/integratees/compound/MockCTokenBase.sol3.74 KB
- contracts/mocks/integratees/compound/MockCTokenIntegratee.sol1.39 KB
- contracts/mocks/integratees/utils/MockIntegrateeBase.sol1.6 KB
- contracts/mocks/integratees/utils/SimpleMockIntegrateeBase.sol1.13 KB
- contracts/mocks/prices/CentralizedRateProvider.sol8.27 KB
- contracts/mocks/prices/MockChaiPriceSource.sol925 B
- contracts/mocks/prices/MockChainlinkPriceSource.sol1.25 KB
- contracts/mocks/prices/MockSynthetixPriceSource.sol4.03 KB
- contracts/mocks/prices/MockUniswapV2PriceSource.sol1.92 KB
- contracts/mocks/tokens/MockReentrancyToken.sol1.58 KB
- contracts/mocks/tokens/MockSynthetixToken.sol2.02 KB
- contracts/mocks/tokens/MockToken.sol913 B
- contracts/mocks/utils/EthConstantMixin.sol405 B
- contracts/mocks/utils/NormalizedRateProviderBase.sol1.67 KB
- contracts/mocks/utils/RateProviderBase.sol2.2 KB
- contracts/mocks/utils/SwapperBase.sol2.87 KB
- contracts/persistent/dispatcher/Dispatcher.sol24.68 KB
- contracts/persistent/dispatcher/IDispatcher.sol2.57 KB
- contracts/persistent/utils/IMigratableVault.sol751 B
- contracts/persistent/utils/IMigrationHookHandler.sol904 B
- contracts/persistent/vault/VaultLibBase1.sol979 B
- contracts/persistent/vault/VaultLibBaseCore.sol4.68 KB
- contracts/persistent/vault/utils/ProxiableVaultLib.sol1.75 KB
- contracts/persistent/vault/utils/SharesTokenBase.sol5.38 KB
- contracts/persistent/vault/utils/VaultLibSafeMath.sol2.13 KB
- contracts/release/core/fund-deployer/FundDeployer.sol19.78 KB
- contracts/release/core/fund-deployer/IFundDeployer.sol658 B
- contracts/release/core/fund/comptroller/ComptrollerLib.sol39.06 KB
- contracts/release/core/fund/comptroller/ComptrollerProxy.sol648 B
- contracts/release/core/fund/comptroller/IComptroller.sol1.26 KB
- contracts/release/core/fund/vault/IVault.sol1.29 KB
- contracts/release/core/fund/vault/VaultLib.sol8.88 KB
- contracts/release/extensions/IExtension.sol755 B
- contracts/release/extensions/fee-manager/FeeManager.sol21.61 KB
- contracts/release/extensions/fee-manager/IFee.sol1.67 KB
- contracts/release/extensions/fee-manager/IFeeManager.sol901 B
- contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol907 B
- contracts/release/extensions/fee-manager/fees/EntranceRateDirectFee.sol939 B
- contracts/release/extensions/fee-manager/fees/ManagementFee.sol7.02 KB
- contracts/release/extensions/fee-manager/fees/PerformanceFee.sol19.69 KB
- contracts/release/extensions/fee-manager/fees/utils/EntranceRateFeeBase.sol4.93 KB
- contracts/release/extensions/fee-manager/fees/utils/FeeBase.sol3.05 KB
- contracts/release/extensions/integration-manager/IIntegrationManager.sol522 B
- contracts/release/extensions/integration-manager/IntegrationManager.sol33.88 KB
- contracts/release/extensions/integration-manager/integrations/IIntegrationAdapter.sol989 B
- contracts/release/extensions/integration-manager/integrations/adapters/ChaiAdapter.sol5.83 KB
- contracts/release/extensions/integration-manager/integrations/adapters/CompoundAdapter.sol7.45 KB
- contracts/release/extensions/integration-manager/integrations/adapters/KyberAdapter.sol7.45 KB
- contracts/release/extensions/integration-manager/integrations/adapters/ParaSwapAdapter.sol10.75 KB
- contracts/release/extensions/integration-manager/integrations/adapters/SynthetixAdapter.sol5.95 KB
- contracts/release/extensions/integration-manager/integrations/adapters/TrackedAssetsAdapter.sol3.19 KB
- contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2Adapter.sol12.38 KB
- contracts/release/extensions/integration-manager/integrations/adapters/ZeroExV2Adapter.sol13.77 KB
- contracts/release/extensions/integration-manager/integrations/utils/AdapterBase.sol4.57 KB
- contracts/release/extensions/integration-manager/integrations/utils/IntegrationSelectors.sol1.03 KB
- contracts/release/extensions/policy-manager/IPolicy.sol1.18 KB
- contracts/release/extensions/policy-manager/IPolicyManager.sol768 B
- contracts/release/extensions/policy-manager/PolicyManager.sol13.63 KB
- contracts/release/extensions/policy-manager/policies/buy-shares/BuySharesCallerWhitelist.sol3.66 KB
- contracts/release/extensions/policy-manager/policies/buy-shares/InvestorWhitelist.sol3.63 KB
- contracts/release/extensions/policy-manager/policies/buy-shares/MinMaxInvestment.sol5.39 KB
- contracts/release/extensions/policy-manager/policies/buy-shares/utils/BuySharesSetupPolicyBase.sol1.38 KB
- contracts/release/extensions/policy-manager/policies/buy-shares/utils/PreBuySharesValidatePolicyBase.sol1.41 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/AdapterBlacklist.sol2.5 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/AdapterWhitelist.sol2.5 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/AssetBlacklist.sol3.62 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/AssetWhitelist.sol3.66 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/GuaranteedRedemption.sol10.31 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/MaxConcentration.sol7 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/utils/PostCallOnIntegrationValidatePolicyBase.sol1.67 KB
- contracts/release/extensions/policy-manager/policies/call-on-integration/utils/PreCallOnIntegrationValidatePolicyBase.sol1.34 KB
- contracts/release/extensions/policy-manager/policies/utils/AddressListPolicyMixin.sol2.99 KB
- contracts/release/extensions/policy-manager/policies/utils/PolicyBase.sol1.68 KB
- contracts/release/extensions/utils/ExtensionBase.sol3.17 KB
- contracts/release/extensions/utils/FundDeployerOwnerMixin.sol1.49 KB
- contracts/release/extensions/utils/PermissionedVaultActionMixin.sol4.42 KB
- contracts/release/infrastructure/price-feeds/derivatives/AggregatedDerivativePriceFeed.sol6.82 KB
- contracts/release/infrastructure/price-feeds/derivatives/IAggregatedDerivativePriceFeed.sol563 B
- contracts/release/infrastructure/price-feeds/derivatives/IDerivativePriceFeed.sol683 B
- contracts/release/infrastructure/price-feeds/derivatives/feeds/ChaiPriceFeed.sol2.96 KB
- contracts/release/infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol4 KB
- contracts/release/infrastructure/price-feeds/derivatives/feeds/SynthetixPriceFeed.sol6.81 KB
- contracts/release/infrastructure/price-feeds/derivatives/feeds/UniswapV2PoolPriceFeed.sol10.62 KB
- contracts/release/infrastructure/price-feeds/derivatives/feeds/WdgldPriceFeed.sol4.72 KB
- contracts/release/infrastructure/price-feeds/primitives/ChainlinkPriceFeed.sol19.13 KB
- contracts/release/infrastructure/price-feeds/primitives/IPrimitivePriceFeed.sol778 B
- contracts/release/infrastructure/price-feeds/utils/UniswapV2PoolTokenValueCalculator.sol7.22 KB
- contracts/release/infrastructure/utils/DispatcherOwnerMixin.sol1.45 KB
- contracts/release/infrastructure/value-interpreter/IValueInterpreter.sol1.01 KB
- contracts/release/infrastructure/value-interpreter/ValueInterpreter.sol8.41 KB
- contracts/release/interfaces/ICERC20.sol822 B
- contracts/release/interfaces/ICEther.sol490 B
- contracts/release/interfaces/IChai.sol614 B
- contracts/release/interfaces/IChainlinkAggregator.sol535 B
- contracts/release/interfaces/IKyberNetworkProxy.sol681 B
- contracts/release/interfaces/IMakerDaoPot.sol666 B
- contracts/release/interfaces/IParaSwapAugustusSwapper.sol929 B
- contracts/release/interfaces/ISynthetix.sol568 B
- contracts/release/interfaces/ISynthetixAddressResolver.sol513 B
- contracts/release/interfaces/ISynthetixExchangeRates.sol492 B
- contracts/release/interfaces/ISynthetixExchanger.sol768 B
- contracts/release/interfaces/ISynthetixProxyERC20.sol465 B
- contracts/release/interfaces/ISynthetixSynth.sol460 B
- contracts/release/interfaces/IUniswapV2Factory.sol621 B
- contracts/release/interfaces/IUniswapV2Pair.sol860 B
- contracts/release/interfaces/IUniswapV2Router2.sol1.12 KB
- contracts/release/interfaces/IWETH.sol462 B
- contracts/release/interfaces/IZeroExV2.sol1.87 KB
- contracts/release/peripheral/FundActionsWrapper.sol4.58 KB
- contracts/release/peripheral/shares-requestors/AuthUserExecutedSharesRequestorFactory.sol4.59 KB
- contracts/release/peripheral/shares-requestors/AuthUserExecutedSharesRequestorLib.sol12.05 KB
- contracts/release/peripheral/shares-requestors/AuthUserExecutedSharesRequestorProxy.sol551 B
- contracts/release/peripheral/shares-requestors/IAuthUserExecutedSharesRequestor.sol471 B
- contracts/release/utils/AddressArrayLib.sol2.61 KB
- contracts/release/utils/AssetFinalityResolver.sol2.66 KB
- contracts/release/utils/MakerDaoMath.sol2.32 KB
- contracts/release/utils/MathHelpers.sol1.4 KB
- contracts/release/utils/Proxy.sol1.94 KB
contracts/mocks/prices/MockSynthetixPriceSource.sol
// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <[email protected]>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@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;
mapping(bytes32 => uint256) private fixedRate;
mapping(bytes32 => AggregatorInfo) private currencyKeyToAggregator;
enum RateAsset {ETH, USD}
struct AggregatorInfo {
address aggregator;
RateAsset rateAsset;
}
constructor(address _ethUsdAggregator) public {
currencyKeyToAggregator[bytes32("ETH")] = AggregatorInfo({
aggregator: _ethUsdAggregator,
rateAsset: RateAsset.USD
});
}
function setPriceSourcesForCurrencyKeys(
bytes32[] calldata _currencyKeys,
address[] calldata _aggregators,
RateAsset[] calldata _rateAssets
) external onlyOwner {
require(
_currencyKeys.length == _aggregators.length &&
_rateAssets.length == _aggregators.length
);
for (uint256 i = 0; i < _currencyKeys.length; i++) {
currencyKeyToAggregator[_currencyKeys[i]] = AggregatorInfo({
aggregator: _aggregators[i],
rateAsset: _rateAssets[i]
});
}
}
function setRate(bytes32 _currencyKey, uint256 _rate) external onlyOwner {
fixedRate[_currencyKey] = _rate;
}
/// @dev Calculates the rate from a currencty key against its RateAsset
/// TODO: Use CentralizedRateProvider to randomize and make consistent with the rest
function rateAndInvalid(bytes32 _currencyKey)
external
view
override
returns (uint256 rate_, bool isInvalid_)
{
uint256 storedRate = getFixedRate(_currencyKey);
if (storedRate != 0) {
rate_ = storedRate;
} else {
AggregatorInfo memory aggregatorInfo = getAggregatorFromCurrencyKey(_currencyKey);
address aggregator = aggregatorInfo.aggregator;
if (aggregator != address(0)) {
uint256 decimals = MockChainlinkPriceSource(aggregator).decimals();
rate_ = uint256(MockChainlinkPriceSource(aggregator).latestAnswer()).mul(
10**(uint256(18).sub(decimals))
);
if (aggregatorInfo.rateAsset == RateAsset.ETH) {
uint256 ethToUsd = uint256(
MockChainlinkPriceSource(
getAggregatorFromCurrencyKey(bytes32("ETH"))
.aggregator
)
.latestAnswer()
);
rate_ = rate_.mul(ethToUsd).div(10**8);
}
}
}
isInvalid_ = (rate_ == 0);
return (rate_, isInvalid_);
}
///////////////////
// STATE GETTERS //
///////////////////
function getAggregatorFromCurrencyKey(bytes32 _currencyKey)
public
view
returns (AggregatorInfo memory _aggregator)
{
return currencyKeyToAggregator[_currencyKey];
}
function getFixedRate(bytes32 _currencyKey) public view returns (uint256) {
return fixedRate[_currencyKey];
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"libraries": {},
"optimizer": {
"runs": 200,
"details": {
"cse": true,
"yul": false,
"peephole": true,
"deduplicate": true,
"orderLiterals": true,
"jumpdestRemover": true,
"constantOptimizer": true
}
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.