Source Code
Overview
S Balance
S Value
$0.00Latest 25 from a total of 404,042 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Prices With ... | 61055845 | 20 secs ago | IN | 5 wei | 0.03753921 | ||||
| Set Prices With ... | 61055821 | 1 min ago | IN | 5 wei | 0.03738154 | ||||
| Set Prices With ... | 61055797 | 1 min ago | IN | 5 wei | 0.03754726 | ||||
| Set Prices With ... | 61055775 | 2 mins ago | IN | 5 wei | 0.0376984 | ||||
| Set Prices With ... | 61055750 | 3 mins ago | IN | 5 wei | 0.03751578 | ||||
| Set Prices With ... | 61055722 | 3 mins ago | IN | 5 wei | 0.03769339 | ||||
| Set Prices With ... | 61055691 | 4 mins ago | IN | 5 wei | 0.037686 | ||||
| Set Prices With ... | 61055659 | 5 mins ago | IN | 5 wei | 0.03753842 | ||||
| Set Prices With ... | 61055638 | 5 mins ago | IN | 5 wei | 0.03754297 | ||||
| Set Prices With ... | 61055614 | 6 mins ago | IN | 5 wei | 0.03634078 | ||||
| Set Prices With ... | 61055585 | 7 mins ago | IN | 5 wei | 0.03769642 | ||||
| Set Prices With ... | 61055564 | 8 mins ago | IN | 5 wei | 0.03754337 | ||||
| Set Prices With ... | 61055542 | 8 mins ago | IN | 5 wei | 0.03769405 | ||||
| Set Prices With ... | 61055510 | 9 mins ago | IN | 5 wei | 0.03768817 | ||||
| Set Prices With ... | 61055492 | 10 mins ago | IN | 5 wei | 0.03770151 | ||||
| Set Prices With ... | 61055476 | 10 mins ago | IN | 5 wei | 0.03634072 | ||||
| Set Prices With ... | 61055450 | 11 mins ago | IN | 5 wei | 0.0378502 | ||||
| Set Prices With ... | 61055415 | 12 mins ago | IN | 5 wei | 0.03738596 | ||||
| Set Prices With ... | 61055391 | 12 mins ago | IN | 5 wei | 0.03785925 | ||||
| Set Prices With ... | 61055356 | 13 mins ago | IN | 5 wei | 0.03785126 | ||||
| Set Prices With ... | 61055329 | 14 mins ago | IN | 5 wei | 0.03785628 | ||||
| Set Prices With ... | 61055311 | 15 mins ago | IN | 5 wei | 0.03770052 | ||||
| Set Prices With ... | 61055288 | 15 mins ago | IN | 5 wei | 0.03619532 | ||||
| Set Prices With ... | 61055259 | 16 mins ago | IN | 5 wei | 0.0378508 | ||||
| Set Prices With ... | 61055237 | 17 mins ago | IN | 5 wei | 0.03786017 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 61055845 | 20 secs ago | 5 wei | ||||
| 61055821 | 1 min ago | 5 wei | ||||
| 61055797 | 1 min ago | 5 wei | ||||
| 61055775 | 2 mins ago | 5 wei | ||||
| 61055750 | 3 mins ago | 5 wei | ||||
| 61055722 | 3 mins ago | 5 wei | ||||
| 61055691 | 4 mins ago | 5 wei | ||||
| 61055659 | 5 mins ago | 5 wei | ||||
| 61055638 | 5 mins ago | 5 wei | ||||
| 61055614 | 6 mins ago | 5 wei | ||||
| 61055585 | 7 mins ago | 5 wei | ||||
| 61055564 | 8 mins ago | 5 wei | ||||
| 61055542 | 8 mins ago | 5 wei | ||||
| 61055510 | 9 mins ago | 5 wei | ||||
| 61055492 | 10 mins ago | 5 wei | ||||
| 61055476 | 10 mins ago | 5 wei | ||||
| 61055450 | 11 mins ago | 5 wei | ||||
| 61055415 | 12 mins ago | 5 wei | ||||
| 61055391 | 12 mins ago | 5 wei | ||||
| 61055356 | 13 mins ago | 5 wei | ||||
| 61055329 | 14 mins ago | 5 wei | ||||
| 61055311 | 15 mins ago | 5 wei | ||||
| 61055288 | 15 mins ago | 5 wei | ||||
| 61055259 | 16 mins ago | 5 wei | ||||
| 61055237 | 17 mins ago | 5 wei |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FastPriceFeed
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "../libraries/math/SafeMath.sol";
import "./interfaces/ISecondaryPriceFeed.sol";
import "./interfaces/IFastPriceFeed.sol";
import "./interfaces/IFastPriceEvents.sol";
import "../core/interfaces/IVaultPriceFeed.sol";
import "../core/interfaces/IPositionRouter.sol";
import "../core/interfaces/IPositionManager.sol";
import "../access/Governable.sol";
import "./interfaces/IPyth.sol";
import "./interfaces/PythStructs.sol";
contract FastPriceFeed is ISecondaryPriceFeed, IFastPriceFeed, Governable {
using SafeMath for uint256;
// fit data in a uint256 slot to save gas costs
struct PriceDataItem {
uint160 refPrice; // Chainlink price
uint32 refTime; // last updated at time
uint32 cumulativeRefDelta; // cumulative Chainlink price delta
uint32 cumulativeFastDelta; // cumulative fast price delta
}
uint256 public constant PRICE_PRECISION = 10 ** 30;
uint256 public constant CUMULATIVE_DELTA_PRECISION = 10 * 1000 * 1000;
uint256 public constant MAX_REF_PRICE = type(uint160).max;
uint256 public constant MAX_CUMULATIVE_REF_DELTA = type(uint32).max;
uint256 public constant MAX_CUMULATIVE_FAST_DELTA = type(uint32).max;
uint256 public constant BASIS_POINTS_DIVISOR = 10000;
uint256 public constant MAX_PRICE_DURATION = 30 minutes;
IPyth public immutable pyth;
bool public isInitialized;
bool public isSpreadEnabled = false;
address public immutable vaultPriceFeed;
address public immutable fastPriceEvents;
address public tokenManager;
uint256 public override lastUpdatedAt;
uint256 public override lastUpdatedBlock;
uint256 public priceDuration;
uint256 public maxPriceUpdateDelay;
uint256 public spreadBasisPointsIfInactive;
uint256 public spreadBasisPointsIfChainError;
uint256 public minBlockInterval;
uint256 public priceDataInterval;
// allowed deviation from primary price
uint256 public maxDeviationBasisPoints;
uint256 public minAuthorizations;
uint256 public disableFastPriceVoteCount = 0;
mapping(address => bool) public isUpdater;
mapping(address => uint256) public prices;
mapping(address => bytes32) public priceFeedIds;
mapping(address => PriceDataItem) public priceData;
mapping(address => uint256) public maxCumulativeDeltaDiffs;
mapping(address => bool) public isSigner;
mapping(address => bool) public disableFastPriceVotes;
address[] public tokens;
IPositionRouter public positionRouter;
IPositionManager public positionManager;
event DisableFastPrice(address signer);
event EnableFastPrice(address signer);
event PriceData(address token, uint256 refPrice, uint256 fastPrice, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta);
event MaxCumulativeDeltaDiffExceeded(address token, uint256 refPrice, uint256 fastPrice, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta);
modifier onlySigner() {
require(isSigner[msg.sender], "FastPriceFeed: forbidden");
_;
}
modifier onlyUpdater() {
require(isUpdater[msg.sender], "FastPriceFeed: forbidden");
_;
}
modifier onlyTokenManager() {
require(msg.sender == tokenManager, "FastPriceFeed: forbidden");
_;
}
constructor(
address _pyth,
uint256 _priceDuration,
uint256 _maxPriceUpdateDelay,
uint256 _minBlockInterval,
uint256 _maxDeviationBasisPoints,
address _vaultPriceFeed,
address _fastPriceEvents,
address _tokenManager,
IPositionRouter _positionRouter,
IPositionManager _positionManager
) public {
require(_priceDuration <= MAX_PRICE_DURATION, "FastPriceFeed: invalid _priceDuration");
pyth = IPyth(_pyth);
priceDuration = _priceDuration;
maxPriceUpdateDelay = _maxPriceUpdateDelay;
minBlockInterval = _minBlockInterval;
maxDeviationBasisPoints = _maxDeviationBasisPoints;
fastPriceEvents = _fastPriceEvents;
vaultPriceFeed = _vaultPriceFeed;
tokenManager = _tokenManager;
positionRouter = _positionRouter;
positionManager = _positionManager;
}
function initialize(
uint256 _minAuthorizations,
address[] memory _signers,
address[] memory _updaters,
address[] memory _tokens,
bytes32[] memory _priceFeedIds
) public onlyGov {
require(!isInitialized, "FastPriceFeed: already initialized");
require(_tokens.length == _priceFeedIds.length, "FastPriceFeed: invalid lengths");
isInitialized = true;
minAuthorizations = _minAuthorizations;
for (uint256 i; i < _signers.length; i++) {
address signer = _signers[i];
isSigner[signer] = true;
}
for (uint256 i; i < _updaters.length; i++) {
address updater = _updaters[i];
isUpdater[updater] = true;
}
tokens = _tokens;
for (uint256 i; i < _tokens.length; i++) {
address token = _tokens[i];
priceFeedIds[token] = _priceFeedIds[i];
}
}
function setSigner(address _account, bool _isActive) external override onlyGov {
isSigner[_account] = _isActive;
}
function setUpdater(address _account, bool _isActive) external override onlyGov {
isUpdater[_account] = _isActive;
}
function setPriceDuration(uint256 _priceDuration) external override onlyGov {
require(_priceDuration <= MAX_PRICE_DURATION, "FastPriceFeed: invalid _priceDuration");
priceDuration = _priceDuration;
}
function setMaxPriceUpdateDelay(uint256 _maxPriceUpdateDelay) external override onlyGov {
maxPriceUpdateDelay = _maxPriceUpdateDelay;
}
function setSpreadBasisPointsIfInactive(uint256 _spreadBasisPointsIfInactive) external override onlyGov {
spreadBasisPointsIfInactive = _spreadBasisPointsIfInactive;
}
function setSpreadBasisPointsIfChainError(uint256 _spreadBasisPointsIfChainError) external override onlyGov {
spreadBasisPointsIfChainError = _spreadBasisPointsIfChainError;
}
function setMinBlockInterval(uint256 _minBlockInterval) external override onlyGov {
minBlockInterval = _minBlockInterval;
}
function setIsSpreadEnabled(bool _isSpreadEnabled) external override onlyGov {
isSpreadEnabled = _isSpreadEnabled;
}
function setLastUpdatedAt(uint256 _lastUpdatedAt) external onlyGov {
lastUpdatedAt = _lastUpdatedAt;
}
function setTokenManager(address _tokenManager) external onlyTokenManager {
tokenManager = _tokenManager;
}
function setMaxDeviationBasisPoints(uint256 _maxDeviationBasisPoints) external override onlyTokenManager {
maxDeviationBasisPoints = _maxDeviationBasisPoints;
}
function setMaxCumulativeDeltaDiffs(address[] memory _tokens, uint256[] memory _maxCumulativeDeltaDiffs) external override onlyTokenManager {
require(_tokens.length == _maxCumulativeDeltaDiffs.length, "FastPriceFeed: mismatched lengths");
for (uint256 i; i < _tokens.length; i++) {
address token = _tokens[i];
maxCumulativeDeltaDiffs[token] = _maxCumulativeDeltaDiffs[i];
}
}
function setPriceDataInterval(uint256 _priceDataInterval) external override onlyTokenManager {
priceDataInterval = _priceDataInterval;
}
function setMinAuthorizations(uint256 _minAuthorizations) external onlyTokenManager {
minAuthorizations = _minAuthorizations;
}
function setPricesWithData(bytes[] memory priceUpdateData) external payable onlyUpdater {
_setPricesWithData(priceUpdateData);
}
function setPricesWithDataAndExecute(
bytes[] memory priceUpdateData,
uint256 _endIndexForIncreasePositions,
uint256 _endIndexForDecreasePositions,
uint256 _maxIncreasePositions,
uint256 _maxDecreasePositions
) external payable onlyUpdater {
_setPricesWithData(priceUpdateData);
IPositionRouter _positionRouter = positionRouter;
uint256 maxEndIndexForIncrease = _positionRouter.increasePositionRequestKeysStart().add(_maxIncreasePositions);
uint256 maxEndIndexForDecrease = _positionRouter.decreasePositionRequestKeysStart().add(_maxDecreasePositions);
if (_endIndexForIncreasePositions > maxEndIndexForIncrease) {
_endIndexForIncreasePositions = maxEndIndexForIncrease;
}
if (_endIndexForDecreasePositions > maxEndIndexForDecrease) {
_endIndexForDecreasePositions = maxEndIndexForDecrease;
}
_positionRouter.executeIncreasePositions(_endIndexForIncreasePositions, payable(msg.sender));
_positionRouter.executeDecreasePositions(_endIndexForDecreasePositions, payable(msg.sender));
}
function disableFastPrice() external onlySigner {
require(!disableFastPriceVotes[msg.sender], "FastPriceFeed: already voted");
disableFastPriceVotes[msg.sender] = true;
disableFastPriceVoteCount = disableFastPriceVoteCount.add(1);
emit DisableFastPrice(msg.sender);
}
function enableFastPrice() external onlySigner {
require(disableFastPriceVotes[msg.sender], "FastPriceFeed: already enabled");
disableFastPriceVotes[msg.sender] = false;
disableFastPriceVoteCount = disableFastPriceVoteCount.sub(1);
emit EnableFastPrice(msg.sender);
}
// under regular operation, the fastPrice (prices[token]) is returned and there is no spread returned from this function,
// though VaultPriceFeed might apply its own spread
//
// if the fastPrice has not been updated within priceDuration then it is ignored and only _refPrice with a spread is used (spread: spreadBasisPointsIfInactive)
// in case the fastPrice has not been updated for maxPriceUpdateDelay then the _refPrice with a larger spread is used (spread: spreadBasisPointsIfChainError)
//
// there will be a spread from the _refPrice to the fastPrice in the following cases:
// - in case isSpreadEnabled is set to true
// - in case the maxDeviationBasisPoints between _refPrice and fastPrice is exceeded
// - in case watchers flag an issue
// - in case the cumulativeFastDelta exceeds the cumulativeRefDelta by the maxCumulativeDeltaDiff
function getPrice(address _token, uint256 _refPrice, bool _maximise) external override view returns (uint256) {
if (block.timestamp > lastUpdatedAt.add(maxPriceUpdateDelay)) {
if (_maximise) {
return _refPrice.mul(BASIS_POINTS_DIVISOR.add(spreadBasisPointsIfChainError)).div(BASIS_POINTS_DIVISOR);
}
return _refPrice.mul(BASIS_POINTS_DIVISOR.sub(spreadBasisPointsIfChainError)).div(BASIS_POINTS_DIVISOR);
}
if (block.timestamp > lastUpdatedAt.add(priceDuration)) {
if (_maximise) {
return _refPrice.mul(BASIS_POINTS_DIVISOR.add(spreadBasisPointsIfInactive)).div(BASIS_POINTS_DIVISOR);
}
return _refPrice.mul(BASIS_POINTS_DIVISOR.sub(spreadBasisPointsIfInactive)).div(BASIS_POINTS_DIVISOR);
}
uint256 fastPrice = prices[_token];
if (fastPrice == 0) {return _refPrice;}
uint256 diffBasisPoints = _refPrice > fastPrice ? _refPrice.sub(fastPrice) : fastPrice.sub(_refPrice);
diffBasisPoints = diffBasisPoints.mul(BASIS_POINTS_DIVISOR).div(_refPrice);
// create a spread between the _refPrice and the fastPrice if the maxDeviationBasisPoints is exceeded
// or if watchers have flagged an issue with the fast price
bool hasSpread = !favorFastPrice(_token) || diffBasisPoints > maxDeviationBasisPoints;
if (hasSpread) {
// return the higher of the two prices
if (_maximise) {
return _refPrice > fastPrice ? _refPrice : fastPrice;
}
// return the lower of the two prices
return _refPrice < fastPrice ? _refPrice : fastPrice;
}
return fastPrice;
}
function favorFastPrice(address _token) public view returns (bool) {
if (isSpreadEnabled) {
return false;
}
if (disableFastPriceVoteCount >= minAuthorizations) {
// force a spread if watchers have flagged an issue with the fast price
return false;
}
(/* uint256 prevRefPrice */, /* uint256 refTime */, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta) = getPriceData(_token);
if (cumulativeFastDelta > cumulativeRefDelta && cumulativeFastDelta.sub(cumulativeRefDelta) > maxCumulativeDeltaDiffs[_token]) {
// force a spread if the cumulative delta for the fast price feed exceeds the cumulative delta
// for the Chainlink price feed by the maxCumulativeDeltaDiff allowed
return false;
}
return true;
}
function getPriceData(address _token) public view returns (uint256, uint256, uint256, uint256) {
PriceDataItem memory data = priceData[_token];
return (uint256(data.refPrice), uint256(data.refTime), uint256(data.cumulativeRefDelta), uint256(data.cumulativeFastDelta));
}
function _setPricesWithData(bytes[] memory priceUpdateData) private {
_setLastUpdatedValues();
uint256 fee = pyth.getUpdateFee(priceUpdateData);
require(msg.value >= fee, "insufficient value");
pyth.updatePriceFeeds{value: fee}(priceUpdateData);
uint256 tokenCount = tokens.length;
uint256 _priceDuration = priceDuration;
for (uint256 i; i < tokenCount; i++) {
address token = tokens[i];
bytes32 priceFeedId = priceFeedIds[token];
PythStructs.Price memory pythPrice = pyth.getPrice(priceFeedId);
require(pythPrice.price > 0, "pyth price <= 0");
// require that pythPrice publishTime is recent
require(pythPrice.publishTime > block.timestamp - _priceDuration, "stale pyth price");
// the confidence interval is not considered here
// the manually configured spread is assumed to be sufficient
uint256 price = uint256(pythPrice.price);
// adjust price to have 30 decimals of precision
if (pythPrice.expo < 0) {
uint256 divisor = 10 ** uint256(- pythPrice.expo);
// if divisor < PRICE_PRECISION there would be some rounding of price
// it is assumed that rounding of precision after 30 decimals should
// not cause significant differences in price calculations
price = price * PRICE_PRECISION / divisor;
} else {
uint256 multiplier = 10 ** uint256(pythPrice.expo);
price = price * PRICE_PRECISION * multiplier;
}
_setPrice(token, price);
}
}
function _setPrice(address _token, uint256 _price) private {
uint256 refPrice = IVaultPriceFeed(vaultPriceFeed).getLatestPrimaryPrice(_token);
uint256 fastPrice = prices[_token];
(uint256 prevRefPrice, uint256 refTime, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta) = getPriceData(_token);
if (prevRefPrice > 0) {
uint256 refDeltaAmount = refPrice > prevRefPrice ? refPrice.sub(prevRefPrice) : prevRefPrice.sub(refPrice);
uint256 fastDeltaAmount = fastPrice > _price ? fastPrice.sub(_price) : _price.sub(fastPrice);
// reset cumulative delta values if it is a new time window
if (refTime.div(priceDataInterval) != block.timestamp.div(priceDataInterval)) {
cumulativeRefDelta = 0;
cumulativeFastDelta = 0;
}
cumulativeRefDelta = cumulativeRefDelta.add(refDeltaAmount.mul(CUMULATIVE_DELTA_PRECISION).div(prevRefPrice));
cumulativeFastDelta = cumulativeFastDelta.add(fastDeltaAmount.mul(CUMULATIVE_DELTA_PRECISION).div(fastPrice));
}
if (cumulativeFastDelta > cumulativeRefDelta && cumulativeFastDelta.sub(cumulativeRefDelta) > maxCumulativeDeltaDiffs[_token]) {
emit MaxCumulativeDeltaDiffExceeded(_token, refPrice, fastPrice, cumulativeRefDelta, cumulativeFastDelta);
}
_setPriceData(_token, refPrice, cumulativeRefDelta, cumulativeFastDelta);
emit PriceData(_token, refPrice, fastPrice, cumulativeRefDelta, cumulativeFastDelta);
prices[_token] = _price;
_emitPriceEvent(_token, _price);
}
function _setPriceData(address _token, uint256 _refPrice, uint256 _cumulativeRefDelta, uint256 _cumulativeFastDelta) private {
require(_refPrice < MAX_REF_PRICE, "FastPriceFeed: invalid refPrice");
// skip validation of block.timestamp, it should only be out of range after the year 2100
require(_cumulativeRefDelta < MAX_CUMULATIVE_REF_DELTA, "FastPriceFeed: invalid cumulativeRefDelta");
require(_cumulativeFastDelta < MAX_CUMULATIVE_FAST_DELTA, "FastPriceFeed: invalid cumulativeFastDelta");
priceData[_token] = PriceDataItem(
uint160(_refPrice),
uint32(block.timestamp),
uint32(_cumulativeRefDelta),
uint32(_cumulativeFastDelta)
);
}
function _emitPriceEvent(address _token, uint256 _price) private {
IFastPriceEvents(fastPriceEvents).emitPriceEvent(_token, _price);
}
function _setLastUpdatedValues() private {
if (minBlockInterval > 0) {
require(block.number.sub(lastUpdatedBlock) >= minBlockInterval, "FastPriceFeed: minBlockInterval not yet passed");
}
lastUpdatedAt = block.timestamp;
lastUpdatedBlock = block.number;
}
function getUpdateFee(
bytes[] memory _updateData
) external view returns (uint feeAmount) {
return pyth.getUpdateFee(_updateData);
}
function executeMultipleDecreaseOrders(
address[] memory _accounts,
uint256[] memory _orderIndexes,
address payable _feeReceiver,
bytes[] memory _updateData,
bool _useTryCatch
) external payable onlyUpdater returns (bool[] memory) {
require(
_accounts.length == _orderIndexes.length,
"OrderExecutor: input arrays length mismatch"
);
_setPricesWithData(_updateData);
// Create result array to track success/failure of each order execution
bool[] memory results = new bool[](_accounts.length);
// Attempt to execute each order
for (uint256 i = 0; i < _accounts.length; i++) {
if (_useTryCatch) {
try positionManager.executeDecreaseOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
) {
results[i] = true;
} catch {
results[i] = false;
}
} else {
positionManager.executeDecreaseOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
);
results[i] = true;
}
}
return results;
}
function executeMultipleIncreaseOrders(
address[] memory _accounts,
uint256[] memory _orderIndexes,
address payable _feeReceiver,
bytes[] memory _updateData,
bool _useTryCatch
) external payable onlyUpdater returns (bool[] memory) {
require(
_accounts.length == _orderIndexes.length,
"OrderExecutor: input arrays length mismatch"
);
_setPricesWithData(_updateData);
// Create result array to track success/failure of each order execution
bool[] memory results = new bool[](_accounts.length);
// Attempt to execute each order
for (uint256 i = 0; i < _accounts.length; i++) {
if (_useTryCatch) {
try positionManager.executeIncreaseOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
) {
results[i] = true;
} catch {
results[i] = false;
}
} else {
positionManager.executeIncreaseOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
);
results[i] = true;
}
}
return results;
}
function executeMultipleSwapOrders(
address[] memory _accounts,
uint256[] memory _orderIndexes,
address payable _feeReceiver,
bytes[] memory _updateData,
bool _useTryCatch
) external payable onlyUpdater returns (bool[] memory) {
require(
_accounts.length == _orderIndexes.length,
"OrderExecutor: input arrays length mismatch"
);
_setPricesWithData(_updateData);
// Create result array to track success/failure of each order execution
bool[] memory results = new bool[](_accounts.length);
// Attempt to execute each order
for (uint256 i = 0; i < _accounts.length; i++) {
if (_useTryCatch) {
try positionManager.executeSwapOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
) {
results[i] = true;
} catch {
results[i] = false;
}
} else {
positionManager.executeSwapOrder(
_accounts[i],
_orderIndexes[i],
_feeReceiver
);
results[i] = true;
}
}
return results;
}
function liquidateMultiplePositions(
address[] memory _accounts,
address[] memory _collateralTokens,
address[] memory _indexTokens,
bool[] memory _isLongs,
address _feeReceiver,
bytes[] memory _updateData,
bool _useTryCatch
) external payable onlyUpdater returns (bool[] memory) {
require(
_accounts.length == _collateralTokens.length &&
_accounts.length == _indexTokens.length &&
_accounts.length == _isLongs.length,
"OrderExecutor: input arrays length mismatch"
);
_setPricesWithData(_updateData);
// Create result array to track success/failure of each liquidation
bool[] memory results = new bool[](_accounts.length);
// Attempt to liquidate each position
for (uint256 i = 0; i < _accounts.length; i++) {
if (_useTryCatch) {
// Use try-catch to handle potential errors
try positionManager.liquidatePosition(
_accounts[i],
_collateralTokens[i],
_indexTokens[i],
_isLongs[i],
_feeReceiver
) {
// Liquidation successful
results[i] = true;
} catch {
// Liquidation failed
results[i] = false;
}
} else {
// Call without try-catch
// This will revert the entire transaction if any liquidation fails
positionManager.liquidatePosition(
_accounts[i],
_collateralTokens[i],
_indexTokens[i],
_isLongs[i],
_feeReceiver
);
// If execution reaches here, the liquidation was successful
results[i] = true;
}
}
return results;
}
function getTokensLength() external view returns (uint256) {
return tokens.length;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
contract Governable {
address public gov;
constructor() public {
gov = msg.sender;
}
modifier onlyGov() {
require(msg.sender == gov, "Governable: forbidden");
_;
}
function setGov(address _gov) external onlyGov {
gov = _gov;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IPositionManager {
function executeDecreaseOrder(address _account, uint256 _orderIndex, address payable _feeReceiver) external;
function executeIncreaseOrder(address _account, uint256 _orderIndex, address payable _feeReceiver) external;
function executeSwapOrder(address _account, uint256 _orderIndex, address payable _feeReceiver) external;
function liquidatePosition(
address _account,
address _collateralToken,
address _indexToken,
bool _isLong,
address _feeReceiver
) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IPositionRouter {
function increasePositionRequestKeysStart() external returns (uint256);
function decreasePositionRequestKeysStart() external returns (uint256);
function executeIncreasePositions(uint256 _count, address payable _executionFeeReceiver) external;
function executeDecreasePositions(uint256 _count, address payable _executionFeeReceiver) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IVaultPriceFeed {
function adjustmentBasisPoints(address _token) external view returns (uint256);
function isAdjustmentAdditive(address _token) external view returns (bool);
function pythNetwork() external view returns (address);
function setAdjustment(address _token, bool _isAdditive, uint256 _adjustmentBps) external;
function setIsSecondaryPriceEnabled(bool _isEnabled) external;
function setSpreadBasisPoints(address _token, uint256 _spreadBasisPoints) external;
function setSpreadThresholdBasisPoints(uint256 _spreadThresholdBasisPoints) external;
function setFavorPrimaryPrice(bool _favorPrimaryPrice) external;
function setMaxStrictPriceDeviation(uint256 _maxStrictPriceDeviation) external;
function getPrice(address _token, bool _maximise, bool _includeAmmPrice, bool _useSwapPricing) external view returns (uint256);
function getLatestPrimaryPrice(address _token) external view returns (uint256);
function getPrimaryPrice(address _token, bool _maximise) external view returns (uint256);
function setPythNetwork(address _pythNetwork) external;
function setTokenConfig(
address _token,
bytes32 _priceFeed,
uint256 _allowedStaleness,
bool _isStrictStable
) external;
function setSecondaryPriceFeed(address _secondaryPriceFeed) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IFastPriceEvents {
function emitPriceEvent(address _token, uint256 _price) external;
function setIsPriceFeed(address _priceFeed, bool _isPriceFeed) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IFastPriceFeed {
function lastUpdatedAt() external view returns (uint256);
function lastUpdatedBlock() external view returns (uint256);
function setSigner(address _account, bool _isActive) external;
function setUpdater(address _account, bool _isActive) external;
function setPriceDuration(uint256 _priceDuration) external;
function setMaxPriceUpdateDelay(uint256 _maxPriceUpdateDelay) external;
function setSpreadBasisPointsIfInactive(uint256 _spreadBasisPointsIfInactive) external;
function setSpreadBasisPointsIfChainError(uint256 _spreadBasisPointsIfChainError) external;
function setMinBlockInterval(uint256 _minBlockInterval) external;
function setIsSpreadEnabled(bool _isSpreadEnabled) external;
function setMaxDeviationBasisPoints(uint256 _maxDeviationBasisPoints) external;
function setMaxCumulativeDeltaDiffs(address[] memory _tokens, uint256[] memory _maxCumulativeDeltaDiffs) external;
function setPriceDataInterval(uint256 _priceDataInterval) external;
}// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
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 and confidence interval.
/// @dev Reverts if the price has not been updated within the last `getValidTimePeriod()` seconds.
/// @param id The Pyth Price Feed ID of which to fetch the price and confidence interval.
/// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
function getPrice(
bytes32 id
) 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 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);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.12;
/// @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: MIT
pragma solidity >=0.6.12;
interface ISecondaryPriceFeed {
function getPrice(address _token, uint256 _referencePrice, bool _maximise) external view returns (uint256);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.12;
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;
}
}{
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 14
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_pyth","type":"address"},{"internalType":"uint256","name":"_priceDuration","type":"uint256"},{"internalType":"uint256","name":"_maxPriceUpdateDelay","type":"uint256"},{"internalType":"uint256","name":"_minBlockInterval","type":"uint256"},{"internalType":"uint256","name":"_maxDeviationBasisPoints","type":"uint256"},{"internalType":"address","name":"_vaultPriceFeed","type":"address"},{"internalType":"address","name":"_fastPriceEvents","type":"address"},{"internalType":"address","name":"_tokenManager","type":"address"},{"internalType":"contract IPositionRouter","name":"_positionRouter","type":"address"},{"internalType":"contract IPositionManager","name":"_positionManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"}],"name":"DisableFastPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"}],"name":"EnableFastPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"refPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fastPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeRefDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeFastDelta","type":"uint256"}],"name":"MaxCumulativeDeltaDiffExceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"refPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fastPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeRefDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeFastDelta","type":"uint256"}],"name":"PriceData","type":"event"},{"inputs":[],"name":"BASIS_POINTS_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CUMULATIVE_DELTA_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CUMULATIVE_FAST_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CUMULATIVE_REF_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRICE_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_REF_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableFastPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableFastPriceVoteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"disableFastPriceVotes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableFastPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_orderIndexes","type":"uint256[]"},{"internalType":"address payable","name":"_feeReceiver","type":"address"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"},{"internalType":"bool","name":"_useTryCatch","type":"bool"}],"name":"executeMultipleDecreaseOrders","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_orderIndexes","type":"uint256[]"},{"internalType":"address payable","name":"_feeReceiver","type":"address"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"},{"internalType":"bool","name":"_useTryCatch","type":"bool"}],"name":"executeMultipleIncreaseOrders","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_orderIndexes","type":"uint256[]"},{"internalType":"address payable","name":"_feeReceiver","type":"address"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"},{"internalType":"bool","name":"_useTryCatch","type":"bool"}],"name":"executeMultipleSwapOrders","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fastPriceEvents","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"favorFastPrice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_refPrice","type":"uint256"},{"internalType":"bool","name":"_maximise","type":"bool"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getPriceData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"getUpdateFee","outputs":[{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minAuthorizations","type":"uint256"},{"internalType":"address[]","name":"_signers","type":"address[]"},{"internalType":"address[]","name":"_updaters","type":"address[]"},{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"bytes32[]","name":"_priceFeedIds","type":"bytes32[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSpreadEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isUpdater","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"address[]","name":"_collateralTokens","type":"address[]"},{"internalType":"address[]","name":"_indexTokens","type":"address[]"},{"internalType":"bool[]","name":"_isLongs","type":"bool[]"},{"internalType":"address","name":"_feeReceiver","type":"address"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"},{"internalType":"bool","name":"_useTryCatch","type":"bool"}],"name":"liquidateMultiplePositions","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxCumulativeDeltaDiffs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeviationBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPriceUpdateDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAuthorizations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBlockInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionManager","outputs":[{"internalType":"contract IPositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionRouter","outputs":[{"internalType":"contract IPositionRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceData","outputs":[{"internalType":"uint160","name":"refPrice","type":"uint160"},{"internalType":"uint32","name":"refTime","type":"uint32"},{"internalType":"uint32","name":"cumulativeRefDelta","type":"uint32"},{"internalType":"uint32","name":"cumulativeFastDelta","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDataInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceFeedIds","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"prices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pyth","outputs":[{"internalType":"contract IPyth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isSpreadEnabled","type":"bool"}],"name":"setIsSpreadEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lastUpdatedAt","type":"uint256"}],"name":"setLastUpdatedAt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_maxCumulativeDeltaDiffs","type":"uint256[]"}],"name":"setMaxCumulativeDeltaDiffs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDeviationBasisPoints","type":"uint256"}],"name":"setMaxDeviationBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPriceUpdateDelay","type":"uint256"}],"name":"setMaxPriceUpdateDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minAuthorizations","type":"uint256"}],"name":"setMinAuthorizations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBlockInterval","type":"uint256"}],"name":"setMinBlockInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceDataInterval","type":"uint256"}],"name":"setPriceDataInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceDuration","type":"uint256"}],"name":"setPriceDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"priceUpdateData","type":"bytes[]"}],"name":"setPricesWithData","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"priceUpdateData","type":"bytes[]"},{"internalType":"uint256","name":"_endIndexForIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_endIndexForDecreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxDecreasePositions","type":"uint256"}],"name":"setPricesWithDataAndExecute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spreadBasisPointsIfChainError","type":"uint256"}],"name":"setSpreadBasisPointsIfChainError","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spreadBasisPointsIfInactive","type":"uint256"}],"name":"setSpreadBasisPointsIfInactive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenManager","type":"address"}],"name":"setTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"spreadBasisPointsIfChainError","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"spreadBasisPointsIfInactive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultPriceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60e06040526000805460ff60a81b19168155600c553480156200002157600080fd5b5060405162003b3e38038062003b3e833981016040819052620000449162000102565b600080546001600160a01b03191633179055610708891115620000845760405162461bcd60e51b81526004016200007b90620001c0565b60405180910390fd5b6001600160601b031960609a8b1b8116608052600499909955600597909755600895909555600a93909355861b851660c05290941b90921660a052600180546001600160a01b039485166001600160a01b0319918216179091556015805493851693821693909317909255601680549190931691161790556200021e565b6000806000806000806000806000806101408b8d03121562000122578586fd5b8a516200012f8162000205565b809a505060208b0151985060408b0151975060608b0151965060808b0151955060a08b01516200015f8162000205565b60c08c0151909550620001728162000205565b60e08c0151909450620001858162000205565b6101008c0151909350620001998162000205565b6101208c0151909250620001ad8162000205565b809150509295989b9194979a5092959850565b60208082526025908201527f466173745072696365466565643a20696e76616c6964205f707269636544757260408201526430ba34b7b760d91b606082015260800190565b6001600160a01b03811681146200021b57600080fd5b50565b60805160601c60a05160601c60c05160601c6138cc62000272600039806109bf5280612a285250806121955280612629525080611e2552806121bf528061220352806122c1528061239552506138cc6000f3fe6080604052600436106102e35760003560e01c8063791b98bc11610182578063791b98bc1461064b5780637be3ab02146106605780637cb2b79c146106735780637df73e27146106935780637fece368146106b357806382553aad146106d35780638b7677f4146106f357806395082d25146107135780639fef799614610728578063a2b47c161461073b578063a374242514610750578063a6eca89614610770578063b0a2566614610785578063b0c26ecf1461079a578063b3606b56146107af578063b70c7b70146107c4578063c84a9124146107e4578063cab44b76146107f9578063ce98dfa814610829578063cfad57a214610849578063cfed246b14610869578063d47eed4514610889578063d6a153f1146108a9578063d925351a146108c9578063de0d1b94146108e9578063dfb481c914610909578063e64559ad1461091e578063e68a22c014610933578063e6ca28d014610948578063eeaa783a1461095b578063f90ce5ba14610970578063f98d06f014610985576102e3565b806303b04936146102e857806303cd25711461031e5780630604ddea146103405780630e9272ea14610355578063126082cf1461037757806312d43a511461038c57806314dd2dce146103a15780631a153391146103c35780632798117d146103e3578063287800c9146104035780632a709b14146104185780632e9cd94b1461042d57806331cb61051461044d578063336eb6ae1461046d578063392e53cd1461048d57806344c23193146104a25780634bd66c1c146103405780634c0e31c8146104c25780634f64b2be146104e25780634fdfb0861461050257806354aea127146105225780635facf2cd1461053757806361ef161f1461054a57806363a22d711461055f578063668d3d651461057f578063695d4184146105945780636c56fd05146105a95780636ccd47c4146105c9578063715c7536146105de57806372279ba1146105f357806374bfed891461062357806378e8ab1714610638575b600080fd5b3480156102f457600080fd5b50610308610303366004612d4b565b61099a565b6040516103159190613381565b60405180910390f35b34801561032a57600080fd5b506103336109af565b604051610315919061338c565b34801561034c57600080fd5b506103336109b5565b34801561036157600080fd5b5061036a6109bd565b604051610315919061322b565b34801561038357600080fd5b506103336109e1565b34801561039857600080fd5b5061036a6109e7565b3480156103ad57600080fd5b506103c16103bc3660046130ff565b6109f6565b005b3480156103cf57600080fd5b506103c16103de366004612d67565b610a2e565b6103f66103f1366004612f2b565b610a83565b60405161031591906132db565b34801561040f57600080fd5b50610333610ccd565b34801561042457600080fd5b5061036a610cd3565b34801561043957600080fd5b506103c16104483660046130ff565b610ce2565b34801561045957600080fd5b506103c1610468366004612d67565b610d11565b34801561047957600080fd5b50610333610488366004612d4b565b610d66565b34801561049957600080fd5b50610308610d78565b3480156104ae57600080fd5b506103c16104bd3660046130ff565b610d88565b3480156104ce57600080fd5b506103c16104dd366004612ecb565b610dd9565b3480156104ee57600080fd5b5061036a6104fd3660046130ff565b610e87565b34801561050e57600080fd5b5061030861051d366004612d4b565b610eae565b34801561052e57600080fd5b50610333610ec3565b6103f6610545366004612ddd565b610ec9565b34801561055657600080fd5b5061036a611183565b34801561056b57600080fd5b506103c161057a36600461312f565b611192565b34801561058b57600080fd5b50610333611345565b3480156105a057600080fd5b5061030861134b565b3480156105b557600080fd5b506103086105c4366004612d4b565b61135b565b3480156105d557600080fd5b506103c16113e6565b3480156105ea57600080fd5b506103336114a6565b3480156105ff57600080fd5b5061061361060e366004612d4b565b6114ac565b6040516103159493929190613813565b34801561062f57600080fd5b5061033361152a565b6103c1610646366004612fd8565b611530565b34801561065757600080fd5b5061036a61156b565b6103f661066e366004612f2b565b61157a565b34801561067f57600080fd5b506103c161068e366004612d4b565b6117b9565b34801561069f57600080fd5b506103086106ae366004612d4b565b611805565b3480156106bf57600080fd5b506103336106ce366004612d9c565b61181a565b3480156106df57600080fd5b506103c16106ee3660046130ff565b6119a6565b3480156106ff57600080fd5b506103c161070e3660046130ff565b6119d5565b34801561071f57600080fd5b50610333611a04565b6103c1610736366004613012565b611a14565b34801561074757600080fd5b50610333611c0b565b34801561075c57600080fd5b5061033361076b366004612d4b565b611c12565b34801561077c57600080fd5b50610333611c24565b34801561079157600080fd5b50610333611c2a565b3480156107a657600080fd5b50610333611c30565b3480156107bb57600080fd5b50610333611c36565b3480156107d057600080fd5b506103c16107df3660046130ff565b611c3c565b3480156107f057600080fd5b506103c1611c6b565b34801561080557600080fd5b50610819610814366004612d4b565b611d26565b60405161031594939291906137cd565b34801561083557600080fd5b506103c161084436600461306c565b611d65565b34801561085557600080fd5b506103c1610864366004612d4b565b611dad565b34801561087557600080fd5b50610333610884366004612d4b565b611df9565b34801561089557600080fd5b506103336108a4366004612fd8565b611e0b565b3480156108b557600080fd5b506103c16108c43660046130ff565b611eb0565b3480156108d557600080fd5b506103c16108e43660046130ff565b611edf565b3480156108f557600080fd5b506103c16109043660046130ff565b611f0e565b34801561091557600080fd5b50610333611f3d565b34801561092a57600080fd5b50610333611f43565b34801561093f57600080fd5b50610333611f49565b6103f6610956366004612f2b565b611f54565b34801561096757600080fd5b5061036a612193565b34801561097c57600080fd5b506103336121b7565b34801561099157600080fd5b5061036a6121bd565b60136020526000908152604090205460ff1681565b60045481565b63ffffffff81565b7f000000000000000000000000000000000000000000000000000000000000000081565b61271081565b6000546001600160a01b031681565b6000546001600160a01b03163314610a295760405162461bcd60e51b8152600401610a2090613599565b60405180910390fd5b600255565b6000546001600160a01b03163314610a585760405162461bcd60e51b8152600401610a2090613599565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b336000908152600d602052604090205460609060ff16610ab55760405162461bcd60e51b8152600401610a2090613722565b8451865114610ad65760405162461bcd60e51b8152600401610a20906135c8565b610adf836121e1565b606086516001600160401b0381118015610af857600080fd5b50604051908082528060200260200182016040528015610b22578160200160208202803683370190505b50905060005b8751811015610cc2578315610c0b5760165488516001600160a01b03909116906307c7edc3908a9084908110610b5a57fe5b6020026020010151898481518110610b6e57fe5b6020026020010151896040518463ffffffff1660e01b8152600401610b959392919061328a565b600060405180830381600087803b158015610baf57600080fd5b505af1925050508015610bc0575060015b610be7576000828281518110610bd257fe5b91151560209283029190910190910152610c06565b6001828281518110610bf557fe5b911515602092830291909101909101525b610cba565b60165488516001600160a01b03909116906307c7edc3908a9084908110610c2e57fe5b6020026020010151898481518110610c4257fe5b6020026020010151896040518463ffffffff1660e01b8152600401610c699392919061328a565b600060405180830381600087803b158015610c8357600080fd5b505af1158015610c97573d6000803e3d6000fd5b505050506001828281518110610ca957fe5b911515602092830291909101909101525b600101610b28565b509695505050505050565b600b5481565b6001546001600160a01b031681565b6001546001600160a01b03163314610d0c5760405162461bcd60e51b8152600401610a2090613722565b600955565b6000546001600160a01b03163314610d3b5760405162461bcd60e51b8152600401610a2090613599565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b600f6020526000908152604090205481565b600054600160a01b900460ff1681565b6000546001600160a01b03163314610db25760405162461bcd60e51b8152600401610a2090613599565b610708811115610dd45760405162461bcd60e51b8152600401610a2090613408565b600455565b6001546001600160a01b03163314610e035760405162461bcd60e51b8152600401610a2090613722565b8051825114610e245760405162461bcd60e51b8152600401610a20906134cc565b60005b8251811015610e82576000838281518110610e3e57fe5b60200260200101519050828281518110610e5457fe5b6020908102919091018101516001600160a01b03909216600090815260119091526040902055600101610e27565b505050565b60148181548110610e9457fe5b6000918252602090912001546001600160a01b0316905081565b600d6020526000908152604090205460ff1681565b60025481565b336000908152600d602052604090205460609060ff16610efb5760405162461bcd60e51b8152600401610a2090613722565b86518851148015610f0d575085518851145b8015610f1a575084518851145b610f365760405162461bcd60e51b8152600401610a20906135c8565b610f3f836121e1565b606088516001600160401b0381118015610f5857600080fd5b50604051908082528060200260200182016040528015610f82578160200160208202803683370190505b50905060005b8951811015611176578315611095576016548a516001600160a01b039091169063de2ea948908c9084908110610fba57fe5b60200260200101518b8481518110610fce57fe5b60200260200101518b8581518110610fe257fe5b60200260200101518b8681518110610ff657fe5b60200260200101518b6040518663ffffffff1660e01b815260040161101f95949392919061323f565b600060405180830381600087803b15801561103957600080fd5b505af192505050801561104a575060015b61107157600082828151811061105c57fe5b91151560209283029190910190910152611090565b600182828151811061107f57fe5b911515602092830291909101909101525b61116e565b6016548a516001600160a01b039091169063de2ea948908c90849081106110b857fe5b60200260200101518b84815181106110cc57fe5b60200260200101518b85815181106110e057fe5b60200260200101518b86815181106110f457fe5b60200260200101518b6040518663ffffffff1660e01b815260040161111d95949392919061323f565b600060405180830381600087803b15801561113757600080fd5b505af115801561114b573d6000803e3d6000fd5b50505050600182828151811061115d57fe5b911515602092830291909101909101525b600101610f88565b5098975050505050505050565b6015546001600160a01b031681565b6000546001600160a01b031633146111bc5760405162461bcd60e51b8152600401610a2090613599565b600054600160a01b900460ff16156111e65760405162461bcd60e51b8152600401610a209061378b565b80518251146112075760405162461bcd60e51b8152600401610a2090613754565b6000805460ff60a01b1916600160a01b178155600b8690555b845181101561127357600085828151811061123757fe5b6020908102919091018101516001600160a01b03166000908152601290915260409020805460ff19166001908117909155919091019050611220565b5060005b83518110156112ca57600084828151811061128e57fe5b6020908102919091018101516001600160a01b03166000908152600d90915260409020805460ff19166001908117909155919091019050611277565b5081516112de906014906020850190612a8d565b5060005b825181101561133d5760008382815181106112f957fe5b6020026020010151905082828151811061130f57fe5b6020908102919091018101516001600160a01b039092166000908152600f90915260409020556001016112e2565b505050505050565b61070881565b600054600160a81b900460ff1681565b60008054600160a81b900460ff1615611376575060006113e1565b600b54600c5410611389575060006113e1565b600080611395846114ac565b93509350505081811180156113ca57506001600160a01b0384166000908152601160205260409020546113c882846124ee565b115b156113da576000925050506113e1565b6001925050505b919050565b3360009081526012602052604090205460ff166114155760405162461bcd60e51b8152600401610a2090613722565b3360009081526013602052604090205460ff166114445760405162461bcd60e51b8152600401610a2090613562565b336000908152601360205260409020805460ff19169055600c546114699060016124ee565b600c556040517f9fe0c305c33aa92757a537936872a60be0d91549a4303cc99fd8b7fce8a002759061149c90339061322b565b60405180910390a1565b600a5481565b6000806000806114ba612af2565b505050506001600160a01b039182166000908152601060209081526040918290208251608081018452905494851680825263ffffffff600160a01b87048116938301849052600160c01b87048116948301859052600160e01b909604909516606090910181905293949093919250565b60065481565b336000908152600d602052604090205460ff1661155f5760405162461bcd60e51b8152600401610a2090613722565b611568816121e1565b50565b6016546001600160a01b031681565b336000908152600d602052604090205460609060ff166115ac5760405162461bcd60e51b8152600401610a2090613722565b84518651146115cd5760405162461bcd60e51b8152600401610a20906135c8565b6115d6836121e1565b606086516001600160401b03811180156115ef57600080fd5b50604051908082528060200260200182016040528015611619578160200160208202803683370190505b50905060005b8751811015610cc25783156117025760165488516001600160a01b039091169063d38ab519908a908490811061165157fe5b602002602001015189848151811061166557fe5b6020026020010151896040518463ffffffff1660e01b815260040161168c9392919061328a565b600060405180830381600087803b1580156116a657600080fd5b505af19250505080156116b7575060015b6116de5760008282815181106116c957fe5b911515602092830291909101909101526116fd565b60018282815181106116ec57fe5b911515602092830291909101909101525b6117b1565b60165488516001600160a01b039091169063d38ab519908a908490811061172557fe5b602002602001015189848151811061173957fe5b6020026020010151896040518463ffffffff1660e01b81526004016117609392919061328a565b600060405180830381600087803b15801561177a57600080fd5b505af115801561178e573d6000803e3d6000fd5b5050505060018282815181106117a057fe5b911515602092830291909101909101525b60010161161f565b6001546001600160a01b031633146117e35760405162461bcd60e51b8152600401610a2090613722565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60126020526000908152604090205460ff1681565b600061183360055460025461253090919063ffffffff16565b4211156118945781156118745761186d61271061186761186060075461271061253090919063ffffffff16565b8690612555565b9061258f565b905061199f565b61186d6127106118676118606007546127106124ee90919063ffffffff16565b6004546002546118a391612530565b4211156118f05781156118d05761186d61271061186761186060065461271061253090919063ffffffff16565b61186d6127106118676118606006546127106124ee90919063ffffffff16565b6001600160a01b0384166000908152600e602052604090205480611917578391505061199f565b600081851161192f5761192a82866124ee565b611939565b61193985836124ee565b905061194b8561186783612710612555565b905060006119588761135b565b15806119655750600a5482115b9050801561199957841561198c578286116119805782611982565b855b935050505061199f565b8286106119805782611982565b50909150505b9392505050565b6001546001600160a01b031633146119d05760405162461bcd60e51b8152600401610a2090613722565b600a55565b6000546001600160a01b031633146119ff5760405162461bcd60e51b8152600401610a2090613599565b600555565b68327cb2734119d3b7a9601e1b81565b336000908152600d602052604090205460ff16611a435760405162461bcd60e51b8152600401610a2090613722565b611a4c856121e1565b6000601560009054906101000a90046001600160a01b031690506000611ae584836001600160a01b0316639b5786206040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611aa757600080fd5b505af1158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190613117565b90612530565b90506000611b2884846001600160a01b0316631bca8cf06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611aa757600080fd5b905081871115611b36578196505b80861115611b42578095505b604051629a208160e81b81526001600160a01b03841690639a20810090611b6f908a9033906004016137fc565b600060405180830381600087803b158015611b8957600080fd5b505af1158015611b9d573d6000803e3d6000fd5b505060405163f3883d8b60e01b81526001600160a01b038616925063f3883d8b9150611bcf90899033906004016137fc565b600060405180830381600087803b158015611be957600080fd5b505af1158015611bfd573d6000803e3d6000fd5b505050505050505050505050565b6298968081565b60116020526000908152604090205481565b60075481565b600c5481565b60145490565b60085481565b6000546001600160a01b03163314611c665760405162461bcd60e51b8152600401610a2090613599565b600655565b3360009081526012602052604090205460ff16611c9a5760405162461bcd60e51b8152600401610a2090613722565b3360009081526013602052604090205460ff1615611cca5760405162461bcd60e51b8152600401610a20906133a8565b336000908152601360205260409020805460ff19166001908117909155600c54611cf391612530565b600c556040517f4c0c5fabf50e808e3bc8d19577d305e3a7163eea7e8a74a50caa8896694cd44b9061149c90339061322b565b6010602052600090815260409020546001600160a01b0381169063ffffffff600160a01b8204811691600160c01b8104821691600160e01b9091041684565b6000546001600160a01b03163314611d8f5760405162461bcd60e51b8152600401610a2090613599565b60008054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314611dd75760405162461bcd60e51b8152600401610a2090613599565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600e6020526000908152604090205481565b60405163d47eed4560e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d47eed4590611e5a908590600401613321565b60206040518083038186803b158015611e7257600080fd5b505afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613117565b92915050565b6000546001600160a01b03163314611eda5760405162461bcd60e51b8152600401610a2090613599565b600855565b6001546001600160a01b03163314611f095760405162461bcd60e51b8152600401610a2090613722565b600b55565b6000546001600160a01b03163314611f385760405162461bcd60e51b8152600401610a2090613599565b600755565b60095481565b60055481565b6001600160a01b0381565b336000908152600d602052604090205460609060ff16611f865760405162461bcd60e51b8152600401610a2090613722565b8451865114611fa75760405162461bcd60e51b8152600401610a20906135c8565b611fb0836121e1565b606086516001600160401b0381118015611fc957600080fd5b50604051908082528060200260200182016040528015611ff3578160200160208202803683370190505b50905060005b8751811015610cc25783156120dc5760165488516001600160a01b03909116906311d9444a908a908490811061202b57fe5b602002602001015189848151811061203f57fe5b6020026020010151896040518463ffffffff1660e01b81526004016120669392919061328a565b600060405180830381600087803b15801561208057600080fd5b505af1925050508015612091575060015b6120b85760008282815181106120a357fe5b911515602092830291909101909101526120d7565b60018282815181106120c657fe5b911515602092830291909101909101525b61218b565b60165488516001600160a01b03909116906311d9444a908a90849081106120ff57fe5b602002602001015189848151811061211357fe5b6020026020010151896040518463ffffffff1660e01b815260040161213a9392919061328a565b600060405180830381600087803b15801561215457600080fd5b505af1158015612168573d6000803e3d6000fd5b50505050600182828151811061217a57fe5b911515602092830291909101909101525b600101611ff9565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6121e96125ce565b60405163d47eed4560e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d47eed4590612238908590600401613321565b60206040518083038186803b15801561225057600080fd5b505afa158015612264573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122889190613117565b9050803410156122aa5760405162461bcd60e51b8152600401610a209061350d565b604051631df3cbc560e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ef9e5e289083906122f8908690600401613321565b6000604051808303818588803b15801561231157600080fd5b505af1158015612325573d6000803e3d6000fd5b50506014546004549093509150600090505b828110156124e75760006014828154811061234e57fe5b60009182526020808320909101546001600160a01b0316808352600f90915260409091205490915061237e612af2565b6040516331d98b3f60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906331d98b3f906123ca90859060040161338c565b60806040518083038186803b1580156123e257600080fd5b505afa1580156123f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061241a9190613088565b90506000816000015160070b136124435760405162461bcd60e51b8152600401610a2090613539565b8442038160600151116124685760405162461bcd60e51b8152600401610a20906133de565b6000816000015160070b90506000826040015160030b12156124b257604082015160000360030b600a0a8068327cb2734119d3b7a9601e1b8302816124a957fe5b049150506124cd565b604082015160030b600a0a0268327cb2734119d3b7a9601e1b025b6124d7848261260f565b5050600190920191506123379050565b5050505050565b600061199f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061288b565b60008282018381101561199f5760405162461bcd60e51b8152600401610a2090613497565b60008261256457506000611eaa565b8282028284828161257157fe5b041461199f5760405162461bcd60e51b8152600401610a2090613613565b600061199f83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b8152506128b7565b60085415612605576008546003546125e79043906124ee565b10156126055760405162461bcd60e51b8152600401610a209061368b565b4260025543600355565b6040516315afe77960e21b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906356bf9de49061265e90869060040161322b565b60206040518083038186803b15801561267657600080fd5b505afa15801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190613117565b6001600160a01b0384166000908152600e60205260408120549192508080806126d6886114ac565b9350935093509350600084111561279d5760008487116126ff576126fa85886124ee565b612709565b61270987866124ee565b905060008887116127235761271e89886124ee565b61272d565b61272d878a6124ee565b90506127446009544261258f90919063ffffffff16565b60095461275290879061258f565b146127605760009350600092505b61277b612774876118678562989680612555565b8590612530565b9350612798612791886118678462989680612555565b8490612530565b925050505b81811180156127cc57506001600160a01b0388166000908152601160205260409020546127ca82846124ee565b115b15612811577fe582322b389ad06b2bbf619cd6da3f16a288ec873ea0fa6df4d72f3d9480b44788878785856040516128089594939291906132ad565b60405180910390a15b61281d888784846128ee565b7f23b9387f81fca646aac1dc4487ede045c65f5f7445482906565f01e05afdb3a888878785856040516128549594939291906132ad565b60405180910390a16001600160a01b0388166000908152600e602052604090208790556128818888612a11565b5050505050505050565b600081848411156128af5760405162461bcd60e51b8152600401610a209190613395565b505050900390565b600081836128d85760405162461bcd60e51b8152600401610a209190613395565b5060008385816128e457fe5b0495945050505050565b6001600160a01b0383106129145760405162461bcd60e51b8152600401610a2090613654565b63ffffffff82106129375760405162461bcd60e51b8152600401610a20906136d9565b63ffffffff811061295a5760405162461bcd60e51b8152600401610a209061344d565b604080516080810182526001600160a01b03948516815263ffffffff4281166020808401918252958216838501908152948216606084019081529787166000908152601090965292909420905181549251935196518516600160e01b026001600160e01b03978616600160c01b0263ffffffff60c01b1995909616600160a01b0263ffffffff60a01b19929097166001600160a01b0319909416939093171694909417919091169190911792909216919091179055565b60405163e0409c7160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e0409c7190612a5f9085908590600401613271565b600060405180830381600087803b158015612a7957600080fd5b505af115801561133d573d6000803e3d6000fd5b828054828255906000526020600020908101928215612ae2579160200282015b82811115612ae257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612aad565b50612aee929150612b19565b5090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b80821115612aee5780546001600160a01b0319168155600101612b1a565b8035611eaa81613873565b600082601f830112612b53578081fd5b8135612b66612b6182613854565b61382e565b818152915060208083019084810181840286018201871015612b8757600080fd5b60005b84811015612baf578135612b9d81613873565b84529282019290820190600101612b8a565b505050505092915050565b600082601f830112612bca578081fd5b8135612bd8612b6182613854565b818152915060208083019084810181840286018201871015612bf957600080fd5b60005b84811015612baf57612c0e8883612d3b565b84529282019290820190600101612bfc565b600082601f830112612c30578081fd5b8135612c3e612b6182613854565b818152915060208083019084810181840286018201871015612c5f57600080fd5b60005b84811015612baf57813584529282019290820190600101612c62565b6000601f8381840112612c8f578182fd5b8235612c9d612b6182613854565b818152925060208084019085810160005b84811015612d2f578135880189603f820112612cc957600080fd5b808401356001600160401b03811115612ce157600080fd5b612cf2818901601f1916860161382e565b81815260408c81848601011115612d0857600080fd5b82818501888401375060009181018601919091528552509282019290820190600101612cae565b50505050505092915050565b80358015158114611eaa57600080fd5b600060208284031215612d5c578081fd5b813561199f81613873565b60008060408385031215612d79578081fd5b8235612d8481613873565b9150612d938460208501612d3b565b90509250929050565b600080600060608486031215612db0578081fd5b8335612dbb81613873565b9250602084013591506040840135612dd281613888565b809150509250925092565b600080600080600080600060e0888a031215612df7578283fd5b87356001600160401b0380821115612e0d578485fd5b612e198b838c01612b43565b985060208a0135915080821115612e2e578485fd5b612e3a8b838c01612b43565b975060408a0135915080821115612e4f578485fd5b612e5b8b838c01612b43565b965060608a0135915080821115612e70578485fd5b612e7c8b838c01612bba565b9550612e8b8b60808c01612b38565b945060a08a0135915080821115612ea0578384fd5b50612ead8a828b01612c7e565b925050612ebd8960c08a01612d3b565b905092959891949750929550565b60008060408385031215612edd578081fd5b82356001600160401b0380821115612ef3578283fd5b612eff86838701612b43565b93506020850135915080821115612f14578283fd5b50612f2185828601612c20565b9150509250929050565b600080600080600060a08688031215612f42578283fd5b85356001600160401b0380821115612f58578485fd5b612f6489838a01612b43565b96506020880135915080821115612f79578485fd5b612f8589838a01612c20565b955060408801359150612f9782613873565b90935060608701359080821115612fac578283fd5b50612fb988828901612c7e565b9250506080860135612fca81613888565b809150509295509295909350565b600060208284031215612fe9578081fd5b81356001600160401b03811115612ffe578182fd5b61300a84828501612c7e565b949350505050565b600080600080600060a08688031215613029578283fd5b85356001600160401b0381111561303e578384fd5b61304a88828901612c7e565b9860208801359850604088013597606081013597506080013595509350505050565b60006020828403121561307d578081fd5b813561199f81613888565b600060808284031215613099578081fd5b6130a3608061382e565b82518060070b81146130b3578283fd5b815260208301516001600160401b03811681146130ce578283fd5b60208201526040830151600381900b81146130e7578283fd5b60408201526060928301519281019290925250919050565b600060208284031215613110578081fd5b5035919050565b600060208284031215613128578081fd5b5051919050565b600080600080600060a08688031215613146578283fd5b8535945060208601356001600160401b0380821115613163578485fd5b61316f89838a01612b43565b95506040880135915080821115613184578485fd5b61319089838a01612b43565b945060608801359150808211156131a5578283fd5b6131b189838a01612b43565b935060808801359150808211156131c6578283fd5b506131d388828901612c20565b9150509295509295909350565b60008151808452815b81811015613205576020818501810151868301820152016131e9565b818111156132165782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0395861681529385166020850152918416604084015215156060830152909116608082015260a00190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156133155783511515835292840192918401916001016132f7565b50909695505050505050565b6000602080830181845280855180835260408601915060408482028701019250838701855b8281101561337457603f198886030184526133628583516131e0565b94509285019290850190600101613346565b5092979650505050505050565b901515815260200190565b90815260200190565b60006020825261199f60208301846131e0565b6020808252601c908201527b11985cdd141c9a58d9519959590e88185b1c9958591e481d9bdd195960221b604082015260600190565b60208082526010908201526f7374616c65207079746820707269636560801b604082015260600190565b60208082526025908201527f466173745072696365466565643a20696e76616c6964205f707269636544757260408201526430ba34b7b760d91b606082015260800190565b6020808252602a908201527f466173745072696365466565643a20696e76616c69642063756d756c61746976604082015269654661737444656c746160b01b606082015260800190565b6020808252601b908201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604082015260600190565b60208082526021908201527f466173745072696365466565643a206d69736d617463686564206c656e6774686040820152607360f81b606082015260800190565b602080825260129082015271696e73756666696369656e742076616c756560701b604082015260600190565b6020808252600f908201526e070797468207072696365203c3d203608c1b604082015260600190565b6020808252601e908201527f466173745072696365466565643a20616c726561647920656e61626c65640000604082015260600190565b60208082526015908201527423b7bb32b93730b136329d103337b93134b23232b760591b604082015260600190565b6020808252602b908201527f4f726465724578656375746f723a20696e70757420617272617973206c656e6760408201526a0e8d040dad2e6dac2e8c6d60ab1b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601f908201527f466173745072696365466565643a20696e76616c696420726566507269636500604082015260600190565b6020808252602e908201527f466173745072696365466565643a206d696e426c6f636b496e74657276616c2060408201526d1b9bdd081e595d081c185cdcd95960921b606082015260800190565b60208082526029908201527f466173745072696365466565643a20696e76616c69642063756d756c617469766040820152686552656644656c746160b81b606082015260800190565b6020808252601890820152772330b9ba283934b1b2a332b2b21d103337b93134b23232b760411b604082015260600190565b6020808252601e908201527f466173745072696365466565643a20696e76616c6964206c656e677468730000604082015260600190565b60208082526022908201527f466173745072696365466565643a20616c726561647920696e697469616c697a604082015261195960f21b606082015260800190565b6001600160a01b0394909416845263ffffffff9283166020850152908216604084015216606082015260800190565b9182526001600160a01b0316602082015260400190565b93845260208401929092526040830152606082015260800190565b6040518181016001600160401b038111828210171561384c57600080fd5b604052919050565b60006001600160401b03821115613869578081fd5b5060209081020190565b6001600160a01b038116811461156857600080fd5b801515811461156857600080fdfea2646970667358221220c0e854873816890d904eaa66aee087da2b06ffa9449296e3dcb2b289c944a77164736f6c634300060c00330000000000000000000000002880ab155794e7179c9ee2e38200202908c17b430000000000000000000000000000000000000000000000000000000000000078000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000aee8213a86c5488b7f981e2965abbfaf565437920000000000000000000000004236907b95d07e56a70f21707e6105b1dccebfc000000000000000000000000030b12942912cee5a719edec2dd147224fcc373a000000000000000000000000091c62ae93ccffdbe0b1be841433e46e033514c8d000000000000000000000000e6d870dc71e7f15f2372c9cd517e166a237bc2f0
Deployed Bytecode
0x6080604052600436106102e35760003560e01c8063791b98bc11610182578063791b98bc1461064b5780637be3ab02146106605780637cb2b79c146106735780637df73e27146106935780637fece368146106b357806382553aad146106d35780638b7677f4146106f357806395082d25146107135780639fef799614610728578063a2b47c161461073b578063a374242514610750578063a6eca89614610770578063b0a2566614610785578063b0c26ecf1461079a578063b3606b56146107af578063b70c7b70146107c4578063c84a9124146107e4578063cab44b76146107f9578063ce98dfa814610829578063cfad57a214610849578063cfed246b14610869578063d47eed4514610889578063d6a153f1146108a9578063d925351a146108c9578063de0d1b94146108e9578063dfb481c914610909578063e64559ad1461091e578063e68a22c014610933578063e6ca28d014610948578063eeaa783a1461095b578063f90ce5ba14610970578063f98d06f014610985576102e3565b806303b04936146102e857806303cd25711461031e5780630604ddea146103405780630e9272ea14610355578063126082cf1461037757806312d43a511461038c57806314dd2dce146103a15780631a153391146103c35780632798117d146103e3578063287800c9146104035780632a709b14146104185780632e9cd94b1461042d57806331cb61051461044d578063336eb6ae1461046d578063392e53cd1461048d57806344c23193146104a25780634bd66c1c146103405780634c0e31c8146104c25780634f64b2be146104e25780634fdfb0861461050257806354aea127146105225780635facf2cd1461053757806361ef161f1461054a57806363a22d711461055f578063668d3d651461057f578063695d4184146105945780636c56fd05146105a95780636ccd47c4146105c9578063715c7536146105de57806372279ba1146105f357806374bfed891461062357806378e8ab1714610638575b600080fd5b3480156102f457600080fd5b50610308610303366004612d4b565b61099a565b6040516103159190613381565b60405180910390f35b34801561032a57600080fd5b506103336109af565b604051610315919061338c565b34801561034c57600080fd5b506103336109b5565b34801561036157600080fd5b5061036a6109bd565b604051610315919061322b565b34801561038357600080fd5b506103336109e1565b34801561039857600080fd5b5061036a6109e7565b3480156103ad57600080fd5b506103c16103bc3660046130ff565b6109f6565b005b3480156103cf57600080fd5b506103c16103de366004612d67565b610a2e565b6103f66103f1366004612f2b565b610a83565b60405161031591906132db565b34801561040f57600080fd5b50610333610ccd565b34801561042457600080fd5b5061036a610cd3565b34801561043957600080fd5b506103c16104483660046130ff565b610ce2565b34801561045957600080fd5b506103c1610468366004612d67565b610d11565b34801561047957600080fd5b50610333610488366004612d4b565b610d66565b34801561049957600080fd5b50610308610d78565b3480156104ae57600080fd5b506103c16104bd3660046130ff565b610d88565b3480156104ce57600080fd5b506103c16104dd366004612ecb565b610dd9565b3480156104ee57600080fd5b5061036a6104fd3660046130ff565b610e87565b34801561050e57600080fd5b5061030861051d366004612d4b565b610eae565b34801561052e57600080fd5b50610333610ec3565b6103f6610545366004612ddd565b610ec9565b34801561055657600080fd5b5061036a611183565b34801561056b57600080fd5b506103c161057a36600461312f565b611192565b34801561058b57600080fd5b50610333611345565b3480156105a057600080fd5b5061030861134b565b3480156105b557600080fd5b506103086105c4366004612d4b565b61135b565b3480156105d557600080fd5b506103c16113e6565b3480156105ea57600080fd5b506103336114a6565b3480156105ff57600080fd5b5061061361060e366004612d4b565b6114ac565b6040516103159493929190613813565b34801561062f57600080fd5b5061033361152a565b6103c1610646366004612fd8565b611530565b34801561065757600080fd5b5061036a61156b565b6103f661066e366004612f2b565b61157a565b34801561067f57600080fd5b506103c161068e366004612d4b565b6117b9565b34801561069f57600080fd5b506103086106ae366004612d4b565b611805565b3480156106bf57600080fd5b506103336106ce366004612d9c565b61181a565b3480156106df57600080fd5b506103c16106ee3660046130ff565b6119a6565b3480156106ff57600080fd5b506103c161070e3660046130ff565b6119d5565b34801561071f57600080fd5b50610333611a04565b6103c1610736366004613012565b611a14565b34801561074757600080fd5b50610333611c0b565b34801561075c57600080fd5b5061033361076b366004612d4b565b611c12565b34801561077c57600080fd5b50610333611c24565b34801561079157600080fd5b50610333611c2a565b3480156107a657600080fd5b50610333611c30565b3480156107bb57600080fd5b50610333611c36565b3480156107d057600080fd5b506103c16107df3660046130ff565b611c3c565b3480156107f057600080fd5b506103c1611c6b565b34801561080557600080fd5b50610819610814366004612d4b565b611d26565b60405161031594939291906137cd565b34801561083557600080fd5b506103c161084436600461306c565b611d65565b34801561085557600080fd5b506103c1610864366004612d4b565b611dad565b34801561087557600080fd5b50610333610884366004612d4b565b611df9565b34801561089557600080fd5b506103336108a4366004612fd8565b611e0b565b3480156108b557600080fd5b506103c16108c43660046130ff565b611eb0565b3480156108d557600080fd5b506103c16108e43660046130ff565b611edf565b3480156108f557600080fd5b506103c16109043660046130ff565b611f0e565b34801561091557600080fd5b50610333611f3d565b34801561092a57600080fd5b50610333611f43565b34801561093f57600080fd5b50610333611f49565b6103f6610956366004612f2b565b611f54565b34801561096757600080fd5b5061036a612193565b34801561097c57600080fd5b506103336121b7565b34801561099157600080fd5b5061036a6121bd565b60136020526000908152604090205460ff1681565b60045481565b63ffffffff81565b7f0000000000000000000000004236907b95d07e56a70f21707e6105b1dccebfc081565b61271081565b6000546001600160a01b031681565b6000546001600160a01b03163314610a295760405162461bcd60e51b8152600401610a2090613599565b60405180910390fd5b600255565b6000546001600160a01b03163314610a585760405162461bcd60e51b8152600401610a2090613599565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b336000908152600d602052604090205460609060ff16610ab55760405162461bcd60e51b8152600401610a2090613722565b8451865114610ad65760405162461bcd60e51b8152600401610a20906135c8565b610adf836121e1565b606086516001600160401b0381118015610af857600080fd5b50604051908082528060200260200182016040528015610b22578160200160208202803683370190505b50905060005b8751811015610cc2578315610c0b5760165488516001600160a01b03909116906307c7edc3908a9084908110610b5a57fe5b6020026020010151898481518110610b6e57fe5b6020026020010151896040518463ffffffff1660e01b8152600401610b959392919061328a565b600060405180830381600087803b158015610baf57600080fd5b505af1925050508015610bc0575060015b610be7576000828281518110610bd257fe5b91151560209283029190910190910152610c06565b6001828281518110610bf557fe5b911515602092830291909101909101525b610cba565b60165488516001600160a01b03909116906307c7edc3908a9084908110610c2e57fe5b6020026020010151898481518110610c4257fe5b6020026020010151896040518463ffffffff1660e01b8152600401610c699392919061328a565b600060405180830381600087803b158015610c8357600080fd5b505af1158015610c97573d6000803e3d6000fd5b505050506001828281518110610ca957fe5b911515602092830291909101909101525b600101610b28565b509695505050505050565b600b5481565b6001546001600160a01b031681565b6001546001600160a01b03163314610d0c5760405162461bcd60e51b8152600401610a2090613722565b600955565b6000546001600160a01b03163314610d3b5760405162461bcd60e51b8152600401610a2090613599565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b600f6020526000908152604090205481565b600054600160a01b900460ff1681565b6000546001600160a01b03163314610db25760405162461bcd60e51b8152600401610a2090613599565b610708811115610dd45760405162461bcd60e51b8152600401610a2090613408565b600455565b6001546001600160a01b03163314610e035760405162461bcd60e51b8152600401610a2090613722565b8051825114610e245760405162461bcd60e51b8152600401610a20906134cc565b60005b8251811015610e82576000838281518110610e3e57fe5b60200260200101519050828281518110610e5457fe5b6020908102919091018101516001600160a01b03909216600090815260119091526040902055600101610e27565b505050565b60148181548110610e9457fe5b6000918252602090912001546001600160a01b0316905081565b600d6020526000908152604090205460ff1681565b60025481565b336000908152600d602052604090205460609060ff16610efb5760405162461bcd60e51b8152600401610a2090613722565b86518851148015610f0d575085518851145b8015610f1a575084518851145b610f365760405162461bcd60e51b8152600401610a20906135c8565b610f3f836121e1565b606088516001600160401b0381118015610f5857600080fd5b50604051908082528060200260200182016040528015610f82578160200160208202803683370190505b50905060005b8951811015611176578315611095576016548a516001600160a01b039091169063de2ea948908c9084908110610fba57fe5b60200260200101518b8481518110610fce57fe5b60200260200101518b8581518110610fe257fe5b60200260200101518b8681518110610ff657fe5b60200260200101518b6040518663ffffffff1660e01b815260040161101f95949392919061323f565b600060405180830381600087803b15801561103957600080fd5b505af192505050801561104a575060015b61107157600082828151811061105c57fe5b91151560209283029190910190910152611090565b600182828151811061107f57fe5b911515602092830291909101909101525b61116e565b6016548a516001600160a01b039091169063de2ea948908c90849081106110b857fe5b60200260200101518b84815181106110cc57fe5b60200260200101518b85815181106110e057fe5b60200260200101518b86815181106110f457fe5b60200260200101518b6040518663ffffffff1660e01b815260040161111d95949392919061323f565b600060405180830381600087803b15801561113757600080fd5b505af115801561114b573d6000803e3d6000fd5b50505050600182828151811061115d57fe5b911515602092830291909101909101525b600101610f88565b5098975050505050505050565b6015546001600160a01b031681565b6000546001600160a01b031633146111bc5760405162461bcd60e51b8152600401610a2090613599565b600054600160a01b900460ff16156111e65760405162461bcd60e51b8152600401610a209061378b565b80518251146112075760405162461bcd60e51b8152600401610a2090613754565b6000805460ff60a01b1916600160a01b178155600b8690555b845181101561127357600085828151811061123757fe5b6020908102919091018101516001600160a01b03166000908152601290915260409020805460ff19166001908117909155919091019050611220565b5060005b83518110156112ca57600084828151811061128e57fe5b6020908102919091018101516001600160a01b03166000908152600d90915260409020805460ff19166001908117909155919091019050611277565b5081516112de906014906020850190612a8d565b5060005b825181101561133d5760008382815181106112f957fe5b6020026020010151905082828151811061130f57fe5b6020908102919091018101516001600160a01b039092166000908152600f90915260409020556001016112e2565b505050505050565b61070881565b600054600160a81b900460ff1681565b60008054600160a81b900460ff1615611376575060006113e1565b600b54600c5410611389575060006113e1565b600080611395846114ac565b93509350505081811180156113ca57506001600160a01b0384166000908152601160205260409020546113c882846124ee565b115b156113da576000925050506113e1565b6001925050505b919050565b3360009081526012602052604090205460ff166114155760405162461bcd60e51b8152600401610a2090613722565b3360009081526013602052604090205460ff166114445760405162461bcd60e51b8152600401610a2090613562565b336000908152601360205260409020805460ff19169055600c546114699060016124ee565b600c556040517f9fe0c305c33aa92757a537936872a60be0d91549a4303cc99fd8b7fce8a002759061149c90339061322b565b60405180910390a1565b600a5481565b6000806000806114ba612af2565b505050506001600160a01b039182166000908152601060209081526040918290208251608081018452905494851680825263ffffffff600160a01b87048116938301849052600160c01b87048116948301859052600160e01b909604909516606090910181905293949093919250565b60065481565b336000908152600d602052604090205460ff1661155f5760405162461bcd60e51b8152600401610a2090613722565b611568816121e1565b50565b6016546001600160a01b031681565b336000908152600d602052604090205460609060ff166115ac5760405162461bcd60e51b8152600401610a2090613722565b84518651146115cd5760405162461bcd60e51b8152600401610a20906135c8565b6115d6836121e1565b606086516001600160401b03811180156115ef57600080fd5b50604051908082528060200260200182016040528015611619578160200160208202803683370190505b50905060005b8751811015610cc25783156117025760165488516001600160a01b039091169063d38ab519908a908490811061165157fe5b602002602001015189848151811061166557fe5b6020026020010151896040518463ffffffff1660e01b815260040161168c9392919061328a565b600060405180830381600087803b1580156116a657600080fd5b505af19250505080156116b7575060015b6116de5760008282815181106116c957fe5b911515602092830291909101909101526116fd565b60018282815181106116ec57fe5b911515602092830291909101909101525b6117b1565b60165488516001600160a01b039091169063d38ab519908a908490811061172557fe5b602002602001015189848151811061173957fe5b6020026020010151896040518463ffffffff1660e01b81526004016117609392919061328a565b600060405180830381600087803b15801561177a57600080fd5b505af115801561178e573d6000803e3d6000fd5b5050505060018282815181106117a057fe5b911515602092830291909101909101525b60010161161f565b6001546001600160a01b031633146117e35760405162461bcd60e51b8152600401610a2090613722565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60126020526000908152604090205460ff1681565b600061183360055460025461253090919063ffffffff16565b4211156118945781156118745761186d61271061186761186060075461271061253090919063ffffffff16565b8690612555565b9061258f565b905061199f565b61186d6127106118676118606007546127106124ee90919063ffffffff16565b6004546002546118a391612530565b4211156118f05781156118d05761186d61271061186761186060065461271061253090919063ffffffff16565b61186d6127106118676118606006546127106124ee90919063ffffffff16565b6001600160a01b0384166000908152600e602052604090205480611917578391505061199f565b600081851161192f5761192a82866124ee565b611939565b61193985836124ee565b905061194b8561186783612710612555565b905060006119588761135b565b15806119655750600a5482115b9050801561199957841561198c578286116119805782611982565b855b935050505061199f565b8286106119805782611982565b50909150505b9392505050565b6001546001600160a01b031633146119d05760405162461bcd60e51b8152600401610a2090613722565b600a55565b6000546001600160a01b031633146119ff5760405162461bcd60e51b8152600401610a2090613599565b600555565b68327cb2734119d3b7a9601e1b81565b336000908152600d602052604090205460ff16611a435760405162461bcd60e51b8152600401610a2090613722565b611a4c856121e1565b6000601560009054906101000a90046001600160a01b031690506000611ae584836001600160a01b0316639b5786206040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611aa757600080fd5b505af1158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190613117565b90612530565b90506000611b2884846001600160a01b0316631bca8cf06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611aa757600080fd5b905081871115611b36578196505b80861115611b42578095505b604051629a208160e81b81526001600160a01b03841690639a20810090611b6f908a9033906004016137fc565b600060405180830381600087803b158015611b8957600080fd5b505af1158015611b9d573d6000803e3d6000fd5b505060405163f3883d8b60e01b81526001600160a01b038616925063f3883d8b9150611bcf90899033906004016137fc565b600060405180830381600087803b158015611be957600080fd5b505af1158015611bfd573d6000803e3d6000fd5b505050505050505050505050565b6298968081565b60116020526000908152604090205481565b60075481565b600c5481565b60145490565b60085481565b6000546001600160a01b03163314611c665760405162461bcd60e51b8152600401610a2090613599565b600655565b3360009081526012602052604090205460ff16611c9a5760405162461bcd60e51b8152600401610a2090613722565b3360009081526013602052604090205460ff1615611cca5760405162461bcd60e51b8152600401610a20906133a8565b336000908152601360205260409020805460ff19166001908117909155600c54611cf391612530565b600c556040517f4c0c5fabf50e808e3bc8d19577d305e3a7163eea7e8a74a50caa8896694cd44b9061149c90339061322b565b6010602052600090815260409020546001600160a01b0381169063ffffffff600160a01b8204811691600160c01b8104821691600160e01b9091041684565b6000546001600160a01b03163314611d8f5760405162461bcd60e51b8152600401610a2090613599565b60008054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314611dd75760405162461bcd60e51b8152600401610a2090613599565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600e6020526000908152604090205481565b60405163d47eed4560e01b81526000906001600160a01b037f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43169063d47eed4590611e5a908590600401613321565b60206040518083038186803b158015611e7257600080fd5b505afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613117565b92915050565b6000546001600160a01b03163314611eda5760405162461bcd60e51b8152600401610a2090613599565b600855565b6001546001600160a01b03163314611f095760405162461bcd60e51b8152600401610a2090613722565b600b55565b6000546001600160a01b03163314611f385760405162461bcd60e51b8152600401610a2090613599565b600755565b60095481565b60055481565b6001600160a01b0381565b336000908152600d602052604090205460609060ff16611f865760405162461bcd60e51b8152600401610a2090613722565b8451865114611fa75760405162461bcd60e51b8152600401610a20906135c8565b611fb0836121e1565b606086516001600160401b0381118015611fc957600080fd5b50604051908082528060200260200182016040528015611ff3578160200160208202803683370190505b50905060005b8751811015610cc25783156120dc5760165488516001600160a01b03909116906311d9444a908a908490811061202b57fe5b602002602001015189848151811061203f57fe5b6020026020010151896040518463ffffffff1660e01b81526004016120669392919061328a565b600060405180830381600087803b15801561208057600080fd5b505af1925050508015612091575060015b6120b85760008282815181106120a357fe5b911515602092830291909101909101526120d7565b60018282815181106120c657fe5b911515602092830291909101909101525b61218b565b60165488516001600160a01b03909116906311d9444a908a90849081106120ff57fe5b602002602001015189848151811061211357fe5b6020026020010151896040518463ffffffff1660e01b815260040161213a9392919061328a565b600060405180830381600087803b15801561215457600080fd5b505af1158015612168573d6000803e3d6000fd5b50505050600182828151811061217a57fe5b911515602092830291909101909101525b600101611ff9565b7f000000000000000000000000aee8213a86c5488b7f981e2965abbfaf5654379281565b60035481565b7f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b4381565b6121e96125ce565b60405163d47eed4560e01b81526000906001600160a01b037f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43169063d47eed4590612238908590600401613321565b60206040518083038186803b15801561225057600080fd5b505afa158015612264573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122889190613117565b9050803410156122aa5760405162461bcd60e51b8152600401610a209061350d565b604051631df3cbc560e31b81526001600160a01b037f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43169063ef9e5e289083906122f8908690600401613321565b6000604051808303818588803b15801561231157600080fd5b505af1158015612325573d6000803e3d6000fd5b50506014546004549093509150600090505b828110156124e75760006014828154811061234e57fe5b60009182526020808320909101546001600160a01b0316808352600f90915260409091205490915061237e612af2565b6040516331d98b3f60e01b81526001600160a01b037f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b4316906331d98b3f906123ca90859060040161338c565b60806040518083038186803b1580156123e257600080fd5b505afa1580156123f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061241a9190613088565b90506000816000015160070b136124435760405162461bcd60e51b8152600401610a2090613539565b8442038160600151116124685760405162461bcd60e51b8152600401610a20906133de565b6000816000015160070b90506000826040015160030b12156124b257604082015160000360030b600a0a8068327cb2734119d3b7a9601e1b8302816124a957fe5b049150506124cd565b604082015160030b600a0a0268327cb2734119d3b7a9601e1b025b6124d7848261260f565b5050600190920191506123379050565b5050505050565b600061199f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061288b565b60008282018381101561199f5760405162461bcd60e51b8152600401610a2090613497565b60008261256457506000611eaa565b8282028284828161257157fe5b041461199f5760405162461bcd60e51b8152600401610a2090613613565b600061199f83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b8152506128b7565b60085415612605576008546003546125e79043906124ee565b10156126055760405162461bcd60e51b8152600401610a209061368b565b4260025543600355565b6040516315afe77960e21b81526000906001600160a01b037f000000000000000000000000aee8213a86c5488b7f981e2965abbfaf5654379216906356bf9de49061265e90869060040161322b565b60206040518083038186803b15801561267657600080fd5b505afa15801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190613117565b6001600160a01b0384166000908152600e60205260408120549192508080806126d6886114ac565b9350935093509350600084111561279d5760008487116126ff576126fa85886124ee565b612709565b61270987866124ee565b905060008887116127235761271e89886124ee565b61272d565b61272d878a6124ee565b90506127446009544261258f90919063ffffffff16565b60095461275290879061258f565b146127605760009350600092505b61277b612774876118678562989680612555565b8590612530565b9350612798612791886118678462989680612555565b8490612530565b925050505b81811180156127cc57506001600160a01b0388166000908152601160205260409020546127ca82846124ee565b115b15612811577fe582322b389ad06b2bbf619cd6da3f16a288ec873ea0fa6df4d72f3d9480b44788878785856040516128089594939291906132ad565b60405180910390a15b61281d888784846128ee565b7f23b9387f81fca646aac1dc4487ede045c65f5f7445482906565f01e05afdb3a888878785856040516128549594939291906132ad565b60405180910390a16001600160a01b0388166000908152600e602052604090208790556128818888612a11565b5050505050505050565b600081848411156128af5760405162461bcd60e51b8152600401610a209190613395565b505050900390565b600081836128d85760405162461bcd60e51b8152600401610a209190613395565b5060008385816128e457fe5b0495945050505050565b6001600160a01b0383106129145760405162461bcd60e51b8152600401610a2090613654565b63ffffffff82106129375760405162461bcd60e51b8152600401610a20906136d9565b63ffffffff811061295a5760405162461bcd60e51b8152600401610a209061344d565b604080516080810182526001600160a01b03948516815263ffffffff4281166020808401918252958216838501908152948216606084019081529787166000908152601090965292909420905181549251935196518516600160e01b026001600160e01b03978616600160c01b0263ffffffff60c01b1995909616600160a01b0263ffffffff60a01b19929097166001600160a01b0319909416939093171694909417919091169190911792909216919091179055565b60405163e0409c7160e01b81526001600160a01b037f0000000000000000000000004236907b95d07e56a70f21707e6105b1dccebfc0169063e0409c7190612a5f9085908590600401613271565b600060405180830381600087803b158015612a7957600080fd5b505af115801561133d573d6000803e3d6000fd5b828054828255906000526020600020908101928215612ae2579160200282015b82811115612ae257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612aad565b50612aee929150612b19565b5090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b80821115612aee5780546001600160a01b0319168155600101612b1a565b8035611eaa81613873565b600082601f830112612b53578081fd5b8135612b66612b6182613854565b61382e565b818152915060208083019084810181840286018201871015612b8757600080fd5b60005b84811015612baf578135612b9d81613873565b84529282019290820190600101612b8a565b505050505092915050565b600082601f830112612bca578081fd5b8135612bd8612b6182613854565b818152915060208083019084810181840286018201871015612bf957600080fd5b60005b84811015612baf57612c0e8883612d3b565b84529282019290820190600101612bfc565b600082601f830112612c30578081fd5b8135612c3e612b6182613854565b818152915060208083019084810181840286018201871015612c5f57600080fd5b60005b84811015612baf57813584529282019290820190600101612c62565b6000601f8381840112612c8f578182fd5b8235612c9d612b6182613854565b818152925060208084019085810160005b84811015612d2f578135880189603f820112612cc957600080fd5b808401356001600160401b03811115612ce157600080fd5b612cf2818901601f1916860161382e565b81815260408c81848601011115612d0857600080fd5b82818501888401375060009181018601919091528552509282019290820190600101612cae565b50505050505092915050565b80358015158114611eaa57600080fd5b600060208284031215612d5c578081fd5b813561199f81613873565b60008060408385031215612d79578081fd5b8235612d8481613873565b9150612d938460208501612d3b565b90509250929050565b600080600060608486031215612db0578081fd5b8335612dbb81613873565b9250602084013591506040840135612dd281613888565b809150509250925092565b600080600080600080600060e0888a031215612df7578283fd5b87356001600160401b0380821115612e0d578485fd5b612e198b838c01612b43565b985060208a0135915080821115612e2e578485fd5b612e3a8b838c01612b43565b975060408a0135915080821115612e4f578485fd5b612e5b8b838c01612b43565b965060608a0135915080821115612e70578485fd5b612e7c8b838c01612bba565b9550612e8b8b60808c01612b38565b945060a08a0135915080821115612ea0578384fd5b50612ead8a828b01612c7e565b925050612ebd8960c08a01612d3b565b905092959891949750929550565b60008060408385031215612edd578081fd5b82356001600160401b0380821115612ef3578283fd5b612eff86838701612b43565b93506020850135915080821115612f14578283fd5b50612f2185828601612c20565b9150509250929050565b600080600080600060a08688031215612f42578283fd5b85356001600160401b0380821115612f58578485fd5b612f6489838a01612b43565b96506020880135915080821115612f79578485fd5b612f8589838a01612c20565b955060408801359150612f9782613873565b90935060608701359080821115612fac578283fd5b50612fb988828901612c7e565b9250506080860135612fca81613888565b809150509295509295909350565b600060208284031215612fe9578081fd5b81356001600160401b03811115612ffe578182fd5b61300a84828501612c7e565b949350505050565b600080600080600060a08688031215613029578283fd5b85356001600160401b0381111561303e578384fd5b61304a88828901612c7e565b9860208801359850604088013597606081013597506080013595509350505050565b60006020828403121561307d578081fd5b813561199f81613888565b600060808284031215613099578081fd5b6130a3608061382e565b82518060070b81146130b3578283fd5b815260208301516001600160401b03811681146130ce578283fd5b60208201526040830151600381900b81146130e7578283fd5b60408201526060928301519281019290925250919050565b600060208284031215613110578081fd5b5035919050565b600060208284031215613128578081fd5b5051919050565b600080600080600060a08688031215613146578283fd5b8535945060208601356001600160401b0380821115613163578485fd5b61316f89838a01612b43565b95506040880135915080821115613184578485fd5b61319089838a01612b43565b945060608801359150808211156131a5578283fd5b6131b189838a01612b43565b935060808801359150808211156131c6578283fd5b506131d388828901612c20565b9150509295509295909350565b60008151808452815b81811015613205576020818501810151868301820152016131e9565b818111156132165782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0395861681529385166020850152918416604084015215156060830152909116608082015260a00190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156133155783511515835292840192918401916001016132f7565b50909695505050505050565b6000602080830181845280855180835260408601915060408482028701019250838701855b8281101561337457603f198886030184526133628583516131e0565b94509285019290850190600101613346565b5092979650505050505050565b901515815260200190565b90815260200190565b60006020825261199f60208301846131e0565b6020808252601c908201527b11985cdd141c9a58d9519959590e88185b1c9958591e481d9bdd195960221b604082015260600190565b60208082526010908201526f7374616c65207079746820707269636560801b604082015260600190565b60208082526025908201527f466173745072696365466565643a20696e76616c6964205f707269636544757260408201526430ba34b7b760d91b606082015260800190565b6020808252602a908201527f466173745072696365466565643a20696e76616c69642063756d756c61746976604082015269654661737444656c746160b01b606082015260800190565b6020808252601b908201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604082015260600190565b60208082526021908201527f466173745072696365466565643a206d69736d617463686564206c656e6774686040820152607360f81b606082015260800190565b602080825260129082015271696e73756666696369656e742076616c756560701b604082015260600190565b6020808252600f908201526e070797468207072696365203c3d203608c1b604082015260600190565b6020808252601e908201527f466173745072696365466565643a20616c726561647920656e61626c65640000604082015260600190565b60208082526015908201527423b7bb32b93730b136329d103337b93134b23232b760591b604082015260600190565b6020808252602b908201527f4f726465724578656375746f723a20696e70757420617272617973206c656e6760408201526a0e8d040dad2e6dac2e8c6d60ab1b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601f908201527f466173745072696365466565643a20696e76616c696420726566507269636500604082015260600190565b6020808252602e908201527f466173745072696365466565643a206d696e426c6f636b496e74657276616c2060408201526d1b9bdd081e595d081c185cdcd95960921b606082015260800190565b60208082526029908201527f466173745072696365466565643a20696e76616c69642063756d756c617469766040820152686552656644656c746160b81b606082015260800190565b6020808252601890820152772330b9ba283934b1b2a332b2b21d103337b93134b23232b760411b604082015260600190565b6020808252601e908201527f466173745072696365466565643a20696e76616c6964206c656e677468730000604082015260600190565b60208082526022908201527f466173745072696365466565643a20616c726561647920696e697469616c697a604082015261195960f21b606082015260800190565b6001600160a01b0394909416845263ffffffff9283166020850152908216604084015216606082015260800190565b9182526001600160a01b0316602082015260400190565b93845260208401929092526040830152606082015260800190565b6040518181016001600160401b038111828210171561384c57600080fd5b604052919050565b60006001600160401b03821115613869578081fd5b5060209081020190565b6001600160a01b038116811461156857600080fd5b801515811461156857600080fdfea2646970667358221220c0e854873816890d904eaa66aee087da2b06ffa9449296e3dcb2b289c944a77164736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b430000000000000000000000000000000000000000000000000000000000000078000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000aee8213a86c5488b7f981e2965abbfaf565437920000000000000000000000004236907b95d07e56a70f21707e6105b1dccebfc000000000000000000000000030b12942912cee5a719edec2dd147224fcc373a000000000000000000000000091c62ae93ccffdbe0b1be841433e46e033514c8d000000000000000000000000e6d870dc71e7f15f2372c9cd517e166a237bc2f0
-----Decoded View---------------
Arg [0] : _pyth (address): 0x2880aB155794e7179c9eE2e38200202908C17B43
Arg [1] : _priceDuration (uint256): 120
Arg [2] : _maxPriceUpdateDelay (uint256): 300
Arg [3] : _minBlockInterval (uint256): 1
Arg [4] : _maxDeviationBasisPoints (uint256): 1000
Arg [5] : _vaultPriceFeed (address): 0xAEE8213a86c5488b7F981E2965abbFAF56543792
Arg [6] : _fastPriceEvents (address): 0x4236907B95d07E56A70f21707e6105B1dCcebfC0
Arg [7] : _tokenManager (address): 0x30B12942912Cee5A719edec2dD147224fCC373A0
Arg [8] : _positionRouter (address): 0x91c62ae93ccfFdBE0B1Be841433E46E033514C8D
Arg [9] : _positionManager (address): 0xe6d870DC71e7f15F2372C9cD517E166a237BC2F0
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000078
Arg [2] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [5] : 000000000000000000000000aee8213a86c5488b7f981e2965abbfaf56543792
Arg [6] : 0000000000000000000000004236907b95d07e56a70f21707e6105b1dccebfc0
Arg [7] : 00000000000000000000000030b12942912cee5a719edec2dd147224fcc373a0
Arg [8] : 00000000000000000000000091c62ae93ccffdbe0b1be841433e46e033514c8d
Arg [9] : 000000000000000000000000e6d870dc71e7f15f2372c9cd517e166a237bc2f0
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.