Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
PythAggregatorV3EmergencyFeed
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1000 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache 2 pragma solidity 0.8.20; import {PythStructs} from "./PythStructs.sol"; import {IPyth} from "./IPyth.sol"; // This interface is forked from the Zerolend Adapter found here: // https://github.com/zerolend/pyth-oracles/blob/master/contracts/PythAggregatorV3.sol // Original license found under licenses/zerolend-pyth-oracles.md /** * @title A port of the ChainlinkAggregatorV3 interface that supports Pyth price feeds * @notice This does not store any roundId information on-chain. Please review the code before using this implementation. * Users should deploy an instance of this contract to wrap every price feed id that they need to use. * @notice This version was modified by fMoney (Nikar0) to use in the event of a stable wrapper losing peg on-chain vs it's price feed. * This gives the protocol a chance to protect against bad debt and maintain stability in the platform. * Ideal use: Deploy secondary Lender Oracle pointing to the same feeds as primary but replace possibly at risk stable asset's PythAggregator to Emergency version. * In the event of a depeg, switch Oracle to secondary & manually serve on-chain price for affected asset(s) until event is resolved, then switch Oracle back to main. * For security reasons the Emergency version should NOT be the default feed for an asset as admin or guardian could maliciously tank price & cause forced liquidations. * It's a temporary last resort mechanism for a chance to protect the protocol from bad debt and survive in black swan events. */ contract PythAggregatorV3EmergencyFeed { // New events event depegSet(int depegPrice, bool isActive); event AdminSet(address indexed previousAdmin, address indexed newAdmin); event DepegGuardianSet(address indexed previousGuardian, address indexed newGuardian); // New variables address public admin; // Multisig address public depegGuardian; int256 public depegPrice; bool public isActive; bytes32 public priceId; IPyth public pyth; constructor(address _pyth, bytes32 _priceId, address _admin, address _depegGuardian) { priceId = _priceId; pyth = IPyth(_pyth); admin = _admin; depegGuardian = _depegGuardian; } // Wrapper function to update the underlying Pyth price feeds. Not part of the AggregatorV3 interface but useful. function updateFeeds(bytes[] calldata priceUpdateData) public payable { // Update the prices to the latest available values and pay the required fee for it. The `priceUpdateData` data // should be retrieved from our off-chain Price Service API using the `pyth-evm-js` package. // See section "How Pyth Works on EVM Chains" below for more information. uint fee = pyth.getUpdateFee(priceUpdateData); pyth.updatePriceFeeds{value: fee}(priceUpdateData); // refund remaining eth payable(msg.sender).call{value: address(this).balance}(""); } function decimals() public view virtual returns (uint8) { PythStructs.Price memory price = pyth.getPriceUnsafe(priceId); return uint8(-1 * int8(price.expo)); } function description() public pure returns (string memory) { return "Modified emergency feed for Stable (USDC) feed. Enables manual price serving in the event of an on-chain depeg vs oracle feed."; } function version() public pure returns (uint256) { return 1; } function latestAnswer() public view virtual returns (int256) { PythStructs.Price memory price = pyth.getPriceUnsafe(priceId); return int256(price.price); } function latestTimestamp() public view returns (uint256) { PythStructs.Price memory price = pyth.getPriceUnsafe(priceId); return price.publishTime; } function latestRound() public view returns (uint256) { // use timestamp as the round id return latestTimestamp(); } function getAnswer(uint256) public view returns (int256) { return latestAnswer(); } function getTimestamp(uint256) external view returns (uint256) { return latestTimestamp(); } function getRoundData( uint80 _roundId ) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { PythStructs.Price memory price = pyth.getPriceUnsafe(priceId); return ( _roundId, int256(price.price), price.publishTime, price.publishTime, _roundId ); } function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { PythStructs.Price memory price = pyth.getPriceUnsafe(priceId); roundId = uint80(price.publishTime); int256 finalPrice; if(!isActive){ finalPrice = int256(price.price); } else { finalPrice = depegPrice; } return ( roundId, finalPrice, price.publishTime, price.publishTime, roundId ); } // Manually sets price in the event of an on-chain depeg vs feed. function depegSetter(int _price, bool _isActive) external { require(msg.sender == admin || msg.sender == depegGuardian, "!Auth"); if(_price == 0){ isActive = false; depegPrice = previewDepegPrice(_price); emit depegSet(depegPrice, isActive); } else { depegPrice = previewDepegPrice(_price); if(_isActive != isActive){ isActive = _isActive; } emit depegSet(depegPrice, isActive); } } // Helper function to preview price output on depegSetter function previewDepegPrice(int _price) public pure returns(int){ if(_price > 1e4 || _price == 0){return 1e8;} return _price * 1e4; } // Assigns admin address with access to all gated functions function setAdmin(address _newAdmin) external { require(msg.sender == admin, "!Admin"); require(_newAdmin != address(0), "0x00"); if(_newAdmin != admin){ emit AdminSet(admin, _newAdmin); admin = _newAdmin; } } // Assigns depegGuardian address, can only access depegSetter. function setDepegGuardian(address _newGuardian) external{ require(msg.sender == admin, "!Admin"); require(_newGuardian != address(0), "0x00"); if(_newGuardian != depegGuardian){ emit DepegGuardianSet(depegGuardian, _newGuardian); depegGuardian = _newGuardian; } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; import "./PythStructs.sol"; import "./IPythEvents.sol"; /// @title Consume prices from the Pyth Network (https://pyth.network/). /// @dev Please refer to the guidance at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how to consume prices safely. /// @author Pyth Data Association interface IPyth is IPythEvents { /// @notice Returns the price of a price feed without any sanity checks. /// @dev This function returns the most recent price update in this contract without any recency checks. /// This function is unsafe as the returned price update may be arbitrarily far in the past. /// /// Users of this function should check the `publishTime` in the price to ensure that the returned price is /// sufficiently recent for their application. If you are considering using this function, it may be /// safer / easier to use `getPriceNoOlderThan`. /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely. function getPriceUnsafe( bytes32 id ) external view returns (PythStructs.Price memory price); /// @notice Returns the price that is no older than `age` seconds of the current time. /// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently /// recently. /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely. function getPriceNoOlderThan( bytes32 id, uint age ) external view returns (PythStructs.Price memory price); /// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks. /// @dev This function returns the same price as `getEmaPrice` in the case where the price is available. /// However, if the price is not recent this function returns the latest available price. /// /// The returned price can be from arbitrarily far in the past; this function makes no guarantees that /// the returned price is recent or useful for any particular application. /// /// Users of this function should check the `publishTime` in the price to ensure that the returned price is /// sufficiently recent for their application. If you are considering using this function, it may be /// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`. /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely. function getEmaPriceUnsafe( bytes32 id ) external view returns (PythStructs.Price memory price); /// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds /// of the current time. /// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently /// recently. /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely. function getEmaPriceNoOlderThan( bytes32 id, uint age ) external view returns (PythStructs.Price memory price); /// @notice Update price feeds with given update messages. /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling /// `getUpdateFee` with the length of the `updateData` array. /// Prices will be updated if they are more recent than the current stored prices. /// The call will succeed even if the update is not the most recent. /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid. /// @param updateData Array of price update data. function updatePriceFeeds(bytes[] calldata updateData) external payable; /// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is /// necessary if the current on-chain publishTime is older than the given publishTime. It relies solely on the /// given `publishTimes` for the price feeds and does not read the actual price update publish time within `updateData`. /// /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling /// `getUpdateFee` with the length of the `updateData` array. /// /// `priceIds` and `publishTimes` are two arrays with the same size that correspond to senders known publishTime /// of each priceId when calling this method. If all of price feeds within `priceIds` have updated and have /// a newer or equal publish time than the given publish time, it will reject the transaction to save gas. /// Otherwise, it calls updatePriceFeeds method to update the prices. /// /// @dev Reverts if update is not needed or the transferred fee is not sufficient or the updateData is invalid. /// @param updateData Array of price update data. /// @param priceIds Array of price ids. /// @param publishTimes Array of publishTimes. `publishTimes[i]` corresponds to known `publishTime` of `priceIds[i]` function updatePriceFeedsIfNecessary( bytes[] calldata updateData, bytes32[] calldata priceIds, uint64[] calldata publishTimes ) external payable; /// @notice Returns the required fee to update an array of price updates. /// @param updateData Array of price update data. /// @return feeAmount The required fee in Wei. function getUpdateFee( bytes[] calldata updateData ) external view returns (uint feeAmount); /// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published /// within `minPublishTime` and `maxPublishTime`. /// /// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price; /// otherwise, please consider using `updatePriceFeeds`. This method may store the price updates on-chain, if they /// are more recent than the current stored prices. /// /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling /// `getUpdateFee` with the length of the `updateData` array. /// /// /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is /// no update for any of the given `priceIds` within the given time range. /// @param updateData Array of price update data. /// @param priceIds Array of price ids. /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`. /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`. /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order). function parsePriceFeedUpdates( bytes[] calldata updateData, bytes32[] calldata priceIds, uint64 minPublishTime, uint64 maxPublishTime ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds); /// @notice Similar to `parsePriceFeedUpdates` but ensures the updates returned are /// the first updates published in minPublishTime. That is, if there are multiple updates for a given timestamp, /// this method will return the first update. This method may store the price updates on-chain, if they /// are more recent than the current stored prices. /// /// /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is /// no update for any of the given `priceIds` within the given time range and uniqueness condition. /// @param updateData Array of price update data. /// @param priceIds Array of price ids. /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`. /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`. /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order). function parsePriceFeedUpdatesUnique( bytes[] calldata updateData, bytes32[] calldata priceIds, uint64 minPublishTime, uint64 maxPublishTime ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; /// @title IPythEvents contains the events that Pyth contract emits. /// @dev This interface can be used for listening to the updates for off-chain and testing purposes. interface IPythEvents { /// @dev Emitted when the price feed with `id` has received a fresh update. /// @param id The Pyth Price Feed ID. /// @param publishTime Publish time of the given price update. /// @param price Price of the given price update. /// @param conf Confidence interval of the given price update. event PriceFeedUpdate( bytes32 indexed id, uint64 publishTime, int64 price, uint64 conf ); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; contract PythStructs { // A price with a degree of uncertainty, represented as a price +- a confidence interval. // // The confidence interval roughly corresponds to the standard error of a normal distribution. // Both the price and confidence are stored in a fixed-point numeric representation, // `x * (10^expo)`, where `expo` is the exponent. // // Please refer to the documentation at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how // to how this price safely. struct Price { // Price int64 price; // Confidence interval around the price uint64 conf; // Price exponent int32 expo; // Unix timestamp describing when the price was published uint publishTime; } // PriceFeed represents a current aggregate price from pyth publisher feeds. struct PriceFeed { // The price ID. bytes32 id; // Latest available price Price price; // Latest available exponentially-weighted moving average price Price emaPrice; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "shanghai", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_pyth","type":"address"},{"internalType":"bytes32","name":"_priceId","type":"bytes32"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_depegGuardian","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGuardian","type":"address"},{"indexed":true,"internalType":"address","name":"newGuardian","type":"address"}],"name":"DepegGuardianSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int256","name":"depegPrice","type":"int256"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"depegSet","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depegGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depegPrice","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_price","type":"int256"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"depegSetter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_price","type":"int256"}],"name":"previewDepegPrice","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"priceId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pyth","outputs":[{"internalType":"contract IPyth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGuardian","type":"address"}],"name":"setDepegGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"priceUpdateData","type":"bytes[]"}],"name":"updateFeeds","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b506040516110d83803806110d883398101604081905261002e91610090565b600492909255600580546001600160a01b039485166001600160a01b0319918216179091555f805492851692821692909217909155600180549290931691161790556100da565b80516001600160a01b038116811461008b575f80fd5b919050565b5f805f80608085870312156100a3575f80fd5b6100ac85610075565b9350602085015192506100c160408601610075565b91506100cf60608601610075565b905092959194509250565b610ff1806100e75f395ff3fe608060405260043610610162575f3560e01c80638205bf6a116100c6578063d654c8f01161007c578063f90a419d11610057578063f90a419d146103bd578063f98d06f0146103dc578063feaf968c146103fb575f80fd5b8063d654c8f014610353578063f851a44014610368578063f85748bc1461039e575f80fd5b8063b5ab58dc116100ac578063b5ab58dc14610302578063b633620c14610321578063bc36c0a914610340575f80fd5b80638205bf6a146102985780639a6fc8f5146102ac575f80fd5b806354fd4d501161011b578063704b6c0211610101578063704b6c02146102375780637284e4161461025857806372930e1814610279575f80fd5b806354fd4d5014610210578063668a0f0214610223575f80fd5b8063311893341161014b57806331189334146101c1578063313ce567146101d657806350d25bcd146101fc575f80fd5b806307b6f9951461016657806322f3e2d414610198575b5f80fd5b348015610171575f80fd5b50610185610180366004610bd3565b61040f565b6040519081526020015b60405180910390f35b3480156101a3575f80fd5b506003546101b19060ff1681565b604051901515815260200161018f565b3480156101cc575f80fd5b5061018560045481565b3480156101e1575f80fd5b506101ea610440565b60405160ff909116815260200161018f565b348015610207575f80fd5b506101856104c9565b34801561021b575f80fd5b506001610185565b34801561022e575f80fd5b50610185610543565b348015610242575f80fd5b50610256610251366004610bea565b610551565b005b348015610263575f80fd5b5061026c61064e565b60405161018f9190610c17565b348015610284575f80fd5b50610256610293366004610bea565b61066e565b3480156102a3575f80fd5b5061018561076a565b3480156102b7575f80fd5b506102cb6102c6366004610c62565b6107e4565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161018f565b34801561030d575f80fd5b5061018561031c366004610bd3565b61087b565b34801561032c575f80fd5b5061018561033b366004610bd3565b610884565b61025661034e366004610c8b565b61088d565b34801561035e575f80fd5b5061018560025481565b348015610373575f80fd5b505f54610386906001600160a01b031681565b6040516001600160a01b03909116815260200161018f565b3480156103a9575f80fd5b506102566103b8366004610cfa565b6109de565b3480156103c8575f80fd5b50600154610386906001600160a01b031681565b3480156103e7575f80fd5b50600554610386906001600160a01b031681565b348015610406575f80fd5b506102cb610b1d565b5f61271082138061041e575081155b1561042e57506305f5e100919050565b61043a82612710610d40565b92915050565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa15801561048c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104b09190610db8565b905080604001515f196104c39190610e43565b91505090565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610515573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105399190610db8565b5160070b92915050565b5f61054c61076a565b905090565b5f546001600160a01b031633146105985760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b60448201526064015b60405180910390fd5b6001600160a01b0381166105d75760405162461bcd60e51b815260040161058f906020808252600490820152630307830360e41b604082015260600190565b5f546001600160a01b0382811691161461064b575f80546040516001600160a01b03808516939216917fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff9791a35f805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383161790555b50565b60606040518060a00160405280607e8152602001610f3e607e9139905090565b5f546001600160a01b031633146106b05760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b604482015260640161058f565b6001600160a01b0381166106ef5760405162461bcd60e51b815260040161058f906020808252600490820152630307830360e41b604082015260600190565b6001546001600160a01b0382811691161461064b576001546040516001600160a01b038084169216907f856a58eac55526043a8c8e9481e2d6e1ad01aaac82023a85f5f80b56f2cecd00905f90a3600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa1580156107b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107da9190610db8565b6060015192915050565b600554600480546040516396834ad360e01b8152918201525f91829182918291829182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610838573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061085c9190610db8565b8051606090910151979860079190910b97965086955088945092505050565b5f61043a6104c9565b5f61043a61076a565b6005546040517fd47eed450000000000000000000000000000000000000000000000000000000081525f916001600160a01b03169063d47eed45906108d89086908690600401610e8e565b602060405180830381865afa1580156108f3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109179190610f26565b6005546040517fef9e5e280000000000000000000000000000000000000000000000000000000081529192506001600160a01b03169063ef9e5e289083906109659087908790600401610e8e565b5f604051808303818588803b15801561097c575f80fd5b505af115801561098e573d5f803e3d5ffd5b505060405133935047925090505f81818185875af1925050503d805f81146109d1576040519150601f19603f3d011682016040523d82523d5f602084013e6109d6565b606091505b505050505050565b5f546001600160a01b0316331480610a0057506001546001600160a01b031633145b610a4c5760405162461bcd60e51b815260206004820152600560248201527f2141757468000000000000000000000000000000000000000000000000000000604482015260640161058f565b815f03610ab1576003805460ff19169055610a668261040f565b60028190556003546040805192835260ff909116151560208301527f4db1e2752ffb381bbcce016de66c2df1b0397e761f06bc17467bf17fce5d2b0591015b60405180910390a15050565b610aba8261040f565b60025560035460ff16151581151514610adc576003805460ff19168215151790555b6002546003546040805192835260ff909116151560208301527f4db1e2752ffb381bbcce016de66c2df1b0397e761f06bc17467bf17fce5d2b059101610aa5565b600554600480546040516396834ad360e01b8152918201525f91829182918291829182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610b71573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b959190610db8565b60608101516003549097509091505f9060ff16610bb75750805160070b610bbc565b506002545b606091909101519596909594508493508692509050565b5f60208284031215610be3575f80fd5b5035919050565b5f60208284031215610bfa575f80fd5b81356001600160a01b0381168114610c10575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610c4257858101830151858201604001528201610c26565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610c72575f80fd5b813569ffffffffffffffffffff81168114610c10575f80fd5b5f8060208385031215610c9c575f80fd5b823567ffffffffffffffff80821115610cb3575f80fd5b818501915085601f830112610cc6575f80fd5b813581811115610cd4575f80fd5b8660208260051b8501011115610ce8575f80fd5b60209290920196919550909350505050565b5f8060408385031215610d0b575f80fd5b8235915060208301358015158114610d21575f80fd5b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b8082025f82127f800000000000000000000000000000000000000000000000000000000000000084141615610d7757610d77610d2c565b818105831482151761043a5761043a610d2c565b805167ffffffffffffffff81168114610da2575f80fd5b919050565b8051600381900b8114610da2575f80fd5b5f60808284031215610dc8575f80fd5b6040516080810181811067ffffffffffffffff82111715610df757634e487b7160e01b5f52604160045260245ffd5b6040528251600781900b8114610e0b575f80fd5b8152610e1960208401610d8b565b6020820152610e2a60408401610da7565b6040820152606083015160608201528091505092915050565b5f825f0b825f0b02805f0b9150808214610e5f57610e5f610d2c565b5092915050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b60208082528181018390525f906040600585901b8401810190840186845b87811015610f1957868403603f190183528135368a9003601e19018112610ed1575f80fd5b8901858101903567ffffffffffffffff811115610eec575f80fd5b803603821315610efa575f80fd5b610f05868284610e66565b955050509184019190840190600101610eac565b5091979650505050505050565b5f60208284031215610f36575f80fd5b505191905056fe4d6f64696669656420656d657267656e6379206665656420666f7220537461626c652028555344432920666565642e20456e61626c6573206d616e75616c2070726963652073657276696e6720696e20746865206576656e74206f6620616e206f6e2d636861696e206465706567207673206f7261636c6520666565642ea26469706673582212205cc9bed592d09f7ffc575e509e96f366a02fd09534518007dbf9bdfb4e3d67bc64736f6c634300081400330000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f0000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c248
Deployed Bytecode
0x608060405260043610610162575f3560e01c80638205bf6a116100c6578063d654c8f01161007c578063f90a419d11610057578063f90a419d146103bd578063f98d06f0146103dc578063feaf968c146103fb575f80fd5b8063d654c8f014610353578063f851a44014610368578063f85748bc1461039e575f80fd5b8063b5ab58dc116100ac578063b5ab58dc14610302578063b633620c14610321578063bc36c0a914610340575f80fd5b80638205bf6a146102985780639a6fc8f5146102ac575f80fd5b806354fd4d501161011b578063704b6c0211610101578063704b6c02146102375780637284e4161461025857806372930e1814610279575f80fd5b806354fd4d5014610210578063668a0f0214610223575f80fd5b8063311893341161014b57806331189334146101c1578063313ce567146101d657806350d25bcd146101fc575f80fd5b806307b6f9951461016657806322f3e2d414610198575b5f80fd5b348015610171575f80fd5b50610185610180366004610bd3565b61040f565b6040519081526020015b60405180910390f35b3480156101a3575f80fd5b506003546101b19060ff1681565b604051901515815260200161018f565b3480156101cc575f80fd5b5061018560045481565b3480156101e1575f80fd5b506101ea610440565b60405160ff909116815260200161018f565b348015610207575f80fd5b506101856104c9565b34801561021b575f80fd5b506001610185565b34801561022e575f80fd5b50610185610543565b348015610242575f80fd5b50610256610251366004610bea565b610551565b005b348015610263575f80fd5b5061026c61064e565b60405161018f9190610c17565b348015610284575f80fd5b50610256610293366004610bea565b61066e565b3480156102a3575f80fd5b5061018561076a565b3480156102b7575f80fd5b506102cb6102c6366004610c62565b6107e4565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161018f565b34801561030d575f80fd5b5061018561031c366004610bd3565b61087b565b34801561032c575f80fd5b5061018561033b366004610bd3565b610884565b61025661034e366004610c8b565b61088d565b34801561035e575f80fd5b5061018560025481565b348015610373575f80fd5b505f54610386906001600160a01b031681565b6040516001600160a01b03909116815260200161018f565b3480156103a9575f80fd5b506102566103b8366004610cfa565b6109de565b3480156103c8575f80fd5b50600154610386906001600160a01b031681565b3480156103e7575f80fd5b50600554610386906001600160a01b031681565b348015610406575f80fd5b506102cb610b1d565b5f61271082138061041e575081155b1561042e57506305f5e100919050565b61043a82612710610d40565b92915050565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa15801561048c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104b09190610db8565b905080604001515f196104c39190610e43565b91505090565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610515573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105399190610db8565b5160070b92915050565b5f61054c61076a565b905090565b5f546001600160a01b031633146105985760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b60448201526064015b60405180910390fd5b6001600160a01b0381166105d75760405162461bcd60e51b815260040161058f906020808252600490820152630307830360e41b604082015260600190565b5f546001600160a01b0382811691161461064b575f80546040516001600160a01b03808516939216917fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff9791a35f805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383161790555b50565b60606040518060a00160405280607e8152602001610f3e607e9139905090565b5f546001600160a01b031633146106b05760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b604482015260640161058f565b6001600160a01b0381166106ef5760405162461bcd60e51b815260040161058f906020808252600490820152630307830360e41b604082015260600190565b6001546001600160a01b0382811691161461064b576001546040516001600160a01b038084169216907f856a58eac55526043a8c8e9481e2d6e1ad01aaac82023a85f5f80b56f2cecd00905f90a3600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600554600480546040516396834ad360e01b8152918201525f9182916001600160a01b03909116906396834ad390602401608060405180830381865afa1580156107b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107da9190610db8565b6060015192915050565b600554600480546040516396834ad360e01b8152918201525f91829182918291829182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610838573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061085c9190610db8565b8051606090910151979860079190910b97965086955088945092505050565b5f61043a6104c9565b5f61043a61076a565b6005546040517fd47eed450000000000000000000000000000000000000000000000000000000081525f916001600160a01b03169063d47eed45906108d89086908690600401610e8e565b602060405180830381865afa1580156108f3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109179190610f26565b6005546040517fef9e5e280000000000000000000000000000000000000000000000000000000081529192506001600160a01b03169063ef9e5e289083906109659087908790600401610e8e565b5f604051808303818588803b15801561097c575f80fd5b505af115801561098e573d5f803e3d5ffd5b505060405133935047925090505f81818185875af1925050503d805f81146109d1576040519150601f19603f3d011682016040523d82523d5f602084013e6109d6565b606091505b505050505050565b5f546001600160a01b0316331480610a0057506001546001600160a01b031633145b610a4c5760405162461bcd60e51b815260206004820152600560248201527f2141757468000000000000000000000000000000000000000000000000000000604482015260640161058f565b815f03610ab1576003805460ff19169055610a668261040f565b60028190556003546040805192835260ff909116151560208301527f4db1e2752ffb381bbcce016de66c2df1b0397e761f06bc17467bf17fce5d2b0591015b60405180910390a15050565b610aba8261040f565b60025560035460ff16151581151514610adc576003805460ff19168215151790555b6002546003546040805192835260ff909116151560208301527f4db1e2752ffb381bbcce016de66c2df1b0397e761f06bc17467bf17fce5d2b059101610aa5565b600554600480546040516396834ad360e01b8152918201525f91829182918291829182916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610b71573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b959190610db8565b60608101516003549097509091505f9060ff16610bb75750805160070b610bbc565b506002545b606091909101519596909594508493508692509050565b5f60208284031215610be3575f80fd5b5035919050565b5f60208284031215610bfa575f80fd5b81356001600160a01b0381168114610c10575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610c4257858101830151858201604001528201610c26565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610c72575f80fd5b813569ffffffffffffffffffff81168114610c10575f80fd5b5f8060208385031215610c9c575f80fd5b823567ffffffffffffffff80821115610cb3575f80fd5b818501915085601f830112610cc6575f80fd5b813581811115610cd4575f80fd5b8660208260051b8501011115610ce8575f80fd5b60209290920196919550909350505050565b5f8060408385031215610d0b575f80fd5b8235915060208301358015158114610d21575f80fd5b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b8082025f82127f800000000000000000000000000000000000000000000000000000000000000084141615610d7757610d77610d2c565b818105831482151761043a5761043a610d2c565b805167ffffffffffffffff81168114610da2575f80fd5b919050565b8051600381900b8114610da2575f80fd5b5f60808284031215610dc8575f80fd5b6040516080810181811067ffffffffffffffff82111715610df757634e487b7160e01b5f52604160045260245ffd5b6040528251600781900b8114610e0b575f80fd5b8152610e1960208401610d8b565b6020820152610e2a60408401610da7565b6040820152606083015160608201528091505092915050565b5f825f0b825f0b02805f0b9150808214610e5f57610e5f610d2c565b5092915050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b60208082528181018390525f906040600585901b8401810190840186845b87811015610f1957868403603f190183528135368a9003601e19018112610ed1575f80fd5b8901858101903567ffffffffffffffff811115610eec575f80fd5b803603821315610efa575f80fd5b610f05868284610e66565b955050509184019190840190600101610eac565b5091979650505050505050565b5f60208284031215610f36575f80fd5b505191905056fe4d6f64696669656420656d657267656e6379206665656420666f7220537461626c652028555344432920666565642e20456e61626c6573206d616e75616c2070726963652073657276696e6720696e20746865206576656e74206f6620616e206f6e2d636861696e206465706567207673206f7261636c6520666565642ea26469706673582212205cc9bed592d09f7ffc575e509e96f366a02fd09534518007dbf9bdfb4e3d67bc64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f0000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c248
-----Decoded View---------------
Arg [0] : _pyth (address): 0x2880aB155794e7179c9eE2e38200202908C17B43
Arg [1] : _priceId (bytes32): 0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a
Arg [2] : _admin (address): 0xEDFa5163b3517c375a978B1557D9D90ba823213F
Arg [3] : _depegGuardian (address): 0x3C173F1BAF9F97bf244796c0179952a6a2e9C248
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43
Arg [1] : eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a
Arg [2] : 000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f
Arg [3] : 0000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c248
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.