Overview
TokenID
365867
Total Transfers
-
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 0 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
IdRegistry
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 100000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {SignatureChecker} from "openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {IIdRegistry} from "./interfaces/IIdRegistry.sol"; import {EIP712} from "./abstract/EIP712.sol"; import {Nonces} from "./abstract/Nonces.sol"; import {Signatures} from "./abstract/Signatures.sol"; import {Migration} from "./abstract/Migration.sol"; /** * @title Farcaster IdRegistry * * @notice See https://github.com/farcasterxyz/contracts/blob/v3.1.0/docs/docs.md for an overview. * * @custom:security-contact [email protected] */ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces { /*////////////////////////////////////////////////////////////// CONSTANTS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ string public constant name = "Farcaster FID"; /** * @inheritdoc IIdRegistry */ string public constant VERSION = "2023.11.15"; /** * @inheritdoc IIdRegistry */ bytes32 public constant TRANSFER_TYPEHASH = keccak256("Transfer(uint256 fid,address to,uint256 nonce,uint256 deadline)"); /** * @inheritdoc IIdRegistry */ bytes32 public constant TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH = keccak256("TransferAndChangeRecovery(uint256 fid,address to,address recovery,uint256 nonce,uint256 deadline)"); /** * @inheritdoc IIdRegistry */ bytes32 public constant CHANGE_RECOVERY_ADDRESS_TYPEHASH = keccak256("ChangeRecoveryAddress(uint256 fid,address from,address to,uint256 nonce,uint256 deadline)"); /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ address public idGateway; /** * @inheritdoc IIdRegistry */ bool public gatewayFrozen; /** * @inheritdoc IIdRegistry */ uint256 public idCounter; /** * @inheritdoc IIdRegistry */ mapping(address owner => uint256 fid) public idOf; /** * @inheritdoc IIdRegistry */ mapping(uint256 fid => address custody) public custodyOf; /** * @inheritdoc IIdRegistry */ mapping(uint256 fid => address recovery) public recoveryOf; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Set the owner of the contract to the provided _owner. * * @param _migrator Migrator address. * @param _initialOwner Initial owner address. * */ // solhint-disable-next-line no-empty-blocks constructor( address _migrator, address _initialOwner ) Migration(24 hours, _migrator, _initialOwner) EIP712("Farcaster IdRegistry", "1") {} /*////////////////////////////////////////////////////////////// REGISTRATION LOGIC //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ function register(address to, address recovery) external whenNotPaused returns (uint256 fid) { if (msg.sender != idGateway) revert Unauthorized(); /* Revert if the target(to) has an fid */ if (idOf[to] != 0) revert HasId(); /* Safety: idCounter won't realistically overflow. */ unchecked { /* Incrementing before assignment ensures that no one gets the 0 fid. */ fid = ++idCounter; } _unsafeRegister(fid, to, recovery); } /*////////////////////////////////////////////////////////////// TRANSFER LOGIC //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ function transfer(address to, uint256 deadline, bytes calldata sig) external { uint256 fromId = _validateTransfer(msg.sender, to); /* Revert if signature is invalid */ _verifyTransferSig({fid: fromId, to: to, deadline: deadline, signer: to, sig: sig}); _unsafeTransfer(fromId, msg.sender, to); } /** * @inheritdoc IIdRegistry */ function transferFor( address from, address to, uint256 fromDeadline, bytes calldata fromSig, uint256 toDeadline, bytes calldata toSig ) external { uint256 fromId = _validateTransfer(from, to); /* Revert if either signature is invalid */ _verifyTransferSig({fid: fromId, to: to, deadline: fromDeadline, signer: from, sig: fromSig}); _verifyTransferSig({fid: fromId, to: to, deadline: toDeadline, signer: to, sig: toSig}); _unsafeTransfer(fromId, from, to); } /** * @inheritdoc IIdRegistry */ function transferAndChangeRecovery(address to, address recovery, uint256 deadline, bytes calldata sig) external { uint256 fromId = _validateTransfer(msg.sender, to); /* Revert if signature is invalid */ _verifyTransferAndChangeRecoverySig({ fid: fromId, to: to, recovery: recovery, deadline: deadline, signer: to, sig: sig }); _unsafeTransfer(fromId, msg.sender, to); _unsafeChangeRecovery(fromId, recovery); } /** * @inheritdoc IIdRegistry */ function transferAndChangeRecoveryFor( address from, address to, address recovery, uint256 fromDeadline, bytes calldata fromSig, uint256 toDeadline, bytes calldata toSig ) external { uint256 fromId = _validateTransfer(from, to); /* Revert if either signature is invalid */ _verifyTransferAndChangeRecoverySig({ fid: fromId, to: to, recovery: recovery, deadline: fromDeadline, signer: from, sig: fromSig }); _verifyTransferAndChangeRecoverySig({ fid: fromId, to: to, recovery: recovery, deadline: toDeadline, signer: to, sig: toSig }); _unsafeTransfer(fromId, from, to); _unsafeChangeRecovery(fromId, recovery); } /** * @dev Retrieve fid and validate sender/recipient */ function _validateTransfer(address from, address to) internal view returns (uint256 fromId) { fromId = idOf[from]; /* Revert if the sender has no id */ if (fromId == 0) revert HasNoId(); /* Revert if recipient has an id */ if (idOf[to] != 0) revert HasId(); } /** * @dev Register the fid without checking invariants. */ function _unsafeRegister(uint256 id, address to, address recovery) internal { idOf[to] = id; custodyOf[id] = to; recoveryOf[id] = recovery; emit Register(to, id, recovery); } /** * @dev Transfer the fid to another address without checking invariants. */ function _unsafeTransfer(uint256 id, address from, address to) internal whenNotPaused { idOf[to] = id; custodyOf[id] = to; delete idOf[from]; emit Transfer(from, to, id); } /*////////////////////////////////////////////////////////////// RECOVERY LOGIC //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ function changeRecoveryAddress(address recovery) external whenNotPaused { /* Revert if the caller does not own an fid */ uint256 ownerId = idOf[msg.sender]; if (ownerId == 0) revert HasNoId(); _unsafeChangeRecovery(ownerId, recovery); } /** * @inheritdoc IIdRegistry */ function changeRecoveryAddressFor( address owner, address recovery, uint256 deadline, bytes calldata sig ) external whenNotPaused { /* Revert if the caller does not own an fid */ uint256 ownerId = idOf[owner]; if (ownerId == 0) revert HasNoId(); _verifyChangeRecoveryAddressSig({ fid: ownerId, from: recoveryOf[ownerId], to: recovery, deadline: deadline, signer: owner, sig: sig }); _unsafeChangeRecovery(ownerId, recovery); } /** * @dev Change recovery address without checking invariants. */ function _unsafeChangeRecovery(uint256 id, address recovery) internal whenNotPaused { /* Change the recovery address */ recoveryOf[id] = recovery; emit ChangeRecoveryAddress(id, recovery); } /** * @inheritdoc IIdRegistry */ function recover(address from, address to, uint256 deadline, bytes calldata sig) external { /* Revert if from does not own an fid */ uint256 fromId = idOf[from]; if (fromId == 0) revert HasNoId(); /* Revert if the caller is not the recovery address */ address caller = msg.sender; if (recoveryOf[fromId] != caller) revert Unauthorized(); /* Revert if destination(to) already has an fid */ if (idOf[to] != 0) revert HasId(); /* Revert if signature is invalid */ _verifyTransferSig({fid: fromId, to: to, deadline: deadline, signer: to, sig: sig}); emit Recover(from, to, fromId); _unsafeTransfer(fromId, from, to); } /** * @inheritdoc IIdRegistry */ function recoverFor( address from, address to, uint256 recoveryDeadline, bytes calldata recoverySig, uint256 toDeadline, bytes calldata toSig ) external { /* Revert if from does not own an fid */ uint256 fromId = idOf[from]; if (fromId == 0) revert HasNoId(); /* Revert if destination(to) already has an fid */ if (idOf[to] != 0) revert HasId(); /* Revert if either signature is invalid */ _verifyTransferSig({ fid: fromId, to: to, deadline: recoveryDeadline, signer: recoveryOf[fromId], sig: recoverySig }); _verifyTransferSig({fid: fromId, to: to, deadline: toDeadline, signer: to, sig: toSig}); emit Recover(from, to, fromId); _unsafeTransfer(fromId, from, to); } /*////////////////////////////////////////////////////////////// PERMISSIONED ACTIONS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ function setIdGateway(address _idGateway) external onlyOwner { if (gatewayFrozen) revert GatewayFrozen(); emit SetIdGateway(idGateway, _idGateway); idGateway = _idGateway; } /** * @inheritdoc IIdRegistry */ function freezeIdGateway() external onlyOwner { if (gatewayFrozen) revert GatewayFrozen(); emit FreezeIdGateway(idGateway); gatewayFrozen = true; } /*////////////////////////////////////////////////////////////// MIGRATION //////////////////////////////////////////////////////////////*/ function bulkRegisterIds(BulkRegisterData[] calldata ids) external onlyMigrator { // Safety: i can be incremented unchecked since it is bound by ids.length. unchecked { for (uint256 i = 0; i < ids.length; i++) { BulkRegisterData calldata id = ids[i]; if (idOf[id.custody] != 0) revert HasId(); _unsafeRegister(id.fid, id.custody, id.recovery); } } } function bulkRegisterIdsWithDefaultRecovery( BulkRegisterDefaultRecoveryData[] calldata ids, address recovery ) external onlyMigrator { // Safety: i can be incremented unchecked since it is bound by ids.length. unchecked { for (uint256 i = 0; i < ids.length; i++) { BulkRegisterDefaultRecoveryData calldata id = ids[i]; if (idOf[id.custody] != 0) revert HasId(); _unsafeRegister(id.fid, id.custody, recovery); } } } function bulkResetIds(uint24[] calldata ids) external onlyMigrator { // Safety: i can be incremented unchecked since it is bound by ids.length. unchecked { for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; address custody = custodyOf[id]; idOf[custody] = 0; custodyOf[id] = address(0); recoveryOf[id] = address(0); emit AdminReset(id); } } } function setIdCounter(uint256 _counter) external onlyMigrator { emit SetIdCounter(idCounter, _counter); idCounter = _counter; } /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IIdRegistry */ function verifyFidSignature( address custodyAddress, uint256 fid, bytes32 digest, bytes calldata sig ) external view returns (bool isValid) { isValid = idOf[custodyAddress] == fid && SignatureChecker.isValidSignatureNow(custodyAddress, digest, sig); } /*////////////////////////////////////////////////////////////// SIGNATURE VERIFICATION HELPERS //////////////////////////////////////////////////////////////*/ function _verifyTransferSig(uint256 fid, address to, uint256 deadline, address signer, bytes memory sig) internal { _verifySig( _hashTypedDataV4(keccak256(abi.encode(TRANSFER_TYPEHASH, fid, to, _useNonce(signer), deadline))), signer, deadline, sig ); } function _verifyTransferAndChangeRecoverySig( uint256 fid, address to, address recovery, uint256 deadline, address signer, bytes memory sig ) internal { _verifySig( _hashTypedDataV4( keccak256( abi.encode(TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH, fid, to, recovery, _useNonce(signer), deadline) ) ), signer, deadline, sig ); } function _verifyChangeRecoveryAddressSig( uint256 fid, address from, address to, uint256 deadline, address signer, bytes memory sig ) internal { _verifySig( _hashTypedDataV4( keccak256(abi.encode(CHANGE_RECOVERY_ADDRESS_TYPEHASH, fid, from, to, _useNonce(signer), deadline)) ), signer, deadline, sig ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Gnosis Safe. * * _Available since v4.1._ */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); return (error == ECDSA.RecoverError.NoError && recovered == signer) || isValidERC1271SignatureNow(signer, hash, signature); } /** * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated * against the signer smart contract using ERC1271. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidERC1271SignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IIdRegistry { /*////////////////////////////////////////////////////////////// STRUCTS //////////////////////////////////////////////////////////////*/ /** * @dev Struct argument for bulk register function, representing an FID * and its associated custody address and recovery address. * * @param fid Fid to add. * @param custody Custody address. * @param recovery Recovery address. */ struct BulkRegisterData { uint24 fid; address custody; address recovery; } /** * @dev Struct argument for bulk register function, representing an FID * and its associated custody address. * * @param fid Fid associated with provided keys to add. * @param custody Custody address. */ struct BulkRegisterDefaultRecoveryData { uint24 fid; address custody; } /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ /// @dev Revert when the caller does not have the authority to perform the action. error Unauthorized(); /// @dev Revert when the caller must have an fid but does not have one. error HasNoId(); /// @dev Revert when the destination must be empty but has an fid. error HasId(); /// @dev Revert when the gateway dependency is permanently frozen. error GatewayFrozen(); /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /** * @dev Emit an event when a new Farcaster ID is registered. * * Hubs listen for this and update their address-to-fid mapping by adding `to` as the * current owner of `id`. Hubs assume the invariants: * * 1. Two Register events can never emit with the same `id` * * 2. Two Register(alice, ..., ...) cannot emit unless a Transfer(alice, bob, ...) emits * in between, where bob != alice. * * @param to The custody address that owns the fid * @param id The fid that was registered. * @param recovery The address that can initiate a recovery request for the fid. */ event Register(address indexed to, uint256 indexed id, address recovery); /** * @dev Emit an event when an fid is transferred to a new custody address. * * Hubs listen to this event and atomically change the current owner of `id` * from `from` to `to` in their address-to-fid mapping. Hubs assume the invariants: * * 1. A Transfer(..., alice, ...) cannot emit if the most recent event for alice is * Register (alice, ..., ...) * * 2. A Transfer(alice, ..., id) cannot emit unless the most recent event with that id is * Transfer(..., alice, id) or Register(alice, id, ...) * * @param from The custody address that previously owned the fid. * @param to The custody address that now owns the fid. * @param id The fid that was transferred. */ event Transfer(address indexed from, address indexed to, uint256 indexed id); /** * @dev Emit an event when an fid is recovered. * * @param from The custody address that previously owned the fid. * @param to The custody address that now owns the fid. * @param id The fid that was recovered. */ event Recover(address indexed from, address indexed to, uint256 indexed id); /** * @dev Emit an event when a Farcaster ID's recovery address changes. It is possible for this * event to emit multiple times in a row with the same recovery address. * * @param id The fid whose recovery address was changed. * @param recovery The new recovery address. */ event ChangeRecoveryAddress(uint256 indexed id, address indexed recovery); /** * @dev Emit an event when the contract owner sets a new IdGateway address. * * @param oldIdGateway The old IdGateway address. * @param newIdGateway The new IdGateway address. */ event SetIdGateway(address oldIdGateway, address newIdGateway); /** * @dev Emit an event when the contract owner permanently freezes the IdGateway address. * * @param idGateway The permanent IdGateway address. */ event FreezeIdGateway(address idGateway); /** * @dev Emit an event when the migration admin sets the idCounter. * * @param oldCounter The previous idCounter value. * @param newCounter The new idCounter value. */ event SetIdCounter(uint256 oldCounter, uint256 newCounter); /** * @dev Emit an event when the migration admin resets an fid. * * @param fid The reset fid. */ event AdminReset(uint256 indexed fid); /*////////////////////////////////////////////////////////////// CONSTANTS //////////////////////////////////////////////////////////////*/ /** * @notice Defined for compatibility with tools like Etherscan that detect fid * transfers as token transfers. This is intentionally lowercased. */ function name() external view returns (string memory); /** * @notice Contract version specified in the Farcaster protocol version scheme. */ function VERSION() external view returns (string memory); /** * @notice EIP-712 typehash for Transfer signatures. */ function TRANSFER_TYPEHASH() external view returns (bytes32); /** * @notice EIP-712 typehash for TransferAndChangeRecovery signatures. */ function TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH() external view returns (bytes32); /** * @notice EIP-712 typehash for ChangeRecoveryAddress signatures. */ function CHANGE_RECOVERY_ADDRESS_TYPEHASH() external view returns (bytes32); /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /** * @notice Address of the IdGateway, an address allowed to register fids. */ function idGateway() external view returns (address); /** * @notice Whether the IdGateway address is permanently frozen. */ function gatewayFrozen() external view returns (bool); /** * @notice The last Farcaster id that was issued. */ function idCounter() external view returns (uint256); /** * @notice Maps each address to an fid, or zero if it does not own an fid. */ function idOf(address owner) external view returns (uint256 fid); /** * @notice Maps each fid to the address that currently owns it. */ function custodyOf(uint256 fid) external view returns (address owner); /** * @notice Maps each fid to an address that can initiate a recovery. */ function recoveryOf(uint256 fid) external view returns (address recovery); /*////////////////////////////////////////////////////////////// TRANSFER LOGIC //////////////////////////////////////////////////////////////*/ /** * @notice Transfer the fid owned by this address to another address that does not have an fid. * A signed Transfer message from the destination address must be provided. * * @param to The address to transfer the fid to. * @param deadline Expiration timestamp of the signature. * @param sig EIP-712 Transfer signature signed by the to address. */ function transfer(address to, uint256 deadline, bytes calldata sig) external; /** * @notice Transfer the fid owned by this address to another address that does not have an fid, * and change the fid's recovery address to the provided recovery address. This function * can be used to safely receive an fid from an untrusted address. * * A signed TransferAndChangeRecovery message from the destination address including the * new recovery must be provided. * * @param to The address to transfer the fid to. * @param recovery The new recovery address. * @param deadline Expiration timestamp of the signature. * @param sig EIP-712 Transfer signature signed by the to address. */ function transferAndChangeRecovery(address to, address recovery, uint256 deadline, bytes calldata sig) external; /** * @notice Transfer the fid owned by the from address to another address that does not * have an fid. Caller must provide two signed Transfer messages: one signed by * the from address and one signed by the to address. * * @param from The owner address of the fid to transfer. * @param to The address to transfer the fid to. * @param fromDeadline Expiration timestamp of the from signature. * @param fromSig EIP-712 Transfer signature signed by the from address. * @param toDeadline Expiration timestamp of the to signature. * @param toSig EIP-712 Transfer signature signed by the to address. */ function transferFor( address from, address to, uint256 fromDeadline, bytes calldata fromSig, uint256 toDeadline, bytes calldata toSig ) external; /** * @notice Transfer the fid owned by the from address to another address that does not * have an fid, and change the fid's recovery address to the provided recovery * address. This can be used to safely receive an fid transfer from an untrusted * address. Caller must provide two signed TransferAndChangeRecovery messages: * one signed by the from address and one signed by the to address. * * @param from The owner address of the fid to transfer. * @param to The address to transfer the fid to. * @param recovery The new recovery address. * @param fromDeadline Expiration timestamp of the from signature. * @param fromSig EIP-712 Transfer signature signed by the from address. * @param toDeadline Expiration timestamp of the to signature. * @param toSig EIP-712 Transfer signature signed by the to address. */ function transferAndChangeRecoveryFor( address from, address to, address recovery, uint256 fromDeadline, bytes calldata fromSig, uint256 toDeadline, bytes calldata toSig ) external; /*////////////////////////////////////////////////////////////// RECOVERY LOGIC //////////////////////////////////////////////////////////////*/ /** * @notice Change the recovery address of the fid owned by the caller. * * @param recovery The address which can recover the fid. Set to 0x0 to disable recovery. */ function changeRecoveryAddress(address recovery) external; /** * @notice Change the recovery address of fid owned by the owner. Caller must provide an * EIP-712 ChangeRecoveryAddress message signed by the owner. * * @param owner Custody address of the fid whose recovery address will be changed. * @param recovery The address which can recover the fid. Set to 0x0 to disable recovery. * @param deadline Expiration timestamp of the ChangeRecoveryAddress signature. * @param sig EIP-712 ChangeRecoveryAddress message signed by the owner address. */ function changeRecoveryAddressFor(address owner, address recovery, uint256 deadline, bytes calldata sig) external; /** * @notice Transfer the fid from the from address to the to address. Must be called by the * recovery address. A signed message from the to address must be provided. * * @param from The address that currently owns the fid. * @param to The address to transfer the fid to. * @param deadline Expiration timestamp of the signature. * @param sig EIP-712 Transfer signature signed by the to address. */ function recover(address from, address to, uint256 deadline, bytes calldata sig) external; /** * @notice Transfer the fid owned by the from address to another address that does not * have an fid. Caller must provide two signed Transfer messages: one signed by * the recovery address and one signed by the to address. * * @param from The owner address of the fid to transfer. * @param to The address to transfer the fid to. * @param recoveryDeadline Expiration timestamp of the recovery signature. * @param recoverySig EIP-712 Transfer signature signed by the recovery address. * @param toDeadline Expiration timestamp of the to signature. * @param toSig EIP-712 Transfer signature signed by the to address. */ function recoverFor( address from, address to, uint256 recoveryDeadline, bytes calldata recoverySig, uint256 toDeadline, bytes calldata toSig ) external; /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /** * @notice Verify that a signature was produced by the custody address that owns an fid. * * @param custodyAddress The address to check the signature of. * @param fid The fid to check the signature of. * @param digest The digest that was signed. * @param sig The signature to check. * * @return isValid Whether provided signature is valid. */ function verifyFidSignature( address custodyAddress, uint256 fid, bytes32 digest, bytes calldata sig ) external view returns (bool isValid); /*////////////////////////////////////////////////////////////// PERMISSIONED ACTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Registers an fid to the given address and sets up recovery. * May only be called by the configured IdGateway address. */ function register(address to, address recovery) external returns (uint256 fid); /** * @notice Set the IdGateway address allowed to register fids. Only callable by owner. * * @param _idGateway The new IdGateway address. */ function setIdGateway(address _idGateway) external; /** * @notice Permanently freeze the IdGateway address. Only callable by owner. */ function freezeIdGateway() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {EIP712 as EIP712Base} from "openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {IEIP712} from "../interfaces/abstract/IEIP712.sol"; abstract contract EIP712 is IEIP712, EIP712Base { constructor(string memory name, string memory version) EIP712Base(name, version) {} /*////////////////////////////////////////////////////////////// EIP-712 HELPERS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IEIP712 */ function domainSeparatorV4() external view returns (bytes32) { return _domainSeparatorV4(); } /** * @inheritdoc IEIP712 */ function hashTypedDataV4(bytes32 structHash) external view returns (bytes32) { return _hashTypedDataV4(structHash); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {Nonces as NoncesBase} from "openzeppelin-latest/contracts/utils/Nonces.sol"; import {INonces} from "../interfaces/abstract/INonces.sol"; abstract contract Nonces is INonces, NoncesBase { /*////////////////////////////////////////////////////////////// NONCE MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @inheritdoc INonces */ function useNonce() external returns (uint256) { return _useNonce(msg.sender); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {SignatureChecker} from "openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {ISignatures} from "../interfaces/abstract/ISignatures.sol"; abstract contract Signatures is ISignatures { /*////////////////////////////////////////////////////////////// SIGNATURE VERIFICATION HELPERS //////////////////////////////////////////////////////////////*/ function _verifySig(bytes32 digest, address signer, uint256 deadline, bytes memory sig) internal view { if (block.timestamp > deadline) revert SignatureExpired(); if (!SignatureChecker.isValidSignatureNow(signer, digest, sig)) { revert InvalidSignature(); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {Guardians} from "../abstract/Guardians.sol"; import {IMigration} from "../interfaces/abstract/IMigration.sol"; abstract contract Migration is IMigration, Guardians { /*////////////////////////////////////////////////////////////// IMMUTABLES //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IMigration */ uint24 public immutable gracePeriod; /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IMigration */ address public migrator; /** * @inheritdoc IMigration */ uint40 public migratedAt; /*////////////////////////////////////////////////////////////// MODIFIERS //////////////////////////////////////////////////////////////*/ /** * @notice Allow only the migrator to call the protected function. * Revoke permissions after the migration period. */ modifier onlyMigrator() { if (msg.sender != migrator) revert OnlyMigrator(); if (isMigrated() && block.timestamp > migratedAt + gracePeriod) { revert PermissionRevoked(); } _requirePaused(); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Set the grace period and migrator address. * Pauses contract at deployment time. * * @param _gracePeriod Migration grace period in seconds. * @param _initialOwner Initial owner address. Set as migrator. */ constructor(uint24 _gracePeriod, address _migrator, address _initialOwner) Guardians(_initialOwner) { gracePeriod = _gracePeriod; migrator = _migrator; emit SetMigrator(address(0), _migrator); _pause(); } /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IMigration */ function isMigrated() public view returns (bool) { return migratedAt != 0; } /*////////////////////////////////////////////////////////////// MIGRATION //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IMigration */ function migrate() external { if (msg.sender != migrator) revert OnlyMigrator(); if (isMigrated()) revert AlreadyMigrated(); _requirePaused(); migratedAt = uint40(block.timestamp); emit Migrated(migratedAt); } /*////////////////////////////////////////////////////////////// SET MIGRATOR //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IMigration */ function setMigrator(address _migrator) public onlyOwner { if (isMigrated()) revert AlreadyMigrated(); _requirePaused(); emit SetMigrator(migrator, _migrator); migrator = _migrator; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.8; import "./ECDSA.sol"; import "../ShortStrings.sol"; import "../../interfaces/IERC5267.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * _Available since v3.4._ * * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment */ abstract contract EIP712 is IERC5267 { using ShortStrings for *; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _cachedDomainSeparator; uint256 private immutable _cachedChainId; address private immutable _cachedThis; bytes32 private immutable _hashedName; bytes32 private immutable _hashedVersion; ShortString private immutable _name; ShortString private immutable _version; string private _nameFallback; string private _versionFallback; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { _name = name.toShortStringWithFallback(_nameFallback); _version = version.toShortStringWithFallback(_versionFallback); _hashedName = keccak256(bytes(name)); _hashedVersion = keccak256(bytes(version)); _cachedChainId = block.chainid; _cachedDomainSeparator = _buildDomainSeparator(); _cachedThis = address(this); } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _cachedThis && block.chainid == _cachedChainId) { return _cachedDomainSeparator; } else { return _buildDomainSeparator(); } } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {EIP-5267}. * * _Available since v4.9._ */ function eip712Domain() public view virtual override returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { return ( hex"0f", // 01111 _name.toStringWithFallback(_nameFallback), _version.toStringWithFallback(_versionFallback), block.chainid, address(this), bytes32(0), new uint256[](0) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IEIP712 { /*////////////////////////////////////////////////////////////// EIP-712 HELPERS //////////////////////////////////////////////////////////////*/ /** * @notice Helper view to read EIP-712 domain separator. * * @return bytes32 domain separator hash. */ function domainSeparatorV4() external view returns (bytes32); /** * @notice Helper view to hash EIP-712 typed data onchain. * * @param structHash EIP-712 typed data hash. * * @return bytes32 EIP-712 message digest. */ function hashTypedDataV4(bytes32 structHash) external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; /** * @dev Provides tracking nonces for addresses. Nonces will only increment. */ abstract contract Nonces { /** * @dev The nonce used for an `account` is not the expected current nonce. */ error InvalidAccountNonce(address account, uint256 currentNonce); mapping(address => uint256) private _nonces; /** * @dev Returns an the next unused nonce for an address. */ function nonces(address owner) public view virtual returns (uint256) { return _nonces[owner]; } /** * @dev Consumes a nonce. * * Returns the current value and increments nonce. */ function _useNonce(address owner) internal virtual returns (uint256) { // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be // decremented or reset. This guarantees that the nonce never overflows. unchecked { // It is important to do x++ and not ++x here. return _nonces[owner]++; } } /** * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`. */ function _useCheckedNonce(address owner, uint256 nonce) internal virtual returns (uint256) { uint256 current = _useNonce(owner); if (nonce != current) { revert InvalidAccountNonce(owner, current); } return current; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface INonces { /*////////////////////////////////////////////////////////////// NONCE MANAGEMENT //////////////////////////////////////////////////////////////*/ /** * @notice Increase caller's nonce, invalidating previous signatures. * * @return uint256 The caller's new nonce. */ function useNonce() external returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface ISignatures { /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ /// @dev Revert when the signature provided is invalid. error InvalidSignature(); /// @dev Revert when the block.timestamp is ahead of the signature deadline. error SignatureExpired(); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import {Ownable2Step} from "openzeppelin/contracts/access/Ownable2Step.sol"; import {Pausable} from "openzeppelin/contracts/security/Pausable.sol"; import {IGuardians} from "../interfaces/abstract/IGuardians.sol"; abstract contract Guardians is IGuardians, Ownable2Step, Pausable { /** * @notice Mapping of addresses to guardian status. */ mapping(address guardian => bool isGuardian) public guardians; /*////////////////////////////////////////////////////////////// MODIFIERS //////////////////////////////////////////////////////////////*/ /** * @notice Allow only the owner or a guardian to call the * protected function. */ modifier onlyGuardian() { if (msg.sender != owner() && !guardians[msg.sender]) { revert OnlyGuardian(); } _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /** * @notice Set the initial owner address. * * @param _initialOwner Address of the contract owner. */ constructor(address _initialOwner) { _transferOwnership(_initialOwner); } /*////////////////////////////////////////////////////////////// PERMISSIONED FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @inheritdoc IGuardians */ function addGuardian(address guardian) external onlyOwner { guardians[guardian] = true; emit Add(guardian); } /** * @inheritdoc IGuardians */ function removeGuardian(address guardian) external onlyOwner { guardians[guardian] = false; emit Remove(guardian); } /** * @inheritdoc IGuardians */ function pause() external onlyGuardian { _pause(); } /** * @inheritdoc IGuardians */ function unpause() external onlyOwner { _unpause(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IMigration { /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ /// @dev Revert if the caller is not the migrator. error OnlyMigrator(); /// @dev Revert if the migrator calls a migration function after the grace period. error PermissionRevoked(); /// @dev Revert if the migrator calls migrate more than once. error AlreadyMigrated(); /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /** * @dev Emit an event when the admin calls migrate(). Used to migrate * Hubs from reading events from one contract to another. * * @param migratedAt The timestamp at which the migration occurred. */ event Migrated(uint256 indexed migratedAt); /** * @notice Emit an event when the owner changes the migrator address. * * @param oldMigrator The address of the previous migrator. * @param newMigrator The address of the new migrator. */ event SetMigrator(address oldMigrator, address newMigrator); /*////////////////////////////////////////////////////////////// IMMUTABLES //////////////////////////////////////////////////////////////*/ /** * @notice Period in seconds after migration during which admin can continue to call protected * migration functions. Admins can make corrections to the migrated data during the * grace period if necessary, but cannot make changes after it expires. */ function gracePeriod() external view returns (uint24); /*////////////////////////////////////////////////////////////// STORAGE //////////////////////////////////////////////////////////////*/ /** * @notice Migration admin address. */ function migrator() external view returns (address); /** * @notice Timestamp at which data is migrated. Hubs will cut over to use this contract as their * source of truth after this timestamp. */ function migratedAt() external view returns (uint40); /*////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /** * @notice Check if the contract has been migrated. * * @return true if the contract has been migrated, false otherwise. */ function isMigrated() external view returns (bool); /*////////////////////////////////////////////////////////////// PERMISSIONED ACTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Set the time of the migration and emit an event. Hubs will watch this event and * cut over to use this contract as their source of truth after this timestamp. * Only callable by the migrator. */ function migrate() external; /** * @notice Set the migrator address. Only callable by owner. * * @param _migrator Migrator address. */ function setMigrator(address _migrator) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _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) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol) pragma solidity ^0.8.8; import "./StorageSlot.sol"; // | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | // | length | 0x BB | type ShortString is bytes32; /** * @dev This library provides functions to convert short memory strings * into a `ShortString` type that can be used as an immutable variable. * * Strings of arbitrary length can be optimized using this library if * they are short enough (up to 31 bytes) by packing them with their * length (1 byte) in a single EVM word (32 bytes). Additionally, a * fallback mechanism can be used for every other case. * * Usage example: * * ```solidity * contract Named { * using ShortStrings for *; * * ShortString private immutable _name; * string private _nameFallback; * * constructor(string memory contractName) { * _name = contractName.toShortStringWithFallback(_nameFallback); * } * * function name() external view returns (string memory) { * return _name.toStringWithFallback(_nameFallback); * } * } * ``` */ library ShortStrings { // Used as an identifier for strings longer than 31 bytes. bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; error StringTooLong(string str); error InvalidShortString(); /** * @dev Encode a string of at most 31 chars into a `ShortString`. * * This will trigger a `StringTooLong` error is the input string is too long. */ function toShortString(string memory str) internal pure returns (ShortString) { bytes memory bstr = bytes(str); if (bstr.length > 31) { revert StringTooLong(str); } return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); } /** * @dev Decode a `ShortString` back to a "normal" string. */ function toString(ShortString sstr) internal pure returns (string memory) { uint256 len = byteLength(sstr); // using `new string(len)` would work locally but is not memory safe. string memory str = new string(32); /// @solidity memory-safe-assembly assembly { mstore(str, len) mstore(add(str, 0x20), sstr) } return str; } /** * @dev Return the length of a `ShortString`. */ function byteLength(ShortString sstr) internal pure returns (uint256) { uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; if (result > 31) { revert InvalidShortString(); } return result; } /** * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. */ function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { if (bytes(value).length < 32) { return toShortString(value); } else { StorageSlot.getStringSlot(store).value = value; return ShortString.wrap(_FALLBACK_SENTINEL); } } /** * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. */ function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return toString(value); } else { return store; } } /** * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}. * * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. */ function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) { return byteLength(value); } else { return bytes(store).length; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) pragma solidity ^0.8.0; interface IERC5267 { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IGuardians { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ /** * @dev Emit an event when owner adds a new guardian address. * * @param guardian Address of the added guardian. */ event Add(address indexed guardian); /** * @dev Emit an event when owner removes a guardian address. * * @param guardian Address of the removed guardian. */ event Remove(address indexed guardian); /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ /// @dev Revert if an unauthorized caller calls a protected function. error OnlyGuardian(); /*////////////////////////////////////////////////////////////// PERMISSIONED FUNCTIONS //////////////////////////////////////////////////////////////*/ /** * @notice Add an address as a guardian. Only callable by owner. * * @param guardian Address of the guardian. */ function addGuardian(address guardian) external; /** * @notice Remove a guardian. Only callable by owner. * * @param guardian Address of the guardian. */ function removeGuardian(address guardian) external; /** * @notice Pause the contract. Only callable by owner or a guardian. */ function pause() external; /** * @notice Unpause the contract. Only callable by owner. */ function unpause() external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "remappings": [ "solmate/=lib/solmate/", "openzeppelin/=lib/openzeppelin-contracts/", "openzeppelin-latest/=lib/openzeppelin-latest/", "chainlink/=lib/chainlink-brownie-contracts/contracts/src/", "chainlink-brownie-contracts/=lib/chainlink-brownie-contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-latest/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 100000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_migrator","type":"address"},{"internalType":"address","name":"_initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyMigrated","type":"error"},{"inputs":[],"name":"GatewayFrozen","type":"error"},{"inputs":[],"name":"HasId","type":"error"},{"inputs":[],"name":"HasNoId","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"OnlyGuardian","type":"error"},{"inputs":[],"name":"OnlyMigrator","type":"error"},{"inputs":[],"name":"PermissionRevoked","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"}],"name":"Add","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fid","type":"uint256"}],"name":"AdminReset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"recovery","type":"address"}],"name":"ChangeRecoveryAddress","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"idGateway","type":"address"}],"name":"FreezeIdGateway","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"migratedAt","type":"uint256"}],"name":"Migrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Recover","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"recovery","type":"address"}],"name":"Register","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"}],"name":"Remove","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldCounter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCounter","type":"uint256"}],"name":"SetIdCounter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldIdGateway","type":"address"},{"indexed":false,"internalType":"address","name":"newIdGateway","type":"address"}],"name":"SetIdGateway","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldMigrator","type":"address"},{"indexed":false,"internalType":"address","name":"newMigrator","type":"address"}],"name":"SetMigrator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CHANGE_RECOVERY_ADDRESS_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"addGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint24","name":"fid","type":"uint24"},{"internalType":"address","name":"custody","type":"address"},{"internalType":"address","name":"recovery","type":"address"}],"internalType":"struct IIdRegistry.BulkRegisterData[]","name":"ids","type":"tuple[]"}],"name":"bulkRegisterIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint24","name":"fid","type":"uint24"},{"internalType":"address","name":"custody","type":"address"}],"internalType":"struct IIdRegistry.BulkRegisterDefaultRecoveryData[]","name":"ids","type":"tuple[]"},{"internalType":"address","name":"recovery","type":"address"}],"name":"bulkRegisterIdsWithDefaultRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24[]","name":"ids","type":"uint24[]"}],"name":"bulkResetIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recovery","type":"address"}],"name":"changeRecoveryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"recovery","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"changeRecoveryAddressFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fid","type":"uint256"}],"name":"custodyOf","outputs":[{"internalType":"address","name":"custody","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domainSeparatorV4","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeIdGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gatewayFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gracePeriod","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"guardians","outputs":[{"internalType":"bool","name":"isGuardian","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"structHash","type":"bytes32"}],"name":"hashTypedDataV4","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"idCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"idGateway","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"idOf","outputs":[{"internalType":"uint256","name":"fid","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMigrated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"migratedAt","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"migrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"recoveryDeadline","type":"uint256"},{"internalType":"bytes","name":"recoverySig","type":"bytes"},{"internalType":"uint256","name":"toDeadline","type":"uint256"},{"internalType":"bytes","name":"toSig","type":"bytes"}],"name":"recoverFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fid","type":"uint256"}],"name":"recoveryOf","outputs":[{"internalType":"address","name":"recovery","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"recovery","type":"address"}],"name":"register","outputs":[{"internalType":"uint256","name":"fid","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"removeGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_counter","type":"uint256"}],"name":"setIdCounter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_idGateway","type":"address"}],"name":"setIdGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_migrator","type":"address"}],"name":"setMigrator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"recovery","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"transferAndChangeRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"recovery","type":"address"},{"internalType":"uint256","name":"fromDeadline","type":"uint256"},{"internalType":"bytes","name":"fromSig","type":"bytes"},{"internalType":"uint256","name":"toDeadline","type":"uint256"},{"internalType":"bytes","name":"toSig","type":"bytes"}],"name":"transferAndChangeRecoveryFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"fromDeadline","type":"uint256"},{"internalType":"bytes","name":"fromSig","type":"bytes"},{"internalType":"uint256","name":"toDeadline","type":"uint256"},{"internalType":"bytes","name":"toSig","type":"bytes"}],"name":"transferFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"custodyAddress","type":"address"},{"internalType":"uint256","name":"fid","type":"uint256"},{"internalType":"bytes32","name":"digest","type":"bytes32"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"verifyFidSignature","outputs":[{"internalType":"bool","name":"isValid","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101806040523480156200001257600080fd5b5060405162003b7e38038062003b7e8339810160408190526200003591620003be565b6040518060400160405280601481526020017f4661726361737465722049645265676973747279000000000000000000000000815250604051806040016040528060018152602001603160f81b815250818162015180868680620000a8620000a2620001f460201b60201c565b620001f8565b6001805460ff60a01b19169055620000c081620001f8565b5062ffffff8316608052600380546001600160a01b0319166001600160a01b038416908117909155604080516000815260208101929092527fd8ad954fe808212ab9ed7139873e40807dff7995fe36e3d6cdeb8fa00fcebf10910160405180910390a16200012d62000216565b506200013f9150839050600462000279565b610140526200015081600562000279565b61016052815160208084019190912061010052815190820120610120524660c052620001e06101005161012051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60a05250503060e05250620005dc92505050565b3390565b600180546001600160a01b03191690556200021381620002b2565b50565b6200022062000302565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586200025c3390565b6040516001600160a01b03909116815260200160405180910390a1565b6000602083511015620002995762000291836200035e565b9050620002ac565b81620002a684826200049b565b5060ff90505b92915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b62000316600154600160a01b900460ff1690565b156200035c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064015b60405180910390fd5b565b600080829050601f815111156200038c578260405163305a27a960e01b815260040162000353919062000567565b80516200039982620005b7565b179392505050565b80516001600160a01b0381168114620003b957600080fd5b919050565b60008060408385031215620003d257600080fd5b620003dd83620003a1565b9150620003ed60208401620003a1565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200042157607f821691505b6020821081036200044257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200049657600081815260208120601f850160051c81016020861015620004715750805b601f850160051c820191505b8181101562000492578281556001016200047d565b5050505b505050565b81516001600160401b03811115620004b757620004b7620003f6565b620004cf81620004c884546200040c565b8462000448565b602080601f831160018114620005075760008415620004ee5750858301515b600019600386901b1c1916600185901b17855562000492565b600085815260208120601f198616915b82811015620005385788860151825594840194600190910190840162000517565b5085821015620005575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b81811015620005965785810183015185820160400152820162000578565b506000604082860101526040601f19601f8301168501019250505092915050565b80516020808301519190811015620004425760001960209190910360031b1b16919050565b60805160a05160c05160e051610100516101205161014051610160516135206200065e60003960006112ec015260006112c101526000612768015260006127400152600061269b015260006126c5015260006126ef0152600081816106ae01528181610f70015281816113dd015281816118580152611eae01526135206000f3fe608060405234801561001057600080fd5b506004361061032a5760003560e01c806384b0196e116101b2578063ba656434116100f9578063ea2bbb83116100a2578063f2fde38b1161007c578063f2fde38b1461081c578063fa1a1b251461082f578063ff12644114610865578063ffa1ad741461087857600080fd5b8063ea2bbb83146107d9578063eb08ab2814610800578063f1f0b2241461080957600080fd5b8063d94fe832116100d3578063d94fe83214610793578063ddd76649146107b3578063e30c3978146107bb57600080fd5b8063ba65643414610746578063be45fd6214610759578063d5bac7f31461076c57600080fd5b80639cbef8dc1161015b578063a5ed6a6a11610135578063a5ed6a6a146106f7578063aa6773541461070a578063b06faf621461071d57600080fd5b80639cbef8dc14610696578063a06db7dc146106a9578063a526d83b146106e457600080fd5b80638da5cb5b1161018c5780638da5cb5b1461064b5780638fd3ab801461066957806395e7549f1461067157600080fd5b806384b0196e146105de5780638b21e484146105f95780638d8043e21461063857600080fd5b80634c5cbb3411610276578063715018a61161021f5780637cd07e47116101f95780637cd07e47146105805780637ecebe00146105a05780638456cb59146105d657600080fd5b8063715018a61461056857806378e890ba1461057057806379ba50971461057857600080fd5b806365269e471161025057806365269e471461050257806369615a4c14610538578063714041561461055557600080fd5b80634c5cbb34146104b957806355c5b358146104cc5780635c975abb146104df57600080fd5b80632a42ede3116102d85780633f4ba83a116102b25780633f4ba83a146104595780634980f288146104615780634b57a6001461047457600080fd5b80632a42ede31461042057806332faac70146104335780633ab8465d1461044657600080fd5b806306fdde031161030957806306fdde03146103b157806316f72842146103fa57806323cf31181461040d57600080fd5b8062bf26f41461032f578063033e2cb3146103695780630633b14a1461037e575b600080fd5b6103567fcdbe3d2a782931ab7e1b568857680f9812900b4702ab75d82ddfd270aaf595f581565b6040519081526020015b60405180910390f35b61037c610377366004612de0565b6108b4565b005b6103a161038c366004612de0565b60026020526000908152604090205460ff1681565b6040519015158152602001610360565b6103ed6040518060400160405280600d81526020017f466172636173746572204649440000000000000000000000000000000000000081525081565b6040516103609190612e70565b61037c610408366004612ec5565b6109ac565b61037c61041b366004612de0565b610a56565b61037c61042e366004612f69565b610b5a565b6103a1610441366004612fd8565b610d28565b61037c610454366004612f69565b610da2565b61037c610e11565b61035661046f366004613023565b610e23565b6007546104949073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610360565b61037c6104c736600461303c565b610e34565b61037c6104da3660046130f3565b610eeb565b60015474010000000000000000000000000000000000000000900460ff166103a1565b610494610510366004613023565b600a6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b336000908152600660205260409020805460018101909155610356565b61037c610563366004612de0565b6110ea565b61037c611166565b610356611178565b61037c611182565b6003546104949073ffffffffffffffffffffffffffffffffffffffff1681565b6103566105ae366004612de0565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205490565b61037c61123c565b6105e66112b3565b6040516103609796959493929190613168565b6003546106229074010000000000000000000000000000000000000000900464ffffffffff1681565b60405164ffffffffff9091168152602001610360565b61037c610646366004613227565b611358565b60005473ffffffffffffffffffffffffffffffffffffffff16610494565b61037c611544565b6007546103a19074010000000000000000000000000000000000000000900460ff1681565b61037c6106a4366004612f69565b611675565b6106d07f000000000000000000000000000000000000000000000000000000000000000081565b60405162ffffff9091168152602001610360565b61037c6106f2366004612de0565b611754565b61037c610705366004613023565b6117d3565b6103566107183660046132ab565b61192b565b60035474010000000000000000000000000000000000000000900464ffffffffff1615156103a1565b61037c610754366004612ec5565b6119fa565b61037c6107673660046132de565b611bcb565b6103567f73452d4f5155a3eca764048760f921bf1c1895c2982c18744c2cee4cf9bffc2b81565b6103566107a1366004612de0565b60096020526000908152604090205481565b61037c611c2e565b60015473ffffffffffffffffffffffffffffffffffffffff16610494565b6103567f945a10ef569bd76eee6deb46dcc4541142d52149c7015b1cf0a68ead33382a9b81565b61035660085481565b61037c610817366004612de0565b611d19565b61037c61082a366004612de0565b611d79565b61049461083d366004613023565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b61037c610873366004613338565b611e29565b6103ed6040518060400160405280600a81526020017f323032332e31312e31350000000000000000000000000000000000000000000081525081565b6108bc61201e565b60075474010000000000000000000000000000000000000000900460ff1615610911576040517f351f92c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f306b123921c19a8629c68977f4dfea9ef9d5a6dedfafcd0d4a70ac6c9b763ac2910160405180910390a1600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006109b8898961209f565b90506109fd8189898c8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b610a408189868b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b610a4b818a8a612219565b505050505050505050565b610a5e61201e565b60035474010000000000000000000000000000000000000000900464ffffffffff1615610ab7576040517fca1c3cbc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610abf6122bb565b6003546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fd8ad954fe808212ab9ed7139873e40807dff7995fe36e3d6cdeb8fa00fcebf10910160405180910390a1600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff851660009081526009602052604081205490819003610bba576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600b6020526040902054339073ffffffffffffffffffffffffffffffffffffffff168114610c19576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff861660009081526009602052604090205415610c76576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cb98287878988888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b818673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167ff6891c84a6c6af32a6d052172a8acc4c631b1d5057ffa2bc1da268b6938ea2da60405160405180910390a4610d1f828888612219565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff851660009081526009602052604081205485148015610d985750610d98868585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061233f92505050565b9695505050505050565b6000610dae338761209f565b9050610df4818787878a88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610dff813388612219565b610e098186612457565b505050505050565b610e1961201e565b610e216124dd565b565b6000610e2e8261255a565b92915050565b6000610e408a8a61209f565b9050610e86818a8a8a8e8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610eca818a8a878d88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610ed5818b8b612219565b610edf8189612457565b50505050505050505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314610f3c576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff1615158015610fc35750600354610fb9907f000000000000000000000000000000000000000000000000000000000000000062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15610ffa576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110026122bb565b60005b818110156110e05736838383818110611020576110206133e7565b90506060020190506009600082602001602081019061103f9190612de0565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020541561109d576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110d76110ad6020830183613416565b62ffffff166110c26040840160208501612de0565b6110d26060850160408601612de0565b6125a2565b50600101611005565b505050565b905090565b6110f261201e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fbe7c7ac3248df4581c206a84aab3cb4e7d521b5398b42b681757f78a5a7d411e9190a250565b61116e61201e565b610e216000612650565b60006110e5612681565b600154339073ffffffffffffffffffffffffffffffffffffffff168114611230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61123981612650565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061127457503360009081526002602052604090205460ff16155b156112ab576040517fcae1d95600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e216127b9565b6000606080828080836112e77f00000000000000000000000000000000000000000000000000000000000000006004612828565b6113127f00000000000000000000000000000000000000000000000000000000000000006005612828565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146113a9576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16151580156114305750600354611426907f000000000000000000000000000000000000000000000000000000000000000062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15611467576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61146f6122bb565b60005b8281101561153e573684848381811061148d5761148d6133e7565b9050604002019050600960008260200160208101906114ac9190612de0565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020541561150a576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61153561151a6020830183613416565b62ffffff1661152f6040840160208501612de0565b856125a2565b50600101611472565b50505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314611595576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16156115ee576040517fca1c3cbc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115f66122bb565b600380547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000004264ffffffffff90811682029290921792839055604051920416907fe4a25c0c2cbe89d6ad8b64c61a7dbdd20d1f781f6023f1ab94ebb7fe0aef6ab890600090a2565b61167d6128d3565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260096020526040812054908190036116dd576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dff81600b600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687878a88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061295892505050565b61175c61201e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f87dc5eecd6d6bdeae407c426da6bfba5b7190befc554ed5d4d62dd5cf939fbae9190a250565b60035473ffffffffffffffffffffffffffffffffffffffff163314611824576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16151580156118ab57506003546118a1907f000000000000000000000000000000000000000000000000000000000000000062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b156118e2576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ea6122bb565b60085460408051918252602082018390527f562044dce594b5c0ac495e6cf3717dbef4dcc96bf978ff452457bfccd68a4eed910160405180910390a1600855565b60006119356128d3565b60075473ffffffffffffffffffffffffffffffffffffffff163314611986576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260096020526040902054156119e3576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506008805460010190819055610e2e8184846125a2565b73ffffffffffffffffffffffffffffffffffffffff881660009081526009602052604081205490819003611a5a576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff881660009081526009602052604090205415611ab7576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600b6020908152604091829020548251601f8901839004830281018301909352878352611b229284928c928c9273ffffffffffffffffffffffffffffffffffffffff909116918c908c908190840183828082843760009201919091525061215c92505050565b611b658189868b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b808873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167ff6891c84a6c6af32a6d052172a8acc4c631b1d5057ffa2bc1da268b6938ea2da60405160405180910390a4610a4b818a8a612219565b6000611bd7338661209f565b9050611c1c8186868887878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b611c27813387612219565b5050505050565b611c3661201e565b60075474010000000000000000000000000000000000000000900460ff1615611c8b576040517f351f92c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075460405173ffffffffffffffffffffffffffffffffffffffff90911681527f1f54688ee839cb2e57222a4f7482fd67a532a36666748891a7634428b2e8a1539060200160405180910390a1600780547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b611d216128d3565b3360009081526009602052604081205490819003611d6b576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d758183612457565b5050565b611d8161201e565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611de460005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60035473ffffffffffffffffffffffffffffffffffffffff163314611e7a576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff1615158015611f015750600354611ef7907f000000000000000000000000000000000000000000000000000000000000000062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15611f38576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f406122bb565b60005b818110156110e0576000838383818110611f5f57611f5f6133e7565b9050602002016020810190611f749190613416565b62ffffff166000818152600a60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff168085526009845282852085905585855281547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909255600b90935281842080549091169055519293509183917f8b4b4c6da5b89da518fb865149e01ad2863b48861a8b952e11645f663959fa7091a25050600101611f43565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611227565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260096020526040812054908190036120ff576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526009602052604090205415610e2e576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c276122117fcdbe3d2a782931ab7e1b568857680f9812900b4702ab75d82ddfd270aaf595f587876121b98773ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b60408051602081019590955284019290925273ffffffffffffffffffffffffffffffffffffffff166060830152608082015260a0810186905260c0015b6040516020818303038152906040528051906020012061255a565b8385846129b6565b6122216128d3565b73ffffffffffffffffffffffffffffffffffffffff8082166000818152600960208181526040808420899055888452600a825280842080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168617905594871680845291905283822082905592518693917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60015474010000000000000000000000000000000000000000900460ff16610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611227565b600080600061234e8585612a31565b909250905060008160048111156123675761236761343b565b14801561239f57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610d985750610d98868686612a76565b610e096122117f945a10ef569bd76eee6deb46dcc4541142d52149c7015b1cf0a68ead33382a9b88888861240e8873ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b60408051602081019690965285019390935273ffffffffffffffffffffffffffffffffffffffff918216606085015216608083015260a082015260c0810186905260e0016121f6565b61245f6128d3565b6000828152600b602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85169081179091559051909184917f8e700b803af43e14651431cd73c9fe7d11b131ad797576a70b893ce5766f65c39190a35050565b6124e56122bb565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6000610e2e612567612681565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b73ffffffffffffffffffffffffffffffffffffffff8281166000818152600960209081526040808320889055878352600a825280832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081168617909155600b8352928190208054909316948616948517909255905192835285927ff2e19a901b0748d8b08e428d0468896a039ac751ec4fec49b44b7b9c28097e45910160405180910390a3505050565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561123981612bd3565b60003073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156126e757507f000000000000000000000000000000000000000000000000000000000000000046145b1561271157507f000000000000000000000000000000000000000000000000000000000000000090565b6110e5604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6127c16128d3565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125303390565b606060ff83146128425761283b83612c48565b9050610e2e565b81805461284e9061346a565b80601f016020809104026020016040519081016040528092919081815260200182805461287a9061346a565b80156128c75780601f1061289c576101008083540402835291602001916128c7565b820191906000526020600020905b8154815290600101906020018083116128aa57829003601f168201915b50505050509050610e2e565b60015474010000000000000000000000000000000000000000900460ff1615610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611227565b610e096122117f73452d4f5155a3eca764048760f921bf1c1895c2982c18744c2cee4cf9bffc2b88888861240e8873ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b814211156129f0576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6129fb83858361233f565b61153e576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808251604103612a675760208301516040840151606085015160001a612a5b87828585612c87565b94509450505050612a6f565b506000905060025b9250929050565b60008060008573ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8686604051602401612aad9291906134bd565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612b3691906134de565b600060405180830381855afa9150503d8060008114612b71576040519150601f19603f3d011682016040523d82523d6000602084013e612b76565b606091505b5091509150818015612b8a57506020815110155b8015610d98575080517f1626ba7e0000000000000000000000000000000000000000000000000000000090612bc890830160209081019084016134fa565b149695505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606000612c5583612d76565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612cbe5750600090506003612d6d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612d12573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116612d6657600060019250925050612d6d565b9150600090505b94509492505050565b600060ff8216601f811115610e2e576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114612ddb57600080fd5b919050565b600060208284031215612df257600080fd5b612dfb82612db7565b9392505050565b60005b83811015612e1d578181015183820152602001612e05565b50506000910152565b60008151808452612e3e816020860160208601612e02565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612dfb6020830184612e26565b60008083601f840112612e9557600080fd5b50813567ffffffffffffffff811115612ead57600080fd5b602083019150836020828501011115612a6f57600080fd5b60008060008060008060008060c0898b031215612ee157600080fd5b612eea89612db7565b9750612ef860208a01612db7565b965060408901359550606089013567ffffffffffffffff80821115612f1c57600080fd5b612f288c838d01612e83565b909750955060808b0135945060a08b0135915080821115612f4857600080fd5b50612f558b828c01612e83565b999c989b5096995094979396929594505050565b600080600080600060808688031215612f8157600080fd5b612f8a86612db7565b9450612f9860208701612db7565b935060408601359250606086013567ffffffffffffffff811115612fbb57600080fd5b612fc788828901612e83565b969995985093965092949392505050565b600080600080600060808688031215612ff057600080fd5b612ff986612db7565b94506020860135935060408601359250606086013567ffffffffffffffff811115612fbb57600080fd5b60006020828403121561303557600080fd5b5035919050565b600080600080600080600080600060e08a8c03121561305a57600080fd5b6130638a612db7565b985061307160208b01612db7565b975061307f60408b01612db7565b965060608a0135955060808a013567ffffffffffffffff808211156130a357600080fd5b6130af8d838e01612e83565b909750955060a08c0135945060c08c01359150808211156130cf57600080fd5b506130dc8c828d01612e83565b915080935050809150509295985092959850929598565b6000806020838503121561310657600080fd5b823567ffffffffffffffff8082111561311e57600080fd5b818501915085601f83011261313257600080fd5b81358181111561314157600080fd5b86602060608302850101111561315657600080fd5b60209290920196919550909350505050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e0818401526131a460e084018a612e26565b83810360408501526131b6818a612e26565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015613215578351835292840192918401916001016131f9565b50909c9b505050505050505050505050565b60008060006040848603121561323c57600080fd5b833567ffffffffffffffff8082111561325457600080fd5b818601915086601f83011261326857600080fd5b81358181111561327757600080fd5b8760208260061b850101111561328c57600080fd5b6020928301955093506132a29186019050612db7565b90509250925092565b600080604083850312156132be57600080fd5b6132c783612db7565b91506132d560208401612db7565b90509250929050565b600080600080606085870312156132f457600080fd5b6132fd85612db7565b935060208501359250604085013567ffffffffffffffff81111561332057600080fd5b61332c87828801612e83565b95989497509550505050565b6000806020838503121561334b57600080fd5b823567ffffffffffffffff8082111561336357600080fd5b818501915085601f83011261337757600080fd5b81358181111561338657600080fd5b8660208260051b850101111561315657600080fd5b64ffffffffff8181168382160190808211156133e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561342857600080fd5b813562ffffff81168114612dfb57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c9082168061347e57607f821691505b6020821081036134b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8281526040602082015260006134d66040830184612e26565b949350505050565b600082516134f0818460208701612e02565b9190910192915050565b60006020828403121561350c57600080fd5b505191905056fea164736f6c6343000815000a0000000000000000000000002d93c2f74b2c4697f9ea85d0450148aa45d4d5a2000000000000000000000000299707e127cc77de01b9fd968bc0ff475f3c6342
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061032a5760003560e01c806384b0196e116101b2578063ba656434116100f9578063ea2bbb83116100a2578063f2fde38b1161007c578063f2fde38b1461081c578063fa1a1b251461082f578063ff12644114610865578063ffa1ad741461087857600080fd5b8063ea2bbb83146107d9578063eb08ab2814610800578063f1f0b2241461080957600080fd5b8063d94fe832116100d3578063d94fe83214610793578063ddd76649146107b3578063e30c3978146107bb57600080fd5b8063ba65643414610746578063be45fd6214610759578063d5bac7f31461076c57600080fd5b80639cbef8dc1161015b578063a5ed6a6a11610135578063a5ed6a6a146106f7578063aa6773541461070a578063b06faf621461071d57600080fd5b80639cbef8dc14610696578063a06db7dc146106a9578063a526d83b146106e457600080fd5b80638da5cb5b1161018c5780638da5cb5b1461064b5780638fd3ab801461066957806395e7549f1461067157600080fd5b806384b0196e146105de5780638b21e484146105f95780638d8043e21461063857600080fd5b80634c5cbb3411610276578063715018a61161021f5780637cd07e47116101f95780637cd07e47146105805780637ecebe00146105a05780638456cb59146105d657600080fd5b8063715018a61461056857806378e890ba1461057057806379ba50971461057857600080fd5b806365269e471161025057806365269e471461050257806369615a4c14610538578063714041561461055557600080fd5b80634c5cbb34146104b957806355c5b358146104cc5780635c975abb146104df57600080fd5b80632a42ede3116102d85780633f4ba83a116102b25780633f4ba83a146104595780634980f288146104615780634b57a6001461047457600080fd5b80632a42ede31461042057806332faac70146104335780633ab8465d1461044657600080fd5b806306fdde031161030957806306fdde03146103b157806316f72842146103fa57806323cf31181461040d57600080fd5b8062bf26f41461032f578063033e2cb3146103695780630633b14a1461037e575b600080fd5b6103567fcdbe3d2a782931ab7e1b568857680f9812900b4702ab75d82ddfd270aaf595f581565b6040519081526020015b60405180910390f35b61037c610377366004612de0565b6108b4565b005b6103a161038c366004612de0565b60026020526000908152604090205460ff1681565b6040519015158152602001610360565b6103ed6040518060400160405280600d81526020017f466172636173746572204649440000000000000000000000000000000000000081525081565b6040516103609190612e70565b61037c610408366004612ec5565b6109ac565b61037c61041b366004612de0565b610a56565b61037c61042e366004612f69565b610b5a565b6103a1610441366004612fd8565b610d28565b61037c610454366004612f69565b610da2565b61037c610e11565b61035661046f366004613023565b610e23565b6007546104949073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610360565b61037c6104c736600461303c565b610e34565b61037c6104da3660046130f3565b610eeb565b60015474010000000000000000000000000000000000000000900460ff166103a1565b610494610510366004613023565b600a6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b336000908152600660205260409020805460018101909155610356565b61037c610563366004612de0565b6110ea565b61037c611166565b610356611178565b61037c611182565b6003546104949073ffffffffffffffffffffffffffffffffffffffff1681565b6103566105ae366004612de0565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205490565b61037c61123c565b6105e66112b3565b6040516103609796959493929190613168565b6003546106229074010000000000000000000000000000000000000000900464ffffffffff1681565b60405164ffffffffff9091168152602001610360565b61037c610646366004613227565b611358565b60005473ffffffffffffffffffffffffffffffffffffffff16610494565b61037c611544565b6007546103a19074010000000000000000000000000000000000000000900460ff1681565b61037c6106a4366004612f69565b611675565b6106d07f000000000000000000000000000000000000000000000000000000000001518081565b60405162ffffff9091168152602001610360565b61037c6106f2366004612de0565b611754565b61037c610705366004613023565b6117d3565b6103566107183660046132ab565b61192b565b60035474010000000000000000000000000000000000000000900464ffffffffff1615156103a1565b61037c610754366004612ec5565b6119fa565b61037c6107673660046132de565b611bcb565b6103567f73452d4f5155a3eca764048760f921bf1c1895c2982c18744c2cee4cf9bffc2b81565b6103566107a1366004612de0565b60096020526000908152604090205481565b61037c611c2e565b60015473ffffffffffffffffffffffffffffffffffffffff16610494565b6103567f945a10ef569bd76eee6deb46dcc4541142d52149c7015b1cf0a68ead33382a9b81565b61035660085481565b61037c610817366004612de0565b611d19565b61037c61082a366004612de0565b611d79565b61049461083d366004613023565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b61037c610873366004613338565b611e29565b6103ed6040518060400160405280600a81526020017f323032332e31312e31350000000000000000000000000000000000000000000081525081565b6108bc61201e565b60075474010000000000000000000000000000000000000000900460ff1615610911576040517f351f92c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f306b123921c19a8629c68977f4dfea9ef9d5a6dedfafcd0d4a70ac6c9b763ac2910160405180910390a1600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006109b8898961209f565b90506109fd8189898c8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b610a408189868b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b610a4b818a8a612219565b505050505050505050565b610a5e61201e565b60035474010000000000000000000000000000000000000000900464ffffffffff1615610ab7576040517fca1c3cbc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610abf6122bb565b6003546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fd8ad954fe808212ab9ed7139873e40807dff7995fe36e3d6cdeb8fa00fcebf10910160405180910390a1600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff851660009081526009602052604081205490819003610bba576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600b6020526040902054339073ffffffffffffffffffffffffffffffffffffffff168114610c19576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff861660009081526009602052604090205415610c76576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cb98287878988888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b818673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167ff6891c84a6c6af32a6d052172a8acc4c631b1d5057ffa2bc1da268b6938ea2da60405160405180910390a4610d1f828888612219565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff851660009081526009602052604081205485148015610d985750610d98868585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061233f92505050565b9695505050505050565b6000610dae338761209f565b9050610df4818787878a88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610dff813388612219565b610e098186612457565b505050505050565b610e1961201e565b610e216124dd565b565b6000610e2e8261255a565b92915050565b6000610e408a8a61209f565b9050610e86818a8a8a8e8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610eca818a8a878d88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123b092505050565b610ed5818b8b612219565b610edf8189612457565b50505050505050505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314610f3c576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff1615158015610fc35750600354610fb9907f000000000000000000000000000000000000000000000000000000000001518062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15610ffa576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110026122bb565b60005b818110156110e05736838383818110611020576110206133e7565b90506060020190506009600082602001602081019061103f9190612de0565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020541561109d576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110d76110ad6020830183613416565b62ffffff166110c26040840160208501612de0565b6110d26060850160408601612de0565b6125a2565b50600101611005565b505050565b905090565b6110f261201e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517fbe7c7ac3248df4581c206a84aab3cb4e7d521b5398b42b681757f78a5a7d411e9190a250565b61116e61201e565b610e216000612650565b60006110e5612681565b600154339073ffffffffffffffffffffffffffffffffffffffff168114611230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61123981612650565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331480159061127457503360009081526002602052604090205460ff16155b156112ab576040517fcae1d95600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e216127b9565b6000606080828080836112e77f46617263617374657220496452656769737472790000000000000000000000146004612828565b6113127f31000000000000000000000000000000000000000000000000000000000000016005612828565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b60035473ffffffffffffffffffffffffffffffffffffffff1633146113a9576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16151580156114305750600354611426907f000000000000000000000000000000000000000000000000000000000001518062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15611467576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61146f6122bb565b60005b8281101561153e573684848381811061148d5761148d6133e7565b9050604002019050600960008260200160208101906114ac9190612de0565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020541561150a576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61153561151a6020830183613416565b62ffffff1661152f6040840160208501612de0565b856125a2565b50600101611472565b50505050565b60035473ffffffffffffffffffffffffffffffffffffffff163314611595576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16156115ee576040517fca1c3cbc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115f66122bb565b600380547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000004264ffffffffff90811682029290921792839055604051920416907fe4a25c0c2cbe89d6ad8b64c61a7dbdd20d1f781f6023f1ab94ebb7fe0aef6ab890600090a2565b61167d6128d3565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260096020526040812054908190036116dd576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dff81600b600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687878a88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061295892505050565b61175c61201e565b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f87dc5eecd6d6bdeae407c426da6bfba5b7190befc554ed5d4d62dd5cf939fbae9190a250565b60035473ffffffffffffffffffffffffffffffffffffffff163314611824576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff16151580156118ab57506003546118a1907f000000000000000000000000000000000000000000000000000000000001518062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b156118e2576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ea6122bb565b60085460408051918252602082018390527f562044dce594b5c0ac495e6cf3717dbef4dcc96bf978ff452457bfccd68a4eed910160405180910390a1600855565b60006119356128d3565b60075473ffffffffffffffffffffffffffffffffffffffff163314611986576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260096020526040902054156119e3576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506008805460010190819055610e2e8184846125a2565b73ffffffffffffffffffffffffffffffffffffffff881660009081526009602052604081205490819003611a5a576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff881660009081526009602052604090205415611ab7576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600b6020908152604091829020548251601f8901839004830281018301909352878352611b229284928c928c9273ffffffffffffffffffffffffffffffffffffffff909116918c908c908190840183828082843760009201919091525061215c92505050565b611b658189868b87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b808873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167ff6891c84a6c6af32a6d052172a8acc4c631b1d5057ffa2bc1da268b6938ea2da60405160405180910390a4610a4b818a8a612219565b6000611bd7338661209f565b9050611c1c8186868887878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215c92505050565b611c27813387612219565b5050505050565b611c3661201e565b60075474010000000000000000000000000000000000000000900460ff1615611c8b576040517f351f92c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60075460405173ffffffffffffffffffffffffffffffffffffffff90911681527f1f54688ee839cb2e57222a4f7482fd67a532a36666748891a7634428b2e8a1539060200160405180910390a1600780547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b611d216128d3565b3360009081526009602052604081205490819003611d6b576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d758183612457565b5050565b611d8161201e565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611de460005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60035473ffffffffffffffffffffffffffffffffffffffff163314611e7a576040517f8020644900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035474010000000000000000000000000000000000000000900464ffffffffff1615158015611f015750600354611ef7907f000000000000000000000000000000000000000000000000000000000001518062ffffff169074010000000000000000000000000000000000000000900464ffffffffff1661339b565b64ffffffffff1642115b15611f38576040517fca0dc97b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f406122bb565b60005b818110156110e0576000838383818110611f5f57611f5f6133e7565b9050602002016020810190611f749190613416565b62ffffff166000818152600a60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff168085526009845282852085905585855281547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909255600b90935281842080549091169055519293509183917f8b4b4c6da5b89da518fb865149e01ad2863b48861a8b952e11645f663959fa7091a25050600101611f43565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611227565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260096020526040812054908190036120ff576040517f210b4b2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526009602052604090205415610e2e576040517ff90230a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c276122117fcdbe3d2a782931ab7e1b568857680f9812900b4702ab75d82ddfd270aaf595f587876121b98773ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b60408051602081019590955284019290925273ffffffffffffffffffffffffffffffffffffffff166060830152608082015260a0810186905260c0015b6040516020818303038152906040528051906020012061255a565b8385846129b6565b6122216128d3565b73ffffffffffffffffffffffffffffffffffffffff8082166000818152600960208181526040808420899055888452600a825280842080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168617905594871680845291905283822082905592518693917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60015474010000000000000000000000000000000000000000900460ff16610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611227565b600080600061234e8585612a31565b909250905060008160048111156123675761236761343b565b14801561239f57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610d985750610d98868686612a76565b610e096122117f945a10ef569bd76eee6deb46dcc4541142d52149c7015b1cf0a68ead33382a9b88888861240e8873ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b60408051602081019690965285019390935273ffffffffffffffffffffffffffffffffffffffff918216606085015216608083015260a082015260c0810186905260e0016121f6565b61245f6128d3565b6000828152600b602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85169081179091559051909184917f8e700b803af43e14651431cd73c9fe7d11b131ad797576a70b893ce5766f65c39190a35050565b6124e56122bb565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6000610e2e612567612681565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b73ffffffffffffffffffffffffffffffffffffffff8281166000818152600960209081526040808320889055878352600a825280832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081168617909155600b8352928190208054909316948616948517909255905192835285927ff2e19a901b0748d8b08e428d0468896a039ac751ec4fec49b44b7b9c28097e45910160405180910390a3505050565b600180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561123981612bd3565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000fc6c5f01fc30151999387bb99a9f489b161480156126e757507f000000000000000000000000000000000000000000000000000000000000000a46145b1561271157507fe1b31bdbe66f9f4152b2cce1a6aae08b72ea880abb5cbc5e5ba67051c6b86ebb90565b6110e5604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fab5c5d43f71e0fa54f1a9e7546cbafa4b42b4abb224b10e26064578da3b71329918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6127c16128d3565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125303390565b606060ff83146128425761283b83612c48565b9050610e2e565b81805461284e9061346a565b80601f016020809104026020016040519081016040528092919081815260200182805461287a9061346a565b80156128c75780601f1061289c576101008083540402835291602001916128c7565b820191906000526020600020905b8154815290600101906020018083116128aa57829003601f168201915b50505050509050610e2e565b60015474010000000000000000000000000000000000000000900460ff1615610e21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611227565b610e096122117f73452d4f5155a3eca764048760f921bf1c1895c2982c18744c2cee4cf9bffc2b88888861240e8873ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902080546001810190915590565b814211156129f0576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6129fb83858361233f565b61153e576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808251604103612a675760208301516040840151606085015160001a612a5b87828585612c87565b94509450505050612a6f565b506000905060025b9250929050565b60008060008573ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8686604051602401612aad9291906134bd565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612b3691906134de565b600060405180830381855afa9150503d8060008114612b71576040519150601f19603f3d011682016040523d82523d6000602084013e612b76565b606091505b5091509150818015612b8a57506020815110155b8015610d98575080517f1626ba7e0000000000000000000000000000000000000000000000000000000090612bc890830160209081019084016134fa565b149695505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60606000612c5583612d76565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612cbe5750600090506003612d6d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612d12573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116612d6657600060019250925050612d6d565b9150600090505b94509492505050565b600060ff8216601f811115610e2e576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114612ddb57600080fd5b919050565b600060208284031215612df257600080fd5b612dfb82612db7565b9392505050565b60005b83811015612e1d578181015183820152602001612e05565b50506000910152565b60008151808452612e3e816020860160208601612e02565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612dfb6020830184612e26565b60008083601f840112612e9557600080fd5b50813567ffffffffffffffff811115612ead57600080fd5b602083019150836020828501011115612a6f57600080fd5b60008060008060008060008060c0898b031215612ee157600080fd5b612eea89612db7565b9750612ef860208a01612db7565b965060408901359550606089013567ffffffffffffffff80821115612f1c57600080fd5b612f288c838d01612e83565b909750955060808b0135945060a08b0135915080821115612f4857600080fd5b50612f558b828c01612e83565b999c989b5096995094979396929594505050565b600080600080600060808688031215612f8157600080fd5b612f8a86612db7565b9450612f9860208701612db7565b935060408601359250606086013567ffffffffffffffff811115612fbb57600080fd5b612fc788828901612e83565b969995985093965092949392505050565b600080600080600060808688031215612ff057600080fd5b612ff986612db7565b94506020860135935060408601359250606086013567ffffffffffffffff811115612fbb57600080fd5b60006020828403121561303557600080fd5b5035919050565b600080600080600080600080600060e08a8c03121561305a57600080fd5b6130638a612db7565b985061307160208b01612db7565b975061307f60408b01612db7565b965060608a0135955060808a013567ffffffffffffffff808211156130a357600080fd5b6130af8d838e01612e83565b909750955060a08c0135945060c08c01359150808211156130cf57600080fd5b506130dc8c828d01612e83565b915080935050809150509295985092959850929598565b6000806020838503121561310657600080fd5b823567ffffffffffffffff8082111561311e57600080fd5b818501915085601f83011261313257600080fd5b81358181111561314157600080fd5b86602060608302850101111561315657600080fd5b60209290920196919550909350505050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e0818401526131a460e084018a612e26565b83810360408501526131b6818a612e26565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015613215578351835292840192918401916001016131f9565b50909c9b505050505050505050505050565b60008060006040848603121561323c57600080fd5b833567ffffffffffffffff8082111561325457600080fd5b818601915086601f83011261326857600080fd5b81358181111561327757600080fd5b8760208260061b850101111561328c57600080fd5b6020928301955093506132a29186019050612db7565b90509250925092565b600080604083850312156132be57600080fd5b6132c783612db7565b91506132d560208401612db7565b90509250929050565b600080600080606085870312156132f457600080fd5b6132fd85612db7565b935060208501359250604085013567ffffffffffffffff81111561332057600080fd5b61332c87828801612e83565b95989497509550505050565b6000806020838503121561334b57600080fd5b823567ffffffffffffffff8082111561336357600080fd5b818501915085601f83011261337757600080fd5b81358181111561338657600080fd5b8660208260051b850101111561315657600080fd5b64ffffffffff8181168382160190808211156133e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561342857600080fd5b813562ffffff81168114612dfb57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c9082168061347e57607f821691505b6020821081036134b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8281526040602082015260006134d66040830184612e26565b949350505050565b600082516134f0818460208701612e02565b9190910192915050565b60006020828403121561350c57600080fd5b505191905056fea164736f6c6343000815000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002d93c2f74b2c4697f9ea85d0450148aa45d4d5a2000000000000000000000000299707e127cc77de01b9fd968bc0ff475f3c6342
-----Decoded View---------------
Arg [0] : _migrator (address): 0x2D93c2F74b2C4697f9ea85D0450148AA45D4D5a2
Arg [1] : _initialOwner (address): 0x299707E127CC77DE01b9Fd968Bc0ff475f3C6342
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002d93c2f74b2c4697f9ea85d0450148aa45d4d5a2
Arg [1] : 000000000000000000000000299707e127cc77de01b9fd968bc0ff475f3c6342
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.