Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 17522517 | 1007 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AllowlistUpgradeable
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/**SPDX-License-Identifier: BUSL-1.1
▄▄█████████▄
╓██▀└ ,╓▄▄▄, '▀██▄
██▀ ▄██▀▀╙╙▀▀██▄ └██µ ,, ,, , ,,, ,,,
██ ,██¬ ▄████▄ ▀█▄ ╙█▄ ▄███▀▀███▄ ███▄ ██ ███▀▀▀███▄ ▄███▀▀███,
██ ██ ╒█▀' ╙█▌ ╙█▌ ██ ▐██ ███ █████, ██ ██▌ └██▌ ██▌ └██▌
██ ▐█▌ ██ ╟█ █▌ ╟█ ██▌ ▐██ ██ └███ ██ ██▌ ╟██ j██ ╟██
╟█ ██ ╙██ ▄█▀ ▐█▌ ██ ╙██ ██▌ ██ ╙████ ██▌ ▄██▀ ██▌ ,██▀
██ "██, ╙▀▀███████████⌐ ╙████████▀ ██ ╙██ ███████▀▀ ╙███████▀`
██▄ ╙▀██▄▄▄▄▄,,, ¬─ '─¬
╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀
╙▀▀██████R⌐
*/
pragma solidity 0.8.16;
import "contracts/external/openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "contracts/interfaces/IAllowlist.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
/**
* @title AllowlistUpgradeable
* @author Ondo Finance
* @notice This contract manages the allowlist status for accounts.
*/
contract AllowlistUpgradeable is
Initializable,
AccessControlEnumerableUpgradeable,
IAllowlist
{
/// @dev Role based access control roles
bytes32 public constant ALLOWLIST_ADMIN = keccak256("ALLOWLIST_ADMIN");
bytes32 public constant ALLOWLIST_SETTER = keccak256("ALLOWLIST_SETTER");
/// @dev {<EOA> : {<term index> : <is verified>}};
mapping(address => mapping(uint256 => bool)) public verifications;
string[] public terms;
uint256 public currentTermIndex = 0;
uint256[] public validIndexes;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address admin, address setter) public initializer {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(ALLOWLIST_ADMIN, admin);
_grantRole(ALLOWLIST_SETTER, setter);
}
/**
* @notice Gets a list term indexes that are valid for a user to be on the
* allowlist
*/
function getValidTermIndexes()
external
view
override
returns (uint256[] memory)
{
return validIndexes;
}
/**
* @notice Returns the current terms string associated with the
* `currentTermIndex`
*/
function getCurrentTerm() external view override returns (string memory) {
return terms[currentTermIndex];
}
/**
* @notice Adds a term to the list of possible terms
*
* @param term Term to add
*
* @dev This function sets the current term index as the added term
* @dev The added term is not valid until it's added to validIndexes
*/
function addTerm(
string calldata term
) external override onlyRole(ALLOWLIST_ADMIN) {
terms.push(term);
setCurrentTermIndex(terms.length - 1);
emit TermAdded(keccak256(bytes(term)), terms.length - 1);
}
/**
* @notice Sets the current term index
*
* @param _currentTermIndex New current term index
*
* @dev The current term index is not a valid term until it's added to
* validIndexes
* @dev This function will revert if the `_currentTermIndex` out of bounds
* of the terms array
*/
function setCurrentTermIndex(
uint256 _currentTermIndex
) public override onlyRole(ALLOWLIST_ADMIN) {
if (_currentTermIndex >= terms.length) {
revert InvalidTermIndex();
}
uint256 oldIndex = currentTermIndex;
currentTermIndex = _currentTermIndex;
emit CurrentTermIndexSet(oldIndex, _currentTermIndex);
}
/**
* @notice Sets the list of valid term indexes
*
* @param _validIndexes List of new valid term indexes
*
* @dev Once the validIndexes are set, any user who has been verified to sign
* a particular term will pass the `isAllowed` check
*/
function setValidTermIndexes(
uint256[] calldata _validIndexes
) external override onlyRole(ALLOWLIST_ADMIN) {
for (uint256 i; i < _validIndexes.length; ++i) {
if (_validIndexes[i] >= terms.length) {
revert InvalidTermIndex();
}
}
uint256[] memory oldIndexes = validIndexes;
validIndexes = _validIndexes;
emit ValidTermIndexesSet(oldIndexes, _validIndexes);
}
/**
* @notice Function that checks whether a user passes the allowlist check
*
* @param account Address of the account to check
*
* @dev Contracts are always allowed. Any entity that has signed a valid term
* or added themselves to the allowslit for a valid term will pass the
* check
*/
function isAllowed(address account) external view override returns (bool) {
// Contracts are always allowed
if (AddressUpgradeable.isContract(account)) {
return true;
}
uint256 validIndexesLength = validIndexes.length;
for (uint256 i; i < validIndexesLength; ++i) {
if (verifications[account][validIndexes[i]]) {
return true;
}
}
return false;
}
/**
* @notice Function that allows a user to add themselves to the allowlist
* for a given `termIndex`
*
* @param termIndex Term index for which the user is adding themselves to the
* allowlist
*/
function addSelfToAllowlist(uint256 termIndex) external override {
if (verifications[msg.sender][termIndex]) {
revert AlreadyVerified();
}
_setAccountStatus(msg.sender, termIndex, true);
emit AccountAddedSelf(msg.sender, termIndex);
}
/**
* @notice Admin function to set an accounts status for a given term index
*
* @param account Address of the account to set the status for
* @param termIndex Term index for which to update status for
* @param status New status of the account
*
* @dev If a user's status has been set to false, a user can then set their
* status back to true. This behavior is known. The allowlist should be
* used in conjunction with a blocklist
*/
function setAccountStatus(
address account,
uint256 termIndex,
bool status
) external override onlyRole(ALLOWLIST_SETTER) {
_setAccountStatus(account, termIndex, status);
emit AccountStatusSetByAdmin(account, termIndex, status);
}
/**
* @notice Function that allows anyone to add a user to the allowlist with a
* given off-chain signature
*
* @param termIndex Term index for which the user is adding themselves to the
* allowlist
* @param account Address of the account to add to the allowlist
* @param v v component of the signature
* @param r r component of the signature
* @param s s component of the signature
*/
function addAccountToAllowlist(
uint256 termIndex,
address account,
uint8 v,
bytes32 r,
bytes32 s
) external override {
if (verifications[account][termIndex]) {
revert AlreadyVerified();
}
if (v != 27 && v != 28) {
revert InvalidVSignature();
}
bytes32 hashedMessage = ECDSA.toEthSignedMessageHash(
bytes(terms[termIndex])
);
address signer = ECDSA.recover(hashedMessage, v, r, s);
if (signer != account) {
revert InvalidSigner();
}
_setAccountStatus(account, termIndex, true);
emit AccountAddedFromSignature(account, termIndex, v, r, s);
}
/**
* @notice Internal function to set the status of an account for a given term
*
* @param account Address of the account to set the status for
* @param termIndex Term index for which to update status for
* @param status New status of the account
*/
function _setAccountStatus(
address account,
uint256 termIndex,
bool status
) internal {
if (termIndex >= terms.length) {
revert InvalidTermIndex();
}
verifications[account][termIndex] = status;
emit AccountStatusSet(account, termIndex, status);
}
}/**SPDX-License-Identifier: BUSL-1.1
▄▄█████████▄
╓██▀└ ,╓▄▄▄, '▀██▄
██▀ ▄██▀▀╙╙▀▀██▄ └██µ ,, ,, , ,,, ,,,
██ ,██¬ ▄████▄ ▀█▄ ╙█▄ ▄███▀▀███▄ ███▄ ██ ███▀▀▀███▄ ▄███▀▀███,
██ ██ ╒█▀' ╙█▌ ╙█▌ ██ ▐██ ███ █████, ██ ██▌ └██▌ ██▌ └██▌
██ ▐█▌ ██ ╟█ █▌ ╟█ ██▌ ▐██ ██ └███ ██ ██▌ ╟██ j██ ╟██
╟█ ██ ╙██ ▄█▀ ▐█▌ ██ ╙██ ██▌ ██ ╙████ ██▌ ▄██▀ ██▌ ,██▀
██ "██, ╙▀▀███████████⌐ ╙████████▀ ██ ╙██ ███████▀▀ ╙███████▀`
██▄ ╙▀██▄▄▄▄▄,,, ¬─ '─¬
╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀
╙▀▀██████R⌐
*/
pragma solidity 0.8.16;
interface IAllowlist {
function addTerm(string calldata term) external;
function setCurrentTermIndex(uint256 _currentTermIndex) external;
function setValidTermIndexes(uint256[] calldata indexes) external;
function isAllowed(address account) external view returns (bool);
function getCurrentTerm() external view returns (string memory);
function getValidTermIndexes() external view returns (uint256[] memory);
function addAccountToAllowlist(
uint256 _currentTermIndex,
address account,
uint8 v,
bytes32 r,
bytes32 s
) external;
function addSelfToAllowlist(uint256 termIndex) external;
function setAccountStatus(
address account,
uint256 termIndex,
bool status
) external;
/**
* @notice Event emitted when a term is added
*
* @param hashedMessage The hash of the terms string that was added
* @param termIndex The index of the term that was added
*/
event TermAdded(bytes32 hashedMessage, uint256 termIndex);
/**
* @notice Event emitted when the current term index is set
*
* @param oldIndex The old current term index
* @param newIndex The new current term index
*/
event CurrentTermIndexSet(uint256 oldIndex, uint256 newIndex);
/**
* @notice Event emitted when the valid term indexes are set
*
* @param oldIndexes The old valid term indexes
* @param newIndexes The new valid term indexes
*/
event ValidTermIndexesSet(uint256[] oldIndexes, uint256[] newIndexes);
/**
* @notice Event emitted when an accoun status is set by an admin
*
* @param account The account whose status was set
* @param termIndex The term index of the account whose status that was set
* @param status The new status of the account
*/
event AccountStatusSetByAdmin(
address indexed account,
uint256 indexed termIndex,
bool status
);
/**
* @notice Event emitted when an account adds itself added to the allowlist
*
* @param account The account that was added
* @param termIndex The term index for which the account was added
*/
event AccountAddedSelf(address indexed account, uint256 indexed termIndex);
/**
* @notice Event emitted when an account is added to the allowlist by a signature
*
* @param account The account that was added
* @param termIndex The term index for which the account was added
* @param v The v value of the signature
* @param r The r value of the signature
* @param s The s value of the signature
*/
event AccountAddedFromSignature(
address indexed account,
uint256 indexed termIndex,
uint8 v,
bytes32 r,
bytes32 s
);
/**
* @notice Event emitted when an account status is set
*
* @param account The account whose status was set
* @param termIndex The term index of the account whose status was set
* @param status The new status of the account
*/
event AccountStatusSet(
address indexed account,
uint256 indexed termIndex,
bool status
);
/// ERRORS ///
error InvalidTermIndex();
error InvalidVSignature();
error AlreadyVerified();
error InvalidSigner();
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "contracts/external/openzeppelin/contracts-upgradeable/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]
* ```
* 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. Equivalent to `reinitializer(1)`.
*/
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.
*
* `initializer` is equivalent to `reinitializer(1)`, so 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.
*
* 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.
*/
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.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerableUpgradeable is
Initializable,
IAccessControlEnumerableUpgradeable,
AccessControlUpgradeable
{
function __AccessControlEnumerable_init() internal onlyInitializing {}
function __AccessControlEnumerable_init_unchained()
internal
onlyInitializing
{}
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @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
virtual
override
returns (address)
{
return _roleMembers[role].at(index);
}
/**
* @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
virtual
override
returns (uint256)
{
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account)
internal
virtual
override
{
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/utils/ERC165Upgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* 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, msg.sender));
* ...
* }
* ```
*
* 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}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is
Initializable,
ContextUpgradeable,
IAccessControlUpgradeable,
ERC165Upgradeable
{
function __AccessControl_init() internal onlyInitializing {}
function __AccessControl_init_unchained() internal onlyInitializing {}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IAccessControlUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account)
public
view
virtual
override
returns (bool)
{
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @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
virtual
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.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_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.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_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 revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
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.
*
* May emit a {RoleGranted} event.
*
* [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}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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.
*
* [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)
{
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;
/// @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 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;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
/**
* @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)
external
view
returns (address);
/**
* @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) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(
bytes32 indexed role,
address indexed account,
address indexed sender
);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(
bytes32 indexed role,
address indexed account,
address indexed sender
);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts-upgradeable/proxy/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 v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts-upgradeable/utils/IERC165Upgradeable.sol";
import "contracts/external/openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {}
function __ERC165_init_unchained() internal onlyInitializing {}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @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.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 100
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyVerified","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"InvalidTermIndex","type":"error"},{"inputs":[],"name":"InvalidVSignature","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"termIndex","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"v","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"r","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"AccountAddedFromSignature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"termIndex","type":"uint256"}],"name":"AccountAddedSelf","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"termIndex","type":"uint256"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"AccountStatusSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"termIndex","type":"uint256"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"AccountStatusSetByAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newIndex","type":"uint256"}],"name":"CurrentTermIndexSet","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":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hashedMessage","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"termIndex","type":"uint256"}],"name":"TermAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"oldIndexes","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"newIndexes","type":"uint256[]"}],"name":"ValidTermIndexesSet","type":"event"},{"inputs":[],"name":"ALLOWLIST_ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ALLOWLIST_SETTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"termIndex","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"addAccountToAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"termIndex","type":"uint256"}],"name":"addSelfToAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"term","type":"string"}],"name":"addTerm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentTermIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTerm","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"getValidTermIndexes","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":"admin","type":"address"},{"internalType":"address","name":"setter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"termIndex","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setAccountStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_currentTermIndex","type":"uint256"}],"name":"setCurrentTermIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_validIndexes","type":"uint256[]"}],"name":"setValidTermIndexes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"terms","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"validIndexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"verifications","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052600060cb5534801561001557600080fd5b5061001e610023565b6100e3565b600054610100900460ff161561008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611e69806100f26000396000f3fe608060405234801561001057600080fd5b50600436106101635760003560e01c806366e4b702116100ce578063a217fddf11610087578063a217fddf14610324578063babcc5391461032c578063c0aa0e8a1461033f578063ca15c87314610352578063d469d0c214610365578063d499ca5b14610378578063d547741f1461038b57600080fd5b806366e4b702146102a057806387a20680146102b55780639010d07c146102be57806390d63fa3146102e957806391d14854146102fc57806392ecf5771461030f57600080fd5b8063283762031161012057806328376203146102115780632c5783b1146102245780632f2ff15d1461023957806336568abe1461024c57806346db089d1461025f578063485cc9551461028d57600080fd5b806301ffc9a71461016857806302ffc7641461019057806308f419f4146101a5578063209b9833146101b8578063248a9ca3146101cd578063251e831b146101fe575b600080fd5b61017b610176366004611734565b61039e565b60405190151581526020015b60405180910390f35b6101a361019e36600461177a565b6103c9565b005b6101a36101b33660046117bf565b610438565b6101c06104b9565b6040516101879190611813565b6101f06101db3660046117bf565b60009081526065602052604090206001015490565b604051908152602001610187565b6101f061020c3660046117bf565b610511565b6101a361021f366004611826565b610532565b6101f0600080516020611df483398151915281565b6101a361024736600461187c565b610707565b6101a361025a36600461187c565b610731565b61017b61026d3660046118a8565b60c960209081526000928352604080842090915290825290205460ff1681565b6101a361029b3660046118d2565b6107b4565b6101f0600080516020611e1483398151915281565b6101f060cb5481565b6102d16102cc3660046118fc565b6108f1565b6040516001600160a01b039091168152602001610187565b6101a36102f73660046117bf565b610910565b61017b61030a36600461187c565b610988565b6103176109b3565b6040516101879190611942565b6101f0600081565b61017b61033a366004611975565b610a59565b61031761034d3660046117bf565b610af8565b6101f06103603660046117bf565b610ba4565b6101a3610373366004611990565b610bbb565b6101a3610386366004611a05565b610cd1565b6101a361039936600461187c565b610d98565b60006001600160e01b03198216635a05180f60e01b14806103c357506103c382610dbd565b92915050565b600080516020611e148339815191526103e181610df2565b6103ec848484610dff565b82846001600160a01b03167f8790cc6238d5595e48c16f8ab0f7bb594de43f92c9cededbc73f1043a5a195378460405161042a911515815260200190565b60405180910390a350505050565b600080516020611df483398151915261045081610df2565b60ca54821061047257604051636c8c0e7160e11b815260040160405180910390fd5b60cb80549083905560408051828152602081018590527f5e8daff369d4fc100bb21041db28b9959d722325e8e96d67f62cacf7430fcaa591015b60405180910390a1505050565b606060cc80548060200260200160405190810160405280929190818152602001828054801561050757602002820191906000526020600020905b8154815260200190600101908083116104f3575b5050505050905090565b60cc818154811061052157600080fd5b600091825260209091200154905081565b6001600160a01b038416600090815260c96020908152604080832088845290915290205460ff161561057757604051630231faf760e31b815260040160405180910390fd5b8260ff16601b1415801561058f57508260ff16601c14155b156105ad57604051632aea050d60e21b815260040160405180910390fd5b600061065d60ca87815481106105c5576105c5611a65565b9060005260206000200180546105da90611a7b565b80601f016020809104026020016040519081016040528092919081815260200182805461060690611a7b565b80156106535780601f1061062857610100808354040283529160200191610653565b820191906000526020600020905b81548152906001019060200180831161063657829003601f168201915b5050505050610e8c565b9050600061066d82868686610ec7565b9050856001600160a01b0316816001600160a01b0316146106a157604051632057875960e21b815260040160405180910390fd5b6106ad86886001610dff565b6040805160ff871681526020810186905290810184905287906001600160a01b038816907ff9e85d67fd10c2dd0202c1221003448f346b28afbeb3bcbcc4544ed032c049179060600160405180910390a350505050505050565b60008281526065602052604090206001015461072281610df2565b61072c8383610eef565b505050565b6001600160a01b03811633146107a65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107b08282610f11565b5050565b600054610100900460ff16158080156107d45750600054600160ff909116105b806107ee5750303b1580156107ee575060005460ff166001145b6108515760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161079d565b6000805460ff191660011790558015610874576000805461ff0019166101001790555b61087f600084610eef565b610897600080516020611df483398151915284610eef565b6108af600080516020611e1483398151915283610eef565b801561072c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016104ac565b60008281526097602052604081206109099083610f33565b9392505050565b33600090815260c96020908152604080832084845290915290205460ff161561094c57604051630231faf760e31b815260040160405180910390fd5b61095833826001610dff565b604051819033907f79abfa347949186dd2aab9e10622b23704ef7646387bfe22bf6a43b1de16fb3990600090a350565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060ca60cb54815481106109ca576109ca611a65565b9060005260206000200180546109df90611a7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0b90611a7b565b80156105075780601f10610a2d57610100808354040283529160200191610507565b820191906000526020600020905b815481529060010190602001808311610a3b57509395945050505050565b60006001600160a01b0382163b15610a7357506001919050565b60cc5460005b81811015610aee576001600160a01b038416600090815260c96020526040812060cc805491929184908110610ab057610ab0611a65565b6000918252602080832090910154835282019290925260400190205460ff1615610ade575060019392505050565b610ae781611acb565b9050610a79565b5060009392505050565b60ca8181548110610b0857600080fd5b906000526020600020016000915090508054610b2390611a7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4f90611a7b565b8015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b60008181526097602052604081206103c390610f3f565b600080516020611df4833981519152610bd381610df2565b60005b82811015610c285760ca54848483818110610bf357610bf3611a65565b9050602002013510610c1857604051636c8c0e7160e11b815260040160405180910390fd5b610c2181611acb565b9050610bd6565b50600060cc805480602002602001604051908101604052809291908181526020018280548015610c7757602002820191906000526020600020905b815481526020019060010190808311610c63575b50505050509050838360cc9190610c8f9291906116d4565b507f7a08cd4d8076e08d23c6543b0d17e2be01826237b85801f5217e43142d67b40b818585604051610cc393929190611ae4565b60405180910390a150505050565b600080516020611df4833981519152610ce981610df2565b60ca80546001810182556000919091527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee101610d26838583611b92565b5060ca54610d3a906101b390600190611c53565b7fc51edb2a65671d8f55ac76a92007ffc21abbc32897ddc88fa4a3a4c4ed9607338383604051610d6b929190611c66565b60405190819003902060ca54610d8390600190611c53565b604080519283526020830191909152016104ac565b600082815260656020526040902060010154610db381610df2565b61072c8383610f11565b60006001600160e01b03198216637965db0b60e01b14806103c357506301ffc9a760e01b6001600160e01b03198316146103c3565b610dfc8133610f49565b50565b60ca548210610e2157604051636c8c0e7160e11b815260040160405180910390fd5b6001600160a01b038316600081815260c960209081526040808320868452825291829020805460ff191685151590811790915591519182528492917f66760e9ee1f8138c12bebf3adf6fae271560cf0f4e42ce31350bb4a5b7a8b462910160405180910390a3505050565b6000610e988251610fad565b82604051602001610eaa929190611c76565b604051602081830303815290604052805190602001209050919050565b6000806000610ed8878787876110b6565b91509150610ee581611170565b5095945050505050565b610ef982826112b5565b600082815260976020526040902061072c908261133b565b610f1b8282611350565b600082815260976020526040902061072c90826113b7565b600061090983836113cc565b60006103c3825490565b610f538282610988565b6107b057610f6b816001600160a01b031660146113f6565b610f768360206113f6565b604051602001610f87929190611cd1565b60408051601f198184030181529082905262461bcd60e51b825261079d91600401611942565b606081600003610fd45750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610ffe5780610fe881611acb565b9150610ff79050600a83611d56565b9150610fd8565b60008167ffffffffffffffff81111561101957611019611b2e565b6040519080825280601f01601f191660200182016040528015611043576020820181803683370190505b5090505b84156110ae57611058600183611c53565b9150611065600a86611d6a565b611070906030611d7e565b60f81b81838151811061108557611085611a65565b60200101906001600160f81b031916908160001a9053506110a7600a86611d56565b9450611047565b949350505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156110e35750600090506003611167565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611137573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661116057600060019250925050611167565b9150600090505b94509492505050565b600081600481111561118457611184611d91565b0361118c5750565b60018160048111156111a0576111a0611d91565b036111e85760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161079d565b60028160048111156111fc576111fc611d91565b036112495760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161079d565b600381600481111561125d5761125d611d91565b03610dfc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161079d565b6112bf8282610988565b6107b05760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556112f73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610909836001600160a01b038416611592565b61135a8282610988565b156107b05760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610909836001600160a01b0384166115e1565b60008260000182815481106113e3576113e3611a65565b9060005260206000200154905092915050565b60606000611405836002611da7565b611410906002611d7e565b67ffffffffffffffff81111561142857611428611b2e565b6040519080825280601f01601f191660200182016040528015611452576020820181803683370190505b509050600360fc1b8160008151811061146d5761146d611a65565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061149c5761149c611a65565b60200101906001600160f81b031916908160001a90535060006114c0846002611da7565b6114cb906001611d7e565b90505b6001811115611543576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114ff576114ff611a65565b1a60f81b82828151811061151557611515611a65565b60200101906001600160f81b031916908160001a90535060049490941c9361153c81611dc6565b90506114ce565b5083156109095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079d565b60008181526001830160205260408120546115d9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103c3565b5060006103c3565b600081815260018301602052604081205480156116ca576000611605600183611c53565b855490915060009061161990600190611c53565b905081811461167e57600086600001828154811061163957611639611a65565b906000526020600020015490508087600001848154811061165c5761165c611a65565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061168f5761168f611ddd565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103c3565b60009150506103c3565b82805482825590600052602060002090810192821561170f579160200282015b8281111561170f5782358255916020019190600101906116f4565b5061171b92915061171f565b5090565b5b8082111561171b5760008155600101611720565b60006020828403121561174657600080fd5b81356001600160e01b03198116811461090957600080fd5b80356001600160a01b038116811461177557600080fd5b919050565b60008060006060848603121561178f57600080fd5b6117988461175e565b925060208401359150604084013580151581146117b457600080fd5b809150509250925092565b6000602082840312156117d157600080fd5b5035919050565b600081518084526020808501945080840160005b83811015611808578151875295820195908201906001016117ec565b509495945050505050565b60208152600061090960208301846117d8565b600080600080600060a0868803121561183e57600080fd5b8535945061184e6020870161175e565b9350604086013560ff8116811461186457600080fd5b94979396509394606081013594506080013592915050565b6000806040838503121561188f57600080fd5b8235915061189f6020840161175e565b90509250929050565b600080604083850312156118bb57600080fd5b6118c48361175e565b946020939093013593505050565b600080604083850312156118e557600080fd5b6118ee8361175e565b915061189f6020840161175e565b6000806040838503121561190f57600080fd5b50508035926020909101359150565b60005b83811015611939578181015183820152602001611921565b50506000910152565b602081526000825180602084015261196181604085016020870161191e565b601f01601f19169190910160400192915050565b60006020828403121561198757600080fd5b6109098261175e565b600080602083850312156119a357600080fd5b823567ffffffffffffffff808211156119bb57600080fd5b818501915085601f8301126119cf57600080fd5b8135818111156119de57600080fd5b8660208260051b85010111156119f357600080fd5b60209290920196919550909350505050565b60008060208385031215611a1857600080fd5b823567ffffffffffffffff80821115611a3057600080fd5b818501915085601f830112611a4457600080fd5b813581811115611a5357600080fd5b8660208285010111156119f357600080fd5b634e487b7160e01b600052603260045260246000fd5b600181811c90821680611a8f57607f821691505b602082108103611aaf57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611add57611add611ab5565b5060010190565b604081526000611af760408301866117d8565b82810360208401528381526001600160fb1b03841115611b1657600080fd5b8360051b808660208401370160200195945050505050565b634e487b7160e01b600052604160045260246000fd5b601f82111561072c57600081815260208120601f850160051c81016020861015611b6b5750805b601f850160051c820191505b81811015611b8a57828155600101611b77565b505050505050565b67ffffffffffffffff831115611baa57611baa611b2e565b611bbe83611bb88354611a7b565b83611b44565b6000601f841160018114611bf25760008515611bda5750838201355b600019600387901b1c1916600186901b178355611c4c565b600083815260209020601f19861690835b82811015611c235786850135825560209485019460019092019101611c03565b5086821015611c405760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b818103818111156103c3576103c3611ab5565b8183823760009101908152919050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351611cae81601a85016020880161191e565b835190830190611cc581601a84016020880161191e565b01601a01949350505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351611d0381601785016020880161191e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611d3481602884016020880161191e565b01602801949350505050565b634e487b7160e01b600052601260045260246000fd5b600082611d6557611d65611d40565b500490565b600082611d7957611d79611d40565b500690565b808201808211156103c3576103c3611ab5565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615611dc157611dc1611ab5565b500290565b600081611dd557611dd5611ab5565b506000190190565b634e487b7160e01b600052603160045260246000fdfe0d5ac11ce98a7539557343d2c66c127dd8d0e8fb181c5ec16cb674ddf827d1090c24059e922be4fa5a047081cbfa54efdf798eaf1522ed3f9b731a560ea8e28aa26469706673582212208f13422f32bf577b142f3fc4a3ac35c92d7745725ab6f2c5377795fbd8cf4a2f64736f6c63430008100033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101635760003560e01c806366e4b702116100ce578063a217fddf11610087578063a217fddf14610324578063babcc5391461032c578063c0aa0e8a1461033f578063ca15c87314610352578063d469d0c214610365578063d499ca5b14610378578063d547741f1461038b57600080fd5b806366e4b702146102a057806387a20680146102b55780639010d07c146102be57806390d63fa3146102e957806391d14854146102fc57806392ecf5771461030f57600080fd5b8063283762031161012057806328376203146102115780632c5783b1146102245780632f2ff15d1461023957806336568abe1461024c57806346db089d1461025f578063485cc9551461028d57600080fd5b806301ffc9a71461016857806302ffc7641461019057806308f419f4146101a5578063209b9833146101b8578063248a9ca3146101cd578063251e831b146101fe575b600080fd5b61017b610176366004611734565b61039e565b60405190151581526020015b60405180910390f35b6101a361019e36600461177a565b6103c9565b005b6101a36101b33660046117bf565b610438565b6101c06104b9565b6040516101879190611813565b6101f06101db3660046117bf565b60009081526065602052604090206001015490565b604051908152602001610187565b6101f061020c3660046117bf565b610511565b6101a361021f366004611826565b610532565b6101f0600080516020611df483398151915281565b6101a361024736600461187c565b610707565b6101a361025a36600461187c565b610731565b61017b61026d3660046118a8565b60c960209081526000928352604080842090915290825290205460ff1681565b6101a361029b3660046118d2565b6107b4565b6101f0600080516020611e1483398151915281565b6101f060cb5481565b6102d16102cc3660046118fc565b6108f1565b6040516001600160a01b039091168152602001610187565b6101a36102f73660046117bf565b610910565b61017b61030a36600461187c565b610988565b6103176109b3565b6040516101879190611942565b6101f0600081565b61017b61033a366004611975565b610a59565b61031761034d3660046117bf565b610af8565b6101f06103603660046117bf565b610ba4565b6101a3610373366004611990565b610bbb565b6101a3610386366004611a05565b610cd1565b6101a361039936600461187c565b610d98565b60006001600160e01b03198216635a05180f60e01b14806103c357506103c382610dbd565b92915050565b600080516020611e148339815191526103e181610df2565b6103ec848484610dff565b82846001600160a01b03167f8790cc6238d5595e48c16f8ab0f7bb594de43f92c9cededbc73f1043a5a195378460405161042a911515815260200190565b60405180910390a350505050565b600080516020611df483398151915261045081610df2565b60ca54821061047257604051636c8c0e7160e11b815260040160405180910390fd5b60cb80549083905560408051828152602081018590527f5e8daff369d4fc100bb21041db28b9959d722325e8e96d67f62cacf7430fcaa591015b60405180910390a1505050565b606060cc80548060200260200160405190810160405280929190818152602001828054801561050757602002820191906000526020600020905b8154815260200190600101908083116104f3575b5050505050905090565b60cc818154811061052157600080fd5b600091825260209091200154905081565b6001600160a01b038416600090815260c96020908152604080832088845290915290205460ff161561057757604051630231faf760e31b815260040160405180910390fd5b8260ff16601b1415801561058f57508260ff16601c14155b156105ad57604051632aea050d60e21b815260040160405180910390fd5b600061065d60ca87815481106105c5576105c5611a65565b9060005260206000200180546105da90611a7b565b80601f016020809104026020016040519081016040528092919081815260200182805461060690611a7b565b80156106535780601f1061062857610100808354040283529160200191610653565b820191906000526020600020905b81548152906001019060200180831161063657829003601f168201915b5050505050610e8c565b9050600061066d82868686610ec7565b9050856001600160a01b0316816001600160a01b0316146106a157604051632057875960e21b815260040160405180910390fd5b6106ad86886001610dff565b6040805160ff871681526020810186905290810184905287906001600160a01b038816907ff9e85d67fd10c2dd0202c1221003448f346b28afbeb3bcbcc4544ed032c049179060600160405180910390a350505050505050565b60008281526065602052604090206001015461072281610df2565b61072c8383610eef565b505050565b6001600160a01b03811633146107a65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107b08282610f11565b5050565b600054610100900460ff16158080156107d45750600054600160ff909116105b806107ee5750303b1580156107ee575060005460ff166001145b6108515760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161079d565b6000805460ff191660011790558015610874576000805461ff0019166101001790555b61087f600084610eef565b610897600080516020611df483398151915284610eef565b6108af600080516020611e1483398151915283610eef565b801561072c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016104ac565b60008281526097602052604081206109099083610f33565b9392505050565b33600090815260c96020908152604080832084845290915290205460ff161561094c57604051630231faf760e31b815260040160405180910390fd5b61095833826001610dff565b604051819033907f79abfa347949186dd2aab9e10622b23704ef7646387bfe22bf6a43b1de16fb3990600090a350565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060ca60cb54815481106109ca576109ca611a65565b9060005260206000200180546109df90611a7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0b90611a7b565b80156105075780601f10610a2d57610100808354040283529160200191610507565b820191906000526020600020905b815481529060010190602001808311610a3b57509395945050505050565b60006001600160a01b0382163b15610a7357506001919050565b60cc5460005b81811015610aee576001600160a01b038416600090815260c96020526040812060cc805491929184908110610ab057610ab0611a65565b6000918252602080832090910154835282019290925260400190205460ff1615610ade575060019392505050565b610ae781611acb565b9050610a79565b5060009392505050565b60ca8181548110610b0857600080fd5b906000526020600020016000915090508054610b2390611a7b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4f90611a7b565b8015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b60008181526097602052604081206103c390610f3f565b600080516020611df4833981519152610bd381610df2565b60005b82811015610c285760ca54848483818110610bf357610bf3611a65565b9050602002013510610c1857604051636c8c0e7160e11b815260040160405180910390fd5b610c2181611acb565b9050610bd6565b50600060cc805480602002602001604051908101604052809291908181526020018280548015610c7757602002820191906000526020600020905b815481526020019060010190808311610c63575b50505050509050838360cc9190610c8f9291906116d4565b507f7a08cd4d8076e08d23c6543b0d17e2be01826237b85801f5217e43142d67b40b818585604051610cc393929190611ae4565b60405180910390a150505050565b600080516020611df4833981519152610ce981610df2565b60ca80546001810182556000919091527f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee101610d26838583611b92565b5060ca54610d3a906101b390600190611c53565b7fc51edb2a65671d8f55ac76a92007ffc21abbc32897ddc88fa4a3a4c4ed9607338383604051610d6b929190611c66565b60405190819003902060ca54610d8390600190611c53565b604080519283526020830191909152016104ac565b600082815260656020526040902060010154610db381610df2565b61072c8383610f11565b60006001600160e01b03198216637965db0b60e01b14806103c357506301ffc9a760e01b6001600160e01b03198316146103c3565b610dfc8133610f49565b50565b60ca548210610e2157604051636c8c0e7160e11b815260040160405180910390fd5b6001600160a01b038316600081815260c960209081526040808320868452825291829020805460ff191685151590811790915591519182528492917f66760e9ee1f8138c12bebf3adf6fae271560cf0f4e42ce31350bb4a5b7a8b462910160405180910390a3505050565b6000610e988251610fad565b82604051602001610eaa929190611c76565b604051602081830303815290604052805190602001209050919050565b6000806000610ed8878787876110b6565b91509150610ee581611170565b5095945050505050565b610ef982826112b5565b600082815260976020526040902061072c908261133b565b610f1b8282611350565b600082815260976020526040902061072c90826113b7565b600061090983836113cc565b60006103c3825490565b610f538282610988565b6107b057610f6b816001600160a01b031660146113f6565b610f768360206113f6565b604051602001610f87929190611cd1565b60408051601f198184030181529082905262461bcd60e51b825261079d91600401611942565b606081600003610fd45750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610ffe5780610fe881611acb565b9150610ff79050600a83611d56565b9150610fd8565b60008167ffffffffffffffff81111561101957611019611b2e565b6040519080825280601f01601f191660200182016040528015611043576020820181803683370190505b5090505b84156110ae57611058600183611c53565b9150611065600a86611d6a565b611070906030611d7e565b60f81b81838151811061108557611085611a65565b60200101906001600160f81b031916908160001a9053506110a7600a86611d56565b9450611047565b949350505050565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156110e35750600090506003611167565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611137573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661116057600060019250925050611167565b9150600090505b94509492505050565b600081600481111561118457611184611d91565b0361118c5750565b60018160048111156111a0576111a0611d91565b036111e85760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161079d565b60028160048111156111fc576111fc611d91565b036112495760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161079d565b600381600481111561125d5761125d611d91565b03610dfc5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161079d565b6112bf8282610988565b6107b05760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556112f73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610909836001600160a01b038416611592565b61135a8282610988565b156107b05760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610909836001600160a01b0384166115e1565b60008260000182815481106113e3576113e3611a65565b9060005260206000200154905092915050565b60606000611405836002611da7565b611410906002611d7e565b67ffffffffffffffff81111561142857611428611b2e565b6040519080825280601f01601f191660200182016040528015611452576020820181803683370190505b509050600360fc1b8160008151811061146d5761146d611a65565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061149c5761149c611a65565b60200101906001600160f81b031916908160001a90535060006114c0846002611da7565b6114cb906001611d7e565b90505b6001811115611543576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114ff576114ff611a65565b1a60f81b82828151811061151557611515611a65565b60200101906001600160f81b031916908160001a90535060049490941c9361153c81611dc6565b90506114ce565b5083156109095760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079d565b60008181526001830160205260408120546115d9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103c3565b5060006103c3565b600081815260018301602052604081205480156116ca576000611605600183611c53565b855490915060009061161990600190611c53565b905081811461167e57600086600001828154811061163957611639611a65565b906000526020600020015490508087600001848154811061165c5761165c611a65565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061168f5761168f611ddd565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103c3565b60009150506103c3565b82805482825590600052602060002090810192821561170f579160200282015b8281111561170f5782358255916020019190600101906116f4565b5061171b92915061171f565b5090565b5b8082111561171b5760008155600101611720565b60006020828403121561174657600080fd5b81356001600160e01b03198116811461090957600080fd5b80356001600160a01b038116811461177557600080fd5b919050565b60008060006060848603121561178f57600080fd5b6117988461175e565b925060208401359150604084013580151581146117b457600080fd5b809150509250925092565b6000602082840312156117d157600080fd5b5035919050565b600081518084526020808501945080840160005b83811015611808578151875295820195908201906001016117ec565b509495945050505050565b60208152600061090960208301846117d8565b600080600080600060a0868803121561183e57600080fd5b8535945061184e6020870161175e565b9350604086013560ff8116811461186457600080fd5b94979396509394606081013594506080013592915050565b6000806040838503121561188f57600080fd5b8235915061189f6020840161175e565b90509250929050565b600080604083850312156118bb57600080fd5b6118c48361175e565b946020939093013593505050565b600080604083850312156118e557600080fd5b6118ee8361175e565b915061189f6020840161175e565b6000806040838503121561190f57600080fd5b50508035926020909101359150565b60005b83811015611939578181015183820152602001611921565b50506000910152565b602081526000825180602084015261196181604085016020870161191e565b601f01601f19169190910160400192915050565b60006020828403121561198757600080fd5b6109098261175e565b600080602083850312156119a357600080fd5b823567ffffffffffffffff808211156119bb57600080fd5b818501915085601f8301126119cf57600080fd5b8135818111156119de57600080fd5b8660208260051b85010111156119f357600080fd5b60209290920196919550909350505050565b60008060208385031215611a1857600080fd5b823567ffffffffffffffff80821115611a3057600080fd5b818501915085601f830112611a4457600080fd5b813581811115611a5357600080fd5b8660208285010111156119f357600080fd5b634e487b7160e01b600052603260045260246000fd5b600181811c90821680611a8f57607f821691505b602082108103611aaf57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611add57611add611ab5565b5060010190565b604081526000611af760408301866117d8565b82810360208401528381526001600160fb1b03841115611b1657600080fd5b8360051b808660208401370160200195945050505050565b634e487b7160e01b600052604160045260246000fd5b601f82111561072c57600081815260208120601f850160051c81016020861015611b6b5750805b601f850160051c820191505b81811015611b8a57828155600101611b77565b505050505050565b67ffffffffffffffff831115611baa57611baa611b2e565b611bbe83611bb88354611a7b565b83611b44565b6000601f841160018114611bf25760008515611bda5750838201355b600019600387901b1c1916600186901b178355611c4c565b600083815260209020601f19861690835b82811015611c235786850135825560209485019460019092019101611c03565b5086821015611c405760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b818103818111156103c3576103c3611ab5565b8183823760009101908152919050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351611cae81601a85016020880161191e565b835190830190611cc581601a84016020880161191e565b01601a01949350505050565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351611d0381601785016020880161191e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611d3481602884016020880161191e565b01602801949350505050565b634e487b7160e01b600052601260045260246000fd5b600082611d6557611d65611d40565b500490565b600082611d7957611d79611d40565b500690565b808201808211156103c3576103c3611ab5565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615611dc157611dc1611ab5565b500290565b600081611dd557611dd5611ab5565b506000190190565b634e487b7160e01b600052603160045260246000fdfe0d5ac11ce98a7539557343d2c66c127dd8d0e8fb181c5ec16cb674ddf827d1090c24059e922be4fa5a047081cbfa54efdf798eaf1522ed3f9b731a560ea8e28aa26469706673582212208f13422f32bf577b142f3fc4a3ac35c92d7745725ab6f2c5377795fbd8cf4a2f64736f6c63430008100033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.