Source Code
Overview
MON Balance
MON Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xB11A6b7e...99af537A7 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
MarketStore
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import "./Roles.sol";
/// @title MarketStore
/// @notice Persistent storage of supported markets
contract MarketStore is Roles {
// Market struct
struct Market {
string name; // Market's full name, e.g. Bitcoin / U.S. Dollar
string category; // crypto, fx, commodities, or indices
address chainlinkFeed; // Price feed contract address
uint256 maxLeverage; // No decimals
uint256 maxDeviation; // In bps, max price difference from oracle to chainlink price
uint256 fee; // In bps. 10 = 0.1%
uint256 liqThreshold; // In bps
uint256 fundingFactor; // Yearly funding rate if OI is completely skewed to one side. In bps.
uint256 minOrderAge; // Min order age before is can be executed. In seconds
uint256 pythMaxAge; // Max Pyth submitted price age, in seconds
bytes32 pythFeed; // Pyth price feed id
bool allowChainlinkExecution; // Allow anyone to execute orders with chainlink
bool isReduceOnly; // accepts only reduce only orders
uint256 minFactor; // funding rate min factor
uint256 sampleSize; // funding rate sample size
}
// Constants to limit gov power
uint256 public constant BPS_DIVIDER = 10000; // 100%
uint256 public constant MAX_FEE = 1000; // 10%
uint256 public constant MAX_DEVIATION = 1000; // 10%
uint256 public constant MAX_LIQTHRESHOLD = 10000; // 100%
uint256 public constant MAX_MIN_ORDER_AGE = 30;
uint256 public constant MIN_PYTH_MAX_AGE = 3;
// list of supported markets
string[] public marketList; // "ETH-USD", "BTC-USD", etc
mapping(string => Market) private markets;
function initialize(address rs) external initializer {
roleStore = RoleStore(rs);
_setGov(msg.sender);
}
/// @notice Set or update a market
/// @dev Only callable by governance
/// @param market String identifier, e.g. "ETH-USD"
/// @param marketInfo Market struct containing required market data
function set(
string calldata market,
Market memory marketInfo
) external onlyGov {
require(marketInfo.fee <= MAX_FEE, "!max-fee");
require(marketInfo.maxLeverage >= 1, "!max-leverage");
require(marketInfo.maxDeviation <= MAX_DEVIATION, "!max-deviation");
require(
marketInfo.liqThreshold <= MAX_LIQTHRESHOLD,
"!max-liqthreshold"
);
require(
marketInfo.minOrderAge <= MAX_MIN_ORDER_AGE,
"!max-minorderage"
);
require(marketInfo.pythMaxAge >= MIN_PYTH_MAX_AGE, "!min-pythmaxage");
require(
marketInfo.maxLeverage * marketInfo.fee <= BPS_DIVIDER,
"!max-leverage-fee"
);
markets[market] = marketInfo;
for (uint256 i = 0; i < marketList.length; i++) {
// check if market already exists, if yes return
if (
keccak256(abi.encodePacked(marketList[i])) ==
keccak256(abi.encodePacked(market))
) return;
}
marketList.push(market);
}
/// @notice Returns market struct of `market`
/// @param market String identifier, e.g. "ETH-USD"
function get(string calldata market) external view returns (Market memory) {
return markets[market];
}
/// @notice Returns market struct array of specified markets
/// @param _markets Array of market strings, e.g. ["ETH-USD", "BTC-USD"]
function getMany(
string[] calldata _markets
) external view returns (Market[] memory) {
uint256 length = _markets.length;
Market[] memory _marketInfos = new Market[](length);
for (uint256 i = 0; i < length; i++) {
_marketInfos[i] = markets[_markets[i]];
}
return _marketInfos;
}
/// @notice Returns market identifier at `index`
/// @param index index of marketList
function getMarketByIndex(
uint256 index
) external view returns (string memory) {
return marketList[index];
}
/// @notice Get a list of all supported markets
function getMarketList() external view returns (string[] memory) {
return marketList;
}
/// @notice Get number of supported markets
function getMarketCount() external view returns (uint256) {
return marketList.length;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import "./Governable.sol";
import "./RoleStore.sol";
/// @title Roles
/// @notice Role-based access control mechanism via onlyContract modifier
abstract contract Roles is Governable {
bytes32 internal constant CONTRACT_ROLE = keccak256("CONTRACT");
RoleStore public roleStore;
/// @dev Reverts if caller address has not the contract role
modifier onlyContract() {
require(roleStore.hasRole(msg.sender, CONTRACT_ROLE), "!contract-role");
_;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
/// @title Governable
/// @notice Basic access control mechanism, gov has access to certain functions
abstract contract Governable is Initializable {
address public gov;
event SetGov(address prevGov, address nextGov);
/// @dev Reverts if called by any account other than gov
modifier onlyGov() {
require(msg.sender == gov, "!gov");
_;
}
/// @notice Sets a new governance address
/// @dev Only callable by governance
function setGov(address _gov) external onlyGov {
_setGov(_gov);
}
/// @notice Sets a new governance address
/// @dev Internal function without access restriction
function _setGov(address _gov) internal {
require(_gov != address(0), "!zero-gov");
address prevGov = gov;
gov = _gov;
emit SetGov(prevGov, _gov);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import "./EnumerableSet.sol";
import "./Governable.sol";
/**
* @title RoleStore
* @notice Role-based access control mechanism. Governance can grant and
* revoke roles dynamically via {grantRole} and {revokeRole}
*/
contract RoleStore is Governable {
// Libraries
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableSet for EnumerableSet.Bytes32Set;
event RoleGranted(
bytes32 indexed role,
address indexed account,
address indexed sender
);
event RoleRevoked(
bytes32 indexed role,
address indexed account,
address indexed sender
);
// Set of roles
EnumerableSet.Bytes32Set internal roles;
// Role -> address
mapping(bytes32 => EnumerableSet.AddressSet) internal roleMembers;
function initialize() external initializer {
_setGov(msg.sender);
}
/// @notice Grants `role` to `account`
/// @dev Only callable by governance
function grantRole(address account, bytes32 role) external onlyGov {
// add role if not already present
if (!roles.contains(role)) roles.add(role);
require(roleMembers[role].add(account));
emit RoleGranted(role, account, msg.sender);
}
/// @notice Revokes `role` from `account`
/// @dev Only callable by governance
function revokeRole(address account, bytes32 role) external onlyGov {
require(roleMembers[role].remove(account));
emit RoleRevoked(role, account, msg.sender);
// Remove role if it has no longer any members
if (roleMembers[role].length() == 0) {
roles.remove(role);
}
}
/// @notice Returns `true` if `account` has been granted `role`
function hasRole(
address account,
bytes32 role
) external view returns (bool) {
return roleMembers[role].contains(account);
}
/// @notice Returns number of roles
function getRoleCount() external view returns (uint256) {
return roles.length();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/Address.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]
* ```
* 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) || (!Address.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 Internal function that returns the initialized version. Returns `_initialized`
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Internal function that returns the initialized version. Returns `_initializing`
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity 0.8.17;
/**
* @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.
*
* ```
* 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 of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @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._indexes[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 read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 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 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[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._indexes[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
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @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
* ====
*
* [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://diligence.consensys.net/posts/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.5.11/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);
}
}
}{
"remappings": [
"@openzeppelin/=lib/openzeppelin-contracts/",
"chainlink/=node_modules/@chainlink/",
"pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/",
"@uniswap/v2-periphery/=node_modules/@uniswap/v2-periphery/",
"@uniswap/v2-core/=node_modules/@uniswap/v2-core/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/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-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"prevGov","type":"address"},{"indexed":false,"internalType":"address","name":"nextGov","type":"address"}],"name":"SetGov","type":"event"},{"inputs":[],"name":"BPS_DIVIDER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DEVIATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_LIQTHRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MIN_ORDER_AGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_PYTH_MAX_AGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"market","type":"string"}],"name":"get","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"category","type":"string"},{"internalType":"address","name":"chainlinkFeed","type":"address"},{"internalType":"uint256","name":"maxLeverage","type":"uint256"},{"internalType":"uint256","name":"maxDeviation","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"liqThreshold","type":"uint256"},{"internalType":"uint256","name":"fundingFactor","type":"uint256"},{"internalType":"uint256","name":"minOrderAge","type":"uint256"},{"internalType":"uint256","name":"pythMaxAge","type":"uint256"},{"internalType":"bytes32","name":"pythFeed","type":"bytes32"},{"internalType":"bool","name":"allowChainlinkExecution","type":"bool"},{"internalType":"bool","name":"isReduceOnly","type":"bool"},{"internalType":"uint256","name":"minFactor","type":"uint256"},{"internalType":"uint256","name":"sampleSize","type":"uint256"}],"internalType":"struct MarketStore.Market","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"_markets","type":"string[]"}],"name":"getMany","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"category","type":"string"},{"internalType":"address","name":"chainlinkFeed","type":"address"},{"internalType":"uint256","name":"maxLeverage","type":"uint256"},{"internalType":"uint256","name":"maxDeviation","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"liqThreshold","type":"uint256"},{"internalType":"uint256","name":"fundingFactor","type":"uint256"},{"internalType":"uint256","name":"minOrderAge","type":"uint256"},{"internalType":"uint256","name":"pythMaxAge","type":"uint256"},{"internalType":"bytes32","name":"pythFeed","type":"bytes32"},{"internalType":"bool","name":"allowChainlinkExecution","type":"bool"},{"internalType":"bool","name":"isReduceOnly","type":"bool"},{"internalType":"uint256","name":"minFactor","type":"uint256"},{"internalType":"uint256","name":"sampleSize","type":"uint256"}],"internalType":"struct MarketStore.Market[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getMarketByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMarketCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMarketList","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rs","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"marketList","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roleStore","outputs":[{"internalType":"contract RoleStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"market","type":"string"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"category","type":"string"},{"internalType":"address","name":"chainlinkFeed","type":"address"},{"internalType":"uint256","name":"maxLeverage","type":"uint256"},{"internalType":"uint256","name":"maxDeviation","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"liqThreshold","type":"uint256"},{"internalType":"uint256","name":"fundingFactor","type":"uint256"},{"internalType":"uint256","name":"minOrderAge","type":"uint256"},{"internalType":"uint256","name":"pythMaxAge","type":"uint256"},{"internalType":"bytes32","name":"pythFeed","type":"bytes32"},{"internalType":"bool","name":"allowChainlinkExecution","type":"bool"},{"internalType":"bool","name":"isReduceOnly","type":"bool"},{"internalType":"uint256","name":"minFactor","type":"uint256"},{"internalType":"uint256","name":"sampleSize","type":"uint256"}],"internalType":"struct MarketStore.Market","name":"marketInfo","type":"tuple"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x60808060405234610016576115cd908161001c8239f35b600080fdfe608060408181526004918236101561001657600080fd5b60009260e0908435821c92836312d43a51146109b957508263232b956c1461096b5782633d4db0431461094e5782634a4a7b0414610924578263565f129f146107105782635b9907a414610842578263693ec85e1461071d5782637c4283bc14610710578263af4b9d3d14610693578263b05f233a14610433578263b1b5266614610440578263bc063e1a14610433578263c4d66de8146102ec578263cb52b8ce1461015f5750508063cfad57a214610120578063dd4c2eb6146101055763fd69f3c2146100e4575b600080fd5b346101015781600319360112610101576020906002549051908152f35b5080fd5b50346101015781600319360112610101576020905160038152f35b823461015c57602036600319011261015c5761015961013d610ccd565b61015460018060a01b03845460101c163314610d47565b610d79565b80f35b80fd5b915091346102e8576003199181833601126102e45767ffffffffffffffff9181358381116102e0576101949036908401610bc0565b939092602435918083116102c5576101e0809784360301126102c5578351968701878110828211176102cd578452828201358181116102c9576101dc90833691860101610ce3565b875260248301359081116102c5576101f8913691840101610ce3565b60208601526044810135916001600160a01b039182841684036102c557610159976102c0946101c493890152606482013560608901526084820135608089015260a482013560a089015260c482013560c089015260e4820135908801526101048101356101008801526101248101356101208801526101448101356101408801526102866101648201610d3a565b6101608801526102996101848201610d3a565b6101808801526101a48101356101a088015201356101c0860152865460101c163314610d47565b610e95565b8880fd5b8980fd5b634e487b7160e01b8a526041835260248afd5b8680fd5b8480fd5b8380fd5b9150503461042f57602036600319011261042f57610308610ccd565b835460ff8160081c161592838094610422575b801561040b575b156103b1575060ff1981166001178555826103a0575b5060018060a01b03166bffffffffffffffffffffffff60a01b600154161760015561036233610d79565b61036a575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff191661010117845538610338565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156103225750600160ff831614610322565b50600160ff83161061031b565b8280fd5b50505050506100df610caf565b8490843461042f576020806003193601126102e857823567ffffffffffffffff9586821161068f573660238301121561068f5781850135948786116102e057600597602436888b1b86018201116102c5576104a08895989997969961156b565b976104ad8751998a610a9a565b858952601f196104bc8761156b565b01885b81811061066b575050368190036042190190885b8c888210610536578c8c8c8c8051938080860192818752855180945283818801981b870101940192955b82871061050a5785850386f35b909192938280610526600193603f198a82030186528851610bee565b96019201960195929190926104fd565b8185919d9a9b9d1b8301013583811215610667578201848101359086821161066357604401908036038213610663576106498f938e600d8f8f959784978961065a9a8451928337810190888160039384815203019020928051986105998a610a67565b6105a285610abc565b8a526105b060018601610abc565b908a015260028401546001600160a01b03169089015282015460608801528d820154608088015281015460a0870152600681015460c087015260078101548e8701526008808201546101008801526009820154610120880152600a820154610140880152600b82015460ff80821615156101608a0152911c161515610180870152600c8101546101a087015201546101c0850152611583565b52610654818d611583565b50610e70565b9a98979a6104d3565b8d80fd5b8c80fd5b9a8b8b82809b9c9e61067e9b969b6114fa565b92010152019a98979a9691966104bf565b8580fd5b83853461015c57602036600319011261015c578235926002548410156106fd57506106f99260026106e692527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01610abc565b9051918291602083526020830190610b62565b0390f35b634e487b7160e01b825260329052602490fd5b50505050506100df610ba2565b83853461015c57602036600319011261015c5782359067ffffffffffffffff821161015c57506106f9936020610758600d9336908701610bc0565b91906107626114fa565b508286519384928337810160038152030190209083519461078286610a67565b61078b83610abc565b865261079960018401610abc565b602087015260018060a01b0360028401541685870152600383015460608701528201546080860152600582015460a0860152600682015460c086015260078201549085015260088101546101008501526009810154610120850152600a81015461014085015260ff600b820154818116151561016087015260081c161515610180850152600c8101546101a085015201546101c083015251918291602083526020830190610bee565b83853461015c578060031936011261015c576002546108608161156b565b9161086d84519384610a9a565b8183526002815260209283810192827f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace855b83831061090057505050508451938085019181865251809252858501958260051b8601019392955b8287106108d45785850386f35b9091929382806108f0600193603f198a82030186528851610b62565b96019201960195929190926108c7565b6001888192610912859b98999b610abc565b8152019201920191909694939661089f565b5050503461010157816003193601126101015760015490516001600160a01b039091168152602090f35b5050503461010157816003193601126101015760209051601e8152f35b83853461015c57602036600319011261015c57823560025481101561010157610993906109e0565b9390936109a7576106f9836106e686610abc565b634e487b7160e01b8252819052602490fd5b859034610101578160031936011261010157905460101c6001600160a01b03168152602090f35b600254811015610a175760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c92168015610a5d575b6020831014610a4757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610a3c565b6101e0810190811067ffffffffffffffff821117610a8457604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610a8457604052565b9060405191826000825492610ad084610a2d565b908184526001948581169081600014610b3f5750600114610afc575b5050610afa92500383610a9a565b565b9093915060005260209081600020936000915b818310610b27575050610afa93508201013880610aec565b85548884018501529485019487945091830191610b0f565b915050610afa94506020925060ff191682840152151560051b8201013880610aec565b919082519283825260005b848110610b8e575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610b6d565b50346100df5760003660031901126100df5760206040516127108152f35b9181601f840112156100df5782359167ffffffffffffffff83116100df57602083818601950101116100df57565b90610c17610c0583516101e0808552840190610b62565b60208401518382036020850152610b62565b9160018060a01b036040820151166040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e083015261010080820151908301526101208082015190830152610140808201519083015261016080820151151590830152610180808201511515908301526101a080820151908301526101c08091015191015290565b50346100df5760003660031901126100df5760206040516103e88152f35b600435906001600160a01b03821682036100df57565b81601f820112156100df5780359067ffffffffffffffff8211610a845760405192610d18601f8401601f191660200185610a9a565b828452602083830101116100df57816000926020809301838601378301015290565b359081151582036100df57565b15610d4e57565b606460405162461bcd60e51b815260206004820152600460248201526310b3b7bb60e11b6044820152fd5b6001600160a01b03818116918215610deb576000805462010000600160b01b03198116601093841b62010000600160b01b031617909155604080519190921c909216825260208201929092527f53351836099c03ffc3b1727d8abd4b0222afa87d4ed76ae3102d51369ef7f7859190a1565b60405162461bcd60e51b815260206004820152600960248201526810bd32b93796b3b7bb60b91b6044820152606490fd5b90601f8111610e2a57505050565b600091825260208220906020601f850160051c83019410610e66575b601f0160051c01915b828110610e5b57505050565b818155600101610e4f565b9092508290610e46565b6000198114610e7f5760010190565b634e487b7160e01b600052601160045260246000fd5b92916103e88060a0830151116114ca5760016060830151106114955760808201511161145f576127108060c08301511161142657601e610100830151116113ee576003610120830151106113b757606082015160a083015190818102918183041490151715610e7f571161137e5760405182858237602081848101600381520301902090805180519067ffffffffffffffff8211610a84578190610f4382610f3d8754610a2d565b87610e1c565b602090601f831160011461131257600092611307575b50508160011b916000199060031b1c19161782555b602081015180519067ffffffffffffffff8211610a8457610f9f82610f966001870154610a2d565b60018701610e1c565b602090601f8311600114611291579180600d94926101c094600092611286575b50508160011b916000199060031b1c19161760018501555b6002840160018060a01b036040830151166bffffffffffffffffffffffff60a01b825416179055606081015160038501556080810151600485015560a0810151600585015560c0810151600685015560e0810151600785015561010081015160088501556101208101516009850155610140810151600a850155600b84016101608201511515815460ff61ff00610180860151151560081b1692169061ffff1916171790556101a0810151600c85015501519101556000600254905b818110611196575068010000000000000000811015610a84578060016110bc92016002556109e0565b9190916111805767ffffffffffffffff8111610a84576110e6816110e08454610a2d565b84610e1c565b6000601f82116001146111205781929394600092611115575b50508160011b916000199060031b1c1916179055565b0135905038806110ff565b601f198216948382526020822091805b87811061116857508360019596971061114e575b505050811b019055565b0135600019600384901b60f8161c19169055388080611144565b90926020600181928686013581550194019101611130565b634e487b7160e01b600052600060045260246000fd5b61119f816109e0565b5060405160208101918160008254926111b784610a2d565b93600181169081156112685750600114611226575b506111e0925003601f198101835282610a9a565b519020604051602081019085888337611209602082888101600083820152038084520182610a9a565b5190201461121f5761121a90610e70565b611093565b5050509050565b9150506000528160206000206000905b83821061124e57505060206111e092820101386111cc565b602091925080600191548385880101520191018391611236565b60ff19168752506111e09380151502830160200191503890506111cc565b015190503880610fbf565b906001850160005260206000209160005b601f19851681106112ef575092600d94926001926101c09583601f198116106112d6575b505050811b016001850155610fd7565b015160001960f88460031b161c191690553880806112c6565b919260206001819286850151815501940192016112a2565b015190503880610f59565b9250846000526020600020906000935b601f1984168510611363576001945083601f1981161061134a575b505050811b018255610f6e565b015160001960f88460031b161c1916905538808061133d565b81810151835560209485019460019093019290910190611322565b60405162461bcd60e51b8152602060048201526011602482015270216d61782d6c657665726167652d66656560781b6044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e216d696e2d707974686d617861676560881b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f216d61782d6d696e6f7264657261676560801b6044820152606490fd5b60405162461bcd60e51b8152602060048201526011602482015270085b585e0b5b1a5c5d1a1c995cda1bdb19607a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d10b6b0bc16b232bb34b0ba34b7b760911b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c216d61782d6c6576657261676560981b6044820152606490fd5b60405162461bcd60e51b8152602060048201526008602482015267216d61782d66656560c01b6044820152606490fd5b6040519061150782610a67565b8160608152606060208201526101c06000918260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a08201520152565b67ffffffffffffffff8111610a845760051b60200190565b8051821015610a175760209160051b01019056fea2646970667358221220dcfc085a53a9088969c27de87d1228eac33e32c27239f991a916795685df492864736f6c63430008110033
Deployed Bytecode
0x608060408181526004918236101561001657600080fd5b60009260e0908435821c92836312d43a51146109b957508263232b956c1461096b5782633d4db0431461094e5782634a4a7b0414610924578263565f129f146107105782635b9907a414610842578263693ec85e1461071d5782637c4283bc14610710578263af4b9d3d14610693578263b05f233a14610433578263b1b5266614610440578263bc063e1a14610433578263c4d66de8146102ec578263cb52b8ce1461015f5750508063cfad57a214610120578063dd4c2eb6146101055763fd69f3c2146100e4575b600080fd5b346101015781600319360112610101576020906002549051908152f35b5080fd5b50346101015781600319360112610101576020905160038152f35b823461015c57602036600319011261015c5761015961013d610ccd565b61015460018060a01b03845460101c163314610d47565b610d79565b80f35b80fd5b915091346102e8576003199181833601126102e45767ffffffffffffffff9181358381116102e0576101949036908401610bc0565b939092602435918083116102c5576101e0809784360301126102c5578351968701878110828211176102cd578452828201358181116102c9576101dc90833691860101610ce3565b875260248301359081116102c5576101f8913691840101610ce3565b60208601526044810135916001600160a01b039182841684036102c557610159976102c0946101c493890152606482013560608901526084820135608089015260a482013560a089015260c482013560c089015260e4820135908801526101048101356101008801526101248101356101208801526101448101356101408801526102866101648201610d3a565b6101608801526102996101848201610d3a565b6101808801526101a48101356101a088015201356101c0860152865460101c163314610d47565b610e95565b8880fd5b8980fd5b634e487b7160e01b8a526041835260248afd5b8680fd5b8480fd5b8380fd5b9150503461042f57602036600319011261042f57610308610ccd565b835460ff8160081c161592838094610422575b801561040b575b156103b1575060ff1981166001178555826103a0575b5060018060a01b03166bffffffffffffffffffffffff60a01b600154161760015561036233610d79565b61036a575080f35b60207f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a180f35b61ffff191661010117845538610338565b608490602086519162461bcd60e51b8352820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152fd5b50303b1580156103225750600160ff831614610322565b50600160ff83161061031b565b8280fd5b50505050506100df610caf565b8490843461042f576020806003193601126102e857823567ffffffffffffffff9586821161068f573660238301121561068f5781850135948786116102e057600597602436888b1b86018201116102c5576104a08895989997969961156b565b976104ad8751998a610a9a565b858952601f196104bc8761156b565b01885b81811061066b575050368190036042190190885b8c888210610536578c8c8c8c8051938080860192818752855180945283818801981b870101940192955b82871061050a5785850386f35b909192938280610526600193603f198a82030186528851610bee565b96019201960195929190926104fd565b8185919d9a9b9d1b8301013583811215610667578201848101359086821161066357604401908036038213610663576106498f938e600d8f8f959784978961065a9a8451928337810190888160039384815203019020928051986105998a610a67565b6105a285610abc565b8a526105b060018601610abc565b908a015260028401546001600160a01b03169089015282015460608801528d820154608088015281015460a0870152600681015460c087015260078101548e8701526008808201546101008801526009820154610120880152600a820154610140880152600b82015460ff80821615156101608a0152911c161515610180870152600c8101546101a087015201546101c0850152611583565b52610654818d611583565b50610e70565b9a98979a6104d3565b8d80fd5b8c80fd5b9a8b8b82809b9c9e61067e9b969b6114fa565b92010152019a98979a9691966104bf565b8580fd5b83853461015c57602036600319011261015c578235926002548410156106fd57506106f99260026106e692527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01610abc565b9051918291602083526020830190610b62565b0390f35b634e487b7160e01b825260329052602490fd5b50505050506100df610ba2565b83853461015c57602036600319011261015c5782359067ffffffffffffffff821161015c57506106f9936020610758600d9336908701610bc0565b91906107626114fa565b508286519384928337810160038152030190209083519461078286610a67565b61078b83610abc565b865261079960018401610abc565b602087015260018060a01b0360028401541685870152600383015460608701528201546080860152600582015460a0860152600682015460c086015260078201549085015260088101546101008501526009810154610120850152600a81015461014085015260ff600b820154818116151561016087015260081c161515610180850152600c8101546101a085015201546101c083015251918291602083526020830190610bee565b83853461015c578060031936011261015c576002546108608161156b565b9161086d84519384610a9a565b8183526002815260209283810192827f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace855b83831061090057505050508451938085019181865251809252858501958260051b8601019392955b8287106108d45785850386f35b9091929382806108f0600193603f198a82030186528851610b62565b96019201960195929190926108c7565b6001888192610912859b98999b610abc565b8152019201920191909694939661089f565b5050503461010157816003193601126101015760015490516001600160a01b039091168152602090f35b5050503461010157816003193601126101015760209051601e8152f35b83853461015c57602036600319011261015c57823560025481101561010157610993906109e0565b9390936109a7576106f9836106e686610abc565b634e487b7160e01b8252819052602490fd5b859034610101578160031936011261010157905460101c6001600160a01b03168152602090f35b600254811015610a175760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c92168015610a5d575b6020831014610a4757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610a3c565b6101e0810190811067ffffffffffffffff821117610a8457604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610a8457604052565b9060405191826000825492610ad084610a2d565b908184526001948581169081600014610b3f5750600114610afc575b5050610afa92500383610a9a565b565b9093915060005260209081600020936000915b818310610b27575050610afa93508201013880610aec565b85548884018501529485019487945091830191610b0f565b915050610afa94506020925060ff191682840152151560051b8201013880610aec565b919082519283825260005b848110610b8e575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610b6d565b50346100df5760003660031901126100df5760206040516127108152f35b9181601f840112156100df5782359167ffffffffffffffff83116100df57602083818601950101116100df57565b90610c17610c0583516101e0808552840190610b62565b60208401518382036020850152610b62565b9160018060a01b036040820151166040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e083015261010080820151908301526101208082015190830152610140808201519083015261016080820151151590830152610180808201511515908301526101a080820151908301526101c08091015191015290565b50346100df5760003660031901126100df5760206040516103e88152f35b600435906001600160a01b03821682036100df57565b81601f820112156100df5780359067ffffffffffffffff8211610a845760405192610d18601f8401601f191660200185610a9a565b828452602083830101116100df57816000926020809301838601378301015290565b359081151582036100df57565b15610d4e57565b606460405162461bcd60e51b815260206004820152600460248201526310b3b7bb60e11b6044820152fd5b6001600160a01b03818116918215610deb576000805462010000600160b01b03198116601093841b62010000600160b01b031617909155604080519190921c909216825260208201929092527f53351836099c03ffc3b1727d8abd4b0222afa87d4ed76ae3102d51369ef7f7859190a1565b60405162461bcd60e51b815260206004820152600960248201526810bd32b93796b3b7bb60b91b6044820152606490fd5b90601f8111610e2a57505050565b600091825260208220906020601f850160051c83019410610e66575b601f0160051c01915b828110610e5b57505050565b818155600101610e4f565b9092508290610e46565b6000198114610e7f5760010190565b634e487b7160e01b600052601160045260246000fd5b92916103e88060a0830151116114ca5760016060830151106114955760808201511161145f576127108060c08301511161142657601e610100830151116113ee576003610120830151106113b757606082015160a083015190818102918183041490151715610e7f571161137e5760405182858237602081848101600381520301902090805180519067ffffffffffffffff8211610a84578190610f4382610f3d8754610a2d565b87610e1c565b602090601f831160011461131257600092611307575b50508160011b916000199060031b1c19161782555b602081015180519067ffffffffffffffff8211610a8457610f9f82610f966001870154610a2d565b60018701610e1c565b602090601f8311600114611291579180600d94926101c094600092611286575b50508160011b916000199060031b1c19161760018501555b6002840160018060a01b036040830151166bffffffffffffffffffffffff60a01b825416179055606081015160038501556080810151600485015560a0810151600585015560c0810151600685015560e0810151600785015561010081015160088501556101208101516009850155610140810151600a850155600b84016101608201511515815460ff61ff00610180860151151560081b1692169061ffff1916171790556101a0810151600c85015501519101556000600254905b818110611196575068010000000000000000811015610a84578060016110bc92016002556109e0565b9190916111805767ffffffffffffffff8111610a84576110e6816110e08454610a2d565b84610e1c565b6000601f82116001146111205781929394600092611115575b50508160011b916000199060031b1c1916179055565b0135905038806110ff565b601f198216948382526020822091805b87811061116857508360019596971061114e575b505050811b019055565b0135600019600384901b60f8161c19169055388080611144565b90926020600181928686013581550194019101611130565b634e487b7160e01b600052600060045260246000fd5b61119f816109e0565b5060405160208101918160008254926111b784610a2d565b93600181169081156112685750600114611226575b506111e0925003601f198101835282610a9a565b519020604051602081019085888337611209602082888101600083820152038084520182610a9a565b5190201461121f5761121a90610e70565b611093565b5050509050565b9150506000528160206000206000905b83821061124e57505060206111e092820101386111cc565b602091925080600191548385880101520191018391611236565b60ff19168752506111e09380151502830160200191503890506111cc565b015190503880610fbf565b906001850160005260206000209160005b601f19851681106112ef575092600d94926001926101c09583601f198116106112d6575b505050811b016001850155610fd7565b015160001960f88460031b161c191690553880806112c6565b919260206001819286850151815501940192016112a2565b015190503880610f59565b9250846000526020600020906000935b601f1984168510611363576001945083601f1981161061134a575b505050811b018255610f6e565b015160001960f88460031b161c1916905538808061133d565b81810151835560209485019460019093019290910190611322565b60405162461bcd60e51b8152602060048201526011602482015270216d61782d6c657665726167652d66656560781b6044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e216d696e2d707974686d617861676560881b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f216d61782d6d696e6f7264657261676560801b6044820152606490fd5b60405162461bcd60e51b8152602060048201526011602482015270085b585e0b5b1a5c5d1a1c995cda1bdb19607a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d10b6b0bc16b232bb34b0ba34b7b760911b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c216d61782d6c6576657261676560981b6044820152606490fd5b60405162461bcd60e51b8152602060048201526008602482015267216d61782d66656560c01b6044820152606490fd5b6040519061150782610a67565b8160608152606060208201526101c06000918260408201528260608201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015282610180820152826101a08201520152565b67ffffffffffffffff8111610a845760051b60200190565b8051821015610a175760209160051b01019056fea2646970667358221220dcfc085a53a9088969c27de87d1228eac33e32c27239f991a916795685df492864736f6c63430008110033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MON
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.