Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ResilientOracle
Compiler Version
v0.8.25+commit.b61c2a91
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2022 Venus
pragma solidity 0.8.25;
import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import { VBep20Interface } from "./interfaces/VBep20Interface.sol";
import { OracleInterface, ResilientOracleInterface, BoundValidatorInterface } from "./interfaces/OracleInterface.sol";
import { AccessControlledV8 } from "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol";
import { ICappedOracle } from "./interfaces/ICappedOracle.sol";
import { Transient } from "./lib/Transient.sol";
/**
* @title ResilientOracle
* @author Venus
* @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.
*
* DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly
* reported prices. If only one oracle is used, this creates a single point of failure and opens a vector
* for attacking the protocol.
*
* The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect
* the protocol from oracle attacks.
*
* For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per
* vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot
* oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source.
*
* To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every
* market. The upper bound ratio represents the deviation between reported price (the price that’s being
* validated) and the anchor price (the price we are validating against) above which the reported price will
* be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below
* which the reported price will be invalidated. So for oracle price to be considered valid the below statement
* should be true:
```
anchorRatio = anchorPrice/reporterPrice
isValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio
```
* In most cases, Chainlink is used as the main oracle, other oracles are used as the pivot oracle depending
* on which supports the given market and Binance oracle is used as the fallback oracle.
*
* For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the
* oracle to be stagnant and treat it like it's disabled.
*/
contract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {
/**
* @dev Oracle roles:
* **main**: The most trustworthy price source
* **pivot**: Price oracle used as a loose sanity checker
* **fallback**: The backup source when main oracle price is invalidated
*/
enum OracleRole {
MAIN,
PIVOT,
FALLBACK
}
struct TokenConfig {
/// @notice asset address
address asset;
/// @notice `oracles` stores the oracles based on their role in the following order:
/// [main, pivot, fallback],
/// It can be indexed with the corresponding enum OracleRole value
address[3] oracles;
/// @notice `enableFlagsForOracles` stores the enabled state
/// for each oracle in the same order as `oracles`
bool[3] enableFlagsForOracles;
/// @notice `cachingEnabled` is a flag that indicates whether the asset price should be cached
bool cachingEnabled;
}
uint256 public constant INVALID_PRICE = 0;
/// @notice Native market address
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address public immutable nativeMarket;
/// @notice VAI address
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address public immutable vai;
/// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)
/// and can serve as any underlying asset of a market that supports native tokens
address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;
/// @notice Slot to cache the asset's price, used for transient storage
/// custom:storage-location erc7201:venus-protocol/oracle/ResilientOracle/cache
/// keccak256(abi.encode(uint256(keccak256("venus-protocol/oracle/ResilientOracle/cache")) - 1))
/// & ~bytes32(uint256(0xff))
bytes32 public constant CACHE_SLOT = 0x4e99ec55972332f5e0ef9c6623192c0401b609161bffae64d9ccdd7ad6cc7800;
/// @notice Bound validator contract address
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
BoundValidatorInterface public immutable boundValidator;
mapping(address => TokenConfig) private tokenConfigs;
event TokenConfigAdded(
address indexed asset,
address indexed mainOracle,
address indexed pivotOracle,
address fallbackOracle
);
/// Event emitted when an oracle is set
event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);
/// Event emitted when an oracle is enabled or disabled
event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);
/// Event emitted when an asset cachingEnabled flag is set
event CachedEnabled(address indexed asset, bool indexed enabled);
/**
* @notice Checks whether an address is null or not
*/
modifier notNullAddress(address someone) {
if (someone == address(0)) revert("can't be zero address");
_;
}
/**
* @notice Checks whether token config exists by checking whether asset is null address
* @dev address can't be null, so it's suitable to be used to check the validity of the config
* @param asset asset address
*/
modifier checkTokenConfigExistence(address asset) {
if (tokenConfigs[asset].asset == address(0)) revert("token config must exist");
_;
}
/// @notice Constructor for the implementation contract. Sets immutable variables.
/// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market
/// (e.g vETH on ethereum would not be supported, only vWETH)
/// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)
/// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).
/// Set to address(0) of VAI is not existent.
/// @param _boundValidator Address of the bound validator contract
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(
address nativeMarketAddress,
address vaiAddress,
BoundValidatorInterface _boundValidator
) notNullAddress(address(_boundValidator)) {
nativeMarket = nativeMarketAddress;
vai = vaiAddress;
boundValidator = _boundValidator;
_disableInitializers();
}
/**
* @notice Initializes the contract admin and sets the BoundValidator contract address
* @param accessControlManager_ Address of the access control manager contract
*/
function initialize(address accessControlManager_) external initializer {
__AccessControlled_init(accessControlManager_);
__Pausable_init();
}
/**
* @notice Pauses oracle
* @custom:access Only Governance
*/
function pause() external {
_checkAccessAllowed("pause()");
_pause();
}
/**
* @notice Unpauses oracle
* @custom:access Only Governance
*/
function unpause() external {
_checkAccessAllowed("unpause()");
_unpause();
}
/**
* @notice Batch sets token configs
* @param tokenConfigs_ Token config array
* @custom:access Only Governance
* @custom:error Throws a length error if the length of the token configs array is 0
*/
function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {
if (tokenConfigs_.length == 0) revert("length can't be 0");
uint256 numTokenConfigs = tokenConfigs_.length;
for (uint256 i; i < numTokenConfigs; ++i) {
setTokenConfig(tokenConfigs_[i]);
}
}
/**
* @notice Sets oracle for a given asset and role.
* @dev Supplied asset **must** exist and main oracle may not be null
* @param asset Asset address
* @param oracle Oracle address
* @param role Oracle role
* @custom:access Only Governance
* @custom:error Null address error if main-role oracle address is null
* @custom:error NotNullAddress error is thrown if asset address is null
* @custom:error TokenConfigExistance error is thrown if token config is not set
* @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset
*/
function setOracle(
address asset,
address oracle,
OracleRole role
) external notNullAddress(asset) checkTokenConfigExistence(asset) {
_checkAccessAllowed("setOracle(address,address,uint8)");
if (oracle == address(0) && role == OracleRole.MAIN) revert("can't set zero address to main oracle");
tokenConfigs[asset].oracles[uint256(role)] = oracle;
emit OracleSet(asset, oracle, uint256(role));
}
/**
* @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist
* @dev Configuration for the asset **must** already exist and the asset cannot be 0 address
* @param asset Asset address
* @param role Oracle role
* @param enable Enabled boolean of the oracle
* @custom:access Only Governance
* @custom:error NotNullAddress error is thrown if asset address is null
* @custom:error TokenConfigExistance error is thrown if token config is not set
* @custom:event Emits OracleEnabled event with asset address, role of the oracle and enabled flag
*/
function enableOracle(
address asset,
OracleRole role,
bool enable
) external notNullAddress(asset) checkTokenConfigExistence(asset) {
_checkAccessAllowed("enableOracle(address,uint8,bool)");
tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;
emit OracleEnabled(asset, uint256(role), enable);
}
/**
* @notice Updates the capped main oracle snapshot.
* @dev This function should always be called before calling getUnderlyingPrice
* @param vToken vToken address
*/
function updatePrice(address vToken) external override {
address asset = _getUnderlyingAsset(vToken);
_updateAssetPrice(asset);
}
/**
* @notice Updates the capped main oracle snapshot.
* @dev This function should always be called before calling getPrice
* @param asset asset address
*/
function updateAssetPrice(address asset) external {
_updateAssetPrice(asset);
}
/**
* @dev Gets token config by asset address
* @param asset asset address
* @return tokenConfig Config for the asset
*/
function getTokenConfig(address asset) external view returns (TokenConfig memory) {
return tokenConfigs[asset];
}
/**
* @notice Gets price of the underlying asset for a given vToken. Validation flow:
* - Check if the oracle is paused globally
* - Validate price from main oracle against pivot oracle
* - Validate price from fallback oracle against pivot oracle if the first validation failed
* - Validate price from main oracle against fallback oracle if the second validation failed
* In the case that the pivot oracle is not available but main price is available and validation is successful,
* main oracle price is returned.
* @param vToken vToken address
* @return price USD price in scaled decimal places.
* @custom:error Paused error is thrown when resilent oracle is paused
* @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid
*/
function getUnderlyingPrice(address vToken) external view override returns (uint256) {
if (paused()) revert("resilient oracle is paused");
address asset = _getUnderlyingAsset(vToken);
return _getPrice(asset);
}
/**
* @notice Gets price of the asset
* @param asset asset address
* @return price USD price in scaled decimal places.
* @custom:error Paused error is thrown when resilent oracle is paused
* @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid
*/
function getPrice(address asset) external view override returns (uint256) {
if (paused()) revert("resilient oracle is paused");
return _getPrice(asset);
}
/**
* @notice Sets/resets single token configs.
* @dev main oracle **must not** be a null address
* @param tokenConfig Token config struct
* @custom:access Only Governance
* @custom:error NotNullAddress is thrown if asset address is null
* @custom:error NotNullAddress is thrown if main-role oracle address for asset is null
* @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account
* @custom:event Emits CachedEnabled event when the asset cachingEnabled flag is set successfully
*/
function setTokenConfig(
TokenConfig memory tokenConfig
) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {
_checkAccessAllowed("setTokenConfig(TokenConfig)");
tokenConfigs[tokenConfig.asset] = tokenConfig;
emit TokenConfigAdded(
tokenConfig.asset,
tokenConfig.oracles[uint256(OracleRole.MAIN)],
tokenConfig.oracles[uint256(OracleRole.PIVOT)],
tokenConfig.oracles[uint256(OracleRole.FALLBACK)]
);
emit CachedEnabled(tokenConfig.asset, tokenConfig.cachingEnabled);
}
/**
* @notice Gets oracle and enabled status by asset address
* @param asset asset address
* @param role Oracle role
* @return oracle Oracle address based on role
* @return enabled Enabled flag of the oracle based on token config
*/
function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {
oracle = tokenConfigs[asset].oracles[uint256(role)];
enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];
}
/**
* @notice Updates the capped oracle snapshot.
* @dev Cache the asset price and return if already cached
* @param asset asset address
*/
function _updateAssetPrice(address asset) internal {
if (Transient.readCachedPrice(CACHE_SLOT, asset) != 0) {
return;
}
(address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);
if (mainOracle != address(0) && mainOracleEnabled) {
// if main oracle is not CorrelatedTokenOracle it will revert so we need to catch the revert
try ICappedOracle(mainOracle).updateSnapshot() {} catch {}
}
if (_isCacheEnabled(asset)) {
uint256 price = _getPrice(asset);
Transient.cachePrice(CACHE_SLOT, asset, price);
}
}
/**
* @notice Gets price for the provided asset
* @param asset asset address
* @return price USD price in scaled decimal places.
* @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid
*/
function _getPrice(address asset) internal view returns (uint256) {
uint256 pivotPrice = INVALID_PRICE;
uint256 price;
price = Transient.readCachedPrice(CACHE_SLOT, asset);
if (price != 0) {
return price;
}
// Get pivot oracle price, Invalid price if not available or error
(address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);
if (pivotOracleEnabled && pivotOracle != address(0)) {
try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {
pivotPrice = pricePivot;
} catch {}
}
// Compare main price and pivot price, return main price and if validation was successful
// note: In case pivot oracle is not available but main price is available and
// validation is successful, the main oracle price is returned.
(uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(
asset,
pivotPrice,
pivotOracleEnabled && pivotOracle != address(0)
);
if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;
// Compare fallback and pivot if main oracle comparision fails with pivot
// Return fallback price when fallback price is validated successfully with pivot oracle
(uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);
if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;
// Lastly compare main price and fallback price
if (
mainPrice != INVALID_PRICE &&
fallbackPrice != INVALID_PRICE &&
boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)
) {
return mainPrice;
}
revert("invalid resilient oracle price");
}
/**
* @notice Gets a price for the provided asset
* @dev This function won't revert when price is 0, because the fallback oracle may still be
* able to fetch a correct price
* @param asset asset address
* @param pivotPrice Pivot oracle price
* @param pivotEnabled If pivot oracle is not empty and enabled
* @return price USD price in scaled decimals
* e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals
* @return pivotValidated Boolean representing if the validation of main oracle price
* and pivot oracle price were successful
* @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset
* @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle
* address is null
*/
function _getMainOraclePrice(
address asset,
uint256 pivotPrice,
bool pivotEnabled
) internal view returns (uint256, bool) {
(address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);
if (mainOracleEnabled && mainOracle != address(0)) {
try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {
if (!pivotEnabled) {
return (mainOraclePrice, true);
}
if (pivotPrice == INVALID_PRICE) {
return (mainOraclePrice, false);
}
return (
mainOraclePrice,
boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)
);
} catch {
return (INVALID_PRICE, false);
}
}
return (INVALID_PRICE, false);
}
/**
* @dev This function won't revert when the price is 0 because getPrice checks if price is > 0
* @param asset asset address
* @return price USD price in 18 decimals
* @return pivotValidated Boolean representing if the validation of fallback oracle price
* and pivot oracle price were successfully
* @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset
* @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle
* address is null
*/
function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {
(address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);
if (fallbackEnabled && fallbackOracle != address(0)) {
try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {
if (pivotPrice == INVALID_PRICE) {
return (fallbackOraclePrice, false);
}
return (
fallbackOraclePrice,
boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)
);
} catch {
return (INVALID_PRICE, false);
}
}
return (INVALID_PRICE, false);
}
/**
* @dev This function returns the underlying asset of a vToken
* @param vToken vToken address
* @return asset underlying asset address
*/
function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {
if (vToken == nativeMarket) {
asset = NATIVE_TOKEN_ADDR;
} else if (vToken == vai) {
asset = vai;
} else {
asset = VBep20Interface(vToken).underlying();
}
}
/**
* @dev This function checks if the asset price should be cached
* @param asset asset address
* @return bool true if caching is enabled, false otherwise
*/
function _isCacheEnabled(address asset) private view returns (bool) {
return tokenConfigs[asset].cachingEnabled;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "./IAccessControlManagerV8.sol";
/**
* @title AccessControlledV8
* @author Venus
* @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)
* to integrate access controlled mechanism. It provides initialise methods and verifying access methods.
*/
abstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {
/// @notice Access control manager contract
IAccessControlManagerV8 private _accessControlManager;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
/// @notice Emitted when access control manager contract address is changed
event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);
/// @notice Thrown when the action is prohibited by AccessControlManager
error Unauthorized(address sender, address calledContract, string methodSignature);
function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {
__Ownable2Step_init();
__AccessControlled_init_unchained(accessControlManager_);
}
function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {
_setAccessControlManager(accessControlManager_);
}
/**
* @notice Sets the address of AccessControlManager
* @dev Admin function to set address of AccessControlManager
* @param accessControlManager_ The new address of the AccessControlManager
* @custom:event Emits NewAccessControlManager event
* @custom:access Only Governance
*/
function setAccessControlManager(address accessControlManager_) external onlyOwner {
_setAccessControlManager(accessControlManager_);
}
/**
* @notice Returns the address of the access control manager contract
*/
function accessControlManager() external view returns (IAccessControlManagerV8) {
return _accessControlManager;
}
/**
* @dev Internal function to set address of AccessControlManager
* @param accessControlManager_ The new address of the AccessControlManager
*/
function _setAccessControlManager(address accessControlManager_) internal {
require(address(accessControlManager_) != address(0), "invalid acess control manager address");
address oldAccessControlManager = address(_accessControlManager);
_accessControlManager = IAccessControlManagerV8(accessControlManager_);
emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);
}
/**
* @notice Reverts if the call is not allowed by AccessControlManager
* @param signature Method signature
*/
function _checkAccessAllowed(string memory signature) internal view {
bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);
if (!isAllowedToCall) {
revert Unauthorized(msg.sender, address(this), signature);
}
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.25;
import "@openzeppelin/contracts/access/IAccessControl.sol";
/**
* @title IAccessControlManagerV8
* @author Venus
* @notice Interface implemented by the `AccessControlManagerV8` contract.
*/
interface IAccessControlManagerV8 is IAccessControl {
function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;
function revokeCallPermission(
address contractAddress,
string calldata functionSig,
address accountToRevoke
) external;
function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);
function hasPermission(
address account,
address contractAddress,
string calldata functionSig
) external view returns (bool);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;
interface ICappedOracle {
function updateSnapshot() external;
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.25;
interface OracleInterface {
function getPrice(address asset) external view returns (uint256);
}
interface ResilientOracleInterface is OracleInterface {
function updatePrice(address vToken) external;
function updateAssetPrice(address asset) external;
function getUnderlyingPrice(address vToken) external view returns (uint256);
}
interface BoundValidatorInterface {
function validatePriceWithAnchorPrice(
address asset,
uint256 reporterPrice,
uint256 anchorPrice
) external view returns (bool);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.25;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
interface VBep20Interface is IERC20Metadata {
/**
* @notice Underlying asset for this VToken
*/
function underlying() external view returns (address);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.25;
library Transient {
/**
* @notice Cache the asset price into transient storage
* @param key address of the asset
* @param value asset price
*/
function cachePrice(bytes32 cacheSlot, address key, uint256 value) internal {
bytes32 slot = keccak256(abi.encode(cacheSlot, key));
assembly ("memory-safe") {
tstore(slot, value)
}
}
/**
* @notice Read cached price from transient storage
* @param key address of the asset
* @return value cached asset price
*/
function readCachedPrice(bytes32 cacheSlot, address key) internal view returns (uint256 value) {
bytes32 slot = keccak256(abi.encode(cacheSlot, key));
assembly ("memory-safe") {
value := tload(slot)
}
}
}{
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"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":"nativeMarketAddress","type":"address"},{"internalType":"address","name":"vaiAddress","type":"address"},{"internalType":"contract BoundValidatorInterface","name":"_boundValidator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"calledContract","type":"address"},{"internalType":"string","name":"methodSignature","type":"string"}],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"bool","name":"enabled","type":"bool"}],"name":"CachedEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAccessControlManager","type":"address"},{"indexed":false,"internalType":"address","name":"newAccessControlManager","type":"address"}],"name":"NewAccessControlManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"uint256","name":"role","type":"uint256"},{"indexed":true,"internalType":"bool","name":"enable","type":"bool"}],"name":"OracleEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"uint256","name":"role","type":"uint256"}],"name":"OracleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"mainOracle","type":"address"},{"indexed":true,"internalType":"address","name":"pivotOracle","type":"address"},{"indexed":false,"internalType":"address","name":"fallbackOracle","type":"address"}],"name":"TokenConfigAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CACHE_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INVALID_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN_ADDR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"accessControlManager","outputs":[{"internalType":"contract IAccessControlManagerV8","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boundValidator","outputs":[{"internalType":"contract BoundValidatorInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"enum ResilientOracle.OracleRole","name":"role","type":"uint8"},{"internalType":"bool","name":"enable","type":"bool"}],"name":"enableOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"enum ResilientOracle.OracleRole","name":"role","type":"uint8"}],"name":"getOracle","outputs":[{"internalType":"address","name":"oracle","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getTokenConfig","outputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[3]","name":"oracles","type":"address[3]"},{"internalType":"bool[3]","name":"enableFlagsForOracles","type":"bool[3]"},{"internalType":"bool","name":"cachingEnabled","type":"bool"}],"internalType":"struct ResilientOracle.TokenConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"getUnderlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"accessControlManager_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nativeMarket","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"accessControlManager_","type":"address"}],"name":"setAccessControlManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"enum ResilientOracle.OracleRole","name":"role","type":"uint8"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[3]","name":"oracles","type":"address[3]"},{"internalType":"bool[3]","name":"enableFlagsForOracles","type":"bool[3]"},{"internalType":"bool","name":"cachingEnabled","type":"bool"}],"internalType":"struct ResilientOracle.TokenConfig","name":"tokenConfig","type":"tuple"}],"name":"setTokenConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[3]","name":"oracles","type":"address[3]"},{"internalType":"bool[3]","name":"enableFlagsForOracles","type":"bool[3]"},{"internalType":"bool","name":"cachingEnabled","type":"bool"}],"internalType":"struct ResilientOracle.TokenConfig[]","name":"tokenConfigs_","type":"tuple[]"}],"name":"setTokenConfigs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"updateAssetPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60e060405234801561000f575f80fd5b5060405161240738038061240783398101604081905261002e91610183565b806001600160a01b03811661008a5760405162461bcd60e51b815260206004820152601560248201527f63616e2774206265207a65726f2061646472657373000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0380851660805283811660a052821660c0526100ab6100b4565b505050506101cd565b5f54610100900460ff161561011b5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610081565b5f5460ff9081161461016a575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b0381168114610180575f80fd5b50565b5f805f60608486031215610195575f80fd5b83516101a08161016c565b60208501519093506101b18161016c565b60408501519092506101c28161016c565b809150509250925092565b60805160a05160c0516121e66102215f395f81816101bf015281816112230152818161174c01526118b501525f8181610369015281816113bc01526113f501525f8181610287015261136701526121e65ff3fe608060405234801561000f575f80fd5b50600436106101a1575f3560e01c80638da5cb5b116100f3578063b62e4c9211610093578063e30c39781161006e578063e30c3978146103be578063e9d1284f146103cf578063f2fde38b146103e3578063fc57d4df146103f6575f80fd5b8063b62e4c9214610364578063c4d66de81461038b578063cb67e3b11461039e575f80fd5b8063a8e68463116100ce578063a8e6846314610312578063a9534f8a14610325578063b4a0bdf314610340578063b62cad6914610351575f80fd5b80638da5cb5b146102db57806396e85ced146102ec578063a6b1344a146102ff575f80fd5b80635c975abb1161015e5780638456cb59116101395780638456cb5914610267578063883cfb911461026f5780638a2f7f6d146102825780638b855da4146102a9575f80fd5b80635c975abb14610241578063715018a61461025757806379ba50971461025f575f80fd5b80630e32cb86146101a557806333d33494146101ba5780633f4ba83a146101fe57806341976e09146102065780634b932b8f146102275780634bf39cba1461023a575b5f80fd5b6101b86101b3366004611c32565b610409565b005b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101b861041d565b610219610214366004611c32565b610451565b6040519081526020016101f5565b6101b8610235366004611c78565b6104bf565b6102195f81565b60335460ff1660405190151581526020016101f5565b6101b8610632565b6101b8610643565b6101b86106ba565b6101b861027d366004611e4c565b6106ea565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6102bc6102b7366004611efb565b610769565b604080516001600160a01b0390931683529015156020830152016101f5565b6065546001600160a01b03166101e1565b6101b86102fa366004611c32565b610809565b6101b861030d366004611f2e565b610822565b6101b8610320366004611f72565b610a21565b6101e173bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb81565b60c9546001600160a01b03166101e1565b6101b861035f366004611c32565b610bcb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101b8610399366004611c32565b610bd4565b6103b16103ac366004611c32565b610ce9565b6040516101f59190611f8d565b6097546001600160a01b03166101e1565b6102195f8051602061219183398151915281565b6101b86103f1366004611c32565b610dca565b610219610404366004611c32565b610e3b565b610411610eb1565b61041a81610f0b565b50565b61044760405180604001604052806009815260200168756e7061757365282960b81b815250610fc9565b61044f611060565b565b5f61045e60335460ff1690565b156104b05760405162461bcd60e51b815260206004820152601a60248201527f726573696c69656e74206f7261636c652069732070617573656400000000000060448201526064015b60405180910390fd5b6104b9826110b2565b92915050565b826001600160a01b0381166104e65760405162461bcd60e51b81526004016104a790612014565b6001600160a01b038085165f90815260fb60205260409020548591166105485760405162461bcd60e51b81526020600482015260176024820152761d1bdad95b8818dbdb999a59c81b5d5cdd08195e1a5cdd604a1b60448201526064016104a7565b6105866040518060400160405280602081526020017f656e61626c654f7261636c6528616464726573732c75696e74382c626f6f6c29815250610fc9565b6001600160a01b0385165f90815260fb6020526040902083906004018560028111156105b4576105b4612043565b600381106105c4576105c4612057565b602091828204019190066101000a81548160ff0219169083151502179055508215158460028111156105f8576105f8612043565b6040516001600160a01b038816907fcf3cad1ec87208efbde5d82a0557484a78d4182c3ad16926a5463bc1f7234b3d905f90a45050505050565b61063a610eb1565b61044f5f6112e7565b60975433906001600160a01b031681146106b15760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016104a7565b61041a816112e7565b6106e2604051806040016040528060078152602001667061757365282960c81b815250610fc9565b61044f611300565b80515f0361072e5760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064016104a7565b80515f5b818110156107645761075c83828151811061074f5761074f612057565b6020026020010151610a21565b600101610732565b505050565b6001600160a01b0382165f90815260fb60205260408120819060010183600281111561079757610797612043565b600381106107a7576107a7612057565b01546001600160a01b038581165f90815260fb60205260409020911692506004018360028111156107da576107da612043565b600381106107ea576107ea612057565b602091828204019190069054906101000a900460ff1690509250929050565b5f6108138261133d565b905061081e81611481565b5050565b826001600160a01b0381166108495760405162461bcd60e51b81526004016104a790612014565b6001600160a01b038085165f90815260fb60205260409020548591166108ab5760405162461bcd60e51b81526020600482015260176024820152761d1bdad95b8818dbdb999a59c81b5d5cdd08195e1a5cdd604a1b60448201526064016104a7565b6108e96040518060400160405280602081526020017f7365744f7261636c6528616464726573732c616464726573732c75696e743829815250610fc9565b6001600160a01b03841615801561091057505f83600281111561090e5761090e612043565b145b1561096b5760405162461bcd60e51b815260206004820152602560248201527f63616e277420736574207a65726f206164647265737320746f206d61696e206f6044820152647261636c6560d81b60648201526084016104a7565b6001600160a01b0385165f90815260fb60205260409020849060010184600281111561099957610999612043565b600381106109a9576109a9612057565b0180546001600160a01b0319166001600160a01b03929092169190911790558260028111156109da576109da612043565b846001600160a01b0316866001600160a01b03167fea681d3efb830ef032a9c29a7215b5ceeeb546250d2c463dbf87817aecda1bf160405160405180910390a45050505050565b80516001600160a01b038116610a495760405162461bcd60e51b81526004016104a790612014565b6020820151516001600160a01b038116610a755760405162461bcd60e51b81526004016104a790612014565b610ab36040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250610fc9565b82516001600160a01b039081165f90815260fb60209081526040909120855181546001600160a01b0319169316929092178255840151849190610afc9060018301906003611acf565b506040820151610b129060048301906003611b27565b50606091909101516005909101805460ff1916911515919091179055602083810151808201518151865160409384015193516001600160a01b039485168152928416949184169316917fa51ad01e2270c314a7b78f0c60fe66c723f2d06c121d63fcdce776e654878fc1910160405180910390a482606001511515835f01516001600160a01b03167fca250c5374abedcbf71c0e3eda7ff4cf940fa9e6561d8cd31d2bf480a140a93f60405160405180910390a3505050565b61041a81611481565b5f54610100900460ff1615808015610bf257505f54600160ff909116105b80610c0b5750303b158015610c0b57505f5460ff166001145b610c6e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104a7565b5f805460ff191660011790558015610c8f575f805461ff0019166101001790555b610c9882611563565b610ca061159a565b801561081e575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b610cf1611bb1565b6001600160a01b038281165f90815260fb602090815260409182902082516080810184528154909416845282516060810193849052909291840191600184019060039082845b81546001600160a01b03168152600190910190602001808311610d37575050509183525050604080516060810191829052602090920191906004840190600390825f855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411610d7b575050509284525050506005919091015460ff16151560209091015292915050565b610dd2610eb1565b609780546001600160a01b0383166001600160a01b03199091168117909155610e036065546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f610e4860335460ff1690565b15610e955760405162461bcd60e51b815260206004820152601a60248201527f726573696c69656e74206f7261636c652069732070617573656400000000000060448201526064016104a7565b5f610e9f8361133d565b9050610eaa816110b2565b9392505050565b6065546001600160a01b0316331461044f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104a7565b6001600160a01b038116610f6f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b60648201526084016104a7565b60c980546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610cdd565b60c9546040516318c5e8ab60e01b81525f916001600160a01b0316906318c5e8ab90610ffb9033908690600401612099565b602060405180830381865afa158015611016573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061103a91906120c4565b90508061081e57333083604051634a3fa29360e01b81526004016104a7939291906120df565b6110686115c8565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f80806110cc5f8051602061219183398151915285611611565b905080156110db579392505050565b5f806110e8866001610769565b9150915080801561110157506001600160a01b03821615155b15611170576040516341976e0960e01b81526001600160a01b0387811660048301528316906341976e0990602401602060405180830381865afa925050508015611168575060408051601f3d908101601f1916820190925261116591810190612113565b60015b156111705793505b5f80611191888785801561118c57506001600160a01b03871615155b611659565b915091505f82141580156111a25750805b156111b257509695505050505050565b5f806111be8a896117d4565b915091505f82141580156111cf5750805b156111e1575098975050505050505050565b83158015906111ef57508115155b801561128c5750604051634be3819f60e11b81526001600160a01b038b8116600483015260248201869052604482018490527f000000000000000000000000000000000000000000000000000000000000000016906397c7033e90606401602060405180830381865afa158015611268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061128c91906120c4565b1561129f57509198975050505050505050565b60405162461bcd60e51b815260206004820152601e60248201527f696e76616c696420726573696c69656e74206f7261636c65207072696365000060448201526064016104a7565b609780546001600160a01b031916905561041a8161193c565b61130861198d565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586110953390565b5f816001600160a01b0381166113655760405162461bcd60e51b81526004016104a790612014565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036113ba5773bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb915061147b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361141b577f0000000000000000000000000000000000000000000000000000000000000000915061147b565b826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611457573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eaa919061212a565b50919050565b6114985f8051602061219183398151915282611611565b156114a05750565b5f806114ac835f610769565b90925090506001600160a01b038216158015906114c65750805b1561151657816001600160a01b031663692404266040518163ffffffff1660e01b81526004015f604051808303815f87803b158015611503575f80fd5b505af1925050508015611514575060015b505b6001600160a01b0383165f90815260fb602052604090206005015460ff1615610764575f611543846110b2565b905061155d5f8051602061219183398151915285836119d3565b50505050565b5f54610100900460ff166115895760405162461bcd60e51b81526004016104a790612145565b611591611a1a565b61041a81611a48565b5f54610100900460ff166115c05760405162461bcd60e51b81526004016104a790612145565b61044f611a6e565b60335460ff1661044f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104a7565b5f8083836040516020016116389291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905280516020909101205c949350505050565b5f805f80611667875f610769565b9150915080801561168057506001600160a01b03821615155b156117c3576040516341976e0960e01b81526001600160a01b0388811660048301528316906341976e0990602401602060405180830381865afa9250505080156116e7575060408051601f3d908101601f191682019092526116e491810190612113565b60015b6116f8575f809350935050506117cc565b8561170b579350600192506117cc915050565b8661171d5793505f92506117cc915050565b604051634be3819f60e11b81526001600160a01b038981166004830152602482018390526044820189905282917f0000000000000000000000000000000000000000000000000000000000000000909116906397c7033e90606401602060405180830381865afa158015611793573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117b791906120c4565b945094505050506117cc565b5f809350935050505b935093915050565b5f805f806117e3866002610769565b915091508080156117fc57506001600160a01b03821615155b1561192c576040516341976e0960e01b81526001600160a01b0387811660048301528316906341976e0990602401602060405180830381865afa925050508015611863575060408051601f3d908101601f1916820190925261186091810190612113565b60015b611874575f80935093505050611935565b856118865793505f9250611935915050565b604051634be3819f60e11b81526001600160a01b038881166004830152602482018390526044820188905282917f0000000000000000000000000000000000000000000000000000000000000000909116906397c7033e90606401602060405180830381865afa1580156118fc573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061192091906120c4565b94509450505050611935565b5f809350935050505b9250929050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335460ff161561044f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104a7565b5f83836040516020016119f99291909182526001600160a01b0316602082015260400190565b60405160208183030381529060405280519060200120905081815d50505050565b5f54610100900460ff16611a405760405162461bcd60e51b81526004016104a790612145565b61044f611aa0565b5f54610100900460ff166104115760405162461bcd60e51b81526004016104a790612145565b5f54610100900460ff16611a945760405162461bcd60e51b81526004016104a790612145565b6033805460ff19169055565b5f54610100900460ff16611ac65760405162461bcd60e51b81526004016104a790612145565b61044f336112e7565b8260038101928215611b17579160200282015b82811115611b1757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ae2565b50611b23929150611bec565b5090565b600183019183908215611b17579160200282015f5b83821115611b7857835183826101000a81548160ff02191690831515021790555092602001926001016020815f01049283019260010302611b3c565b8015611ba45782816101000a81549060ff02191690556001016020815f01049283019260010302611b78565b5050611b23929150611bec565b60405180608001604052805f6001600160a01b03168152602001611bd3611c00565b8152602001611be0611c00565b81525f60209091015290565b5b80821115611b23575f8155600101611bed565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461041a575f80fd5b5f60208284031215611c42575f80fd5b8135610eaa81611c1e565b803560038110611c5b575f80fd5b919050565b801515811461041a575f80fd5b8035611c5b81611c60565b5f805f60608486031215611c8a575f80fd5b8335611c9581611c1e565b9250611ca360208501611c4d565b91506040840135611cb381611c60565b809150509250925092565b634e487b7160e01b5f52604160045260245ffd5b6040516080810167ffffffffffffffff81118282101715611cf557611cf5611cbe565b60405290565b6040516060810167ffffffffffffffff81118282101715611cf557611cf5611cbe565b604051601f8201601f1916810167ffffffffffffffff81118282101715611d4757611d47611cbe565b604052919050565b5f82601f830112611d5e575f80fd5b611d66611cfb565b806060840185811115611d77575f80fd5b845b81811015611d9a578035611d8c81611c60565b845260209384019301611d79565b509095945050505050565b5f6101008284031215611db6575f80fd5b611dbe611cd2565b90508135611dcb81611c1e565b81526020603f83018413611ddd575f80fd5b611de5611cfb565b806080850186811115611df6575f80fd5b602086015b81811015611e1b578035611e0e81611c1e565b8452928401928401611dfb565b50816020860152611e2c8782611d4f565b604086015250505050611e4160e08301611c6d565b606082015292915050565b5f6020808385031215611e5d575f80fd5b823567ffffffffffffffff80821115611e74575f80fd5b818501915085601f830112611e87575f80fd5b813581811115611e9957611e99611cbe565b611ea7848260051b01611d1e565b818152848101925060089190911b830184019087821115611ec6575f80fd5b928401925b81841015611ef057611edd8885611da5565b8352848301925061010084019350611ecb565b979650505050505050565b5f8060408385031215611f0c575f80fd5b8235611f1781611c1e565b9150611f2560208401611c4d565b90509250929050565b5f805f60608486031215611f40575f80fd5b8335611f4b81611c1e565b92506020840135611f5b81611c1e565b9150611f6960408501611c4d565b90509250925092565b5f6101008284031215611f83575f80fd5b610eaa8383611da5565b81516001600160a01b03908116825260208084015161010084019291908185015f5b6003811015611fce578251851682529183019190830190600101611faf565b50505060408501519150608084015f5b6003811015611ffd578351151582529282019290820190600101611fde565b5050505060609290920151151560e0919091015290565b60208082526015908201527463616e2774206265207a65726f206164647265737360581b604082015260600190565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190525f906120bc9083018461206b565b949350505050565b5f602082840312156120d4575f80fd5b8151610eaa81611c60565b6001600160a01b038481168252831660208201526060604082018190525f9061210a9083018461206b565b95945050505050565b5f60208284031215612123575f80fd5b5051919050565b5f6020828403121561213a575f80fd5b8151610eaa81611c1e565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe4e99ec55972332f5e0ef9c6623192c0401b609161bffae64d9ccdd7ad6cc7800a2646970667358221220be9e6d379085b751aaacbc3bc057613c1abc54d8dce38ec07fbb603cb7984a4764736f6c6343000819003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c19
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106101a1575f3560e01c80638da5cb5b116100f3578063b62e4c9211610093578063e30c39781161006e578063e30c3978146103be578063e9d1284f146103cf578063f2fde38b146103e3578063fc57d4df146103f6575f80fd5b8063b62e4c9214610364578063c4d66de81461038b578063cb67e3b11461039e575f80fd5b8063a8e68463116100ce578063a8e6846314610312578063a9534f8a14610325578063b4a0bdf314610340578063b62cad6914610351575f80fd5b80638da5cb5b146102db57806396e85ced146102ec578063a6b1344a146102ff575f80fd5b80635c975abb1161015e5780638456cb59116101395780638456cb5914610267578063883cfb911461026f5780638a2f7f6d146102825780638b855da4146102a9575f80fd5b80635c975abb14610241578063715018a61461025757806379ba50971461025f575f80fd5b80630e32cb86146101a557806333d33494146101ba5780633f4ba83a146101fe57806341976e09146102065780634b932b8f146102275780634bf39cba1461023a575b5f80fd5b6101b86101b3366004611c32565b610409565b005b6101e17f000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c1981565b6040516001600160a01b0390911681526020015b60405180910390f35b6101b861041d565b610219610214366004611c32565b610451565b6040519081526020016101f5565b6101b8610235366004611c78565b6104bf565b6102195f81565b60335460ff1660405190151581526020016101f5565b6101b8610632565b6101b8610643565b6101b86106ba565b6101b861027d366004611e4c565b6106ea565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6102bc6102b7366004611efb565b610769565b604080516001600160a01b0390931683529015156020830152016101f5565b6065546001600160a01b03166101e1565b6101b86102fa366004611c32565b610809565b6101b861030d366004611f2e565b610822565b6101b8610320366004611f72565b610a21565b6101e173bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb81565b60c9546001600160a01b03166101e1565b6101b861035f366004611c32565b610bcb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101b8610399366004611c32565b610bd4565b6103b16103ac366004611c32565b610ce9565b6040516101f59190611f8d565b6097546001600160a01b03166101e1565b6102195f8051602061219183398151915281565b6101b86103f1366004611c32565b610dca565b610219610404366004611c32565b610e3b565b610411610eb1565b61041a81610f0b565b50565b61044760405180604001604052806009815260200168756e7061757365282960b81b815250610fc9565b61044f611060565b565b5f61045e60335460ff1690565b156104b05760405162461bcd60e51b815260206004820152601a60248201527f726573696c69656e74206f7261636c652069732070617573656400000000000060448201526064015b60405180910390fd5b6104b9826110b2565b92915050565b826001600160a01b0381166104e65760405162461bcd60e51b81526004016104a790612014565b6001600160a01b038085165f90815260fb60205260409020548591166105485760405162461bcd60e51b81526020600482015260176024820152761d1bdad95b8818dbdb999a59c81b5d5cdd08195e1a5cdd604a1b60448201526064016104a7565b6105866040518060400160405280602081526020017f656e61626c654f7261636c6528616464726573732c75696e74382c626f6f6c29815250610fc9565b6001600160a01b0385165f90815260fb6020526040902083906004018560028111156105b4576105b4612043565b600381106105c4576105c4612057565b602091828204019190066101000a81548160ff0219169083151502179055508215158460028111156105f8576105f8612043565b6040516001600160a01b038816907fcf3cad1ec87208efbde5d82a0557484a78d4182c3ad16926a5463bc1f7234b3d905f90a45050505050565b61063a610eb1565b61044f5f6112e7565b60975433906001600160a01b031681146106b15760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016104a7565b61041a816112e7565b6106e2604051806040016040528060078152602001667061757365282960c81b815250610fc9565b61044f611300565b80515f0361072e5760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064016104a7565b80515f5b818110156107645761075c83828151811061074f5761074f612057565b6020026020010151610a21565b600101610732565b505050565b6001600160a01b0382165f90815260fb60205260408120819060010183600281111561079757610797612043565b600381106107a7576107a7612057565b01546001600160a01b038581165f90815260fb60205260409020911692506004018360028111156107da576107da612043565b600381106107ea576107ea612057565b602091828204019190069054906101000a900460ff1690509250929050565b5f6108138261133d565b905061081e81611481565b5050565b826001600160a01b0381166108495760405162461bcd60e51b81526004016104a790612014565b6001600160a01b038085165f90815260fb60205260409020548591166108ab5760405162461bcd60e51b81526020600482015260176024820152761d1bdad95b8818dbdb999a59c81b5d5cdd08195e1a5cdd604a1b60448201526064016104a7565b6108e96040518060400160405280602081526020017f7365744f7261636c6528616464726573732c616464726573732c75696e743829815250610fc9565b6001600160a01b03841615801561091057505f83600281111561090e5761090e612043565b145b1561096b5760405162461bcd60e51b815260206004820152602560248201527f63616e277420736574207a65726f206164647265737320746f206d61696e206f6044820152647261636c6560d81b60648201526084016104a7565b6001600160a01b0385165f90815260fb60205260409020849060010184600281111561099957610999612043565b600381106109a9576109a9612057565b0180546001600160a01b0319166001600160a01b03929092169190911790558260028111156109da576109da612043565b846001600160a01b0316866001600160a01b03167fea681d3efb830ef032a9c29a7215b5ceeeb546250d2c463dbf87817aecda1bf160405160405180910390a45050505050565b80516001600160a01b038116610a495760405162461bcd60e51b81526004016104a790612014565b6020820151516001600160a01b038116610a755760405162461bcd60e51b81526004016104a790612014565b610ab36040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250610fc9565b82516001600160a01b039081165f90815260fb60209081526040909120855181546001600160a01b0319169316929092178255840151849190610afc9060018301906003611acf565b506040820151610b129060048301906003611b27565b50606091909101516005909101805460ff1916911515919091179055602083810151808201518151865160409384015193516001600160a01b039485168152928416949184169316917fa51ad01e2270c314a7b78f0c60fe66c723f2d06c121d63fcdce776e654878fc1910160405180910390a482606001511515835f01516001600160a01b03167fca250c5374abedcbf71c0e3eda7ff4cf940fa9e6561d8cd31d2bf480a140a93f60405160405180910390a3505050565b61041a81611481565b5f54610100900460ff1615808015610bf257505f54600160ff909116105b80610c0b5750303b158015610c0b57505f5460ff166001145b610c6e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104a7565b5f805460ff191660011790558015610c8f575f805461ff0019166101001790555b610c9882611563565b610ca061159a565b801561081e575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b610cf1611bb1565b6001600160a01b038281165f90815260fb602090815260409182902082516080810184528154909416845282516060810193849052909291840191600184019060039082845b81546001600160a01b03168152600190910190602001808311610d37575050509183525050604080516060810191829052602090920191906004840190600390825f855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411610d7b575050509284525050506005919091015460ff16151560209091015292915050565b610dd2610eb1565b609780546001600160a01b0383166001600160a01b03199091168117909155610e036065546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f610e4860335460ff1690565b15610e955760405162461bcd60e51b815260206004820152601a60248201527f726573696c69656e74206f7261636c652069732070617573656400000000000060448201526064016104a7565b5f610e9f8361133d565b9050610eaa816110b2565b9392505050565b6065546001600160a01b0316331461044f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104a7565b6001600160a01b038116610f6f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b60648201526084016104a7565b60c980546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610cdd565b60c9546040516318c5e8ab60e01b81525f916001600160a01b0316906318c5e8ab90610ffb9033908690600401612099565b602060405180830381865afa158015611016573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061103a91906120c4565b90508061081e57333083604051634a3fa29360e01b81526004016104a7939291906120df565b6110686115c8565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f80806110cc5f8051602061219183398151915285611611565b905080156110db579392505050565b5f806110e8866001610769565b9150915080801561110157506001600160a01b03821615155b15611170576040516341976e0960e01b81526001600160a01b0387811660048301528316906341976e0990602401602060405180830381865afa925050508015611168575060408051601f3d908101601f1916820190925261116591810190612113565b60015b156111705793505b5f80611191888785801561118c57506001600160a01b03871615155b611659565b915091505f82141580156111a25750805b156111b257509695505050505050565b5f806111be8a896117d4565b915091505f82141580156111cf5750805b156111e1575098975050505050505050565b83158015906111ef57508115155b801561128c5750604051634be3819f60e11b81526001600160a01b038b8116600483015260248201869052604482018490527f000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c1916906397c7033e90606401602060405180830381865afa158015611268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061128c91906120c4565b1561129f57509198975050505050505050565b60405162461bcd60e51b815260206004820152601e60248201527f696e76616c696420726573696c69656e74206f7261636c65207072696365000060448201526064016104a7565b609780546001600160a01b031916905561041a8161193c565b61130861198d565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586110953390565b5f816001600160a01b0381166113655760405162461bcd60e51b81526004016104a790612014565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036113ba5773bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb915061147b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03160361141b577f0000000000000000000000000000000000000000000000000000000000000000915061147b565b826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611457573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eaa919061212a565b50919050565b6114985f8051602061219183398151915282611611565b156114a05750565b5f806114ac835f610769565b90925090506001600160a01b038216158015906114c65750805b1561151657816001600160a01b031663692404266040518163ffffffff1660e01b81526004015f604051808303815f87803b158015611503575f80fd5b505af1925050508015611514575060015b505b6001600160a01b0383165f90815260fb602052604090206005015460ff1615610764575f611543846110b2565b905061155d5f8051602061219183398151915285836119d3565b50505050565b5f54610100900460ff166115895760405162461bcd60e51b81526004016104a790612145565b611591611a1a565b61041a81611a48565b5f54610100900460ff166115c05760405162461bcd60e51b81526004016104a790612145565b61044f611a6e565b60335460ff1661044f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104a7565b5f8083836040516020016116389291909182526001600160a01b0316602082015260400190565b60408051601f1981840301815291905280516020909101205c949350505050565b5f805f80611667875f610769565b9150915080801561168057506001600160a01b03821615155b156117c3576040516341976e0960e01b81526001600160a01b0388811660048301528316906341976e0990602401602060405180830381865afa9250505080156116e7575060408051601f3d908101601f191682019092526116e491810190612113565b60015b6116f8575f809350935050506117cc565b8561170b579350600192506117cc915050565b8661171d5793505f92506117cc915050565b604051634be3819f60e11b81526001600160a01b038981166004830152602482018390526044820189905282917f000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c19909116906397c7033e90606401602060405180830381865afa158015611793573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117b791906120c4565b945094505050506117cc565b5f809350935050505b935093915050565b5f805f806117e3866002610769565b915091508080156117fc57506001600160a01b03821615155b1561192c576040516341976e0960e01b81526001600160a01b0387811660048301528316906341976e0990602401602060405180830381865afa925050508015611863575060408051601f3d908101601f1916820190925261186091810190612113565b60015b611874575f80935093505050611935565b856118865793505f9250611935915050565b604051634be3819f60e11b81526001600160a01b038881166004830152602482018390526044820188905282917f000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c19909116906397c7033e90606401602060405180830381865afa1580156118fc573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061192091906120c4565b94509450505050611935565b5f809350935050505b9250929050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335460ff161561044f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104a7565b5f83836040516020016119f99291909182526001600160a01b0316602082015260400190565b60405160208183030381529060405280519060200120905081815d50505050565b5f54610100900460ff16611a405760405162461bcd60e51b81526004016104a790612145565b61044f611aa0565b5f54610100900460ff166104115760405162461bcd60e51b81526004016104a790612145565b5f54610100900460ff16611a945760405162461bcd60e51b81526004016104a790612145565b6033805460ff19169055565b5f54610100900460ff16611ac65760405162461bcd60e51b81526004016104a790612145565b61044f336112e7565b8260038101928215611b17579160200282015b82811115611b1757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ae2565b50611b23929150611bec565b5090565b600183019183908215611b17579160200282015f5b83821115611b7857835183826101000a81548160ff02191690831515021790555092602001926001016020815f01049283019260010302611b3c565b8015611ba45782816101000a81549060ff02191690556001016020815f01049283019260010302611b78565b5050611b23929150611bec565b60405180608001604052805f6001600160a01b03168152602001611bd3611c00565b8152602001611be0611c00565b81525f60209091015290565b5b80821115611b23575f8155600101611bed565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461041a575f80fd5b5f60208284031215611c42575f80fd5b8135610eaa81611c1e565b803560038110611c5b575f80fd5b919050565b801515811461041a575f80fd5b8035611c5b81611c60565b5f805f60608486031215611c8a575f80fd5b8335611c9581611c1e565b9250611ca360208501611c4d565b91506040840135611cb381611c60565b809150509250925092565b634e487b7160e01b5f52604160045260245ffd5b6040516080810167ffffffffffffffff81118282101715611cf557611cf5611cbe565b60405290565b6040516060810167ffffffffffffffff81118282101715611cf557611cf5611cbe565b604051601f8201601f1916810167ffffffffffffffff81118282101715611d4757611d47611cbe565b604052919050565b5f82601f830112611d5e575f80fd5b611d66611cfb565b806060840185811115611d77575f80fd5b845b81811015611d9a578035611d8c81611c60565b845260209384019301611d79565b509095945050505050565b5f6101008284031215611db6575f80fd5b611dbe611cd2565b90508135611dcb81611c1e565b81526020603f83018413611ddd575f80fd5b611de5611cfb565b806080850186811115611df6575f80fd5b602086015b81811015611e1b578035611e0e81611c1e565b8452928401928401611dfb565b50816020860152611e2c8782611d4f565b604086015250505050611e4160e08301611c6d565b606082015292915050565b5f6020808385031215611e5d575f80fd5b823567ffffffffffffffff80821115611e74575f80fd5b818501915085601f830112611e87575f80fd5b813581811115611e9957611e99611cbe565b611ea7848260051b01611d1e565b818152848101925060089190911b830184019087821115611ec6575f80fd5b928401925b81841015611ef057611edd8885611da5565b8352848301925061010084019350611ecb565b979650505050505050565b5f8060408385031215611f0c575f80fd5b8235611f1781611c1e565b9150611f2560208401611c4d565b90509250929050565b5f805f60608486031215611f40575f80fd5b8335611f4b81611c1e565b92506020840135611f5b81611c1e565b9150611f6960408501611c4d565b90509250925092565b5f6101008284031215611f83575f80fd5b610eaa8383611da5565b81516001600160a01b03908116825260208084015161010084019291908185015f5b6003811015611fce578251851682529183019190830190600101611faf565b50505060408501519150608084015f5b6003811015611ffd578351151582529282019290820190600101611fde565b5050505060609290920151151560e0919091015290565b60208082526015908201527463616e2774206265207a65726f206164647265737360581b604082015260600190565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190525f906120bc9083018461206b565b949350505050565b5f602082840312156120d4575f80fd5b8151610eaa81611c60565b6001600160a01b038481168252831660208201526060604082018190525f9061210a9083018461206b565b95945050505050565b5f60208284031215612123575f80fd5b5051919050565b5f6020828403121561213a575f80fd5b8151610eaa81611c1e565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe4e99ec55972332f5e0ef9c6623192c0401b609161bffae64d9ccdd7ad6cc7800a2646970667358221220be9e6d379085b751aaacbc3bc057613c1abc54d8dce38ec07fbb603cb7984a4764736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c19
-----Decoded View---------------
Arg [0] : nativeMarketAddress (address): 0x0000000000000000000000000000000000000000
Arg [1] : vaiAddress (address): 0x0000000000000000000000000000000000000000
Arg [2] : _boundValidator (address): 0xfdaA5dEEA7850997dA8A6E2F2Ab42E60F1011C19
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000fdaa5deea7850997da8a6e2f2ab42e60f1011c19
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.