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 Name:
TokenState
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only /* TokenState.sol - SKALE Manager Copyright (C) 2019-Present SKALE Labs @author Dmytro Stebaiev 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.11; import "@skalenetwork/skale-manager-interfaces/delegation/ITokenState.sol"; import "@skalenetwork/skale-manager-interfaces/delegation/ILocker.sol"; import "@skalenetwork/skale-manager-interfaces/delegation/IDelegationController.sol"; import "../Permissions.sol"; /** * @title Token State * @dev This contract manages lockers to control token transferability. * * The SKALE Network has three types of locked tokens: * * - Tokens that are transferrable but are currently locked into delegation with * a validator. * * - Tokens that are not transferable from one address to another, but may be * delegated to a validator `getAndUpdateLockedAmount`. This lock enforces * Proof-of-Use requirements. * * - Tokens that are neither transferable nor delegatable * `getAndUpdateForbiddenForDelegationAmount`. This lock enforces slashing. */ contract TokenState is Permissions, ILocker, ITokenState { string[] private _lockers; IDelegationController private _delegationController; bytes32 public constant LOCKER_MANAGER_ROLE = keccak256("LOCKER_MANAGER_ROLE"); modifier onlyLockerManager() { require(hasRole(LOCKER_MANAGER_ROLE, msg.sender), "LOCKER_MANAGER_ROLE is required"); _; } /** * @dev See {ILocker-getAndUpdateLockedAmount}. */ function getAndUpdateLockedAmount(address holder) external override returns (uint) { if (address(_delegationController) == address(0)) { _delegationController = IDelegationController(contractManager.getContract("DelegationController")); } uint locked = 0; if (_delegationController.getDelegationsByHolderLength(holder) > 0) { // the holder ever delegated for (uint i = 0; i < _lockers.length; ++i) { ILocker locker = ILocker(contractManager.getContract(_lockers[i])); locked = locked + locker.getAndUpdateLockedAmount(holder); } } return locked; } /** * @dev See {ILocker-getAndUpdateForbiddenForDelegationAmount}. */ function getAndUpdateForbiddenForDelegationAmount(address holder) external override returns (uint amount) { uint forbidden = 0; for (uint i = 0; i < _lockers.length; ++i) { ILocker locker = ILocker(contractManager.getContract(_lockers[i])); forbidden = forbidden + locker.getAndUpdateForbiddenForDelegationAmount(holder); } return forbidden; } /** * @dev Allows the Owner to remove a contract from the locker. * * Emits a {LockerWasRemoved} event. */ function removeLocker(string calldata locker) external override onlyLockerManager { uint index; bytes32 hash = keccak256(abi.encodePacked(locker)); for (index = 0; index < _lockers.length; ++index) { if (keccak256(abi.encodePacked(_lockers[index])) == hash) { break; } } if (index < _lockers.length) { if (index < _lockers.length - 1) { _lockers[index] = _lockers[_lockers.length - 1]; } delete _lockers[_lockers.length - 1]; _lockers.pop(); emit LockerWasRemoved(locker); } } function initialize(address contractManagerAddress) public override initializer { Permissions.initialize(contractManagerAddress); _setupRole(LOCKER_MANAGER_ROLE, msg.sender); addLocker("DelegationController"); addLocker("Punisher"); } /** * @dev Allows the Owner to add a contract to the Locker. * * Emits a {LockerWasAdded} event. */ function addLocker(string memory locker) public override onlyLockerManager { _lockers.push(locker); emit LockerWasAdded(locker); } }
// SPDX-License-Identifier: AGPL-3.0-only /* ITokenState.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 ITokenState { /** * @dev Emitted when a contract is added to the locker. */ event LockerWasAdded( string locker ); /** * @dev Emitted when a contract is removed from the locker. */ event LockerWasRemoved( string locker ); function removeLocker(string calldata locker) external; function addLocker(string memory locker) external; }
// SPDX-License-Identifier: AGPL-3.0-only /* ILocker.sol - SKALE Manager Copyright (C) 2019-Present SKALE Labs @author Dmytro Stebaiev 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; /** * @dev Interface of the Locker functions. */ interface ILocker { /** * @dev Returns and updates the total amount of locked tokens of a given * `holder`. */ function getAndUpdateLockedAmount(address wallet) external returns (uint); /** * @dev Returns and updates the total non-transferrable and un-delegatable * amount of a given `holder`. */ function getAndUpdateForbiddenForDelegationAmount(address wallet) external returns (uint); }
// SPDX-License-Identifier: AGPL-3.0-only /* IDelegationController.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 IDelegationController { enum State { PROPOSED, ACCEPTED, CANCELED, REJECTED, DELEGATED, UNDELEGATION_REQUESTED, COMPLETED } struct Delegation { address holder; // address of token owner uint validatorId; uint amount; uint delegationPeriod; uint created; // time of delegation creation uint started; // month when a delegation becomes active uint finished; // first month after a delegation ends string info; } /** * @dev Emitted when validator was confiscated. */ event Confiscated( uint indexed validatorId, uint amount ); /** * @dev Emitted when validator was confiscated. */ event SlashesProcessed( address indexed holder, uint limit ); /** * @dev Emitted when a delegation is proposed to a validator. */ event DelegationProposed( uint delegationId ); /** * @dev Emitted when a delegation is accepted by a validator. */ event DelegationAccepted( uint delegationId ); /** * @dev Emitted when a delegation is cancelled by the delegator. */ event DelegationRequestCanceledByUser( uint delegationId ); /** * @dev Emitted when a delegation is requested to undelegate. */ event UndelegationRequested( uint delegationId ); function getAndUpdateDelegatedToValidatorNow(uint validatorId) external returns (uint); function getAndUpdateDelegatedAmount(address holder) external returns (uint); function getAndUpdateEffectiveDelegatedByHolderToValidator(address holder, uint validatorId, uint month) external returns (uint effectiveDelegated); function delegate( uint validatorId, uint amount, uint delegationPeriod, string calldata info ) external; function cancelPendingDelegation(uint delegationId) external; function acceptPendingDelegation(uint delegationId) external; function requestUndelegation(uint delegationId) external; function confiscate(uint validatorId, uint amount) external; function getAndUpdateEffectiveDelegatedToValidator(uint validatorId, uint month) external returns (uint); function getAndUpdateDelegatedByHolderToValidatorNow(address holder, uint validatorId) external returns (uint); function processSlashes(address holder, uint limit) external; function processAllSlashes(address holder) external; function getEffectiveDelegatedValuesByValidator(uint validatorId) external view returns (uint[] memory); function getEffectiveDelegatedToValidator(uint validatorId, uint month) external view returns (uint); function getDelegatedToValidator(uint validatorId, uint month) external view returns (uint); function getDelegation(uint delegationId) external view returns (Delegation memory); function getFirstDelegationMonth(address holder, uint validatorId) external view returns(uint); function getDelegationsByValidatorLength(uint validatorId) external view returns (uint); function getDelegationsByHolderLength(address holder) external view returns (uint); function getState(uint delegationId) external view returns (State state); function getLockedInPendingDelegations(address holder) external view returns (uint); function hasUnprocessedSlashes(address holder) external view returns (bool); }
// 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.11; import "@skalenetwork/skale-manager-interfaces/IContractManager.sol"; import "@skalenetwork/skale-manager-interfaces/IPermissions.sol"; import "./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) { return hasRole(DEFAULT_ADMIN_ROLE, msg.sender); } function _isAdmin(address account) internal view returns (bool) { 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: 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: 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: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) 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. * * ``` * 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. */ 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) { return _values(set._inner); } // 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; 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 on 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; assembly { result := store } return result; } }
// 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 { __Context_init_unchained(); } 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; } uint256[50] private __gap; }
// 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 pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract InitializableWithGap is Initializable { uint256[50] private ______gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; 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 a proxied contract can't have 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "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":false,"internalType":"string","name":"locker","type":"string"}],"name":"LockerWasAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"locker","type":"string"}],"name":"LockerWasRemoved","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":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCKER_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"locker","type":"string"}],"name":"addLocker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractManager","outputs":[{"internalType":"contract IContractManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"getAndUpdateForbiddenForDelegationAmount","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"getAndUpdateLockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","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":"contractManagerAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"locker","type":"string"}],"name":"removeLocker","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"}]
Contract Creation Code
608060405234801561001057600080fd5b50611754806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806391d1485411610097578063ca15c87311610066578063ca15c8731461020f578063ccb70da414610222578063d547741f14610235578063fa8dacba1461024857600080fd5b806391d14854146101be578063a217fddf146101e1578063b39e12cf146101e9578063c4d66de8146101fc57600080fd5b80633527c242116100d35780633527c2421461015857806336568abe1461016b5780635b09dfec1461017e5780639010d07c1461019357600080fd5b80630b975991146100fa578063248a9ca3146101205780632f2ff15d14610143575b600080fd5b61010d610108366004611260565b61025b565b6040519081526020015b60405180910390f35b61010d61012e366004611284565b60009081526065602052604090206002015490565b61015661015136600461129d565b610390565b005b6101566101663660046112e3565b610423565b61015661017936600461129d565b610505565b61010d6000805160206116ff83398151915281565b6101a66101a1366004611394565b61057f565b6040516001600160a01b039091168152602001610117565b6101d16101cc36600461129d565b6105a0565b6040519015158152602001610117565b61010d600081565b6097546101a6906001600160a01b031681565b61015661020a366004611260565b6105b8565b61010d61021d366004611284565b6106a9565b6101566102303660046113b6565b6106c0565b61015661024336600461129d565b6108e5565b61010d610256366004611260565b610966565b600080805b60985481101561038957609754609880546000926001600160a01b0316916335817773918590811061029457610294611428565b906000526020600020016040518263ffffffff1660e01b81526004016102ba9190611479565b602060405180830381865afa1580156102d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fb91906114fe565b604051630b97599160e01b81526001600160a01b03878116600483015291925090821690630b975991906024016020604051808303816000875af1158015610347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036b919061151b565b610375908461154a565b9250508061038290611562565b9050610260565b5092915050565b6000828152606560205260409020600201546103ac90336105a0565b6104155760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b60648201526084015b60405180910390fd5b61041f8282610bcf565b5050565b61043b6000805160206116ff833981519152336105a0565b6104875760405162461bcd60e51b815260206004820152601f60248201527f4c4f434b45525f4d414e414745525f524f4c4520697320726571756972656400604482015260640161040c565b6098805460018101825560009190915281516104ca917f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d81401906020840190611101565b507f6457d87a59963bd676cb5d36785f7a28f1dd7c108b4c3a1ea39a583f85698256816040516104fa919061157d565b60405180910390a150565b6001600160a01b03811633146105755760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161040c565b61041f8282610c28565b60008281526065602052604081206105979083610c81565b90505b92915050565b60008281526065602052604081206105979083610c8d565b600054610100900460ff166105d35760005460ff16156105d7565b303b155b6105f35760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610615576000805461ffff19166101011790555b61061e82610caf565b6106366000805160206116ff83398151915233610415565b61066b604051806040016040528060148152602001732232b632b3b0ba34b7b721b7b73a3937b63632b960611b815250610423565b61069460405180604001604052806008815260200167283ab734b9b432b960c11b815250610423565b801561041f576000805461ff00191690555050565b600081815260656020526040812061059a90610d28565b6106d86000805160206116ff833981519152336105a0565b6107245760405162461bcd60e51b815260206004820152601f60248201527f4c4f434b45525f4d414e414745525f524f4c4520697320726571756972656400604482015260640161040c565b600080838360405160200161073a929190611620565b604051602081830303815290604052805190602001209050600091505b6098548210156107c057806098838154811061077557610775611428565b9060005260206000200160405160200161078f9190611630565b6040516020818303038152906040528051906020012014156107b0576107c0565b6107b982611562565b9150610757565b6098548210156108df576098546107d9906001906116a2565b82101561084057609880546107f0906001906116a2565b8154811061080057610800611428565b906000526020600020016098838154811061081d5761081d611428565b906000526020600020019080546108339061143e565b61083e929190611185565b505b60988054610850906001906116a2565b8154811061086057610860611428565b9060005260206000200160006108769190611200565b6098805480610887576108876116b9565b6001900381819060005260206000200160006108a39190611200565b90557f7f279dfd82e34a2cf8fb310627c066c41c9f0f8ddfcd2bdb68067e68a837651584846040516108d69291906116cf565b60405180910390a15b50505050565b60008281526065602052604090206002015461090190336105a0565b6105755760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161040c565b6099546000906001600160a01b0316610a2b57609754604051633581777360e01b81526020600482015260146024820152732232b632b3b0ba34b7b721b7b73a3937b63632b960611b60448201526001600160a01b0390911690633581777390606401602060405180830381865afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a91906114fe565b609980546001600160a01b0319166001600160a01b03929092169190911790555b609954604051636ed320d760e11b81526001600160a01b038481166004830152600092839291169063dda641ae90602401602060405180830381865afa158015610a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9d919061151b565b111561059a5760005b60985481101561038957609754609880546000926001600160a01b03169163358177739185908110610ada57610ada611428565b906000526020600020016040518263ffffffff1660e01b8152600401610b009190611479565b602060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4191906114fe565b604051637d46d65d60e11b81526001600160a01b0387811660048301529192509082169063fa8dacba906024016020604051808303816000875af1158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb1919061151b565b610bbb908461154a565b92505080610bc890611562565b9050610aa6565b6000828152606560205260409020610be79082610d32565b1561041f5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152606560205260409020610c409082610d47565b1561041f5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b60006105978383610d5c565b6001600160a01b03811660009081526001830160205260408120541515610597565b600054610100900460ff16610cca5760005460ff1615610cce565b303b155b610cea5760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610d0c576000805461ffff19166101011790555b610d14610d86565b610d1f600033610415565b61069482610e08565b600061059a825490565b6000610597836001600160a01b038416610ee2565b6000610597836001600160a01b038416610f31565b6000826000018281548110610d7357610d73611428565b9060005260206000200154905092915050565b600054610100900460ff16610da15760005460ff1615610da5565b303b155b610dc15760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610de3576000805461ffff19166101011790555b610deb611024565b610df3611091565b8015610e05576000805461ff00191690555b50565b6001600160a01b038116610e695760405162461bcd60e51b815260206004820152602260248201527f436f6e74726163744d616e616765722061646472657373206973206e6f742073604482015261195d60f21b606482015260840161040c565b6001600160a01b0381163b610ec05760405162461bcd60e51b815260206004820152601760248201527f41646472657373206973206e6f7420636f6e7472616374000000000000000000604482015260640161040c565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600183016020526040812054610f295750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561059a565b50600061059a565b6000818152600183016020526040812054801561101a576000610f556001836116a2565b8554909150600090610f69906001906116a2565b9050818114610fce576000866000018281548110610f8957610f89611428565b9060005260206000200154905080876000018481548110610fac57610fac611428565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610fdf57610fdf6116b9565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061059a565b600091505061059a565b600054610100900460ff1661108f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161040c565b565b600054610100900460ff166110ac5760005460ff16156110b0565b303b155b6110cc5760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610df3576000805461ffff19166101011790558015610e05576000805461ff001916905550565b82805461110d9061143e565b90600052602060002090601f01602090048101928261112f5760008555611175565b82601f1061114857805160ff1916838001178555611175565b82800160010185558215611175579182015b8281111561117557825182559160200191906001019061115a565b50611181929150611236565b5090565b8280546111919061143e565b90600052602060002090601f0160209004810192826111b35760008555611175565b82601f106111c45780548555611175565b8280016001018555821561117557600052602060002091601f016020900482015b828111156111755782548255916001019190600101906111e5565b50805461120c9061143e565b6000825580601f1061121c575050565b601f016020900490600052602060002090810190610e0591905b5b808211156111815760008155600101611237565b6001600160a01b0381168114610e0557600080fd5b60006020828403121561127257600080fd5b813561127d8161124b565b9392505050565b60006020828403121561129657600080fd5b5035919050565b600080604083850312156112b057600080fd5b8235915060208301356112c28161124b565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156112f557600080fd5b813567ffffffffffffffff8082111561130d57600080fd5b818401915084601f83011261132157600080fd5b813581811115611333576113336112cd565b604051601f8201601f19908116603f0116810190838211818310171561135b5761135b6112cd565b8160405282815287602084870101111561137457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080604083850312156113a757600080fd5b50508035926020909101359150565b600080602083850312156113c957600080fd5b823567ffffffffffffffff808211156113e157600080fd5b818501915085601f8301126113f557600080fd5b81358181111561140457600080fd5b86602082850101111561141657600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061145257607f821691505b6020821081141561147357634e487b7160e01b600052602260045260246000fd5b50919050565b600060208083526000845461148d8161143e565b808487015260406001808416600081146114ae57600181146114c2576114f0565b60ff198516898401526060890195506114f0565b896000528660002060005b858110156114e85781548b82018601529083019088016114cd565b8a0184019650505b509398975050505050505050565b60006020828403121561151057600080fd5b815161127d8161124b565b60006020828403121561152d57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561155d5761155d611534565b500190565b600060001982141561157657611576611534565b5060010190565b600060208083528351808285015260005b818110156115aa5785810183015185820160400152820161158e565b818111156115bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b8183823760009101908152919050565b600080835461163e8161143e565b60018281168015611656576001811461166757611696565b60ff19841687528287019450611696565b8760005260208060002060005b8581101561168d5781548a820152908401908201611674565b50505082870194505b50929695505050505050565b6000828210156116b4576116b4611534565b500390565b634e487b7160e01b600052603160045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056feeb112bc944073ac076a5dd136e56f3837622f936b5920aa63da4ddb9145b62f7a264697066735822122038d37ee3b9f4315c88e0796773da496ad43db4ffc272ce4f4fd8a1de18adfd4f64736f6c634300080b0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806391d1485411610097578063ca15c87311610066578063ca15c8731461020f578063ccb70da414610222578063d547741f14610235578063fa8dacba1461024857600080fd5b806391d14854146101be578063a217fddf146101e1578063b39e12cf146101e9578063c4d66de8146101fc57600080fd5b80633527c242116100d35780633527c2421461015857806336568abe1461016b5780635b09dfec1461017e5780639010d07c1461019357600080fd5b80630b975991146100fa578063248a9ca3146101205780632f2ff15d14610143575b600080fd5b61010d610108366004611260565b61025b565b6040519081526020015b60405180910390f35b61010d61012e366004611284565b60009081526065602052604090206002015490565b61015661015136600461129d565b610390565b005b6101566101663660046112e3565b610423565b61015661017936600461129d565b610505565b61010d6000805160206116ff83398151915281565b6101a66101a1366004611394565b61057f565b6040516001600160a01b039091168152602001610117565b6101d16101cc36600461129d565b6105a0565b6040519015158152602001610117565b61010d600081565b6097546101a6906001600160a01b031681565b61015661020a366004611260565b6105b8565b61010d61021d366004611284565b6106a9565b6101566102303660046113b6565b6106c0565b61015661024336600461129d565b6108e5565b61010d610256366004611260565b610966565b600080805b60985481101561038957609754609880546000926001600160a01b0316916335817773918590811061029457610294611428565b906000526020600020016040518263ffffffff1660e01b81526004016102ba9190611479565b602060405180830381865afa1580156102d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fb91906114fe565b604051630b97599160e01b81526001600160a01b03878116600483015291925090821690630b975991906024016020604051808303816000875af1158015610347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036b919061151b565b610375908461154a565b9250508061038290611562565b9050610260565b5092915050565b6000828152606560205260409020600201546103ac90336105a0565b6104155760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b60648201526084015b60405180910390fd5b61041f8282610bcf565b5050565b61043b6000805160206116ff833981519152336105a0565b6104875760405162461bcd60e51b815260206004820152601f60248201527f4c4f434b45525f4d414e414745525f524f4c4520697320726571756972656400604482015260640161040c565b6098805460018101825560009190915281516104ca917f2237a976fa961f5921fd19f2b03c925c725d77b20ce8f790c19709c03de4d81401906020840190611101565b507f6457d87a59963bd676cb5d36785f7a28f1dd7c108b4c3a1ea39a583f85698256816040516104fa919061157d565b60405180910390a150565b6001600160a01b03811633146105755760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161040c565b61041f8282610c28565b60008281526065602052604081206105979083610c81565b90505b92915050565b60008281526065602052604081206105979083610c8d565b600054610100900460ff166105d35760005460ff16156105d7565b303b155b6105f35760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610615576000805461ffff19166101011790555b61061e82610caf565b6106366000805160206116ff83398151915233610415565b61066b604051806040016040528060148152602001732232b632b3b0ba34b7b721b7b73a3937b63632b960611b815250610423565b61069460405180604001604052806008815260200167283ab734b9b432b960c11b815250610423565b801561041f576000805461ff00191690555050565b600081815260656020526040812061059a90610d28565b6106d86000805160206116ff833981519152336105a0565b6107245760405162461bcd60e51b815260206004820152601f60248201527f4c4f434b45525f4d414e414745525f524f4c4520697320726571756972656400604482015260640161040c565b600080838360405160200161073a929190611620565b604051602081830303815290604052805190602001209050600091505b6098548210156107c057806098838154811061077557610775611428565b9060005260206000200160405160200161078f9190611630565b6040516020818303038152906040528051906020012014156107b0576107c0565b6107b982611562565b9150610757565b6098548210156108df576098546107d9906001906116a2565b82101561084057609880546107f0906001906116a2565b8154811061080057610800611428565b906000526020600020016098838154811061081d5761081d611428565b906000526020600020019080546108339061143e565b61083e929190611185565b505b60988054610850906001906116a2565b8154811061086057610860611428565b9060005260206000200160006108769190611200565b6098805480610887576108876116b9565b6001900381819060005260206000200160006108a39190611200565b90557f7f279dfd82e34a2cf8fb310627c066c41c9f0f8ddfcd2bdb68067e68a837651584846040516108d69291906116cf565b60405180910390a15b50505050565b60008281526065602052604090206002015461090190336105a0565b6105755760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161040c565b6099546000906001600160a01b0316610a2b57609754604051633581777360e01b81526020600482015260146024820152732232b632b3b0ba34b7b721b7b73a3937b63632b960611b60448201526001600160a01b0390911690633581777390606401602060405180830381865afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a91906114fe565b609980546001600160a01b0319166001600160a01b03929092169190911790555b609954604051636ed320d760e11b81526001600160a01b038481166004830152600092839291169063dda641ae90602401602060405180830381865afa158015610a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9d919061151b565b111561059a5760005b60985481101561038957609754609880546000926001600160a01b03169163358177739185908110610ada57610ada611428565b906000526020600020016040518263ffffffff1660e01b8152600401610b009190611479565b602060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4191906114fe565b604051637d46d65d60e11b81526001600160a01b0387811660048301529192509082169063fa8dacba906024016020604051808303816000875af1158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb1919061151b565b610bbb908461154a565b92505080610bc890611562565b9050610aa6565b6000828152606560205260409020610be79082610d32565b1561041f5760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b6000828152606560205260409020610c409082610d47565b1561041f5760405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b60006105978383610d5c565b6001600160a01b03811660009081526001830160205260408120541515610597565b600054610100900460ff16610cca5760005460ff1615610cce565b303b155b610cea5760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610d0c576000805461ffff19166101011790555b610d14610d86565b610d1f600033610415565b61069482610e08565b600061059a825490565b6000610597836001600160a01b038416610ee2565b6000610597836001600160a01b038416610f31565b6000826000018281548110610d7357610d73611428565b9060005260206000200154905092915050565b600054610100900460ff16610da15760005460ff1615610da5565b303b155b610dc15760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610de3576000805461ffff19166101011790555b610deb611024565b610df3611091565b8015610e05576000805461ff00191690555b50565b6001600160a01b038116610e695760405162461bcd60e51b815260206004820152602260248201527f436f6e74726163744d616e616765722061646472657373206973206e6f742073604482015261195d60f21b606482015260840161040c565b6001600160a01b0381163b610ec05760405162461bcd60e51b815260206004820152601760248201527f41646472657373206973206e6f7420636f6e7472616374000000000000000000604482015260640161040c565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600183016020526040812054610f295750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561059a565b50600061059a565b6000818152600183016020526040812054801561101a576000610f556001836116a2565b8554909150600090610f69906001906116a2565b9050818114610fce576000866000018281548110610f8957610f89611428565b9060005260206000200154905080876000018481548110610fac57610fac611428565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610fdf57610fdf6116b9565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061059a565b600091505061059a565b600054610100900460ff1661108f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161040c565b565b600054610100900460ff166110ac5760005460ff16156110b0565b303b155b6110cc5760405162461bcd60e51b815260040161040c906115d2565b600054610100900460ff16158015610df3576000805461ffff19166101011790558015610e05576000805461ff001916905550565b82805461110d9061143e565b90600052602060002090601f01602090048101928261112f5760008555611175565b82601f1061114857805160ff1916838001178555611175565b82800160010185558215611175579182015b8281111561117557825182559160200191906001019061115a565b50611181929150611236565b5090565b8280546111919061143e565b90600052602060002090601f0160209004810192826111b35760008555611175565b82601f106111c45780548555611175565b8280016001018555821561117557600052602060002091601f016020900482015b828111156111755782548255916001019190600101906111e5565b50805461120c9061143e565b6000825580601f1061121c575050565b601f016020900490600052602060002090810190610e0591905b5b808211156111815760008155600101611237565b6001600160a01b0381168114610e0557600080fd5b60006020828403121561127257600080fd5b813561127d8161124b565b9392505050565b60006020828403121561129657600080fd5b5035919050565b600080604083850312156112b057600080fd5b8235915060208301356112c28161124b565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156112f557600080fd5b813567ffffffffffffffff8082111561130d57600080fd5b818401915084601f83011261132157600080fd5b813581811115611333576113336112cd565b604051601f8201601f19908116603f0116810190838211818310171561135b5761135b6112cd565b8160405282815287602084870101111561137457600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080604083850312156113a757600080fd5b50508035926020909101359150565b600080602083850312156113c957600080fd5b823567ffffffffffffffff808211156113e157600080fd5b818501915085601f8301126113f557600080fd5b81358181111561140457600080fd5b86602082850101111561141657600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061145257607f821691505b6020821081141561147357634e487b7160e01b600052602260045260246000fd5b50919050565b600060208083526000845461148d8161143e565b808487015260406001808416600081146114ae57600181146114c2576114f0565b60ff198516898401526060890195506114f0565b896000528660002060005b858110156114e85781548b82018601529083019088016114cd565b8a0184019650505b509398975050505050505050565b60006020828403121561151057600080fd5b815161127d8161124b565b60006020828403121561152d57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561155d5761155d611534565b500190565b600060001982141561157657611576611534565b5060010190565b600060208083528351808285015260005b818110156115aa5785810183015185820160400152820161158e565b818111156115bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b8183823760009101908152919050565b600080835461163e8161143e565b60018281168015611656576001811461166757611696565b60ff19841687528287019450611696565b8760005260208060002060005b8581101561168d5781548a820152908401908201611674565b50505082870194505b50929695505050505050565b6000828210156116b4576116b4611534565b500390565b634e487b7160e01b600052603160045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056feeb112bc944073ac076a5dd136e56f3837622f936b5920aa63da4ddb9145b62f7a264697066735822122038d37ee3b9f4315c88e0796773da496ad43db4ffc272ce4f4fd8a1de18adfd4f64736f6c634300080b0033
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.