Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
OracleLUSD3CRVEURChainlink
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.17; import "borrow/oracle/BaseOracleChainlinkMulti.sol"; import "../../../interfaces/external/curve/ITricryptoPool.sol"; import "../../../interfaces/external/curve/ICurveCryptoSwapPool.sol"; /// @title OracleLUSD3CRVEURChainlink /// @author Angle Labs, Inc. /// @notice Gives the price of Curve LUSD-3CRV in Euro in base 18 contract OracleLUSD3CRVEURChainlink is BaseOracleChainlinkMulti { string public constant DESCRIPTION = "LUSD3CRV/EUR Oracle"; ITricryptoPool public constant LUSD_3CRV_POOL = ITricryptoPool(0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA); ICurveCryptoSwapPool public constant USDBP = ICurveCryptoSwapPool(0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7); constructor(uint32 _stalePeriod, address _treasury) BaseOracleChainlinkMulti(_stalePeriod, _treasury) {} function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) { AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](5); // Chainlink DAI/USD address _circuitChainlink[0] = AggregatorV3Interface(0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9); // Chainlink USDC/USD address _circuitChainlink[1] = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6); // Chainlink USDT/USD address _circuitChainlink[2] = AggregatorV3Interface(0x3E7d1eAB13ad0104d2750B8863b489D65364e32D); // Chainlink LUSD/USD address _circuitChainlink[3] = AggregatorV3Interface(0x3D7aE7E594f2f2091Ad8798313450130d0Aba3a0); // Chainlink EUR/USD address _circuitChainlink[4] = AggregatorV3Interface(0xb49f677943BC038e9857d61E7d053CaA2C1734C1); return _circuitChainlink; } /// @inheritdoc IOracle function read() external view override returns (uint256 quoteAmount) { quoteAmount = _readChainlinkFeed(_lpPrice(), circuitChainlink()[4], 0, 0); } /// @notice Gets the global LP token price function _lpPrice() internal view returns (uint256 lpMetaPrice) { uint256 lp3CRVPrice = _lpPriceBase(); lpMetaPrice = _lpPriceMeta(lp3CRVPrice); } /// @notice Gets the meta LP token price function _lpPriceMeta(uint256 lower3CRVPrice) internal view returns (uint256 quoteAmount) { AggregatorV3Interface[] memory _circuitChainlink = circuitChainlink(); // We use 0 decimals when reading fees through `readChainlinkFeed` since all feeds have 8 decimals // and the virtual price of the Curve pool is given in 18 decimals, just like the amount of decimals // of the LUSD3CRV token uint256 lusdPrice = _readChainlinkFeed(1, _circuitChainlink[3], 1, 0); // Picking the minimum price between LUSD and 3CRV price, multiplying it by the pool's virtual price lusdPrice = lusdPrice >= lower3CRVPrice ? lower3CRVPrice : lusdPrice; quoteAmount = (LUSD_3CRV_POOL.get_virtual_price() * lusdPrice); } /// @notice Get the underlying LP token price function _lpPriceBase() internal view returns (uint256 quoteAmount) { AggregatorV3Interface[] memory _circuitChainlink = circuitChainlink(); uint256 daiPrice = _readChainlinkFeed(1, _circuitChainlink[0], 1, 0); uint256 usdcPrice = _readChainlinkFeed(1, _circuitChainlink[1], 1, 0); uint256 usdtPrice = _readChainlinkFeed(1, _circuitChainlink[2], 1, 0); // Picking the minimum price between DAI, USDC and USDT, multiplying it by the pool's virtual price usdcPrice = usdcPrice >= daiPrice ? (daiPrice >= usdtPrice ? usdtPrice : daiPrice) : usdcPrice >= usdtPrice ? usdtPrice : usdcPrice; quoteAmount = (USDBP.get_virtual_price() * usdcPrice) / 10**18; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; //solhint-disable interface ICurveCryptoSwapPool is IERC20 { function A() external view returns (uint256); function get_virtual_price() external view returns (uint256); function calc_token_fee(uint256[3] memory amounts, uint256[3] memory xp) external view returns (uint256); function calc_token_amount(uint256[3] memory amounts, bool deposit) external view returns (uint256); function add_liquidity(uint256[3] memory amounts, uint256 min_mint_amount) external; function get_dy( int128 i, int128 j, uint256 dx ) external view returns (uint256); function exchange( int128 i, int128 j, uint256 dx, uint256 min_dy ) external; function remove_liquidity(uint256 _amount, uint256[3] memory min_amounts) external; function remove_liquidity_imbalance(uint256[3] memory amounts, uint256 max_burn_amount) external; function calc_withdraw_one_coin(uint256 _token_amount, int128 i) external view returns (uint256); function remove_liquidity_one_coin( uint256 _token_amount, int128 i, uint256 min_amount ) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; //solhint-disable interface ITricryptoPool is IERC20 { function A() external view returns (uint256); function gamma() external view returns (uint256); function get_virtual_price() external view returns (uint256); function price_oracle(uint256 k) external view returns (uint256); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; /// @title IAgToken /// @author Angle Labs, Inc. /// @notice Interface for the stablecoins `AgToken` contracts /// @dev This interface only contains functions of the `AgToken` contract which are called by other contracts /// of this module or of the first module of the Angle Protocol interface IAgToken is IERC20Upgradeable { // ======================= Minter Role Only Functions =========================== /// @notice Lets the `StableMaster` contract or another whitelisted contract mint agTokens /// @param account Address to mint to /// @param amount Amount to mint /// @dev The contracts allowed to issue agTokens are the `StableMaster` contract, `VaultManager` contracts /// associated to this stablecoin as well as the flash loan module (if activated) and potentially contracts /// whitelisted by governance function mint(address account, uint256 amount) external; /// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender` /// @param amount Amount of tokens to burn /// @param burner Address to burn from /// @param sender Address which requested the burn from `burner` /// @dev This method is to be called by a contract with the minter right after being requested /// to do so by a `sender` address willing to burn tokens from another `burner` address /// @dev The method checks the allowance between the `sender` and the `burner` function burnFrom( uint256 amount, address burner, address sender ) external; /// @notice Burns `amount` tokens from a `burner` address /// @param amount Amount of tokens to burn /// @param burner Address to burn from /// @dev This method is to be called by a contract with a minter right on the AgToken after being /// requested to do so by an address willing to burn tokens from its address function burnSelf(uint256 amount, address burner) external; // ========================= Treasury Only Functions =========================== /// @notice Adds a minter in the contract /// @param minter Minter address to add /// @dev Zero address checks are performed directly in the `Treasury` contract function addMinter(address minter) external; /// @notice Removes a minter from the contract /// @param minter Minter address to remove /// @dev This function can also be called by a minter wishing to revoke itself function removeMinter(address minter) external; /// @notice Sets a new treasury contract /// @param _treasury New treasury address function setTreasury(address _treasury) external; // ========================= External functions ================================ /// @notice Checks whether an address has the right to mint agTokens /// @param minter Address for which the minting right should be checked /// @return Whether the address has the right to mint agTokens or not function isMinter(address minter) external view returns (bool); /// @notice Get the associated treasury function treasury() external view returns (address); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /// @title ICoreBorrow /// @author Angle Labs, Inc. /// @notice Interface for the `CoreBorrow` contract /// @dev This interface only contains functions of the `CoreBorrow` contract which are called by other contracts /// of this module interface ICoreBorrow { /// @notice Checks if an address corresponds to a treasury of a stablecoin with a flash loan /// module initialized on it /// @param treasury Address to check /// @return Whether the address has the `FLASHLOANER_TREASURY_ROLE` or not function isFlashLoanerTreasury(address treasury) external view returns (bool); /// @notice Checks whether an address is governor of the Angle Protocol or not /// @param admin Address to check /// @return Whether the address has the `GOVERNOR_ROLE` or not function isGovernor(address admin) external view returns (bool); /// @notice Checks whether an address is governor or a guardian of the Angle Protocol or not /// @param admin Address to check /// @return Whether the address has the `GUARDIAN_ROLE` or not /// @dev Governance should make sure when adding a governor to also give this governor the guardian /// role by calling the `addGovernor` function function isGovernorOrGuardian(address admin) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "./IAgToken.sol"; import "./ICoreBorrow.sol"; /// @title IFlashAngle /// @author Angle Labs, Inc. /// @notice Interface for the `FlashAngle` contract /// @dev This interface only contains functions of the contract which are called by other contracts /// of this module interface IFlashAngle { /// @notice Reference to the `CoreBorrow` contract managing the FlashLoan module function core() external view returns (ICoreBorrow); /// @notice Sends the fees taken from flash loans to the treasury contract associated to the stablecoin /// @param stablecoin Stablecoin from which profits should be sent /// @return balance Amount of profits sent /// @dev This function can only be called by the treasury contract function accrueInterestToTreasury(IAgToken stablecoin) external returns (uint256 balance); /// @notice Adds support for a stablecoin /// @param _treasury Treasury associated to the stablecoin to add support for /// @dev This function can only be called by the `CoreBorrow` contract function addStablecoinSupport(address _treasury) external; /// @notice Removes support for a stablecoin /// @param _treasury Treasury associated to the stablecoin to remove support for /// @dev This function can only be called by the `CoreBorrow` contract function removeStablecoinSupport(address _treasury) external; /// @notice Sets a new core contract /// @param _core Core contract address to set /// @dev This function can only be called by the `CoreBorrow` contract function setCore(address _core) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "./ITreasury.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; /// @title IOracle /// @author Angle Labs, Inc. /// @notice Interface for the `Oracle` contract /// @dev This interface only contains functions of the contract which are called by other contracts /// of this module interface IOracle { /// @notice Reads the rate from the Chainlink circuit and other data provided /// @return quoteAmount The current rate between the in-currency and out-currency in the base /// of the out currency /// @dev For instance if the out currency is EUR (and hence agEUR), then the base of the returned /// value is 10**18 function read() external view returns (uint256); /// @notice Changes the treasury contract /// @param _treasury Address of the new treasury contract /// @dev This function can be called by an approved `VaultManager` contract which can call /// this function after being requested to do so by a `treasury` contract /// @dev In some situations (like reactor contracts), the `VaultManager` may not directly be linked /// to the `oracle` contract and as such we may need governors to be able to call this function as well function setTreasury(address _treasury) external; /// @notice Reference to the `treasury` contract handling this `VaultManager` function treasury() external view returns (ITreasury treasury); /// @notice Array with the list of Chainlink feeds in the order in which they are read function circuitChainlink() external view returns (AggregatorV3Interface[] memory); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "./IAgToken.sol"; import "./ICoreBorrow.sol"; import "./IFlashAngle.sol"; /// @title ITreasury /// @author Angle Labs, Inc. /// @notice Interface for the `Treasury` contract /// @dev This interface only contains functions of the `Treasury` which are called by other contracts /// of this module interface ITreasury { /// @notice Stablecoin handled by this `treasury` contract function stablecoin() external view returns (IAgToken); /// @notice Checks whether a given address has the governor role /// @param admin Address to check /// @return Whether the address has the governor role /// @dev Access control is only kept in the `CoreBorrow` contract function isGovernor(address admin) external view returns (bool); /// @notice Checks whether a given address has the guardian or the governor role /// @param admin Address to check /// @return Whether the address has the guardian or the governor role /// @dev Access control is only kept in the `CoreBorrow` contract which means that this function /// queries the `CoreBorrow` contract function isGovernorOrGuardian(address admin) external view returns (bool); /// @notice Checks whether a given address has well been initialized in this contract /// as a `VaultManager` /// @param _vaultManager Address to check /// @return Whether the address has been initialized or not function isVaultManager(address _vaultManager) external view returns (bool); /// @notice Sets a new flash loan module for this stablecoin /// @param _flashLoanModule Reference to the new flash loan module /// @dev This function removes the minting right to the old flash loan module and grants /// it to the new module function setFlashLoanModule(address _flashLoanModule) external; }
// SPDX-License-Identifier: GPL-3.0 /* * █ ***** ▓▓▓ * ▓▓▓▓▓▓▓ * ///. ▓▓▓▓▓▓▓▓▓▓▓▓▓ ***** //////// ▓▓▓▓▓▓▓ * ///////////// ▓▓▓ ▓▓ ////////////////// █ ▓▓ ▓▓ ▓▓ /////////////////////// ▓▓ ▓▓ ▓▓ ▓▓ //////////////////////////// ▓▓ ▓▓ ▓▓ ▓▓ /////////▓▓▓///////▓▓▓///////// ▓▓ ▓▓ ▓▓ ,////////////////////////////////////// ▓▓ ▓▓ ▓▓ ////////////////////////////////////////// ▓▓ ▓▓ //////////////////////▓▓▓▓///////////////////// ,//////////////////////////////////////////////////// .////////////////////////////////////////////////////////// .//////////////////////////██.,//////////////////////////█ .//////////////////////████..,./////////////////////██ ...////////////////███████.....,.////////////////███ ,.,////////////████████ ........,///////////████ .,.,//////█████████ ,.......///////████ ,..//████████ ........./████ ..,██████ .....,███ .██ ,.,█ ▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓ ▓▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓▓▓▓ ▓▓▓ ▓▓ ▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ */ pragma solidity ^0.8.12; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "../interfaces/IOracle.sol"; import "../interfaces/ITreasury.sol"; /// @title BaseOracleChainlinkMulti /// @author Angle Labs, Inc. /// @notice Base Contract to be overriden by all contracts of the protocol /// @dev This base contract concerns an oracle that uses Chainlink with multiple pools to read from /// @dev All gas-efficient implementation of the `OracleChainlinkMulti` contract should inherit from this abstract contract BaseOracleChainlinkMulti is IOracle { // ========================= Parameters and References ========================= /// @inheritdoc IOracle ITreasury public override treasury; /// @notice Represent the maximum amount of time (in seconds) between each Chainlink update /// before the price feed is considered stale uint32 public stalePeriod; // =================================== Event =================================== event StalePeriodUpdated(uint32 _stalePeriod); // =================================== Errors =================================== error InvalidChainlinkRate(); error NotGovernorOrGuardian(); error NotVaultManagerOrGovernor(); /// @notice Constructor for an oracle using Chainlink with multiple pools to read from /// @param _stalePeriod Minimum feed update frequency for the oracle to not revert /// @param _treasury Treasury associated to the VaultManager which reads from this feed constructor(uint32 _stalePeriod, address _treasury) { stalePeriod = _stalePeriod; treasury = ITreasury(_treasury); } // ============================= Reading Oracles =============================== /// @inheritdoc IOracle function read() external view virtual override returns (uint256 quoteAmount); /// @inheritdoc IOracle function circuitChainlink() public view virtual returns (AggregatorV3Interface[] memory); /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to /// the out-currency /// @param quoteAmount The amount for which to compute the price expressed with base decimal /// @param feed Chainlink feed to query /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided /// to the `quoteAmount` /// @param decimals Number of decimals of the corresponding Chainlink pair /// @return The `quoteAmount` converted in out-currency function _readChainlinkFeed( uint256 quoteAmount, AggregatorV3Interface feed, uint8 multiplied, uint256 decimals ) internal view returns (uint256) { (uint80 roundId, int256 ratio, , uint256 updatedAt, uint80 answeredInRound) = feed.latestRoundData(); if (ratio <= 0 || roundId > answeredInRound || block.timestamp - updatedAt > stalePeriod) revert InvalidChainlinkRate(); uint256 castedRatio = uint256(ratio); // Checking whether we should multiply or divide by the ratio computed if (multiplied == 1) return (quoteAmount * castedRatio) / (10**decimals); else return (quoteAmount * (10**decimals)) / castedRatio; } // ======================= Governance Related Functions ======================== /// @notice Changes the stale period /// @param _stalePeriod New stale period (in seconds) function changeStalePeriod(uint32 _stalePeriod) external { if (!treasury.isGovernorOrGuardian(msg.sender)) revert NotGovernorOrGuardian(); stalePeriod = _stalePeriod; emit StalePeriodUpdated(_stalePeriod); } /// @inheritdoc IOracle function setTreasury(address _treasury) external override { if (!treasury.isVaultManager(msg.sender) && !treasury.isGovernor(msg.sender)) revert NotVaultManagerOrGovernor(); treasury = ITreasury(_treasury); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns ( uint8 ); function description() external view returns ( string memory ); function version() external view returns ( uint256 ); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData( uint80 _roundId ) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
{ "remappings": [ "@chainlink/=node_modules/@chainlink/", "@ensdomains/=lib/borrow-contracts/node_modules/@ensdomains/", "@openzeppelin/=node_modules/@openzeppelin/", "@uniswap/=lib/borrow-contracts/node_modules/@uniswap/", "borrow-contracts/=lib/borrow-contracts/", "borrow/=lib/borrow-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat-deploy/=node_modules/hardhat-deploy/", "hardhat/=node_modules/hardhat/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint32","name":"_stalePeriod","type":"uint32"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidChainlinkRate","type":"error"},{"inputs":[],"name":"NotGovernorOrGuardian","type":"error"},{"inputs":[],"name":"NotVaultManagerOrGovernor","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"_stalePeriod","type":"uint32"}],"name":"StalePeriodUpdated","type":"event"},{"inputs":[],"name":"DESCRIPTION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LUSD_3CRV_POOL","outputs":[{"internalType":"contract ITricryptoPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDBP","outputs":[{"internalType":"contract ICurveCryptoSwapPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_stalePeriod","type":"uint32"}],"name":"changeStalePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"circuitChainlink","outputs":[{"internalType":"contract AggregatorV3Interface[]","name":"","type":"address[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"read","outputs":[{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stalePeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"contract ITreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610f97380380610f9783398101604081905261002f91610071565b600080546001600160c01b031916600160a01b63ffffffff94909416939093026001600160a01b031916929092176001600160a01b03919091161790556100c0565b6000806040838503121561008457600080fd5b825163ffffffff8116811461009857600080fd5b60208401519092506001600160a01b03811681146100b557600080fd5b809150509250929050565b610ec8806100cf6000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063630914d111610076578063a5b36a361161005b578063a5b36a3614610168578063f0f44260146101a5578063f1ae8856146101b857600080fd5b8063630914d1146101385780638531cc9b1461014d57600080fd5b806339fc4bca146100a85780634994cc67146100ed57806357de26a41461010257806361d027b314610118575b600080fd5b6100c373bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100f5610201565b6040516100e49190610aca565b61010a610402565b6040519081526020016100e4565b6000546100c39073ffffffffffffffffffffffffffffffffffffffff1681565b61014b610146366004610b24565b61043e565b005b6100c373ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6000546101909074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016100e4565b61014b6101b3366004610b51565b610589565b6101f46040518060400160405280601381526020017f4c555344334352562f455552204f7261636c650000000000000000000000000081525081565b6040516100e49190610b87565b60408051600580825260c08201909252606091600091906020820160a08036833701905050905073aed0c38402a5d19df6e4c03f4e2dced6e29c1ee98160008151811061025057610250610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050738fffffd4afb6115b954bd326cbe7b4ba576818f6816001815181106102b2576102b2610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050733e7d1eab13ad0104d2750b8863b489d65364e32d8160028151811061031457610314610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050733d7ae7e594f2f2091ad8798313450130d0aba3a08160038151811061037657610376610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073b49f677943bc038e9857d61e7d053caa2c1734c1816004815181106103d8576103d8610bf3565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152919050565b600061043961040f610735565b610417610201565b60048151811061042957610429610bf3565b6020026020010151600080610751565b905090565b6000546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156104ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d09190610c22565b610506576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f4040b15332969bfd8b2035c1a701c8e13f2b5d62ce89b311684a601b2eb44e019060200160405180910390a150565b6000546040517f676a553e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063676a553e90602401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190610c22565b1580156106b757506000546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b59190610c22565b155b156106ee576040517fb05b9b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000806107406108b7565b905061074b81610a01565b91505090565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156107a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c89190610c63565b9450945050935093506000831315806107f857508069ffffffffffffffffffff168469ffffffffffffffffffff16115b8061082b575060005474010000000000000000000000000000000000000000900463ffffffff166108298342610ce2565b115b15610862576040517fae19356300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260ff88166001036108995761087987600a610e1b565b610883828c610e27565b61088d9190610e3e565b955050505050506108af565b806108a588600a610e1b565b610883908c610e27565b949350505050565b6000806108c2610201565b905060006108ef6001836000815181106108de576108de610bf3565b602002602001015160016000610751565b9050600061090b6001846001815181106108de576108de610bf3565b905060006109276001856002815181106108de576108de610bf3565b905082821015610945578082101561093f5781610955565b80610955565b808310156109535782610955565b805b9150670de0b6b3a76400008273bebc44782c7db0a1a60cb6fe97d0b483032ff1c773ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e49190610e79565b6109ee9190610e27565b6109f89190610e3e565b94505050505090565b600080610a0c610201565b90506000610a286001836003815181106108de576108de610bf3565b905083811015610a385780610a3a565b835b90508073ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac09190610e79565b6108af9190610e27565b6020808252825182820181905260009190848201906040850190845b81811015610b1857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610ae6565b50909695505050505050565b600060208284031215610b3657600080fd5b813563ffffffff81168114610b4a57600080fd5b9392505050565b600060208284031215610b6357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b4a57600080fd5b600060208083528351808285015260005b81811015610bb457858101830151858201604001528201610b98565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215610c3457600080fd5b81518015158114610b4a57600080fd5b805169ffffffffffffffffffff81168114610c5e57600080fd5b919050565b600080600080600060a08688031215610c7b57600080fd5b610c8486610c44565b9450602086015193506040860151925060608601519150610ca760808701610c44565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610cf557610cf5610cb3565b92915050565b600181815b80851115610d5457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610d3a57610d3a610cb3565b80851615610d4757918102915b93841c9390800290610d00565b509250929050565b600082610d6b57506001610cf5565b81610d7857506000610cf5565b8160018114610d8e5760028114610d9857610db4565b6001915050610cf5565b60ff841115610da957610da9610cb3565b50506001821b610cf5565b5060208310610133831016604e8410600b8410161715610dd7575081810a610cf5565b610de18383610cfb565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610e1357610e13610cb3565b029392505050565b6000610b4a8383610d5c565b8082028115828204841417610cf557610cf5610cb3565b600082610e74577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215610e8b57600080fd5b505191905056fea264697066735822122054115330033aba729300ac6391db1260c1882a116349f195692c581a852afe0464736f6c63430008110033000000000000000000000000000000000000000000000000000000000002a3000000000000000000000000008667dbebf68b0bfa6db54f550f41be16c4067d60
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063630914d111610076578063a5b36a361161005b578063a5b36a3614610168578063f0f44260146101a5578063f1ae8856146101b857600080fd5b8063630914d1146101385780638531cc9b1461014d57600080fd5b806339fc4bca146100a85780634994cc67146100ed57806357de26a41461010257806361d027b314610118575b600080fd5b6100c373bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100f5610201565b6040516100e49190610aca565b61010a610402565b6040519081526020016100e4565b6000546100c39073ffffffffffffffffffffffffffffffffffffffff1681565b61014b610146366004610b24565b61043e565b005b6100c373ed279fdd11ca84beef15af5d39bb4d4bee23f0ca81565b6000546101909074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016100e4565b61014b6101b3366004610b51565b610589565b6101f46040518060400160405280601381526020017f4c555344334352562f455552204f7261636c650000000000000000000000000081525081565b6040516100e49190610b87565b60408051600580825260c08201909252606091600091906020820160a08036833701905050905073aed0c38402a5d19df6e4c03f4e2dced6e29c1ee98160008151811061025057610250610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050738fffffd4afb6115b954bd326cbe7b4ba576818f6816001815181106102b2576102b2610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050733e7d1eab13ad0104d2750b8863b489d65364e32d8160028151811061031457610314610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050733d7ae7e594f2f2091ad8798313450130d0aba3a08160038151811061037657610376610bf3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073b49f677943bc038e9857d61e7d053caa2c1734c1816004815181106103d8576103d8610bf3565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152919050565b600061043961040f610735565b610417610201565b60048151811061042957610429610bf3565b6020026020010151600080610751565b905090565b6000546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156104ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d09190610c22565b610506576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f4040b15332969bfd8b2035c1a701c8e13f2b5d62ce89b311684a601b2eb44e019060200160405180910390a150565b6000546040517f676a553e00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063676a553e90602401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190610c22565b1580156106b757506000546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b59190610c22565b155b156106ee576040517fb05b9b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000806107406108b7565b905061074b81610a01565b91505090565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156107a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c89190610c63565b9450945050935093506000831315806107f857508069ffffffffffffffffffff168469ffffffffffffffffffff16115b8061082b575060005474010000000000000000000000000000000000000000900463ffffffff166108298342610ce2565b115b15610862576040517fae19356300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260ff88166001036108995761087987600a610e1b565b610883828c610e27565b61088d9190610e3e565b955050505050506108af565b806108a588600a610e1b565b610883908c610e27565b949350505050565b6000806108c2610201565b905060006108ef6001836000815181106108de576108de610bf3565b602002602001015160016000610751565b9050600061090b6001846001815181106108de576108de610bf3565b905060006109276001856002815181106108de576108de610bf3565b905082821015610945578082101561093f5781610955565b80610955565b808310156109535782610955565b805b9150670de0b6b3a76400008273bebc44782c7db0a1a60cb6fe97d0b483032ff1c773ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e49190610e79565b6109ee9190610e27565b6109f89190610e3e565b94505050505090565b600080610a0c610201565b90506000610a286001836003815181106108de576108de610bf3565b905083811015610a385780610a3a565b835b90508073ed279fdd11ca84beef15af5d39bb4d4bee23f0ca73ffffffffffffffffffffffffffffffffffffffff1663bb7b8b806040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac09190610e79565b6108af9190610e27565b6020808252825182820181905260009190848201906040850190845b81811015610b1857835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610ae6565b50909695505050505050565b600060208284031215610b3657600080fd5b813563ffffffff81168114610b4a57600080fd5b9392505050565b600060208284031215610b6357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610b4a57600080fd5b600060208083528351808285015260005b81811015610bb457858101830151858201604001528201610b98565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215610c3457600080fd5b81518015158114610b4a57600080fd5b805169ffffffffffffffffffff81168114610c5e57600080fd5b919050565b600080600080600060a08688031215610c7b57600080fd5b610c8486610c44565b9450602086015193506040860151925060608601519150610ca760808701610c44565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610cf557610cf5610cb3565b92915050565b600181815b80851115610d5457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610d3a57610d3a610cb3565b80851615610d4757918102915b93841c9390800290610d00565b509250929050565b600082610d6b57506001610cf5565b81610d7857506000610cf5565b8160018114610d8e5760028114610d9857610db4565b6001915050610cf5565b60ff841115610da957610da9610cb3565b50506001821b610cf5565b5060208310610133831016604e8410600b8410161715610dd7575081810a610cf5565b610de18383610cfb565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610e1357610e13610cb3565b029392505050565b6000610b4a8383610d5c565b8082028115828204841417610cf557610cf5610cb3565b600082610e74577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215610e8b57600080fd5b505191905056fea264697066735822122054115330033aba729300ac6391db1260c1882a116349f195692c581a852afe0464736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000002a3000000000000000000000000008667dbebf68b0bfa6db54f550f41be16c4067d60
-----Decoded View---------------
Arg [0] : _stalePeriod (uint32): 172800
Arg [1] : _treasury (address): 0x8667DBEBf68B0BFa6Db54f550f41Be16c4067d60
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000002a300
Arg [1] : 0000000000000000000000008667dbebf68b0bfa6db54f550f41be16c4067d60
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.