Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ConstantsHolder
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only /* ConstantsHolder.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity 0.8.17; import { IConstantsHolder } from "@skalenetwork/skale-manager-interfaces/IConstantsHolder.sol"; import { Permissions } from "./Permissions.sol"; /** * @title ConstantsHolder * @dev Contract contains constants and common variables for the SKALE Network. */ contract ConstantsHolder is Permissions, IConstantsHolder { // initial price for creating Node (100 SKL) uint256 public constant NODE_DEPOSIT = 100 * 1e18; uint8 public constant TOTAL_SPACE_ON_NODE = 128; // part of Node for Small Skale-chain (1/128 of Node) uint8 public constant SMALL_DIVISOR = 128; // part of Node for Medium Skale-chain (1/32 of Node) uint8 public constant MEDIUM_DIVISOR = 32; // part of Node for Large Skale-chain (full Node) uint8 public constant LARGE_DIVISOR = 1; // part of Node for Medium Test Skale-chain (1/4 of Node) uint8 public constant MEDIUM_TEST_DIVISOR = 4; // typically number of Nodes for Skale-chain (16 Nodes) uint256 public constant NUMBER_OF_NODES_FOR_SCHAIN = 16; // number of Nodes for Test Skale-chain (2 Nodes) uint256 public constant NUMBER_OF_NODES_FOR_TEST_SCHAIN = 2; // number of Nodes for Test Skale-chain (4 Nodes) uint256 public constant NUMBER_OF_NODES_FOR_MEDIUM_TEST_SCHAIN = 4; // number of seconds in one year uint32 public constant SECONDS_TO_YEAR = 31622400; // initial number of monitors uint256 public constant NUMBER_OF_MONITORS = 24; uint256 public constant OPTIMAL_LOAD_PERCENTAGE = 80; uint256 public constant ADJUSTMENT_SPEED = 1000; uint256 public constant COOLDOWN_TIME = 60; uint256 public constant MIN_PRICE = 10**6; uint256 public constant MSR_REDUCING_COEFFICIENT = 2; uint256 public constant DOWNTIME_THRESHOLD_PART = 30; uint256 public constant BOUNTY_LOCKUP_MONTHS = 2; uint256 public constant ALRIGHT_DELTA = 134161; uint256 public constant BROADCAST_DELTA = 177490; uint256 public constant COMPLAINT_BAD_DATA_DELTA = 80995; uint256 public constant PRE_RESPONSE_DELTA = 114620; uint256 public constant COMPLAINT_DELTA = 203463; uint256 public constant RESPONSE_DELTA = 55111; // MSR - Minimum staking requirement uint256 public msr; // Reward period - 30 days (each 30 days Node would be granted for bounty) uint32 public rewardPeriod; // Allowable latency - 150000 ms by default uint32 public allowableLatency; /** * Delta period - 1 hour (1 hour before Reward period became Monitors need * to send Verdicts and 1 hour after Reward period became Node need to come * and get Bounty) */ uint32 public deltaPeriod; /** * Check time - 2 minutes (every 2 minutes monitors should check metrics * from checked nodes) */ uint256 public checkTime; //Need to add minimal allowed parameters for verdicts uint256 public launchTimestamp; uint256 public rotationDelay; uint256 public proofOfUseLockUpPeriodDays; uint256 public proofOfUseDelegationPercentage; uint256 public limitValidatorsPerDelegator; uint256 public firstDelegationsMonth; // deprecated // date when schains will be allowed for creation uint256 public schainCreationTimeStamp; uint256 public minimalSchainLifetime; uint256 public complaintTimeLimit; uint256 public minNodeBalance; bytes32 public constant CONSTANTS_HOLDER_MANAGER_ROLE = keccak256("CONSTANTS_HOLDER_MANAGER_ROLE"); modifier onlyConstantsHolderManager() { require(hasRole(CONSTANTS_HOLDER_MANAGER_ROLE, msg.sender), "CONSTANTS_HOLDER_MANAGER_ROLE is required"); _; } function initialize(address contractsAddress) public override initializer { Permissions.initialize(contractsAddress); msr = 0; rewardPeriod = 2592000; allowableLatency = 150000; deltaPeriod = 3600; checkTime = 300; launchTimestamp = type(uint).max; rotationDelay = 12 hours; proofOfUseLockUpPeriodDays = 90; proofOfUseDelegationPercentage = 50; limitValidatorsPerDelegator = 20; firstDelegationsMonth = 0; complaintTimeLimit = 1800; minNodeBalance = 1.5 ether; } /** * @dev Allows the Owner to set new reward and delta periods * This function is only for tests. */ function setPeriods(uint32 newRewardPeriod, uint32 newDeltaPeriod) external override onlyConstantsHolderManager { require( newRewardPeriod >= newDeltaPeriod && newRewardPeriod - newDeltaPeriod >= checkTime, "Incorrect Periods" ); emit ConstantUpdated( keccak256(abi.encodePacked("RewardPeriod")), uint(rewardPeriod), uint(newRewardPeriod) ); rewardPeriod = newRewardPeriod; emit ConstantUpdated( keccak256(abi.encodePacked("DeltaPeriod")), uint(deltaPeriod), uint(newDeltaPeriod) ); deltaPeriod = newDeltaPeriod; } /** * @dev Allows the Owner to set the new check time. * This function is only for tests. */ function setCheckTime(uint256 newCheckTime) external override onlyConstantsHolderManager { require(rewardPeriod - deltaPeriod >= checkTime, "Incorrect check time"); emit ConstantUpdated( keccak256(abi.encodePacked("CheckTime")), uint(checkTime), uint(newCheckTime) ); checkTime = newCheckTime; } /** * @dev Allows the Owner to set the allowable latency in milliseconds. * This function is only for testing purposes. */ function setLatency(uint32 newAllowableLatency) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("AllowableLatency")), uint(allowableLatency), uint(newAllowableLatency) ); allowableLatency = newAllowableLatency; } /** * @dev Allows the Owner to set the minimum stake requirement. */ function setMSR(uint256 newMSR) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("MSR")), uint(msr), uint(newMSR) ); msr = newMSR; } /** * @dev Allows the Owner to set the launch timestamp. */ function setLaunchTimestamp(uint256 timestamp) external override onlyConstantsHolderManager { require( block.timestamp < launchTimestamp, "Cannot set network launch timestamp because network is already launched" ); emit ConstantUpdated( keccak256(abi.encodePacked("LaunchTimestamp")), uint(launchTimestamp), uint(timestamp) ); launchTimestamp = timestamp; } /** * @dev Allows the Owner to set the node rotation delay. */ function setRotationDelay(uint256 newDelay) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("RotationDelay")), uint(rotationDelay), uint(newDelay) ); rotationDelay = newDelay; } /** * @dev Allows the Owner to set the proof-of-use lockup period. */ function setProofOfUseLockUpPeriod(uint256 periodDays) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("ProofOfUseLockUpPeriodDays")), uint(proofOfUseLockUpPeriodDays), uint(periodDays) ); proofOfUseLockUpPeriodDays = periodDays; } /** * @dev Allows the Owner to set the proof-of-use delegation percentage * requirement. */ function setProofOfUseDelegationPercentage(uint256 percentage) external override onlyConstantsHolderManager { require(percentage <= 100, "Percentage value is incorrect"); emit ConstantUpdated( keccak256(abi.encodePacked("ProofOfUseDelegationPercentage")), uint(proofOfUseDelegationPercentage), uint(percentage) ); proofOfUseDelegationPercentage = percentage; } /** * @dev Allows the Owner to set the maximum number of validators that a * single delegator can delegate to. */ function setLimitValidatorsPerDelegator(uint256 newLimit) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("LimitValidatorsPerDelegator")), uint(limitValidatorsPerDelegator), uint(newLimit) ); limitValidatorsPerDelegator = newLimit; } function setSchainCreationTimeStamp(uint256 timestamp) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("SchainCreationTimeStamp")), uint(schainCreationTimeStamp), uint(timestamp) ); schainCreationTimeStamp = timestamp; } function setMinimalSchainLifetime(uint256 lifetime) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("MinimalSchainLifetime")), uint(minimalSchainLifetime), uint(lifetime) ); minimalSchainLifetime = lifetime; } function setComplaintTimeLimit(uint256 timeLimit) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("ComplaintTimeLimit")), uint(complaintTimeLimit), uint(timeLimit) ); complaintTimeLimit = timeLimit; } function setMinNodeBalance(uint256 newMinNodeBalance) external override onlyConstantsHolderManager { emit ConstantUpdated( keccak256(abi.encodePacked("MinNodeBalance")), uint(minNodeBalance), uint(newMinNodeBalance) ); minNodeBalance = newMinNodeBalance; } function reinitialize() external override reinitializer(2) { minNodeBalance = 1.5 ether; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @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 EnumerableSetUpgradeable { // 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: AGPL-3.0-only /* IConstantsHolder.sol - SKALE Manager Interfaces Copyright (C) 2021-Present SKALE Labs @author Artem Payvin SKALE Manager Interfaces is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager Interfaces is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager Interfaces. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity >=0.6.10 <0.9.0; interface IConstantsHolder { /** * @dev Emitted when constants updated. */ event ConstantUpdated( bytes32 indexed constantHash, uint previousValue, uint newValue ); function setPeriods(uint32 newRewardPeriod, uint32 newDeltaPeriod) external; function setCheckTime(uint newCheckTime) external; function setLatency(uint32 newAllowableLatency) external; function setMSR(uint newMSR) external; function setLaunchTimestamp(uint timestamp) external; function setRotationDelay(uint newDelay) external; function setProofOfUseLockUpPeriod(uint periodDays) external; function setProofOfUseDelegationPercentage(uint percentage) external; function setLimitValidatorsPerDelegator(uint newLimit) external; function setSchainCreationTimeStamp(uint timestamp) external; function setMinimalSchainLifetime(uint lifetime) external; function setComplaintTimeLimit(uint timeLimit) external; function setMinNodeBalance(uint newMinNodeBalance) external; function reinitialize() external; function msr() external view returns (uint); function launchTimestamp() external view returns (uint); function rotationDelay() external view returns (uint); function limitValidatorsPerDelegator() external view returns (uint); function schainCreationTimeStamp() external view returns (uint); function minimalSchainLifetime() external view returns (uint); function complaintTimeLimit() external view returns (uint); function minNodeBalance() external view returns (uint); }
// SPDX-License-Identifier: AGPL-3.0-only /* IContractManager.sol - SKALE Manager Interfaces Copyright (C) 2021-Present SKALE Labs @author Dmytro Stebaeiv SKALE Manager Interfaces is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager Interfaces is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager Interfaces. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity >=0.6.10 <0.9.0; interface IContractManager { /** * @dev Emitted when contract is upgraded. */ event ContractUpgraded(string contractsName, address contractsAddress); function initialize() external; function setContractsAddress(string calldata contractsName, address newContractsAddress) external; function contracts(bytes32 nameHash) external view returns (address); function getDelegationPeriodManager() external view returns (address); function getBounty() external view returns (address); function getValidatorService() external view returns (address); function getTimeHelpers() external view returns (address); function getConstantsHolder() external view returns (address); function getSkaleToken() external view returns (address); function getTokenState() external view returns (address); function getPunisher() external view returns (address); function getContract(string calldata name) external view returns (address); }
// SPDX-License-Identifier: AGPL-3.0-only /* IPermissions.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity >=0.6.10 <0.9.0; interface IPermissions { function initialize(address contractManagerAddress) external; }
// SPDX-License-Identifier: AGPL-3.0-only /* IAccessControlUpgradeableLegacy.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity >=0.6.10 <0.9.0; interface IAccessControlUpgradeableLegacy { /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; function hasRole(bytes32 role, address account) external view returns (bool); function getRoleMemberCount(bytes32 role) external view returns (uint256); function getRoleMember(bytes32 role, uint256 index) external view returns (address); function getRoleAdmin(bytes32 role) external view returns (bytes32); }
// SPDX-License-Identifier: AGPL-3.0-only /* Permissions.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SKALE Manager is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>. */ pragma solidity 0.8.17; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import { IContractManager } from "@skalenetwork/skale-manager-interfaces/IContractManager.sol"; import { IPermissions } from "@skalenetwork/skale-manager-interfaces/IPermissions.sol"; import { AccessControlUpgradeableLegacy } from "./thirdparty/openzeppelin/AccessControlUpgradeableLegacy.sol"; /** * @title Permissions * @dev Contract is connected module for Upgradeable approach, knows ContractManager */ contract Permissions is AccessControlUpgradeableLegacy, IPermissions { using AddressUpgradeable for address; IContractManager public contractManager; /** * @dev Modifier to make a function callable only when caller is the Owner. * * Requirements: * * - The caller must be the owner. */ modifier onlyOwner() { require(_isOwner(), "Caller is not the owner"); _; } /** * @dev Modifier to make a function callable only when caller is an Admin. * * Requirements: * * - The caller must be an admin. */ modifier onlyAdmin() { require(_isAdmin(msg.sender), "Caller is not an admin"); _; } /** * @dev Modifier to make a function callable only when caller is the Owner * or `contractName` contract. * * Requirements: * * - The caller must be the owner or `contractName`. */ modifier allow(string memory contractName) { require( contractManager.getContract(contractName) == msg.sender || _isOwner(), "Message sender is invalid"); _; } /** * @dev Modifier to make a function callable only when caller is the Owner * or `contractName1` or `contractName2` contract. * * Requirements: * * - The caller must be the owner, `contractName1`, or `contractName2`. */ modifier allowTwo(string memory contractName1, string memory contractName2) { require( contractManager.getContract(contractName1) == msg.sender || contractManager.getContract(contractName2) == msg.sender || _isOwner(), "Message sender is invalid"); _; } /** * @dev Modifier to make a function callable only when caller is the Owner * or `contractName1`, `contractName2`, or `contractName3` contract. * * Requirements: * * - The caller must be the owner, `contractName1`, `contractName2`, or * `contractName3`. */ modifier allowThree(string memory contractName1, string memory contractName2, string memory contractName3) { require( contractManager.getContract(contractName1) == msg.sender || contractManager.getContract(contractName2) == msg.sender || contractManager.getContract(contractName3) == msg.sender || _isOwner(), "Message sender is invalid"); _; } function initialize(address contractManagerAddress) public virtual override initializer { AccessControlUpgradeableLegacy.__AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setContractManager(contractManagerAddress); } function _isOwner() internal view returns (bool owner) { return hasRole(DEFAULT_ADMIN_ROLE, msg.sender); } function _isAdmin(address account) internal view returns (bool admin) { address skaleManagerAddress = contractManager.contracts(keccak256(abi.encodePacked("SkaleManager"))); if (skaleManagerAddress != address(0)) { AccessControlUpgradeableLegacy skaleManager = AccessControlUpgradeableLegacy(skaleManagerAddress); return skaleManager.hasRole(keccak256("ADMIN_ROLE"), account) || _isOwner(); } else { return _isOwner(); } } function _setContractManager(address contractManagerAddress) private { require(contractManagerAddress != address(0), "ContractManager address is not set"); require(contractManagerAddress.isContract(), "Address is not contract"); contractManager = IContractManager(contractManagerAddress); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@skalenetwork/skale-manager-interfaces/thirdparty/openzeppelin/IAccessControlUpgradeableLegacy.sol"; import "./InitializableWithGap.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, _msgSender())); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. */ abstract contract AccessControlUpgradeableLegacy is InitializableWithGap, ContextUpgradeable, IAccessControlUpgradeableLegacy { function __AccessControl_init() internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; struct RoleData { EnumerableSetUpgradeable.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract InitializableWithGap is Initializable { uint256[50] private ______gap; }
{ "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"constantHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ConstantUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADJUSTMENT_SPEED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ALRIGHT_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BOUNTY_LOCKUP_MONTHS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BROADCAST_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMPLAINT_BAD_DATA_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMPLAINT_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONSTANTS_HOLDER_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COOLDOWN_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOWNTIME_THRESHOLD_PART","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LARGE_DIVISOR","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MEDIUM_DIVISOR","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MEDIUM_TEST_DIVISOR","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MSR_REDUCING_COEFFICIENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NODE_DEPOSIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUMBER_OF_MONITORS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUMBER_OF_NODES_FOR_MEDIUM_TEST_SCHAIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUMBER_OF_NODES_FOR_SCHAIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUMBER_OF_NODES_FOR_TEST_SCHAIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPTIMAL_LOAD_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRE_RESPONSE_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESPONSE_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_TO_YEAR","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SMALL_DIVISOR","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_SPACE_ON_NODE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowableLatency","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"complaintTimeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractManager","outputs":[{"internalType":"contract IContractManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deltaPeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstDelegationsMonth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractsAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launchTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitValidatorsPerDelegator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minNodeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimalSchainLifetime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"msr","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proofOfUseDelegationPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proofOfUseLockUpPeriodDays","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reinitialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rotationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"schainCreationTimeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCheckTime","type":"uint256"}],"name":"setCheckTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timeLimit","type":"uint256"}],"name":"setComplaintTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"newAllowableLatency","type":"uint32"}],"name":"setLatency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setLaunchTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"setLimitValidatorsPerDelegator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMSR","type":"uint256"}],"name":"setMSR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinNodeBalance","type":"uint256"}],"name":"setMinNodeBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lifetime","type":"uint256"}],"name":"setMinimalSchainLifetime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"newRewardPeriod","type":"uint32"},{"internalType":"uint32","name":"newDeltaPeriod","type":"uint32"}],"name":"setPeriods","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setProofOfUseDelegationPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"periodDays","type":"uint256"}],"name":"setProofOfUseLockUpPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"setRotationDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setSchainCreationTimeStamp","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50611d72806100206000396000f3fe608060405234801561001057600080fd5b50600436106103505760003560e01c806391d14854116101bf578063c83ee0b3116100fa578063da72d1281161009d578063da72d12814610697578063e0342744146106aa578063e0c6190d146106b4578063e54a0a23146106bd578063e88dc5b7146106c6578063eb15ac80146106d6578063ed089aa7146106e0578063ff3d2fb8146106e957600080fd5b8063c83ee0b3146104cb578063c9fd716c14610657578063ca15c8731461065f578063cbdc9d6d14610672578063d547741f1461067c578063d62d5bb81461068f578063d7adbc081461068f578063d9dd800d1461068f57600080fd5b8063a8f3152b11610162578063a8f3152b146105f1578063abceb19c14610604578063ad9f20a61461060c578063b39e12cf14610616578063b68297d714610629578063b921f6e314610633578063c4d66de81461063b578063c647f8441461064e57600080fd5b806391d14854146105735780639379c8071461059657806393abbbb2146105a957806394450e34146105b15780639c5cd5b4146105c45780639dc37fcf146105cd578063a217fddf146105e0578063a58203df146105e857600080fd5b80635ae8f2bd1161028f57806379ea795e1161023257806379ea795e146104e55780637d263245146104f85780638076fe7414610500578063860af2721461050a578063869bdb3e1461051d5780638906e86b146105355780638c4ff5fc146105405780639010d07c1461054857600080fd5b80635ae8f2bd146104545780635d266a541461045d5780635e2000901461048957806365cf7c9b1461049c5780636c2eb350146104a55780636e336a5d146104ad5780637257c9a9146104c2578063786a46eb146104cb57600080fd5b80632f2ff15d116102f75780632f2ff15d146103e557806336568abe146103f85780633dcbe1f91461040b5780633eb74fa31461041357806346ea746614610426578063566ef7fd1461042f57806356d9741b146104425780635a92fa851461044b57600080fd5b806303e3f68714610355578063049e41771461037157806306b98ad11461037a5780630918992b146103825780630927a78f146103975780630b0d21731461039f5780631ca8baaf146103af578063248a9ca3146103c2575b600080fd5b61035e60a15481565b6040519081526020015b60405180910390f35b61035e609f5481565b61035e601881565b610395610390366004611adc565b6106fc565b005b61035e605081565b61035e68056bc75e2d6310000081565b6103956103bd366004611adc565b610820565b61035e6103d0366004611adc565b60009081526065602052604090206002015490565b6103956103f3366004611b11565b6108b3565b610395610406366004611b11565b610941565b61035e600481565b610395610421366004611adc565b6109bb565b61035e60a25481565b61039561043d366004611adc565b610ab3565b61035e609d5481565b61035e6103e881565b61035e61d74781565b60995461047490600160401b900463ffffffff1681565b60405163ffffffff9091168152602001610368565b610395610497366004611adc565b610b55565b61035e609b5481565b610395610bf7565b61035e600080516020611cdd83398151915281565b61035e60a35481565b6104d3608081565b60405160ff9091168152602001610368565b6103956104f3366004611adc565b610c82565b61035e603c81565b61035e62013c6381565b610395610518366004611adc565b610d19565b60995461047490640100000000900463ffffffff1681565b6104746301e2850081565b6104d3602081565b61055b610556366004611b3d565b610da1565b6040516001600160a01b039091168152602001610368565b610586610581366004611b11565b610dc2565b6040519015158152602001610368565b6103956105a4366004611adc565b610dda565b61035e601081565b6103956105bf366004611b73565b610ecd565b61035e609e5481565b6103956105db366004611adc565b611076565b61035e600081565b61035e60a45481565b6103956105ff366004611b9d565b611112565b6104d3600481565b61035e620f424081565b60975461055b906001600160a01b031681565b61035e62020c1181565b61035e601e81565b610395610649366004611bb8565b6111dd565b61035e609c5481565b6104d3600181565b61035e61066d366004611adc565b6112fc565b61035e6202b55281565b61039561068a366004611b11565b611313565b61035e600281565b6103956106a5366004611adc565b611394565b61035e6201bfbc81565b61035e609a5481565b61035e60a05481565b6099546104749063ffffffff1681565b61035e62031ac781565b61035e60985481565b6103956106f7366004611adc565b61142e565b610714600080516020611cdd83398151915233610dc2565b6107395760405162461bcd60e51b815260040161073090611bd3565b60405180910390fd5b609b5442106107c05760405162461bcd60e51b815260206004820152604760248201527f43616e6e6f7420736574206e6574776f726b206c61756e63682074696d65737460448201527f616d702062656361757365206e6574776f726b20697320616c7265616479206c606482015266185d5b98da195960ca1b608482015260a401610730565b6040516e04c61756e636854696d657374616d7608c1b6020820152602f0160408051601f198184030181528282528051602091820120609b54845290830184905291600080516020611cfd833981519152910160405180910390a2609b55565b610838600080516020611cdd83398151915233610dc2565b6108545760405162461bcd60e51b815260040161073090611bd3565b6040516d4d696e4e6f646542616c616e636560901b6020820152602e0160408051601f19818403018152828252805160209182012060a454845290830184905291600080516020611cfd833981519152910160405180910390a260a455565b6000828152606560205260409020600201546108cf9033610dc2565b6109335760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b6064820152608401610730565b61093d82826114c0565b5050565b6001600160a01b03811633146109b15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610730565b61093d8282611519565b6109d3600080516020611cdd83398151915233610dc2565b6109ef5760405162461bcd60e51b815260040161073090611bd3565b609a54609954610a0e9063ffffffff600160401b820481169116611c32565b63ffffffff161015610a595760405162461bcd60e51b8152602060048201526014602482015273496e636f727265637420636865636b2074696d6560601b6044820152606401610730565b60405168436865636b54696d6560b81b602082015260290160408051601f198184030181528282528051602091820120609a54845290830184905291600080516020611cfd833981519152910160405180910390a2609a55565b610acb600080516020611cdd83398151915233610dc2565b610ae75760405162461bcd60e51b815260040161073090611bd3565b6040517f50726f6f664f665573654c6f636b5570506572696f64446179730000000000006020820152603a0160408051601f198184030181528282528051602091820120609d54845290830184905291600080516020611cfd833981519152910160405180910390a2609d55565b610b6d600080516020611cdd83398151915233610dc2565b610b895760405162461bcd60e51b815260040161073090611bd3565b6040517f4c696d697456616c696461746f727350657244656c656761746f7200000000006020820152603b0160408051601f198184030181528282528051602091820120609f54845290830184905291600080516020611cfd833981519152910160405180910390a2609f55565b600054600290610100900460ff16158015610c19575060005460ff8083169116105b610c355760405162461bcd60e51b815260040161073090611c4f565b600080546714d1120d7b16000060a45561ffff191660ff83169081176101001761ff001916909155604051908152600080516020611d1d833981519152906020015b60405180910390a150565b610c9a600080516020611cdd83398151915233610dc2565b610cb65760405162461bcd60e51b815260040161073090611bd3565b6040517110dbdb5c1b185a5b9d151a5b59531a5b5a5d60721b602082015260320160408051601f19818403018152828252805160209182012060a354845290830184905291600080516020611cfd833981519152910160405180910390a260a355565b610d31600080516020611cdd83398151915233610dc2565b610d4d5760405162461bcd60e51b815260040161073090611bd3565b6040516226a9a960e91b602082015260230160408051601f198184030181528282528051602091820120609854845290830184905291600080516020611cfd833981519152910160405180910390a2609855565b6000828152606560205260408120610db99083611572565b90505b92915050565b6000828152606560205260408120610db9908361157e565b610df2600080516020611cdd83398151915233610dc2565b610e0e5760405162461bcd60e51b815260040161073090611bd3565b6064811115610e5f5760405162461bcd60e51b815260206004820152601d60248201527f50657263656e746167652076616c756520697320696e636f72726563740000006044820152606401610730565b6040517f50726f6f664f6655736544656c65676174696f6e50657263656e7461676500006020820152603e0160408051601f198184030181528282528051602091820120609e54845290830184905291600080516020611cfd833981519152910160405180910390a2609e55565b610ee5600080516020611cdd83398151915233610dc2565b610f015760405162461bcd60e51b815260040161073090611bd3565b8063ffffffff168263ffffffff1610158015610f2e5750609a54610f258284611c32565b63ffffffff1610155b610f6e5760405162461bcd60e51b8152602060048201526011602482015270496e636f727265637420506572696f647360781b6044820152606401610730565b6040516b14995dd85c9914195c9a5bd960a21b6020820152602c0160408051808303601f19018152828252805160209182012060995463ffffffff908116855286169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff191663ffffffff84161790556040516a11195b1d1854195c9a5bd960aa1b6020820152602b0160408051808303601f190181528282528051602091820120609954600160401b900463ffffffff908116855285169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff909216600160401b0263ffffffff60401b1990921691909117905550565b61108e600080516020611cdd83398151915233610dc2565b6110aa5760405162461bcd60e51b815260040161073090611bd3565b60405176053636861696e4372656174696f6e54696d655374616d7604c1b602082015260370160408051601f19818403018152828252805160209182012060a154845290830184905291600080516020611cfd833981519152910160405180910390a260a155565b61112a600080516020611cdd83398151915233610dc2565b6111465760405162461bcd60e51b815260040161073090611bd3565b6040516f416c6c6f7761626c654c6174656e637960801b602082015260300160408051808303601f190181528282528051602091820120609954640100000000900463ffffffff908116855285169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b600054610100900460ff16158080156111fd5750600054600160ff909116105b8061121e575061120c306115a0565b15801561121e575060005460ff166001145b61123a5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff19166001179055801561125d576000805461ff0019166101001790555b611266826115af565b60006098819055609980546bffffffffffffffffffffffff1916690e10000249f000278d0017905561012c609a55600019609b5561a8c0609c55605a609d556032609e556014609f5560a05561070860a3556714d1120d7b16000060a455801561093d576000805461ff001916905560405160018152600080516020611d1d833981519152906020015b60405180910390a15050565b6000818152606560205260408120610dbc9061167b565b60008281526065602052604090206002015461132f9033610dc2565b6109b15760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b6064820152608401610730565b6113ac600080516020611cdd83398151915233610dc2565b6113c85760405162461bcd60e51b815260040161073090611bd3565b604051744d696e696d616c53636861696e4c69666574696d6560581b602082015260350160408051601f19818403018152828252805160209182012060a254845290830184905291600080516020611cfd833981519152910160405180910390a260a255565b611446600080516020611cdd83398151915233610dc2565b6114625760405162461bcd60e51b815260040161073090611bd3565b6040516c526f746174696f6e44656c617960981b6020820152602d0160408051601f198184030181528282528051602091820120609c54845290830184905291600080516020611cfd833981519152910160405180910390a2609c55565b60008281526065602052604090206114d89082611685565b1561093d5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152606560205260409020611531908261169a565b1561093d5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b6000610db983836116af565b6001600160a01b03811660009081526001830160205260408120541515610db9565b6001600160a01b03163b151590565b600054610100900460ff16158080156115cf5750600054600160ff909116105b806115f057506115de306115a0565b1580156115f0575060005460ff166001145b61160c5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff19166001179055801561162f576000805461ff0019166101001790555b6116376116d9565b611642600033610933565b61164b8261179c565b801561093d576000805461ff001916905560405160018152600080516020611d1d833981519152906020016112f0565b6000610dbc825490565b6000610db9836001600160a01b038416611877565b6000610db9836001600160a01b0384166118c6565b60008260000182815481106116c6576116c6611c9d565b9060005260206000200154905092915050565b600054610100900460ff16158080156116f95750600054600160ff909116105b8061171a5750611708306115a0565b15801561171a575060005460ff166001145b6117365760405162461bcd60e51b815260040161073090611c4f565b6000805460ff191660011790558015611759576000805461ff0019166101001790555b6117616119c0565b611769611a2d565b8015611799576000805461ff001916905560405160018152600080516020611d1d83398151915290602001610c77565b50565b6001600160a01b0381166117fd5760405162461bcd60e51b815260206004820152602260248201527f436f6e74726163744d616e616765722061646472657373206973206e6f742073604482015261195d60f21b6064820152608401610730565b61180f816001600160a01b03166115a0565b6118555760405162461bcd60e51b81526020600482015260176024820152761059191c995cdcc81a5cc81b9bdd0818dbdb9d1c9858dd604a1b6044820152606401610730565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526001830160205260408120546118be57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dbc565b506000610dbc565b600081815260018301602052604081205480156119af5760006118ea600183611cb3565b85549091506000906118fe90600190611cb3565b905081811461196357600086600001828154811061191e5761191e611c9d565b906000526020600020015490508087600001848154811061194157611941611c9d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061197457611974611cc6565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dbc565b6000915050610dbc565b5092915050565b600054610100900460ff16611a2b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610730565b565b600054610100900460ff1615808015611a4d5750600054600160ff909116105b80611a6e5750611a5c306115a0565b158015611a6e575060005460ff166001145b611a8a5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff191660011790558015611769576000805461ff0019166101001790558015611799576000805461ff001916905560405160018152600080516020611d1d83398151915290602001610c77565b600060208284031215611aee57600080fd5b5035919050565b80356001600160a01b0381168114611b0c57600080fd5b919050565b60008060408385031215611b2457600080fd5b82359150611b3460208401611af5565b90509250929050565b60008060408385031215611b5057600080fd5b50508035926020909101359150565b803563ffffffff81168114611b0c57600080fd5b60008060408385031215611b8657600080fd5b611b8f83611b5f565b9150611b3460208401611b5f565b600060208284031215611baf57600080fd5b610db982611b5f565b600060208284031215611bca57600080fd5b610db982611af5565b60208082526029908201527f434f4e5354414e54535f484f4c4445525f4d414e414745525f524f4c45206973604082015268081c995c5d5a5c995960ba1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156119b9576119b9611c1c565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b81810381811115610dbc57610dbc611c1c565b634e487b7160e01b600052603160045260246000fdfe901a4192020a5185129ea5dfd5d8e7c687626d09d2d74e45406202aef5ad43afd9f6bd2abae0f2a51b3f5ffb29e0e35ee9ad2e3921ede0d71bff21dc8609f6f17f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a2646970667358221220635fbee27af93083d7dc9b5b99e8ae07dfb29690f9a20cb30e04455defecfe3364736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103505760003560e01c806391d14854116101bf578063c83ee0b3116100fa578063da72d1281161009d578063da72d12814610697578063e0342744146106aa578063e0c6190d146106b4578063e54a0a23146106bd578063e88dc5b7146106c6578063eb15ac80146106d6578063ed089aa7146106e0578063ff3d2fb8146106e957600080fd5b8063c83ee0b3146104cb578063c9fd716c14610657578063ca15c8731461065f578063cbdc9d6d14610672578063d547741f1461067c578063d62d5bb81461068f578063d7adbc081461068f578063d9dd800d1461068f57600080fd5b8063a8f3152b11610162578063a8f3152b146105f1578063abceb19c14610604578063ad9f20a61461060c578063b39e12cf14610616578063b68297d714610629578063b921f6e314610633578063c4d66de81461063b578063c647f8441461064e57600080fd5b806391d14854146105735780639379c8071461059657806393abbbb2146105a957806394450e34146105b15780639c5cd5b4146105c45780639dc37fcf146105cd578063a217fddf146105e0578063a58203df146105e857600080fd5b80635ae8f2bd1161028f57806379ea795e1161023257806379ea795e146104e55780637d263245146104f85780638076fe7414610500578063860af2721461050a578063869bdb3e1461051d5780638906e86b146105355780638c4ff5fc146105405780639010d07c1461054857600080fd5b80635ae8f2bd146104545780635d266a541461045d5780635e2000901461048957806365cf7c9b1461049c5780636c2eb350146104a55780636e336a5d146104ad5780637257c9a9146104c2578063786a46eb146104cb57600080fd5b80632f2ff15d116102f75780632f2ff15d146103e557806336568abe146103f85780633dcbe1f91461040b5780633eb74fa31461041357806346ea746614610426578063566ef7fd1461042f57806356d9741b146104425780635a92fa851461044b57600080fd5b806303e3f68714610355578063049e41771461037157806306b98ad11461037a5780630918992b146103825780630927a78f146103975780630b0d21731461039f5780631ca8baaf146103af578063248a9ca3146103c2575b600080fd5b61035e60a15481565b6040519081526020015b60405180910390f35b61035e609f5481565b61035e601881565b610395610390366004611adc565b6106fc565b005b61035e605081565b61035e68056bc75e2d6310000081565b6103956103bd366004611adc565b610820565b61035e6103d0366004611adc565b60009081526065602052604090206002015490565b6103956103f3366004611b11565b6108b3565b610395610406366004611b11565b610941565b61035e600481565b610395610421366004611adc565b6109bb565b61035e60a25481565b61039561043d366004611adc565b610ab3565b61035e609d5481565b61035e6103e881565b61035e61d74781565b60995461047490600160401b900463ffffffff1681565b60405163ffffffff9091168152602001610368565b610395610497366004611adc565b610b55565b61035e609b5481565b610395610bf7565b61035e600080516020611cdd83398151915281565b61035e60a35481565b6104d3608081565b60405160ff9091168152602001610368565b6103956104f3366004611adc565b610c82565b61035e603c81565b61035e62013c6381565b610395610518366004611adc565b610d19565b60995461047490640100000000900463ffffffff1681565b6104746301e2850081565b6104d3602081565b61055b610556366004611b3d565b610da1565b6040516001600160a01b039091168152602001610368565b610586610581366004611b11565b610dc2565b6040519015158152602001610368565b6103956105a4366004611adc565b610dda565b61035e601081565b6103956105bf366004611b73565b610ecd565b61035e609e5481565b6103956105db366004611adc565b611076565b61035e600081565b61035e60a45481565b6103956105ff366004611b9d565b611112565b6104d3600481565b61035e620f424081565b60975461055b906001600160a01b031681565b61035e62020c1181565b61035e601e81565b610395610649366004611bb8565b6111dd565b61035e609c5481565b6104d3600181565b61035e61066d366004611adc565b6112fc565b61035e6202b55281565b61039561068a366004611b11565b611313565b61035e600281565b6103956106a5366004611adc565b611394565b61035e6201bfbc81565b61035e609a5481565b61035e60a05481565b6099546104749063ffffffff1681565b61035e62031ac781565b61035e60985481565b6103956106f7366004611adc565b61142e565b610714600080516020611cdd83398151915233610dc2565b6107395760405162461bcd60e51b815260040161073090611bd3565b60405180910390fd5b609b5442106107c05760405162461bcd60e51b815260206004820152604760248201527f43616e6e6f7420736574206e6574776f726b206c61756e63682074696d65737460448201527f616d702062656361757365206e6574776f726b20697320616c7265616479206c606482015266185d5b98da195960ca1b608482015260a401610730565b6040516e04c61756e636854696d657374616d7608c1b6020820152602f0160408051601f198184030181528282528051602091820120609b54845290830184905291600080516020611cfd833981519152910160405180910390a2609b55565b610838600080516020611cdd83398151915233610dc2565b6108545760405162461bcd60e51b815260040161073090611bd3565b6040516d4d696e4e6f646542616c616e636560901b6020820152602e0160408051601f19818403018152828252805160209182012060a454845290830184905291600080516020611cfd833981519152910160405180910390a260a455565b6000828152606560205260409020600201546108cf9033610dc2565b6109335760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b6064820152608401610730565b61093d82826114c0565b5050565b6001600160a01b03811633146109b15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610730565b61093d8282611519565b6109d3600080516020611cdd83398151915233610dc2565b6109ef5760405162461bcd60e51b815260040161073090611bd3565b609a54609954610a0e9063ffffffff600160401b820481169116611c32565b63ffffffff161015610a595760405162461bcd60e51b8152602060048201526014602482015273496e636f727265637420636865636b2074696d6560601b6044820152606401610730565b60405168436865636b54696d6560b81b602082015260290160408051601f198184030181528282528051602091820120609a54845290830184905291600080516020611cfd833981519152910160405180910390a2609a55565b610acb600080516020611cdd83398151915233610dc2565b610ae75760405162461bcd60e51b815260040161073090611bd3565b6040517f50726f6f664f665573654c6f636b5570506572696f64446179730000000000006020820152603a0160408051601f198184030181528282528051602091820120609d54845290830184905291600080516020611cfd833981519152910160405180910390a2609d55565b610b6d600080516020611cdd83398151915233610dc2565b610b895760405162461bcd60e51b815260040161073090611bd3565b6040517f4c696d697456616c696461746f727350657244656c656761746f7200000000006020820152603b0160408051601f198184030181528282528051602091820120609f54845290830184905291600080516020611cfd833981519152910160405180910390a2609f55565b600054600290610100900460ff16158015610c19575060005460ff8083169116105b610c355760405162461bcd60e51b815260040161073090611c4f565b600080546714d1120d7b16000060a45561ffff191660ff83169081176101001761ff001916909155604051908152600080516020611d1d833981519152906020015b60405180910390a150565b610c9a600080516020611cdd83398151915233610dc2565b610cb65760405162461bcd60e51b815260040161073090611bd3565b6040517110dbdb5c1b185a5b9d151a5b59531a5b5a5d60721b602082015260320160408051601f19818403018152828252805160209182012060a354845290830184905291600080516020611cfd833981519152910160405180910390a260a355565b610d31600080516020611cdd83398151915233610dc2565b610d4d5760405162461bcd60e51b815260040161073090611bd3565b6040516226a9a960e91b602082015260230160408051601f198184030181528282528051602091820120609854845290830184905291600080516020611cfd833981519152910160405180910390a2609855565b6000828152606560205260408120610db99083611572565b90505b92915050565b6000828152606560205260408120610db9908361157e565b610df2600080516020611cdd83398151915233610dc2565b610e0e5760405162461bcd60e51b815260040161073090611bd3565b6064811115610e5f5760405162461bcd60e51b815260206004820152601d60248201527f50657263656e746167652076616c756520697320696e636f72726563740000006044820152606401610730565b6040517f50726f6f664f6655736544656c65676174696f6e50657263656e7461676500006020820152603e0160408051601f198184030181528282528051602091820120609e54845290830184905291600080516020611cfd833981519152910160405180910390a2609e55565b610ee5600080516020611cdd83398151915233610dc2565b610f015760405162461bcd60e51b815260040161073090611bd3565b8063ffffffff168263ffffffff1610158015610f2e5750609a54610f258284611c32565b63ffffffff1610155b610f6e5760405162461bcd60e51b8152602060048201526011602482015270496e636f727265637420506572696f647360781b6044820152606401610730565b6040516b14995dd85c9914195c9a5bd960a21b6020820152602c0160408051808303601f19018152828252805160209182012060995463ffffffff908116855286169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff191663ffffffff84161790556040516a11195b1d1854195c9a5bd960aa1b6020820152602b0160408051808303601f190181528282528051602091820120609954600160401b900463ffffffff908116855285169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff909216600160401b0263ffffffff60401b1990921691909117905550565b61108e600080516020611cdd83398151915233610dc2565b6110aa5760405162461bcd60e51b815260040161073090611bd3565b60405176053636861696e4372656174696f6e54696d655374616d7604c1b602082015260370160408051601f19818403018152828252805160209182012060a154845290830184905291600080516020611cfd833981519152910160405180910390a260a155565b61112a600080516020611cdd83398151915233610dc2565b6111465760405162461bcd60e51b815260040161073090611bd3565b6040516f416c6c6f7761626c654c6174656e637960801b602082015260300160408051808303601f190181528282528051602091820120609954640100000000900463ffffffff908116855285169184019190915291600080516020611cfd833981519152910160405180910390a26099805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b600054610100900460ff16158080156111fd5750600054600160ff909116105b8061121e575061120c306115a0565b15801561121e575060005460ff166001145b61123a5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff19166001179055801561125d576000805461ff0019166101001790555b611266826115af565b60006098819055609980546bffffffffffffffffffffffff1916690e10000249f000278d0017905561012c609a55600019609b5561a8c0609c55605a609d556032609e556014609f5560a05561070860a3556714d1120d7b16000060a455801561093d576000805461ff001916905560405160018152600080516020611d1d833981519152906020015b60405180910390a15050565b6000818152606560205260408120610dbc9061167b565b60008281526065602052604090206002015461132f9033610dc2565b6109b15760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b6064820152608401610730565b6113ac600080516020611cdd83398151915233610dc2565b6113c85760405162461bcd60e51b815260040161073090611bd3565b604051744d696e696d616c53636861696e4c69666574696d6560581b602082015260350160408051601f19818403018152828252805160209182012060a254845290830184905291600080516020611cfd833981519152910160405180910390a260a255565b611446600080516020611cdd83398151915233610dc2565b6114625760405162461bcd60e51b815260040161073090611bd3565b6040516c526f746174696f6e44656c617960981b6020820152602d0160408051601f198184030181528282528051602091820120609c54845290830184905291600080516020611cfd833981519152910160405180910390a2609c55565b60008281526065602052604090206114d89082611685565b1561093d5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152606560205260409020611531908261169a565b1561093d5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b6000610db983836116af565b6001600160a01b03811660009081526001830160205260408120541515610db9565b6001600160a01b03163b151590565b600054610100900460ff16158080156115cf5750600054600160ff909116105b806115f057506115de306115a0565b1580156115f0575060005460ff166001145b61160c5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff19166001179055801561162f576000805461ff0019166101001790555b6116376116d9565b611642600033610933565b61164b8261179c565b801561093d576000805461ff001916905560405160018152600080516020611d1d833981519152906020016112f0565b6000610dbc825490565b6000610db9836001600160a01b038416611877565b6000610db9836001600160a01b0384166118c6565b60008260000182815481106116c6576116c6611c9d565b9060005260206000200154905092915050565b600054610100900460ff16158080156116f95750600054600160ff909116105b8061171a5750611708306115a0565b15801561171a575060005460ff166001145b6117365760405162461bcd60e51b815260040161073090611c4f565b6000805460ff191660011790558015611759576000805461ff0019166101001790555b6117616119c0565b611769611a2d565b8015611799576000805461ff001916905560405160018152600080516020611d1d83398151915290602001610c77565b50565b6001600160a01b0381166117fd5760405162461bcd60e51b815260206004820152602260248201527f436f6e74726163744d616e616765722061646472657373206973206e6f742073604482015261195d60f21b6064820152608401610730565b61180f816001600160a01b03166115a0565b6118555760405162461bcd60e51b81526020600482015260176024820152761059191c995cdcc81a5cc81b9bdd0818dbdb9d1c9858dd604a1b6044820152606401610730565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526001830160205260408120546118be57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dbc565b506000610dbc565b600081815260018301602052604081205480156119af5760006118ea600183611cb3565b85549091506000906118fe90600190611cb3565b905081811461196357600086600001828154811061191e5761191e611c9d565b906000526020600020015490508087600001848154811061194157611941611c9d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061197457611974611cc6565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dbc565b6000915050610dbc565b5092915050565b600054610100900460ff16611a2b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610730565b565b600054610100900460ff1615808015611a4d5750600054600160ff909116105b80611a6e5750611a5c306115a0565b158015611a6e575060005460ff166001145b611a8a5760405162461bcd60e51b815260040161073090611c4f565b6000805460ff191660011790558015611769576000805461ff0019166101001790558015611799576000805461ff001916905560405160018152600080516020611d1d83398151915290602001610c77565b600060208284031215611aee57600080fd5b5035919050565b80356001600160a01b0381168114611b0c57600080fd5b919050565b60008060408385031215611b2457600080fd5b82359150611b3460208401611af5565b90509250929050565b60008060408385031215611b5057600080fd5b50508035926020909101359150565b803563ffffffff81168114611b0c57600080fd5b60008060408385031215611b8657600080fd5b611b8f83611b5f565b9150611b3460208401611b5f565b600060208284031215611baf57600080fd5b610db982611b5f565b600060208284031215611bca57600080fd5b610db982611af5565b60208082526029908201527f434f4e5354414e54535f484f4c4445525f4d414e414745525f524f4c45206973604082015268081c995c5d5a5c995960ba1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156119b9576119b9611c1c565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b81810381811115610dbc57610dbc611c1c565b634e487b7160e01b600052603160045260246000fdfe901a4192020a5185129ea5dfd5d8e7c687626d09d2d74e45406202aef5ad43afd9f6bd2abae0f2a51b3f5ffb29e0e35ee9ad2e3921ede0d71bff21dc8609f6f17f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498a2646970667358221220635fbee27af93083d7dc9b5b99e8ae07dfb29690f9a20cb30e04455defecfe3364736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.