Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ChainlinkAdapter
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {Controllable} from "../core/base/Controllable.sol"; import {IControllable} from "../interfaces/IControllable.sol"; import {IOracleAdapter} from "../interfaces/IOracleAdapter.sol"; import {IAggregatorV3Interface} from "../integrations/chainlink/IAggregatorV3Interface.sol"; /// @title Oracle adapter for Chainlink-compatible price feeds with 8 decimals /// Changelog: /// 1.1.0: add updatePriceFeed; only gov or multisig can removePriceFeeds /// @author JodsMigel (https://github.com/JodsMigel) contract ChainlinkAdapter is Controllable, IOracleAdapter { using EnumerableSet for EnumerableSet.AddressSet; /// @inheritdoc IControllable string public constant VERSION = "1.1.0"; /// @inheritdoc IOracleAdapter mapping(address asset => address priceFeed) public priceFeeds; EnumerableSet.AddressSet internal _assets; function initialize(address platform_) public initializer { __Controllable_init(platform_); } /// @inheritdoc IOracleAdapter function addPriceFeeds(address[] memory assets_, address[] memory priceFeeds_) external onlyOperator { uint len = assets_.length; if (len != priceFeeds_.length) { revert IControllable.IncorrectArrayLength(); } // nosemgrep for (uint i; i < len; ++i) { // nosemgrep if (!_assets.add(assets_[i])) { revert IControllable.AlreadyExist(); } // nosemgrep priceFeeds[assets_[i]] = priceFeeds_[i]; } emit NewPriceFeeds(assets_, priceFeeds_); } /// @inheritdoc IOracleAdapter function updatePriceFeed(address asset, address priceFeed) external onlyGovernanceOrMultisig { if (!_assets.contains(asset)) { revert IControllable.NotExist(); } priceFeeds[asset] = priceFeed; emit UpdatedPriceFeed(asset, priceFeed); } /// @inheritdoc IOracleAdapter function removePriceFeeds(address[] memory assets_) external onlyGovernanceOrMultisig { uint len = assets_.length; // nosemgrep for (uint i; i < len; ++i) { // nosemgrep if (!_assets.remove(assets_[i])) { revert IControllable.NotExist(); } // nosemgrep priceFeeds[assets_[i]] = address(0); } emit RemovedPriceFeeds(assets_); } /// @inheritdoc IOracleAdapter function getPrice(address asset) external view returns (uint price, uint timestamp) { if (!_assets.contains(asset)) { return (0, 0); } //slither-disable-next-line unused-return (, int answer,, uint updatedAt,) = IAggregatorV3Interface(priceFeeds[asset]).latestRoundData(); return (uint(answer) * 1e10, updatedAt); } /// @inheritdoc IOracleAdapter function getAllPrices() external view returns (address[] memory assets_, uint[] memory prices, uint[] memory timestamps) { uint len = _assets.length(); assets_ = _assets.values(); prices = new uint[](len); timestamps = new uint[](len); // nosemgrep for (uint i; i < len; ++i) { //slither-disable-next-line calls-loop (, int answer,, uint updatedAt,) = IAggregatorV3Interface(priceFeeds[assets_[i]]).latestRoundData(); // nosemgrep prices[i] = uint(answer) * 1e10; timestamps[i] = updatedAt; } } /// @inheritdoc IOracleAdapter function assets() external view returns (address[] memory) { return _assets.values(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "../libs/SlotsLib.sol"; import "../../interfaces/IControllable.sol"; import "../../interfaces/IPlatform.sol"; /// @dev Base core contract. /// It store an immutable platform proxy address in the storage and provides access control to inherited contracts. /// @author Alien Deployer (https://github.com/a17) /// @author 0xhokugava (https://github.com/0xhokugava) abstract contract Controllable is Initializable, IControllable, ERC165 { using SlotsLib for bytes32; string public constant CONTROLLABLE_VERSION = "1.0.0"; bytes32 internal constant _PLATFORM_SLOT = bytes32(uint(keccak256("eip1967.controllable.platform")) - 1); bytes32 internal constant _CREATED_BLOCK_SLOT = bytes32(uint(keccak256("eip1967.controllable.created_block")) - 1); /// @dev Prevent implementation init constructor() { _disableInitializers(); } /// @notice Initialize contract after setup it as proxy implementation /// Save block.timestamp in the "created" variable /// @dev Use it only once after first logic setup /// @param platform_ Platform address //slither-disable-next-line naming-convention function __Controllable_init(address platform_) internal onlyInitializing { if (platform_ == address(0) || IPlatform(platform_).multisig() == address(0)) { revert IncorrectZeroArgument(); } SlotsLib.set(_PLATFORM_SLOT, platform_); // syntax for forge coverage _CREATED_BLOCK_SLOT.set(block.number); emit ContractInitialized(platform_, block.timestamp, block.number); } modifier onlyGovernance() { _requireGovernance(); _; } modifier onlyMultisig() { _requireMultisig(); _; } modifier onlyGovernanceOrMultisig() { _requireGovernanceOrMultisig(); _; } modifier onlyOperator() { _requireOperator(); _; } modifier onlyFactory() { _requireFactory(); _; } // ************* SETTERS/GETTERS ******************* /// @inheritdoc IControllable function platform() public view override returns (address) { return _PLATFORM_SLOT.getAddress(); } /// @inheritdoc IControllable function createdBlock() external view override returns (uint) { return _CREATED_BLOCK_SLOT.getUint(); } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IControllable).interfaceId || super.supportsInterface(interfaceId); } function _requireGovernance() internal view { if (IPlatform(platform()).governance() != msg.sender) { revert NotGovernance(); } } function _requireMultisig() internal view { if (!IPlatform(platform()).isOperator(msg.sender)) { revert NotMultisig(); } } function _requireGovernanceOrMultisig() internal view { IPlatform _platform = IPlatform(platform()); // nosemgrep if (_platform.governance() != msg.sender && _platform.multisig() != msg.sender) { revert NotGovernanceAndNotMultisig(); } } function _requireOperator() internal view { if (!IPlatform(platform()).isOperator(msg.sender)) { revert NotOperator(); } } function _requireFactory() internal view { if (IPlatform(platform()).factory() != msg.sender) { revert NotFactory(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @dev Base core interface implemented by most platform contracts. /// Inherited contracts store an immutable Platform proxy address in the storage, /// which provides authorization capabilities and infrastructure contract addresses. /// @author Alien Deployer (https://github.com/a17) /// @author JodsMigel (https://github.com/JodsMigel) interface IControllable { //region ----- Custom Errors ----- error IncorrectZeroArgument(); error IncorrectMsgSender(); error NotGovernance(); error NotMultisig(); error NotGovernanceAndNotMultisig(); error NotOperator(); error NotFactory(); error NotPlatform(); error NotVault(); error IncorrectArrayLength(); error AlreadyExist(); error NotExist(); error NotTheOwner(); error ETHTransferFailed(); error IncorrectInitParams(); //endregion -- Custom Errors ----- event ContractInitialized(address platform, uint ts, uint block); /// @notice Stability Platform main contract address function platform() external view returns (address); /// @notice Version of contract implementation /// @dev SemVer scheme MAJOR.MINOR.PATCH //slither-disable-next-line naming-convention function VERSION() external view returns (string memory); /// @notice Block number when contract was initialized function createdBlock() external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @dev Adapter for reading oracle prices /// @author Alien Deployer (https://github.com/a17) interface IOracleAdapter { event NewPriceFeeds(address[] assets, address[] priceFeeds); event UpdatedPriceFeed(address asset, address priceFeed); event RemovedPriceFeeds(address[] assets); /// @notice Add price feed to get prices /// Only operator can call this /// @param assets_ Addresses of supported assets /// @param priceFeeds_ Addresses of price feeds function addPriceFeeds(address[] memory assets_, address[] memory priceFeeds_) external; /// @notice Update price feed address for asset /// Only governance or multisig can call this /// @param asset Address of supported asset /// @param priceFeed Address of price feed for asset function updatePriceFeed(address asset, address priceFeed) external; /// @notice Remove price feeds /// Only governance or multisig can call this /// @param assets_ Addresses of supported assets function removePriceFeeds(address[] memory assets_) external; /// @notice Price feeds mapping /// @param asset Address of supported asset /// @param priceFeed Address of price feed for asset function priceFeeds(address asset) external view returns (address priceFeed); /// @notice Asset USD price /// @param asset Address of supported asset /// @return price USD price of 1.0 asset with 18 decimals precision /// @return timestamp Timestamp of last price update function getPrice(address asset) external view returns (uint price, uint timestamp); /// @notice Get all supported assets prices /// @return assets_ Addresses of assets /// @return prices USD prices of 1.0 asset with 18 decimals precision /// @return timestamps Timestamps of last price update function getAllPrices() external view returns (address[] memory assets_, uint[] memory prices, uint[] memory timestamps); /// @notice Get all supported assets in the adapter function assets() external view returns (address[] memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; interface IAggregatorV3Interface { function latestRoundData() external view returns (uint80 roundId, int answer, uint startedAt, uint updatedAt, uint80 answeredInRound); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @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 Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._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 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._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() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @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 { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @title Minimal library for setting / getting slot variables (used in upgradable proxy contracts) library SlotsLib { /// @dev Gets a slot as an address function getAddress(bytes32 slot) internal view returns (address result) { assembly { result := sload(slot) } } /// @dev Gets a slot as uint256 function getUint(bytes32 slot) internal view returns (uint result) { assembly { result := sload(slot) } } /// @dev Sets a slot with address /// @notice Check address for 0 at the setter function set(bytes32 slot, address value) internal { assembly { sstore(slot, value) } } /// @dev Sets a slot with uint function set(bytes32 slot, uint value) internal { assembly { sstore(slot, value) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @notice Interface of the main contract and entry point to the platform. /// @author Alien Deployer (https://github.com/a17) /// @author Jude (https://github.com/iammrjude) /// @author JodsMigel (https://github.com/JodsMigel) interface IPlatform { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ error AlreadyAnnounced(); error SameVersion(); error NoNewVersion(); error UpgradeTimerIsNotOver(uint TimerTimestamp); error IncorrectFee(uint minFee, uint maxFee); error NotEnoughAllowedBBToken(); error TokenAlreadyExistsInSet(address token); error AggregatorNotExists(address dexAggRouter); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ event PlatformVersion(string version); event UpgradeAnnounce( string oldVersion, string newVersion, address[] proxies, address[] newImplementations, uint timelock ); event CancelUpgrade(string oldVersion, string newVersion); event ProxyUpgraded( address indexed proxy, address implementation, string oldContractVersion, string newContractVersion ); event Addresses( address multisig_, address factory_, address priceReader_, address swapper_, address buildingPermitToken_, address vaultManager_, address strategyLogic_, address aprOracle_, address hardWorker, address rebalancer, address zap, address bridge ); event OperatorAdded(address operator); event OperatorRemoved(address operator); event FeesChanged(uint fee, uint feeShareVaultManager, uint feeShareStrategyLogic, uint feeShareEcosystem); event MinInitialBoostChanged(uint minInitialBoostPerDay, uint minInitialBoostDuration); event NewAmmAdapter(string id, address proxy); event EcosystemRevenueReceiver(address receiver); event SetAllowedBBTokenVaults(address bbToken, uint vaultsToBuild, bool firstSet); event RemoveAllowedBBToken(address bbToken); event AddAllowedBoostRewardToken(address token); event RemoveAllowedBoostRewardToken(address token); event AddDefaultBoostRewardToken(address token); event RemoveDefaultBoostRewardToken(address token); event AddBoostTokens(address[] allowedBoostRewardToken, address[] defaultBoostRewardToken); event AllowedBBTokenVaultUsed(address bbToken, uint vaultToUse); event AddDexAggregator(address router); event RemoveDexAggregator(address router); event MinTvlForFreeHardWorkChanged(uint oldValue, uint newValue); event CustomVaultFee(address vault, uint platformFee); event Rebalancer(address rebalancer_); event Bridge(address bridge_); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DATA TYPES */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ struct PlatformUpgrade { string newVersion; address[] proxies; address[] newImplementations; } struct PlatformSettings { string networkName; bytes32 networkExtra; uint fee; uint feeShareVaultManager; uint feeShareStrategyLogic; uint feeShareEcosystem; uint minInitialBoostPerDay; uint minInitialBoostDuration; } struct AmmAdapter { string id; address proxy; } struct SetupAddresses { address factory; address priceReader; address swapper; address buildingPermitToken; address buildingPayPerVaultToken; address vaultManager; address strategyLogic; address aprOracle; address targetExchangeAsset; address hardWorker; address zap; address bridge; address rebalancer; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* VIEW FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @notice Platform version in CalVer scheme: YY.MM.MINOR-tag. Updates on core contract upgrades. function platformVersion() external view returns (string memory); /// @notice Time delay for proxy upgrades of core contracts and changing important platform settings by multisig //slither-disable-next-line naming-convention function TIME_LOCK() external view returns (uint); /// @notice DAO governance function governance() external view returns (address); /// @notice Core team multi signature wallet. Development and operations fund function multisig() external view returns (address); /// @notice This NFT allow user to build limited number of vaults per week function buildingPermitToken() external view returns (address); /// @notice This ERC20 token is used as payment token for vault building function buildingPayPerVaultToken() external view returns (address); /// @notice Receiver of ecosystem revenue function ecosystemRevenueReceiver() external view returns (address); /// @dev The best asset in a network for swaps between strategy assets and farms rewards assets /// The target exchange asset is used for finding the best strategy's exchange asset. /// Rhe fewer routes needed to swap to the target exchange asset, the better. function targetExchangeAsset() external view returns (address); /// @notice Platform factory assembling vaults. Stores settings, strategy logic, farms. /// Provides the opportunity to upgrade vaults and strategies. /// @return Address of Factory proxy function factory() external view returns (address); /// @notice The holders of these NFT receive a share of the vault revenue /// @return Address of VaultManager proxy function vaultManager() external view returns (address); /// @notice The holders of these tokens receive a share of the revenue received in all vaults using this strategy logic. function strategyLogic() external view returns (address); /// @notice Combining oracle and DeX spot prices /// @return Address of PriceReader proxy function priceReader() external view returns (address); /// @notice Providing underlying assets APRs on-chain /// @return Address of AprOracle proxy function aprOracle() external view returns (address); /// @notice On-chain price quoter and swapper /// @return Address of Swapper proxy function swapper() external view returns (address); /// @notice HardWork resolver and caller /// @return Address of HardWorker proxy function hardWorker() external view returns (address); /// @notice Rebalance resolver /// @return Address of Rebalancer proxy function rebalancer() external view returns (address); /// @notice ZAP feature /// @return Address of Zap proxy function zap() external view returns (address); /// @notice Stability Bridge /// @return Address of Bridge proxy function bridge() external view returns (address); /// @notice Name of current EVM network function networkName() external view returns (string memory); /// @notice Minimal initial boost rewards per day USD amount which needs to create rewarding vault function minInitialBoostPerDay() external view returns (uint); /// @notice Minimal boost rewards vesting duration for initial boost function minInitialBoostDuration() external view returns (uint); /// @notice This function provides the timestamp of the platform upgrade timelock. /// @dev This function is an external view function, meaning it doesn't modify the state. /// @return uint representing the timestamp of the platform upgrade timelock. function platformUpgradeTimelock() external view returns (uint); /// @dev Extra network data /// @return 0-2 bytes - color /// 3-5 bytes - background color /// 6-31 bytes - free function networkExtra() external view returns (bytes32); /// @notice Pending platform upgrade data function pendingPlatformUpgrade() external view returns (PlatformUpgrade memory); /// @notice Get platform revenue fee settings /// @return fee Revenue fee % (between MIN_FEE - MAX_FEE) with DENOMINATOR precision. /// @return feeShareVaultManager Revenue fee share % of VaultManager tokenId owner /// @return feeShareStrategyLogic Revenue fee share % of StrategyLogic tokenId owner /// @return feeShareEcosystem Revenue fee share % of ecosystemFeeReceiver function getFees() external view returns (uint fee, uint feeShareVaultManager, uint feeShareStrategyLogic, uint feeShareEcosystem); /// @notice Get custom vault platform fee /// @return fee revenue fee % with DENOMINATOR precision function getCustomVaultFee(address vault) external view returns (uint fee); /// @notice Platform settings function getPlatformSettings() external view returns (PlatformSettings memory); /// @notice AMM adapters of the platform function getAmmAdapters() external view returns (string[] memory id, address[] memory proxy); /// @notice Get AMM adapter data by hash /// @param ammAdapterIdHash Keccak256 hash of adapter ID string /// @return ID string and proxy address of AMM adapter function ammAdapter(bytes32 ammAdapterIdHash) external view returns (AmmAdapter memory); /// @notice Allowed buy-back tokens for rewarding vaults function allowedBBTokens() external view returns (address[] memory); /// @notice Vaults building limit for buy-back token. /// This limit decrements when a vault for BB-token is built. /// @param token Allowed buy-back token /// @return vaultsLimit Number of vaults that can be built for BB-token function allowedBBTokenVaults(address token) external view returns (uint vaultsLimit); /// @notice Vaults building limits for allowed buy-back tokens. /// @return bbToken Allowed buy-back tokens /// @return vaultsLimit Number of vaults that can be built for BB-tokens function allowedBBTokenVaults() external view returns (address[] memory bbToken, uint[] memory vaultsLimit); /// @notice Non-zero vaults building limits for allowed buy-back tokens. /// @return bbToken Allowed buy-back tokens /// @return vaultsLimit Number of vaults that can be built for BB-tokens function allowedBBTokenVaultsFiltered() external view returns (address[] memory bbToken, uint[] memory vaultsLimit); /// @notice Check address for existance in operators list /// @param operator Address /// @return True if this address is Stability Operator function isOperator(address operator) external view returns (bool); /// @notice Tokens that can be used for boost rewards of rewarding vaults /// @return Addresses of tokens function allowedBoostRewardTokens() external view returns (address[] memory); /// @notice Allowed boost reward tokens that used for unmanaged rewarding vaults creation /// @return Addresses of tokens function defaultBoostRewardTokens() external view returns (address[] memory); /// @notice Allowed boost reward tokens that used for unmanaged rewarding vaults creation /// @param addressToRemove This address will be removed from default boost reward tokens /// @return Addresses of tokens function defaultBoostRewardTokensFiltered(address addressToRemove) external view returns (address[] memory); /// @notice Allowed DeX aggregators /// @return Addresses of DeX aggregator rounters function dexAggregators() external view returns (address[] memory); /// @notice DeX aggregator router address is allowed to be used in the platform /// @param dexAggRouter Address of DeX aggreagator router /// @return Can be used function isAllowedDexAggregatorRouter(address dexAggRouter) external view returns (bool); /// @notice Show minimum TVL for compensate if vault has not enough ETH /// @return Minimum TVL for compensate. function minTvlForFreeHardWork() external view returns (uint); /// @notice Front-end platform viewer /// @return platformAddresses Platform core addresses /// platformAddresses[0] factory /// platformAddresses[1] vaultManager /// platformAddresses[2] strategyLogic /// platformAddresses[3] buildingPermitToken /// platformAddresses[4] buildingPayPerVaultToken /// platformAddresses[5] governance /// platformAddresses[6] multisig /// platformAddresses[7] zap /// platformAddresses[8] bridge /// @return bcAssets Blue chip token addresses /// @return dexAggregators_ DeX aggregators allowed to be used entire the platform /// @return vaultType Vault type ID strings /// @return vaultExtra Vault color, background color and other extra data. Index of vault same as in previous array. /// @return vaultBulldingPrice Price of creating new vault in buildingPayPerVaultToken. Index of vault same as in previous array. /// @return strategyId Strategy logic ID strings /// @return isFarmingStrategy True if strategy is farming strategy. Index of strategy same as in previous array. /// @return strategyTokenURI StrategyLogic NFT tokenId metadata and on-chain image. Index of strategy same as in previous array. /// @return strategyExtra Strategy color, background color and other extra data. Index of strategy same as in previous array. function getData() external view returns ( address[] memory platformAddresses, address[] memory bcAssets, address[] memory dexAggregators_, string[] memory vaultType, bytes32[] memory vaultExtra, uint[] memory vaultBulldingPrice, string[] memory strategyId, bool[] memory isFarmingStrategy, string[] memory strategyTokenURI, bytes32[] memory strategyExtra ); /// @notice Front-end balances, prices and vault list viewer /// DEPRECATED: use IFrontend.getBalanceAssets and IFrontend.getBalanceVaults /// @param yourAccount Address of account to query balances /// @return token Tokens supported by the platform /// @return tokenPrice USD price of token. Index of token same as in previous array. /// @return tokenUserBalance User balance of token. Index of token same as in previous array. /// @return vault Deployed vaults /// @return vaultSharePrice Price 1.0 vault share. Index of vault same as in previous array. /// @return vaultUserBalance User balance of vault. Index of vault same as in previous array. /// @return nft Ecosystem NFTs /// nft[0] BuildingPermitToken /// nft[1] VaultManager /// nft[2] StrategyLogic /// @return nftUserBalance User balance of NFT. Index of NFT same as in previous array. /// @return buildingPayPerVaultTokenBalance User balance of vault creation paying token function getBalance(address yourAccount) external view returns ( address[] memory token, uint[] memory tokenPrice, uint[] memory tokenUserBalance, address[] memory vault, uint[] memory vaultSharePrice, uint[] memory vaultUserBalance, address[] memory nft, uint[] memory nftUserBalance, uint buildingPayPerVaultTokenBalance ); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* WRITE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @notice Add platform operator. /// Only governance and multisig can add operator. /// @param operator Address of new operator function addOperator(address operator) external; /// @notice Remove platform operator. /// Only governance and multisig can remove operator. /// @param operator Address of operator to remove function removeOperator(address operator) external; /// @notice Announce upgrade of platform proxies implementations /// Only governance and multisig can announce platform upgrades. /// @param newVersion New platform version. Version must be changed when upgrading. /// @param proxies Addresses of core contract proxies /// @param newImplementations New implementation for proxy. Index of proxy same as in previous array. function announcePlatformUpgrade( string memory newVersion, address[] memory proxies, address[] memory newImplementations ) external; /// @notice Upgrade platform /// Only operator (multisig is operator too) can ececute pending platform upgrade function upgrade() external; /// @notice Cancel pending platform upgrade /// Only operator (multisig is operator too) can ececute pending platform upgrade function cancelUpgrade() external; /// @notice Register AMM adapter in platform /// @param id AMM adapter ID string from AmmAdapterIdLib /// @param proxy Address of AMM adapter proxy function addAmmAdapter(string memory id, address proxy) external; // todo Only governance and multisig can set allowed bb-token vaults building limit /// @notice Set new vaults building limit for buy-back token /// @param bbToken Address of allowed buy-back token /// @param vaultsToBuild Number of vaults that can be built for BB-token function setAllowedBBTokenVaults(address bbToken, uint vaultsToBuild) external; // todo Only governance and multisig can add allowed boost reward token /// @notice Add new allowed boost reward token /// @param token Address of token function addAllowedBoostRewardToken(address token) external; // todo Only governance and multisig can remove allowed boost reward token /// @notice Remove allowed boost reward token /// @param token Address of allowed boost reward token function removeAllowedBoostRewardToken(address token) external; // todo Only governance and multisig can add default boost reward token /// @notice Add default boost reward token /// @param token Address of default boost reward token function addDefaultBoostRewardToken(address token) external; // todo Only governance and multisig can remove default boost reward token /// @notice Remove default boost reward token /// @param token Address of allowed boost reward token function removeDefaultBoostRewardToken(address token) external; // todo Only governance and multisig can add allowed boost reward token // todo Only governance and multisig can add default boost reward token /// @notice Add new allowed boost reward token /// @notice Add default boost reward token /// @param allowedBoostRewardToken Address of allowed boost reward token /// @param defaultBoostRewardToken Address of default boost reward token function addBoostTokens( address[] memory allowedBoostRewardToken, address[] memory defaultBoostRewardToken ) external; /// @notice Decrease allowed BB-token vault building limit when vault is built /// Only Factory can do it. /// @param bbToken Address of allowed buy-back token function useAllowedBBTokenVault(address bbToken) external; /// @notice Allow DeX aggregator routers to be used in the platform /// @param dexAggRouter Addresses of DeX aggreagator routers function addDexAggregators(address[] memory dexAggRouter) external; /// @notice Remove allowed DeX aggregator router from the platform /// @param dexAggRouter Address of DeX aggreagator router function removeDexAggregator(address dexAggRouter) external; /// @notice Change initial boost rewards settings /// @param minInitialBoostPerDay_ Minimal initial boost rewards per day USD amount which needs to create rewarding vault /// @param minInitialBoostDuration_ Minimal boost rewards vesting duration for initial boost function setInitialBoost(uint minInitialBoostPerDay_, uint minInitialBoostDuration_) external; /// @notice Update new minimum TVL for compensate. /// @param value New minimum TVL for compensate. function setMinTvlForFreeHardWork(uint value) external; /// @notice Set custom platform fee for vault /// @param vault Vault address /// @param platformFee Custom platform fee function setCustomVaultFee(address vault, uint platformFee) external; /// @notice Setup Rebalancer. /// Only Goverannce or Multisig can do this when Rebalancer is not set. /// @param rebalancer_ Proxy address of Bridge function setupRebalancer(address rebalancer_) external; /// @notice Setup Bridge. /// Only Goverannce or Multisig can do this when Bridge is not set. /// @param bridge_ Proxy address of Bridge function setupBridge(address bridge_) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@solady/=lib/solady/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/", "solady/=lib/solady/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"AlreadyExist","type":"error"},{"inputs":[],"name":"ETHTransferFailed","type":"error"},{"inputs":[],"name":"IncorrectArrayLength","type":"error"},{"inputs":[],"name":"IncorrectInitParams","type":"error"},{"inputs":[],"name":"IncorrectMsgSender","type":"error"},{"inputs":[],"name":"IncorrectZeroArgument","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotExist","type":"error"},{"inputs":[],"name":"NotFactory","type":"error"},{"inputs":[],"name":"NotGovernance","type":"error"},{"inputs":[],"name":"NotGovernanceAndNotMultisig","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"NotMultisig","type":"error"},{"inputs":[],"name":"NotOperator","type":"error"},{"inputs":[],"name":"NotPlatform","type":"error"},{"inputs":[],"name":"NotTheOwner","type":"error"},{"inputs":[],"name":"NotVault","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"platform","type":"address"},{"indexed":false,"internalType":"uint256","name":"ts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"ContractInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"assets","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"priceFeeds","type":"address[]"}],"name":"NewPriceFeeds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"assets","type":"address[]"}],"name":"RemovedPriceFeeds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"address","name":"priceFeed","type":"address"}],"name":"UpdatedPriceFeed","type":"event"},{"inputs":[],"name":"CONTROLLABLE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets_","type":"address[]"},{"internalType":"address[]","name":"priceFeeds_","type":"address[]"}],"name":"addPriceFeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createdBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPrices","outputs":[{"internalType":"address[]","name":"assets_","type":"address[]"},{"internalType":"uint256[]","name":"prices","type":"uint256[]"},{"internalType":"uint256[]","name":"timestamps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"platform_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"platform","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"priceFeeds","outputs":[{"internalType":"address","name":"priceFeed","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets_","type":"address[]"}],"name":"removePriceFeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"priceFeed","type":"address"}],"name":"updatePriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b5061001861001d565b6100cf565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006d5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cc5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6112f8806100dc5f395ff3fe608060405234801561000f575f80fd5b50600436106100cb575f3560e01c8063767c3c7111610088578063b58aa2f611610063578063b58aa2f6146101ef578063b7997da114610202578063c4d66de814610215578063ffa1ad7414610228575f80fd5b8063767c3c7114610181578063936725ec146101965780639dcb511a146101c7575f80fd5b806301ffc9a7146100cf57806341976e09146100f7578063445df9d61461011f5780634593144c146101365780634bde38c81461014c57806371a973051461016c575b5f80fd5b6100e26100dd366004610e91565b61024c565b60405190151581526020015b60405180910390f35b61010a610105366004610edc565b610282565b604080519283526020830191909152016100ee565b61012761033a565b6040516100ee93929190610f69565b61013e610500565b6040519081526020016100ee565b610154610538565b6040516001600160a01b0390911681526020016100ee565b610174610567565b6040516100ee9190610fab565b61019461018f366004611073565b610573565b005b6101ba604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516100ee91906110ad565b6101546101d5366004610edc565b5f602081905290815260409020546001600160a01b031681565b6101946101fd3660046110f9565b610677565b610194610210366004611159565b6107b8565b610194610223366004610edc565b610849565b6101ba604051806040016040528060058152602001640312e312e360dc1b81525081565b5f6001600160e01b03198216630f1ec81f60e41b148061027c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8061028f600184610957565b61029d57505f928392509050565b6001600160a01b038084165f90815260208190526040808220548151633fabe5a360e21b815291519293849391169163feaf968c9160048083019260a09291908290030181865afa1580156102f4573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061031891906111a9565b50935050925050816402540be4006103309190611209565b9590945092505050565b60608060605f61034a600161097b565b90506103566001610984565b93508067ffffffffffffffff81111561037157610371610fbd565b60405190808252806020026020018201604052801561039a578160200160208202803683370190505b5092508067ffffffffffffffff8111156103b6576103b6610fbd565b6040519080825280602002602001820160405280156103df578160200160208202803683370190505b5091505f5b818110156104f9575f805f8088858151811061040257610402611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f9054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610477573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061049b91906111a9565b50935050925050816402540be4006104b39190611209565b8684815181106104c5576104c5611220565b602002602001018181525050808584815181106104e4576104e4611220565b602090810291909101015250506001016103e4565b5050909192565b5f61053361052f60017f812a673dfca07956350df10f8a654925f561d7a0da09bdbe79e653939a14d9f1611234565b5490565b905090565b5f61053361052f60017faa116a42804728f23983458454b6eb9c6ddf3011db9f9addaf3cd7508d85b0d6611234565b60606105336001610984565b61057b610990565b80515f5b8181101561063b576105b483828151811061059c5761059c611220565b60200260200101516001610aae90919063ffffffff16565b6105d15760405163ad5679e160e01b815260040160405180910390fd5b5f805f8584815181106105e6576105e6611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600101905061057f565b507fa5108c2e2cd93dd143ba00f8e7f12835730cfe9edb750bbd577d80a2ff1992c68260405161066b9190610fab565b60405180910390a15050565b61067f610ac2565b8151815181146106a257604051630ef9926760e21b815260040160405180910390fd5b5f5b81811015610779576106d98482815181106106c1576106c1611220565b60200260200101516001610b5190919063ffffffff16565b6106f6576040516333e9449d60e21b815260040160405180910390fd5b82818151811061070857610708611220565b60200260200101515f8086848151811061072457610724611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508060010190506106a4565b507f7eeabd68e62f463bd0f17eb60c34f5a2069be569889eb12291d8cb7c85ae510d83836040516107ab929190611247565b60405180910390a1505050565b6107c0610990565b6107cb600183610957565b6107e85760405163ad5679e160e01b815260040160405180910390fd5b6001600160a01b038281165f818152602081815260409182902080546001600160a01b031916948616948517905581519283528201929092527f1c326616a19f49e8fb86afacd87ab68273463294bcfa61cffe262aa232db3a31910161066b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f8115801561088e5750825b90505f8267ffffffffffffffff1660011480156108aa5750303b155b9050811580156108b8575080155b156108d65760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561090057845460ff60401b1916600160401b1785555b61090986610b65565b831561094f57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6001600160a01b0381165f90815260018301602052604081205415155b9392505050565b5f61027c825490565b60605f61097483610cc0565b5f610999610538565b9050336001600160a01b0316816001600160a01b0316635aa6e6756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a059190611274565b6001600160a01b031614158015610a8d5750336001600160a01b0316816001600160a01b0316634783c35b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a819190611274565b6001600160a01b031614155b15610aab576040516354299b6f60e01b815260040160405180910390fd5b50565b5f610974836001600160a01b038416610d19565b610aca610538565b6040516336b87bd760e11b81523360048201526001600160a01b039190911690636d70f7ae90602401602060405180830381865afa158015610b0e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b32919061128f565b610b4f57604051631f0853c160e21b815260040160405180910390fd5b565b5f610974836001600160a01b038416610dfc565b610b6d610e48565b6001600160a01b0381161580610bf357505f6001600160a01b0316816001600160a01b0316634783c35b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bc4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610be89190611274565b6001600160a01b0316145b15610c11576040516371c42ac360e01b815260040160405180910390fd5b610c44610c3f60017faa116a42804728f23983458454b6eb9c6ddf3011db9f9addaf3cd7508d85b0d6611234565b829055565b610c7643610c7360017f812a673dfca07956350df10f8a654925f561d7a0da09bdbe79e653939a14d9f1611234565b55565b604080516001600160a01b0383168152426020820152438183015290517f1a2dd071001ebf6e03174e3df5b305795a4ad5d41d8fdb9ba41dbbe2367134269181900360600190a150565b6060815f01805480602002602001604051908101604052809291908181526020018280548015610d0d57602002820191905f5260205f20905b815481526020019060010190808311610cf9575b50505050509050919050565b5f8181526001830160205260408120548015610df3575f610d3b600183611234565b85549091505f90610d4e90600190611234565b9050808214610dad575f865f018281548110610d6c57610d6c611220565b905f5260205f200154905080875f018481548110610d8c57610d8c611220565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080610dbe57610dbe6112ae565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061027c565b5f91505061027c565b5f818152600183016020526040812054610e4157508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561027c565b505f61027c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b4f57604051631afcd79f60e31b815260040160405180910390fd5b5f60208284031215610ea1575f80fd5b81356001600160e01b031981168114610974575f80fd5b6001600160a01b0381168114610aab575f80fd5b8035610ed781610eb8565b919050565b5f60208284031215610eec575f80fd5b813561097481610eb8565b5f815180845260208085019450602084015f5b83811015610f2f5781516001600160a01b031687529582019590820190600101610f0a565b509495945050505050565b5f815180845260208085019450602084015f5b83811015610f2f57815187529582019590820190600101610f4d565b606081525f610f7b6060830186610ef7565b8281036020840152610f8d8186610f3a565b90508281036040840152610fa18185610f3a565b9695505050505050565b602081525f6109746020830184610ef7565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610fe0575f80fd5b8135602067ffffffffffffffff80831115610ffd57610ffd610fbd565b8260051b604051601f19603f8301168101818110848211171561102257611022610fbd565b6040529384526020818701810194908101925087851115611041575f80fd5b6020870191505b848210156110685761105982610ecc565b83529183019190830190611048565b979650505050505050565b5f60208284031215611083575f80fd5b813567ffffffffffffffff811115611099575f80fd5b6110a584828501610fd1565b949350505050565b5f602080835283518060208501525f5b818110156110d9578581018301518582016040015282016110bd565b505f604082860101526040601f19601f8301168501019250505092915050565b5f806040838503121561110a575f80fd5b823567ffffffffffffffff80821115611121575f80fd5b61112d86838701610fd1565b93506020850135915080821115611142575f80fd5b5061114f85828601610fd1565b9150509250929050565b5f806040838503121561116a575f80fd5b823561117581610eb8565b9150602083013561118581610eb8565b809150509250929050565b805169ffffffffffffffffffff81168114610ed7575f80fd5b5f805f805f60a086880312156111bd575f80fd5b6111c686611190565b94506020860151935060408601519250606086015191506111e960808701611190565b90509295509295909350565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761027c5761027c6111f5565b634e487b7160e01b5f52603260045260245ffd5b8181038181111561027c5761027c6111f5565b604081525f6112596040830185610ef7565b828103602084015261126b8185610ef7565b95945050505050565b5f60208284031215611284575f80fd5b815161097481610eb8565b5f6020828403121561129f575f80fd5b81518015158114610974575f80fd5b634e487b7160e01b5f52603160045260245ffdfea264697066735822122003d6ea89e7882802a3e2749b1d73193545de7c4099e403fa0562248efe82b4d564736f6c63430008170033
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106100cb575f3560e01c8063767c3c7111610088578063b58aa2f611610063578063b58aa2f6146101ef578063b7997da114610202578063c4d66de814610215578063ffa1ad7414610228575f80fd5b8063767c3c7114610181578063936725ec146101965780639dcb511a146101c7575f80fd5b806301ffc9a7146100cf57806341976e09146100f7578063445df9d61461011f5780634593144c146101365780634bde38c81461014c57806371a973051461016c575b5f80fd5b6100e26100dd366004610e91565b61024c565b60405190151581526020015b60405180910390f35b61010a610105366004610edc565b610282565b604080519283526020830191909152016100ee565b61012761033a565b6040516100ee93929190610f69565b61013e610500565b6040519081526020016100ee565b610154610538565b6040516001600160a01b0390911681526020016100ee565b610174610567565b6040516100ee9190610fab565b61019461018f366004611073565b610573565b005b6101ba604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516100ee91906110ad565b6101546101d5366004610edc565b5f602081905290815260409020546001600160a01b031681565b6101946101fd3660046110f9565b610677565b610194610210366004611159565b6107b8565b610194610223366004610edc565b610849565b6101ba604051806040016040528060058152602001640312e312e360dc1b81525081565b5f6001600160e01b03198216630f1ec81f60e41b148061027c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8061028f600184610957565b61029d57505f928392509050565b6001600160a01b038084165f90815260208190526040808220548151633fabe5a360e21b815291519293849391169163feaf968c9160048083019260a09291908290030181865afa1580156102f4573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061031891906111a9565b50935050925050816402540be4006103309190611209565b9590945092505050565b60608060605f61034a600161097b565b90506103566001610984565b93508067ffffffffffffffff81111561037157610371610fbd565b60405190808252806020026020018201604052801561039a578160200160208202803683370190505b5092508067ffffffffffffffff8111156103b6576103b6610fbd565b6040519080825280602002602001820160405280156103df578160200160208202803683370190505b5091505f5b818110156104f9575f805f8088858151811061040257610402611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f9054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610477573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061049b91906111a9565b50935050925050816402540be4006104b39190611209565b8684815181106104c5576104c5611220565b602002602001018181525050808584815181106104e4576104e4611220565b602090810291909101015250506001016103e4565b5050909192565b5f61053361052f60017f812a673dfca07956350df10f8a654925f561d7a0da09bdbe79e653939a14d9f1611234565b5490565b905090565b5f61053361052f60017faa116a42804728f23983458454b6eb9c6ddf3011db9f9addaf3cd7508d85b0d6611234565b60606105336001610984565b61057b610990565b80515f5b8181101561063b576105b483828151811061059c5761059c611220565b60200260200101516001610aae90919063ffffffff16565b6105d15760405163ad5679e160e01b815260040160405180910390fd5b5f805f8584815181106105e6576105e6611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600101905061057f565b507fa5108c2e2cd93dd143ba00f8e7f12835730cfe9edb750bbd577d80a2ff1992c68260405161066b9190610fab565b60405180910390a15050565b61067f610ac2565b8151815181146106a257604051630ef9926760e21b815260040160405180910390fd5b5f5b81811015610779576106d98482815181106106c1576106c1611220565b60200260200101516001610b5190919063ffffffff16565b6106f6576040516333e9449d60e21b815260040160405180910390fd5b82818151811061070857610708611220565b60200260200101515f8086848151811061072457610724611220565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508060010190506106a4565b507f7eeabd68e62f463bd0f17eb60c34f5a2069be569889eb12291d8cb7c85ae510d83836040516107ab929190611247565b60405180910390a1505050565b6107c0610990565b6107cb600183610957565b6107e85760405163ad5679e160e01b815260040160405180910390fd5b6001600160a01b038281165f818152602081815260409182902080546001600160a01b031916948616948517905581519283528201929092527f1c326616a19f49e8fb86afacd87ab68273463294bcfa61cffe262aa232db3a31910161066b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f8115801561088e5750825b90505f8267ffffffffffffffff1660011480156108aa5750303b155b9050811580156108b8575080155b156108d65760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561090057845460ff60401b1916600160401b1785555b61090986610b65565b831561094f57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6001600160a01b0381165f90815260018301602052604081205415155b9392505050565b5f61027c825490565b60605f61097483610cc0565b5f610999610538565b9050336001600160a01b0316816001600160a01b0316635aa6e6756040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a059190611274565b6001600160a01b031614158015610a8d5750336001600160a01b0316816001600160a01b0316634783c35b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a5d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a819190611274565b6001600160a01b031614155b15610aab576040516354299b6f60e01b815260040160405180910390fd5b50565b5f610974836001600160a01b038416610d19565b610aca610538565b6040516336b87bd760e11b81523360048201526001600160a01b039190911690636d70f7ae90602401602060405180830381865afa158015610b0e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b32919061128f565b610b4f57604051631f0853c160e21b815260040160405180910390fd5b565b5f610974836001600160a01b038416610dfc565b610b6d610e48565b6001600160a01b0381161580610bf357505f6001600160a01b0316816001600160a01b0316634783c35b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bc4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610be89190611274565b6001600160a01b0316145b15610c11576040516371c42ac360e01b815260040160405180910390fd5b610c44610c3f60017faa116a42804728f23983458454b6eb9c6ddf3011db9f9addaf3cd7508d85b0d6611234565b829055565b610c7643610c7360017f812a673dfca07956350df10f8a654925f561d7a0da09bdbe79e653939a14d9f1611234565b55565b604080516001600160a01b0383168152426020820152438183015290517f1a2dd071001ebf6e03174e3df5b305795a4ad5d41d8fdb9ba41dbbe2367134269181900360600190a150565b6060815f01805480602002602001604051908101604052809291908181526020018280548015610d0d57602002820191905f5260205f20905b815481526020019060010190808311610cf9575b50505050509050919050565b5f8181526001830160205260408120548015610df3575f610d3b600183611234565b85549091505f90610d4e90600190611234565b9050808214610dad575f865f018281548110610d6c57610d6c611220565b905f5260205f200154905080875f018481548110610d8c57610d8c611220565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080610dbe57610dbe6112ae565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061027c565b5f91505061027c565b5f818152600183016020526040812054610e4157508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561027c565b505f61027c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610b4f57604051631afcd79f60e31b815260040160405180910390fd5b5f60208284031215610ea1575f80fd5b81356001600160e01b031981168114610974575f80fd5b6001600160a01b0381168114610aab575f80fd5b8035610ed781610eb8565b919050565b5f60208284031215610eec575f80fd5b813561097481610eb8565b5f815180845260208085019450602084015f5b83811015610f2f5781516001600160a01b031687529582019590820190600101610f0a565b509495945050505050565b5f815180845260208085019450602084015f5b83811015610f2f57815187529582019590820190600101610f4d565b606081525f610f7b6060830186610ef7565b8281036020840152610f8d8186610f3a565b90508281036040840152610fa18185610f3a565b9695505050505050565b602081525f6109746020830184610ef7565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610fe0575f80fd5b8135602067ffffffffffffffff80831115610ffd57610ffd610fbd565b8260051b604051601f19603f8301168101818110848211171561102257611022610fbd565b6040529384526020818701810194908101925087851115611041575f80fd5b6020870191505b848210156110685761105982610ecc565b83529183019190830190611048565b979650505050505050565b5f60208284031215611083575f80fd5b813567ffffffffffffffff811115611099575f80fd5b6110a584828501610fd1565b949350505050565b5f602080835283518060208501525f5b818110156110d9578581018301518582016040015282016110bd565b505f604082860101526040601f19601f8301168501019250505092915050565b5f806040838503121561110a575f80fd5b823567ffffffffffffffff80821115611121575f80fd5b61112d86838701610fd1565b93506020850135915080821115611142575f80fd5b5061114f85828601610fd1565b9150509250929050565b5f806040838503121561116a575f80fd5b823561117581610eb8565b9150602083013561118581610eb8565b809150509250929050565b805169ffffffffffffffffffff81168114610ed7575f80fd5b5f805f805f60a086880312156111bd575f80fd5b6111c686611190565b94506020860151935060408601519250606086015191506111e960808701611190565b90509295509295909350565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761027c5761027c6111f5565b634e487b7160e01b5f52603260045260245ffd5b8181038181111561027c5761027c6111f5565b604081525f6112596040830185610ef7565b828103602084015261126b8185610ef7565b95945050505050565b5f60208284031215611284575f80fd5b815161097481610eb8565b5f6020828403121561129f575f80fd5b81518015158114610974575f80fd5b634e487b7160e01b5f52603160045260245ffdfea264697066735822122003d6ea89e7882802a3e2749b1d73193545de7c4099e403fa0562248efe82b4d564736f6c63430008170033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.