Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
18429164 | 414 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
AccountV3Upgradable
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; import "./AccountV3.sol"; contract AccountV3Upgradable is AccountV3, UUPSUpgradeable { constructor( address entryPoint_, address multicallForwarder, address erc6551Registry, address guardian ) AccountV3(entryPoint_, multicallForwarder, erc6551Registry, guardian) {} function _authorizeUpgrade(address implementation) internal virtual override { if (!guardian.isTrustedImplementation(implementation)) revert InvalidImplementation(); if (!_isValidExecutor(_msgSender())) revert NotAuthorized(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822.sol"; import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeTo(address newImplementation) public virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "erc6551/lib/ERC6551AccountLib.sol"; import "./abstract/Lockable.sol"; import "./abstract/Overridable.sol"; import "./abstract/Permissioned.sol"; import "./abstract/ERC6551Account.sol"; import "./abstract/ERC4337Account.sol"; import "./abstract/execution/TokenboundExecutor.sol"; import "./lib/OPAddressAliasHelper.sol"; import "./interfaces/IAccountGuardian.sol"; /** * @title Tokenbound ERC-6551 Account Implementation */ contract AccountV3 is ERC721Holder, ERC1155Holder, Lockable, Overridable, Permissioned, ERC6551Account, ERC4337Account, TokenboundExecutor { IAccountGuardian immutable guardian; /** * @param entryPoint_ The ERC-4337 EntryPoint address * @param multicallForwarder The MulticallForwarder address * @param erc6551Registry The ERC-6551 Registry address * @param _guardian The AccountGuardian address */ constructor( address entryPoint_, address multicallForwarder, address erc6551Registry, address _guardian ) ERC4337Account(entryPoint_) TokenboundExecutor(multicallForwarder, erc6551Registry) { guardian = IAccountGuardian(_guardian); } /** * @notice Called whenever this account received Ether * * @dev Can be overriden via Overridable */ receive() external payable override { _handleOverride(); } /** * @notice Called whenever the calldata function selector does not match a defined function * * @dev Can be overriden via Overridable */ fallback() external payable { _handleOverride(); } /** * @notice Returns the owner of the token this account is bound to (if available) * * @dev Returns zero address if token is on a foreign chain or token contract does not exist * * @return address The address which owns the token this account is bound to */ function owner() public view returns (address) { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); return _tokenOwner(chainId, tokenContract, tokenId); } /** * @notice Returns whether a given ERC165 interface ID is supported * * @dev Can be overriden via Overridable except for base interfaces. * * @param interfaceId The interface ID to query for * @return bool True if the interface is supported, false otherwise */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Receiver, ERC6551Account, ERC6551Executor) returns (bool) { bool interfaceSupported = super.supportsInterface(interfaceId); if (interfaceSupported) return true; _handleOverrideStatic(); return false; } /** * @dev called whenever an ERC-721 token is received. Can be overriden via Overridable. Reverts * if token being received is the token the account is bound to. */ function onERC721Received(address, address, uint256 tokenId, bytes memory) public virtual override returns (bytes4) { (uint256 chainId, address tokenContract, uint256 _tokenId) = ERC6551AccountLib.token(); if (msg.sender == tokenContract && tokenId == _tokenId && chainId == block.chainid) { revert OwnershipCycle(); } _handleOverride(); return this.onERC721Received.selector; } /** * @dev called whenever an ERC-1155 token is received. Can be overriden via Overridable. */ function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) { _handleOverride(); return this.onERC1155Received.selector; } /** * @dev called whenever a batch of ERC-1155 tokens are received. Can be overriden via Overridable. */ function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { _handleOverride(); return this.onERC1155BatchReceived.selector; } /** * @notice Returns whether a given account is authorized to sign on behalf of this account * * @param signer The address to query authorization for * @return True if the signer is valid, false otherwise */ function _isValidSigner(address signer, bytes memory) internal view virtual override returns (bool) { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); // Single level accuont owner is valid signer address _owner = _tokenOwner(chainId, tokenContract, tokenId); if (signer == _owner) return true; // Root owner of accuont tree is valid signer address _rootOwner = _rootTokenOwner(_owner, chainId, tokenContract, tokenId); if (signer == _rootOwner) return true; // Accounts granted permission by root owner are valid signers return hasPermission(signer, _rootOwner); } /** * Determines if a given hash and signature are valid for this account * @param hash Hash of signed data * @param signature ECDSA signature or encoded contract signature (v=0) */ function _isValidSignature(bytes32 hash, bytes calldata signature) internal view override(ERC4337Account, Signatory) returns (bool) { uint8 v = uint8(signature[64]); address signer; // Smart contract signature if (v == 0) { // Signer address encoded in r signer = address(uint160(uint256(bytes32(signature[:32])))); // Allow recursive signature verification if (!_isValidSigner(signer, "") && signer != address(this)) { return false; } // Signature offset encoded in s bytes calldata _signature = signature[uint256(bytes32(signature[32:64])):]; return SignatureChecker.isValidERC1271SignatureNow(signer, hash, _signature); } ECDSA.RecoverError _error; (signer, _error) = ECDSA.tryRecover(hash, signature); if (_error != ECDSA.RecoverError.NoError) return false; return _isValidSigner(signer, ""); } /** * @notice Returns whether a given account is authorized to execute transactions on behalf of * this account * * @param executor The address to query authorization for * @return True if the executor is authorized, false otherwise */ function _isValidExecutor(address executor) internal view virtual override returns (bool) { // Allow execution from ERC-4337 EntryPoint if (executor == address(entryPoint())) return true; (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); // Allow cross chain execution if (chainId != block.chainid) { // Allow execution from L1 account on OPStack chains if (OPAddressAliasHelper.undoL1ToL2Alias(_msgSender()) == address(this)) { return true; } // Allow execution from trusted cross chain bridges if (guardian.isTrustedExecutor(executor)) return true; } // Allow execution from owner address _owner = _tokenOwner(chainId, tokenContract, tokenId); if (executor == _owner) return true; // Allow execution from root owner of account tree address _rootOwner = _rootTokenOwner(_owner, chainId, tokenContract, tokenId); if (executor == _rootOwner) return true; // Allow execution from permissioned account if (hasPermission(executor, _rootOwner)) return true; return false; } /** * @dev Updates account state based on previous state and msg.data */ function _updateState() internal virtual { _state = uint256(keccak256(abi.encode(_state, _msgData()))); } /** * @dev Called before executing an operation. Reverts if account is locked. Ensures state is * updated prior to execution. */ function _beforeExecute() internal override { if (isLocked()) revert AccountLocked(); _updateState(); } /** * @dev Called before locking the account. Reverts if account is locked. Updates account state. */ function _beforeLock() internal override { if (isLocked()) revert AccountLocked(); _updateState(); } /** * @dev Called before setting overrides on the account. Reverts if account is locked. Updates * account state. */ function _beforeSetOverrides() internal override { if (isLocked()) revert AccountLocked(); _updateState(); } /** * @dev Called before setting permissions on the account. Reverts if account is locked. Updates * account state. */ function _beforeSetPermissions() internal override { if (isLocked()) revert AccountLocked(); _updateState(); } /** * @dev Returns the root owner of an account. If account is not owned by a TBA, returns the * owner of the NFT bound to this account. If account is owned by a TBA, iterates up token * ownership tree and returns root owner. * * *Security Warning*: the return value of this function can only be trusted if it is also the * address of the sender (as the code of the NFT contract cannot be trusted). This function * should therefore only be used for authorization and never authentication. */ function _rootTokenOwner(uint256 chainId, address tokenContract, uint256 tokenId) internal view virtual override(Overridable, Permissioned, Lockable) returns (address) { address _owner = _tokenOwner(chainId, tokenContract, tokenId); return _rootTokenOwner(_owner, chainId, tokenContract, tokenId); } /** * @dev Returns the root owner of an account given a known account owner address (saves an * additional external call). */ function _rootTokenOwner( address owner_, uint256 chainId, address tokenContract, uint256 tokenId ) internal view virtual returns (address) { address _owner = owner_; while (ERC6551AccountLib.isERC6551Account(_owner, __self, erc6551Registry)) { (chainId, tokenContract, tokenId) = IERC6551Account(payable(_owner)).token(); _owner = _tokenOwner(chainId, tokenContract, tokenId); } return _owner; } /** * @dev Returns the owner of the token which this account is bound to. Returns the zero address * if token does not exist on the current chain or if the token contract does not exist */ function _tokenOwner(uint256 chainId, address tokenContract, uint256 tokenId) internal view virtual returns (address) { if (chainId != block.chainid) return address(0); if (tokenContract.code.length == 0) return address(0); try IERC721(tokenContract).ownerOf(tokenId) returns (address _owner) { return _owner; } catch { return address(0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../interfaces/IERC1967.sol"; import "../../interfaces/draft-IERC1822.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967Upgrade is IERC1967 { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
// 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 // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Create2.sol"; import "./ERC6551BytecodeLib.sol"; library ERC6551AccountLib { function computeAddress( address registry, address _implementation, bytes32 _salt, uint256 chainId, address tokenContract, uint256 tokenId ) internal pure returns (address) { bytes32 bytecodeHash = keccak256( ERC6551BytecodeLib.getCreationCode( _implementation, _salt, chainId, tokenContract, tokenId ) ); return Create2.computeAddress(_salt, bytecodeHash, registry); } function isERC6551Account(address account, address expectedImplementation, address registry) internal view returns (bool) { // invalid bytecode size if (account.code.length != 0xAD) return false; address _implementation = implementation(account); // implementation does not exist if (_implementation.code.length == 0) return false; // invalid implementation if (_implementation != expectedImplementation) return false; (bytes32 _salt, uint256 chainId, address tokenContract, uint256 tokenId) = context(account); return account == computeAddress(registry, _implementation, _salt, chainId, tokenContract, tokenId); } function implementation(address account) internal view returns (address _implementation) { assembly { // copy proxy implementation (0x14 bytes) extcodecopy(account, 0xC, 0xA, 0x14) _implementation := mload(0x00) } } function implementation() internal view returns (address _implementation) { return implementation(address(this)); } function token(address account) internal view returns (uint256, address, uint256) { bytes memory encodedData = new bytes(0x60); assembly { // copy 0x60 bytes from end of context extcodecopy(account, add(encodedData, 0x20), 0x4d, 0x60) } return abi.decode(encodedData, (uint256, address, uint256)); } function token() internal view returns (uint256, address, uint256) { return token(address(this)); } function salt(address account) internal view returns (bytes32) { bytes memory encodedData = new bytes(0x20); assembly { // copy 0x20 bytes from beginning of context extcodecopy(account, add(encodedData, 0x20), 0x2d, 0x20) } return abi.decode(encodedData, (bytes32)); } function salt() internal view returns (bytes32) { return salt(address(this)); } function context(address account) internal view returns (bytes32, uint256, address, uint256) { bytes memory encodedData = new bytes(0x80); assembly { // copy full context (0x80 bytes) extcodecopy(account, add(encodedData, 0x20), 0x2D, 0x80) } return abi.decode(encodedData, (bytes32, uint256, address, uint256)); } function context() internal view returns (bytes32, uint256, address, uint256) { return context(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc6551/lib/ERC6551AccountLib.sol"; import "../utils/Errors.sol"; /** * @title Account Lock * @dev Allows the root owner of a token bound account to lock access to an account until a * certain timestamp */ abstract contract Lockable { /** * @notice The timestamp at which this account will be unlocked */ uint256 public lockedUntil; event LockUpdated(uint256 lockedUntil); /** * @dev Locks the account until a certain timestamp * * @param _lockedUntil The time at which this account will no longer be locke */ function lock(uint256 _lockedUntil) external virtual { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); address _owner = _rootTokenOwner(chainId, tokenContract, tokenId); if (_owner == address(0)) revert NotAuthorized(); if (msg.sender != _owner) revert NotAuthorized(); if (_lockedUntil > block.timestamp + 365 days) { revert ExceedsMaxLockTime(); } _beforeLock(); lockedUntil = _lockedUntil; emit LockUpdated(_lockedUntil); } /** * @dev Returns the current lock status of the account as a boolean */ function isLocked() public view virtual returns (bool) { return lockedUntil > block.timestamp; } function _rootTokenOwner(uint256 chainId, address tokenContract, uint256 tokenId) internal view virtual returns (address); function _beforeLock() internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc6551/lib/ERC6551AccountLib.sol"; import "../utils/Errors.sol"; import "../lib/LibSandbox.sol"; /** * @title Account Overrides * @dev Allows the root owner of a token bound account to override the implementation of a given * function selector on the account. Overrides are keyed by the root owner address, so will be * disabled upon transfer of the token which owns this account tree. */ abstract contract Overridable { /** * @dev mapping from owner => selector => implementation */ mapping(address => mapping(bytes4 => address)) public overrides; event OverrideUpdated(address owner, bytes4 selector, address implementation); /** * @dev Sets the implementation address for a given array of function selectors. Can only be * called by the root owner of the account * * @param selectors Array of selectors to override * @param implementations Array of implementation address corresponding to selectors */ function setOverrides(bytes4[] calldata selectors, address[] calldata implementations) external virtual { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); address _owner = _rootTokenOwner(chainId, tokenContract, tokenId); if (_owner == address(0)) revert NotAuthorized(); if (msg.sender != _owner) revert NotAuthorized(); _beforeSetOverrides(); address sandbox = LibSandbox.sandbox(address(this)); if (sandbox.code.length == 0) LibSandbox.deploy(address(this)); uint256 length = selectors.length; if (implementations.length != length) revert InvalidInput(); for (uint256 i = 0; i < length; i++) { overrides[_owner][selectors[i]] = implementations[i]; emit OverrideUpdated(_owner, selectors[i], implementations[i]); } } /** * @dev Calls into the implementation address using sandbox if override is set for the current * function selector. If an implementation is defined, this funciton will either revert or * return with the return value of the implementation */ function _handleOverride() internal virtual { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); address _owner = _rootTokenOwner(chainId, tokenContract, tokenId); address implementation = overrides[_owner][msg.sig]; if (implementation != address(0)) { address sandbox = LibSandbox.sandbox(address(this)); (bool success, bytes memory result) = sandbox.call(abi.encodePacked(implementation, msg.data, msg.sender)); assembly { if iszero(success) { revert(add(result, 32), mload(result)) } return(add(result, 32), mload(result)) } } } /** * @dev Static calls into the implementation addressif override is set for the current function * selector. If an implementation is defined, this funciton will either revert or return with * the return value of the implementation */ function _handleOverrideStatic() internal view virtual { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); address _owner = _rootTokenOwner(chainId, tokenContract, tokenId); address implementation = overrides[_owner][msg.sig]; if (implementation != address(0)) { (bool success, bytes memory result) = implementation.staticcall(msg.data); assembly { if iszero(success) { revert(add(result, 32), mload(result)) } return(add(result, 32), mload(result)) } } } function _beforeSetOverrides() internal virtual {} function _rootTokenOwner(uint256 chainId, address tokenContract, uint256 tokenId) internal view virtual returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc6551/lib/ERC6551AccountLib.sol"; import "../utils/Errors.sol"; /** * @title Account Permissions * @dev Allows the root owner of a token bound account to allow another account to execute * operations from this account. Permissions are keyed by the root owner address, so will be * disabled upon transfer of the token which owns this account tree. */ abstract contract Permissioned { /** * @dev mapping from owner => caller => has permissions */ mapping(address => mapping(address => bool)) public permissions; event PermissionUpdated(address owner, address caller, bool hasPermission); /** * @dev Grants or revokes execution permissions for a given array of callers on this account. * Can only be called by the root owner of the account * * @param callers Array of callers to grant permissions to * @param _permissions Array of booleans, true if execution permissions should be granted, * false if permissions should be revoked */ function setPermissions(address[] calldata callers, bool[] calldata _permissions) external virtual { (uint256 chainId, address tokenContract, uint256 tokenId) = ERC6551AccountLib.token(); address _owner = _rootTokenOwner(chainId, tokenContract, tokenId); if (_owner == address(0)) revert NotAuthorized(); if (msg.sender != _owner) revert NotAuthorized(); _beforeSetPermissions(); uint256 length = callers.length; if (_permissions.length != length) revert InvalidInput(); for (uint256 i = 0; i < length; i++) { permissions[_owner][callers[i]] = _permissions[i]; emit PermissionUpdated(_owner, callers[i], _permissions[i]); } } /** * @dev Returns true if caller has permissions to act on behalf of owner * * @param caller Address to query permissions for * @param owner Root owner address for which to query permissions */ function hasPermission(address caller, address owner) internal view returns (bool) { return permissions[owner][caller]; } function _beforeSetPermissions() internal virtual {} function _rootTokenOwner(uint256 chainId, address tokenContract, uint256 tokenId) internal view virtual returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "erc6551/lib/ERC6551AccountLib.sol"; import "erc6551/interfaces/IERC6551Account.sol"; import "./Signatory.sol"; /** * @title ERC-6551 Account Support * @dev Implements the ERC-6551 Account interface */ abstract contract ERC6551Account is IERC6551Account, ERC165, Signatory { uint256 _state; receive() external payable virtual {} /** * @dev See: {IERC6551Account-isValidSigner} */ function isValidSigner(address signer, bytes calldata data) external view returns (bytes4 magicValue) { if (_isValidSigner(signer, data)) { return IERC6551Account.isValidSigner.selector; } return bytes4(0); } /** * @dev See: {IERC6551Account-token} */ function token() public view returns (uint256 chainId, address tokenContract, uint256 tokenId) { return ERC6551AccountLib.token(); } /** * @dev See: {IERC6551Account-state} */ function state() public view returns (uint256) { return _state; } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC6551Account).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns true if a given signer is authorized to use this account */ function _isValidSigner(address signer, bytes memory) internal view virtual returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol"; import {UserOperation} from "account-abstraction/interfaces/UserOperation.sol"; import {BaseAccount as BaseERC4337Account} from "account-abstraction/core/BaseAccount.sol"; import "../utils/Errors.sol"; /** * @title ERC-4337 Support * @dev Implements ERC-4337 account support */ abstract contract ERC4337Account is BaseERC4337Account { using ECDSA for bytes32; IEntryPoint immutable _entryPoint; constructor(address entryPoint_) { if (entryPoint_ == address(0)) revert InvalidEntryPoint(); _entryPoint = IEntryPoint(entryPoint_); } /** * @dev See {BaseERC4337Account-entryPoint} */ function entryPoint() public view override returns (IEntryPoint) { return _entryPoint; } /** * @dev See {BaseERC4337Account-_validateSignature} */ function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash) internal view virtual override returns (uint256) { if (_isValidSignature(_getUserOpSignatureHash(userOp, userOpHash), userOp.signature)) { return 0; } return 1; } /** * @dev Returns the user operation hash that should be signed by the account owner */ function _getUserOpSignatureHash(UserOperation calldata, bytes32 userOpHash) internal view virtual returns (bytes32) { return userOpHash.toEthSignedMessageHash(); } function _isValidSignature(bytes32 hash, bytes calldata signature) internal view virtual returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "erc6551/interfaces/IERC6551Executable.sol"; import "erc6551/interfaces/IERC6551Account.sol"; import "erc6551/lib/ERC6551AccountLib.sol"; import "../../utils/Errors.sol"; import "../../lib/LibExecutor.sol"; import "../../lib/LibSandbox.sol"; import "./ERC6551Executor.sol"; import "./BatchExecutor.sol"; import "./NestedAccountExecutor.sol"; /** * @title Tokenbound Executor * @dev Enables basic ERC-6551 execution as well as batch, nested, and mult-account execution */ abstract contract TokenboundExecutor is ERC6551Executor, BatchExecutor, NestedAccountExecutor, ERC2771Context { constructor(address multicallForwarder, address _erc6551Registry) ERC2771Context(multicallForwarder) NestedAccountExecutor(_erc6551Registry) { if (multicallForwarder == address(0)) revert InvalidMulticallForwarder(); } function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) { return super._msgSender(); } function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) { return super._msgData(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; // Source: https://github.com/ethereum-optimism/optimism/blob/96562692558e5c3851899488bcebe51fbe3b7f09/packages/contracts-bedrock/src/vendor/AddressAliasHelper.sol library OPAddressAliasHelper { uint160 constant offset = uint160(0x1111000000000000000000000000000000001111); /// @notice Utility function that converts the address in the L1 that submitted a tx to /// the inbox to the msg.sender viewed in the L2 /// @param l1Address the address in the L1 that triggered the tx to L2 /// @return l2Address L2 address as viewed in msg.sender function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { unchecked { l2Address = address(uint160(l1Address) + offset); } } /// @notice Utility function that converts the msg.sender viewed in the L2 to the /// address in the L1 that submitted a tx to the inbox /// @param l2Address L2 address as viewed in msg.sender /// @return l1Address the address in the L1 that triggered the tx to L2 function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) { unchecked { l1Address = address(uint160(l2Address) - offset); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IAccountGuardian { function setTrustedImplementation(address implementation, bool trusted) external; function setTrustedExecutor(address executor, bool trusted) external; function defaultImplementation() external view returns (address); function isTrustedImplementation(address implementation) external view returns (bool); function isTrustedExecutor(address implementation) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967 { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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) (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.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol) pragma solidity ^0.8.0; /** * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer. * `CREATE2` can be used to compute in advance the address where a smart * contract will be deployed, which allows for interesting new mechanisms known * as 'counterfactual interactions'. * * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more * information. */ library Create2 { /** * @dev Deploys a contract using `CREATE2`. The address where the contract * will be deployed can be known in advance via {computeAddress}. * * The bytecode for a contract can be obtained from Solidity with * `type(contractName).creationCode`. * * Requirements: * * - `bytecode` must not be empty. * - `salt` must have not been used for `bytecode` already. * - the factory must have a balance of at least `amount`. * - if `amount` is non-zero, `bytecode` must have a `payable` constructor. */ function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) { require(address(this).balance >= amount, "Create2: insufficient balance"); require(bytecode.length != 0, "Create2: bytecode length is zero"); /// @solidity memory-safe-assembly assembly { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) } require(addr != address(0), "Create2: Failed on deploy"); } /** * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the * `bytecodeHash` or `salt` will result in a new destination address. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) { return computeAddress(salt, bytecodeHash, address(this)); } /** * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}. */ function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) // Get free memory pointer // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... | // |-------------------|---------------------------------------------------------------------------| // | bytecodeHash | CCCCCCCCCCCCC...CC | // | salt | BBBBBBBBBBBBB...BB | // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA | // | 0xFF | FF | // |-------------------|---------------------------------------------------------------------------| // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC | // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | mstore(add(ptr, 0x40), bytecodeHash) mstore(add(ptr, 0x20), salt) mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff mstore8(start, 0xff) addr := keccak256(start, 85) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library ERC6551BytecodeLib { /** * @dev Returns the creation code of the token bound account for a non-fungible token. * * @return result The creation code of the token bound account */ function getCreationCode( address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId ) internal pure returns (bytes memory result) { assembly { result := mload(0x40) // Grab the free memory pointer // Layout the variables and bytecode backwards mstore(add(result, 0xb7), tokenId) mstore(add(result, 0x97), shr(96, shl(96, tokenContract))) mstore(add(result, 0x77), chainId) mstore(add(result, 0x57), salt) mstore(add(result, 0x37), 0x5af43d82803e903d91602b57fd5bf3) mstore(add(result, 0x28), implementation) mstore(add(result, 0x14), 0x3d60ad80600a3d3981f3363d3d373d3d3d363d73) mstore(result, 0xb7) // Store the length mstore(0x40, add(result, 0xd7)) // Allocate the memory } } /** * @dev Returns the create2 address computed from `salt`, `bytecodeHash`, `deployer`. * * @return result The create2 address computed from `salt`, `bytecodeHash`, `deployer` */ function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address result) { assembly { result := mload(0x40) // Grab the free memory pointer mstore8(result, 0xff) mstore(add(result, 0x35), bytecodeHash) mstore(add(result, 0x01), shl(96, deployer)) mstore(add(result, 0x15), salt) result := keccak256(result, 0x55) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; error InvalidOperation(); error ContractCreationFailed(); error NotAuthorized(); error InvalidInput(); error ExceedsMaxLockTime(); error AccountLocked(); error InvalidAccountProof(); error InvalidGuardian(); error InvalidImplementation(); error AlreadyInitialized(); error InvalidEntryPoint(); error InvalidMulticallForwarder(); error InvalidERC6551Registry(); error OwnershipCycle();
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "openzeppelin-contracts/contracts/utils/Create2.sol"; library LibSandbox { bytes public constant header = hex"604380600d600039806000f3fe73"; bytes public constant footer = hex"3314601d573d3dfd5b363d3d373d3d6014360360143d5160601c5af43d6000803e80603e573d6000fd5b3d6000f3"; function bytecode(address owner) internal pure returns (bytes memory) { return abi.encodePacked(header, owner, footer); } function sandbox(address owner) internal view returns (address) { return Create2.computeAddress(keccak256("org.tokenbound.sandbox"), keccak256(bytecode(owner))); } function deploy(address owner) internal { Create2.deploy(0, keccak256("org.tokenbound.sandbox"), bytecode(owner)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @dev the ERC-165 identifier for this interface is `0x6faff5f1` interface IERC6551Account { /** * @dev Allows the account to receive Ether. * * Accounts MUST implement a `receive` function. * * Accounts MAY perform arbitrary logic to restrict conditions * under which Ether can be received. */ receive() external payable; /** * @dev Returns the identifier of the non-fungible token which owns the account. * * The return value of this function MUST be constant - it MUST NOT change over time. * * @return chainId The EIP-155 ID of the chain the token exists on * @return tokenContract The contract address of the token * @return tokenId The ID of the token */ function token() external view returns (uint256 chainId, address tokenContract, uint256 tokenId); /** * @dev Returns a value that SHOULD be modified each time the account changes state. * * @return The current account state */ function state() external view returns (uint256); /** * @dev Returns a magic value indicating whether a given signer is authorized to act on behalf * of the account. * * MUST return the bytes4 magic value 0x523e3260 if the given signer is valid. * * By default, the holder of the non-fungible token the account is bound to MUST be considered * a valid signer. * * Accounts MAY implement additional authorization logic which invalidates the holder as a * signer or grants signing permissions to other non-holder accounts. * * @param signer The address to check signing authorization for * @param context Additional data used to determine whether the signer is valid * @return magicValue Magic value indicating whether the signer is valid */ function isValidSigner(address signer, bytes calldata context) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/interfaces/IERC1271.sol"; /** * @title Signatory * @dev Implements ERC-1271 signature verification */ abstract contract Signatory is IERC1271 { /** * @dev See {IERC1721-isValidSignature} */ function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue) { if (_isValidSignature(hash, signature)) { return IERC1271.isValidSignature.selector; } return bytes4(0); } function _isValidSignature(bytes32 hash, bytes calldata signature) internal view virtual returns (bool); }
/** ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation. ** Only one instance required on each chain. **/ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /* solhint-disable avoid-low-level-calls */ /* solhint-disable no-inline-assembly */ /* solhint-disable reason-string */ import "./UserOperation.sol"; import "./IStakeManager.sol"; import "./IAggregator.sol"; import "./INonceManager.sol"; interface IEntryPoint is IStakeManager, INonceManager { /*** * An event emitted after each successful request * @param userOpHash - unique identifier for the request (hash its entire content, except signature). * @param sender - the account that generates this request. * @param paymaster - if non-null, the paymaster that pays for this request. * @param nonce - the nonce value from the request. * @param success - true if the sender transaction succeeded, false if reverted. * @param actualGasCost - actual amount paid (by account or paymaster) for this UserOperation. * @param actualGasUsed - total gas used by this UserOperation (including preVerification, creation, validation and execution). */ event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed); /** * account "sender" was deployed. * @param userOpHash the userOp that deployed this account. UserOperationEvent will follow. * @param sender the account that is deployed * @param factory the factory used to deploy this account (in the initCode) * @param paymaster the paymaster used by this UserOp */ event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster); /** * An event emitted if the UserOperation "callData" reverted with non-zero length * @param userOpHash the request unique identifier. * @param sender the sender of this request * @param nonce the nonce used in the request * @param revertReason - the return bytes from the (reverted) call to "callData". */ event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason); /** * an event emitted by handleOps(), before starting the execution loop. * any event emitted before this event, is part of the validation. */ event BeforeExecution(); /** * signature aggregator used by the following UserOperationEvents within this bundle. */ event SignatureAggregatorChanged(address indexed aggregator); /** * a custom revert error of handleOps, to identify the offending op. * NOTE: if simulateValidation passes successfully, there should be no reason for handleOps to fail on it. * @param opIndex - index into the array of ops to the failed one (in simulateValidation, this is always zero) * @param reason - revert reason * The string starts with a unique code "AAmn", where "m" is "1" for factory, "2" for account and "3" for paymaster issues, * so a failure can be attributed to the correct entity. * Should be caught in off-chain handleOps simulation and not happen on-chain. * Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts. */ error FailedOp(uint256 opIndex, string reason); /** * error case when a signature aggregator fails to verify the aggregated signature it had created. */ error SignatureValidationFailed(address aggregator); /** * Successful result from simulateValidation. * @param returnInfo gas and time-range returned values * @param senderInfo stake information about the sender * @param factoryInfo stake information about the factory (if any) * @param paymasterInfo stake information about the paymaster (if any) */ error ValidationResult(ReturnInfo returnInfo, StakeInfo senderInfo, StakeInfo factoryInfo, StakeInfo paymasterInfo); /** * Successful result from simulateValidation, if the account returns a signature aggregator * @param returnInfo gas and time-range returned values * @param senderInfo stake information about the sender * @param factoryInfo stake information about the factory (if any) * @param paymasterInfo stake information about the paymaster (if any) * @param aggregatorInfo signature aggregation info (if the account requires signature aggregator) * bundler MUST use it to verify the signature, or reject the UserOperation */ error ValidationResultWithAggregation(ReturnInfo returnInfo, StakeInfo senderInfo, StakeInfo factoryInfo, StakeInfo paymasterInfo, AggregatorStakeInfo aggregatorInfo); /** * return value of getSenderAddress */ error SenderAddressResult(address sender); /** * return value of simulateHandleOp */ error ExecutionResult(uint256 preOpGas, uint256 paid, uint48 validAfter, uint48 validUntil, bool targetSuccess, bytes targetResult); //UserOps handled, per aggregator struct UserOpsPerAggregator { UserOperation[] userOps; // aggregator address IAggregator aggregator; // aggregated signature bytes signature; } /** * Execute a batch of UserOperation. * no signature aggregator is used. * if any account requires an aggregator (that is, it returned an aggregator when * performing simulateValidation), then handleAggregatedOps() must be used instead. * @param ops the operations to execute * @param beneficiary the address to receive the fees */ function handleOps(UserOperation[] calldata ops, address payable beneficiary) external; /** * Execute a batch of UserOperation with Aggregators * @param opsPerAggregator the operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts) * @param beneficiary the address to receive the fees */ function handleAggregatedOps( UserOpsPerAggregator[] calldata opsPerAggregator, address payable beneficiary ) external; /** * generate a request Id - unique identifier for this request. * the request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid. */ function getUserOpHash(UserOperation calldata userOp) external view returns (bytes32); /** * Simulate a call to account.validateUserOp and paymaster.validatePaymasterUserOp. * @dev this method always revert. Successful result is ValidationResult error. other errors are failures. * @dev The node must also verify it doesn't use banned opcodes, and that it doesn't reference storage outside the account's data. * @param userOp the user operation to validate. */ function simulateValidation(UserOperation calldata userOp) external; /** * gas and return values during simulation * @param preOpGas the gas used for validation (including preValidationGas) * @param prefund the required prefund for this operation * @param sigFailed validateUserOp's (or paymaster's) signature check failed * @param validAfter - first timestamp this UserOp is valid (merging account and paymaster time-range) * @param validUntil - last timestamp this UserOp is valid (merging account and paymaster time-range) * @param paymasterContext returned by validatePaymasterUserOp (to be passed into postOp) */ struct ReturnInfo { uint256 preOpGas; uint256 prefund; bool sigFailed; uint48 validAfter; uint48 validUntil; bytes paymasterContext; } /** * returned aggregated signature info. * the aggregator returned by the account, and its current stake. */ struct AggregatorStakeInfo { address aggregator; StakeInfo stakeInfo; } /** * Get counterfactual sender address. * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation. * this method always revert, and returns the address in SenderAddressResult error * @param initCode the constructor code to be passed into the UserOperation. */ function getSenderAddress(bytes memory initCode) external; /** * simulate full execution of a UserOperation (including both validation and target execution) * this method will always revert with "ExecutionResult". * it performs full validation of the UserOperation, but ignores signature error. * an optional target address is called after the userop succeeds, and its value is returned * (before the entire call is reverted) * Note that in order to collect the the success/failure of the target call, it must be executed * with trace enabled to track the emitted events. * @param op the UserOperation to simulate * @param target if nonzero, a target address to call after userop simulation. If called, the targetSuccess and targetResult * are set to the return from that call. * @param targetCallData callData to pass to target address */ function simulateHandleOp(UserOperation calldata op, address target, bytes calldata targetCallData) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /* solhint-disable no-inline-assembly */ import {calldataKeccak} from "../core/Helpers.sol"; /** * User Operation struct * @param sender the sender account of this request. * @param nonce unique value the sender uses to verify it is not a replay. * @param initCode if set, the account contract will be created by this constructor/ * @param callData the method call to execute on this account. * @param callGasLimit the gas limit passed to the callData method call. * @param verificationGasLimit gas used for validateUserOp and validatePaymasterUserOp. * @param preVerificationGas gas not calculated by the handleOps method, but added to the gas paid. Covers batch overhead. * @param maxFeePerGas same as EIP-1559 gas parameter. * @param maxPriorityFeePerGas same as EIP-1559 gas parameter. * @param paymasterAndData if set, this field holds the paymaster address and paymaster-specific data. the paymaster will pay for the transaction instead of the sender. * @param signature sender-verified signature over the entire request, the EntryPoint address and the chain ID. */ struct UserOperation { address sender; uint256 nonce; bytes initCode; bytes callData; uint256 callGasLimit; uint256 verificationGasLimit; uint256 preVerificationGas; uint256 maxFeePerGas; uint256 maxPriorityFeePerGas; bytes paymasterAndData; bytes signature; } /** * Utility functions helpful when working with UserOperation structs. */ library UserOperationLib { function getSender(UserOperation calldata userOp) internal pure returns (address) { address data; //read sender from userOp, which is first userOp member (saves 800 gas...) assembly {data := calldataload(userOp)} return address(uint160(data)); } //relayer/block builder might submit the TX with higher priorityFee, but the user should not // pay above what he signed for. function gasPrice(UserOperation calldata userOp) internal view returns (uint256) { unchecked { uint256 maxFeePerGas = userOp.maxFeePerGas; uint256 maxPriorityFeePerGas = userOp.maxPriorityFeePerGas; if (maxFeePerGas == maxPriorityFeePerGas) { //legacy mode (for networks that don't support basefee opcode) return maxFeePerGas; } return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee); } } function pack(UserOperation calldata userOp) internal pure returns (bytes memory ret) { address sender = getSender(userOp); uint256 nonce = userOp.nonce; bytes32 hashInitCode = calldataKeccak(userOp.initCode); bytes32 hashCallData = calldataKeccak(userOp.callData); uint256 callGasLimit = userOp.callGasLimit; uint256 verificationGasLimit = userOp.verificationGasLimit; uint256 preVerificationGas = userOp.preVerificationGas; uint256 maxFeePerGas = userOp.maxFeePerGas; uint256 maxPriorityFeePerGas = userOp.maxPriorityFeePerGas; bytes32 hashPaymasterAndData = calldataKeccak(userOp.paymasterAndData); return abi.encode( sender, nonce, hashInitCode, hashCallData, callGasLimit, verificationGasLimit, preVerificationGas, maxFeePerGas, maxPriorityFeePerGas, hashPaymasterAndData ); } function hash(UserOperation calldata userOp) internal pure returns (bytes32) { return keccak256(pack(userOp)); } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /* solhint-disable avoid-low-level-calls */ /* solhint-disable no-empty-blocks */ import "../interfaces/IAccount.sol"; import "../interfaces/IEntryPoint.sol"; import "./Helpers.sol"; /** * Basic account implementation. * this contract provides the basic logic for implementing the IAccount interface - validateUserOp * specific account implementation should inherit it and provide the account-specific logic */ abstract contract BaseAccount is IAccount { using UserOperationLib for UserOperation; //return value in case of signature failure, with no time-range. // equivalent to _packValidationData(true,0,0); uint256 constant internal SIG_VALIDATION_FAILED = 1; /** * Return the account nonce. * This method returns the next sequential nonce. * For a nonce of a specific key, use `entrypoint.getNonce(account, key)` */ function getNonce() public view virtual returns (uint256) { return entryPoint().getNonce(address(this), 0); } /** * return the entryPoint used by this account. * subclass should return the current entryPoint used by this account. */ function entryPoint() public view virtual returns (IEntryPoint); /** * Validate user's signature and nonce. * subclass doesn't need to override this method. Instead, it should override the specific internal validation methods. */ function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds) external override virtual returns (uint256 validationData) { _requireFromEntryPoint(); validationData = _validateSignature(userOp, userOpHash); _validateNonce(userOp.nonce); _payPrefund(missingAccountFunds); } /** * ensure the request comes from the known entrypoint. */ function _requireFromEntryPoint() internal virtual view { require(msg.sender == address(entryPoint()), "account: not from EntryPoint"); } /** * validate the signature is valid for this message. * @param userOp validate the userOp.signature field * @param userOpHash convenient field: the hash of the request, to check the signature against * (also hashes the entrypoint and chain id) * @return validationData signature and time-range of this operation * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure, * otherwise, an address of an "authorizer" contract. * <6-byte> validUntil - last timestamp this operation is valid. 0 for "indefinite" * <6-byte> validAfter - first timestamp this operation is valid * If the account doesn't use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure. * Note that the validation code cannot use block.timestamp (or block.number) directly. */ function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash) internal virtual returns (uint256 validationData); /** * Validate the nonce of the UserOperation. * This method may validate the nonce requirement of this account. * e.g. * To limit the nonce to use sequenced UserOps only (no "out of order" UserOps): * `require(nonce < type(uint64).max)` * For a hypothetical account that *requires* the nonce to be out-of-order: * `require(nonce & type(uint64).max == 0)` * * The actual nonce uniqueness is managed by the EntryPoint, and thus no other * action is needed by the account itself. * * @param nonce to validate * * solhint-disable-next-line no-empty-blocks */ function _validateNonce(uint256 nonce) internal view virtual { } /** * sends to the entrypoint (msg.sender) the missing funds for this transaction. * subclass MAY override this method for better funds management * (e.g. send to the entryPoint more than the minimum required, so that in future transactions * it will not be required to send again) * @param missingAccountFunds the minimum value this method should send the entrypoint. * this value MAY be zero, in case there is enough deposit, or the userOp has a paymaster. */ function _payPrefund(uint256 missingAccountFunds) internal virtual { if (missingAccountFunds != 0) { (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(""); (success); //ignore failure (its EntryPoint's job to verify, not account.) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (metatx/ERC2771Context.sol) pragma solidity ^0.8.9; import "../utils/Context.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable _trustedForwarder; /// @custom:oz-upgrades-unsafe-allow constructor constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender) && msg.data.length >= 20) { // The assembly code is more direct than the Solidity version using `abi.decode`. /// @solidity memory-safe-assembly assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender) && msg.data.length >= 20) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @dev the ERC-165 identifier for this interface is `0x51945447` interface IERC6551Executable { /** * @dev Executes a low-level operation if the caller is a valid signer on the account. * * Reverts and bubbles up error if operation fails. * * Accounts implementing this interface MUST accept the following operation parameter values: * - 0 = CALL * - 1 = DELEGATECALL * - 2 = CREATE * - 3 = CREATE2 * * Accounts implementing this interface MAY support additional operations or restrict a signer's * ability to execute certain operations. * * @param to The target address of the operation * @param value The Ether value to be sent to the target * @param data The encoded operation calldata * @param operation A value indicating the type of operation to perform * @return The result of the operation */ function execute(address to, uint256 value, bytes calldata data, uint8 operation) external payable returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "../utils/Errors.sol"; import "./LibSandbox.sol"; library LibExecutor { uint8 constant OP_CALL = 0; uint8 constant OP_DELEGATECALL = 1; uint8 constant OP_CREATE = 2; uint8 constant OP_CREATE2 = 3; function _execute(address to, uint256 value, bytes calldata data, uint8 operation) internal returns (bytes memory) { if (operation == OP_CALL) return _call(to, value, data); if (operation == OP_DELEGATECALL) { address sandbox = LibSandbox.sandbox(address(this)); if (sandbox.code.length == 0) LibSandbox.deploy(address(this)); return _call(sandbox, value, abi.encodePacked(to, data)); } if (operation == OP_CREATE) return abi.encodePacked(_create(value, data)); if (operation == OP_CREATE2) { bytes32 salt = bytes32(data[:32]); bytes calldata bytecode = data[32:]; return abi.encodePacked(_create2(value, salt, bytecode)); } revert InvalidOperation(); } function _call(address to, uint256 value, bytes memory data) internal returns (bytes memory result) { bool success; (success, result) = to.call{value: value}(data); if (!success) { assembly { revert(add(result, 32), mload(result)) } } } function _create(uint256 value, bytes memory data) internal returns (address created) { bytes memory bytecode = data; assembly { created := create(value, add(bytecode, 0x20), mload(bytecode)) } if (created == address(0)) revert ContractCreationFailed(); } function _create2(uint256 value, bytes32 salt, bytes calldata data) internal returns (address created) { bytes memory bytecode = data; assembly { created := create2(value, add(bytecode, 0x20), mload(bytecode), salt) } if (created == address(0)) revert ContractCreationFailed(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "erc6551/interfaces/IERC6551Executable.sol"; import "erc6551/interfaces/IERC6551Account.sol"; import "erc6551/lib/ERC6551AccountLib.sol"; import "../../utils/Errors.sol"; import "../../lib/LibExecutor.sol"; import "../../lib/LibSandbox.sol"; import "./SandboxExecutor.sol"; import "./BaseExecutor.sol"; /** * @title ERC-6551 Executor * @dev Basic executor which implements the IERC6551Executable execution interface */ abstract contract ERC6551Executor is IERC6551Executable, ERC165, BaseExecutor { /** * Executes a low-level operation from this account if the caller is a valid executor * * @param to Account to operate on * @param value Value to send with operation * @param data Encoded calldata of operation * @param operation Operation type (0=CALL, 1=DELEGATECALL, 2=CREATE, 3=CREATE2) */ function execute(address to, uint256 value, bytes calldata data, uint8 operation) external payable virtual returns (bytes memory) { if (!_isValidExecutor(_msgSender())) revert NotAuthorized(); _beforeExecute(); return LibExecutor._execute(to, value, data, operation); } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC6551Executable).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "../../utils/Errors.sol"; import "./BaseExecutor.sol"; /** * @title Batch Executor * @dev Allows multiple operations to be executed from this account in a single transaction */ abstract contract BatchExecutor is BaseExecutor { struct Operation { address to; uint256 value; bytes data; uint8 operation; } /** * @notice Executes a batch of operations if the caller is authorized * @param operations Operations to execute */ function executeBatch(Operation[] calldata operations) external payable returns (bytes[] memory) { if (!_isValidExecutor(_msgSender())) revert NotAuthorized(); _beforeExecute(); uint256 length = operations.length; bytes[] memory results = new bytes[](length); for (uint256 i = 0; i < length; i++) { results[i] = LibExecutor._execute( operations[i].to, operations[i].value, operations[i].data, operations[i].operation ); } return results; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "erc6551/interfaces/IERC6551Executable.sol"; import "erc6551/interfaces/IERC6551Account.sol"; import "erc6551/lib/ERC6551AccountLib.sol"; import "../../utils/Errors.sol"; import "../../lib/LibExecutor.sol"; import "../../lib/LibSandbox.sol"; import "./SandboxExecutor.sol"; import "./BaseExecutor.sol"; import "../Lockable.sol"; /** * @title Nested Account Executor * @dev Allows the root owner of a nested token bound account to execute transactions directly * against the nested account, even if intermediate accounts have not been created. */ abstract contract NestedAccountExecutor is BaseExecutor { address immutable __self = address(this); address public immutable erc6551Registry; struct ERC6551AccountInfo { bytes32 salt; address tokenContract; uint256 tokenId; } constructor(address _erc6551Registry) { if (_erc6551Registry == address(0)) revert InvalidERC6551Registry(); erc6551Registry = _erc6551Registry; } /** * Executes a low-level operation from this account if the caller is a valid signer on the * parent TBA specified in the proof * * @param to Account to operate on * @param value Value to send with operation * @param data Encoded calldata of operation * @param operation Operation type (0=CALL, 1=DELEGATECALL, 2=CREATE, 3=CREATE2) * @param proof An array of ERC-6551 account information specifying the ownership path from this * account to its parent */ function executeNested( address to, uint256 value, bytes calldata data, uint8 operation, ERC6551AccountInfo[] calldata proof ) external payable returns (bytes memory) { uint256 length = proof.length; address current = _msgSender(); ERC6551AccountInfo calldata accountInfo; for (uint256 i = 0; i < length; i++) { accountInfo = proof[i]; address tokenContract = accountInfo.tokenContract; uint256 tokenId = accountInfo.tokenId; address next = ERC6551AccountLib.computeAddress( erc6551Registry, __self, accountInfo.salt, block.chainid, tokenContract, tokenId ); if (tokenContract.code.length == 0) revert InvalidAccountProof(); if (next.code.length > 0) { if (Lockable(next).isLocked()) revert AccountLocked(); } try IERC721(tokenContract).ownerOf(tokenId) returns (address _owner) { if (_owner != current) revert InvalidAccountProof(); current = next; } catch { revert InvalidAccountProof(); } } if (!_isValidExecutor(current)) revert NotAuthorized(); _beforeExecute(); return LibExecutor._execute(to, value, data, operation); } }
// 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.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.12; /** * manage deposits and stakes. * deposit is just a balance used to pay for UserOperations (either by a paymaster or an account) * stake is value locked for at least "unstakeDelay" by the staked entity. */ interface IStakeManager { event Deposited( address indexed account, uint256 totalDeposit ); event Withdrawn( address indexed account, address withdrawAddress, uint256 amount ); /// Emitted when stake or unstake delay are modified event StakeLocked( address indexed account, uint256 totalStaked, uint256 unstakeDelaySec ); /// Emitted once a stake is scheduled for withdrawal event StakeUnlocked( address indexed account, uint256 withdrawTime ); event StakeWithdrawn( address indexed account, address withdrawAddress, uint256 amount ); /** * @param deposit the entity's deposit * @param staked true if this entity is staked. * @param stake actual amount of ether staked for this entity. * @param unstakeDelaySec minimum delay to withdraw the stake. * @param withdrawTime - first block timestamp where 'withdrawStake' will be callable, or zero if already locked * @dev sizes were chosen so that (deposit,staked, stake) fit into one cell (used during handleOps) * and the rest fit into a 2nd cell. * 112 bit allows for 10^15 eth * 48 bit for full timestamp * 32 bit allows 150 years for unstake delay */ struct DepositInfo { uint112 deposit; bool staked; uint112 stake; uint32 unstakeDelaySec; uint48 withdrawTime; } //API struct used by getStakeInfo and simulateValidation struct StakeInfo { uint256 stake; uint256 unstakeDelaySec; } /// @return info - full deposit information of given account function getDepositInfo(address account) external view returns (DepositInfo memory info); /// @return the deposit (for gas payment) of the account function balanceOf(address account) external view returns (uint256); /** * add to the deposit of the given account */ function depositTo(address account) external payable; /** * add to the account's stake - amount and delay * any pending unstake is first cancelled. * @param _unstakeDelaySec the new lock duration before the deposit can be withdrawn. */ function addStake(uint32 _unstakeDelaySec) external payable; /** * attempt to unlock the stake. * the value can be withdrawn (using withdrawStake) after the unstake delay. */ function unlockStake() external; /** * withdraw from the (unlocked) stake. * must first call unlockStake and wait for the unstakeDelay to pass * @param withdrawAddress the address to send withdrawn value. */ function withdrawStake(address payable withdrawAddress) external; /** * withdraw from the deposit. * @param withdrawAddress the address to send withdrawn value. * @param withdrawAmount the amount to withdraw. */ function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "./UserOperation.sol"; /** * Aggregated Signatures validator. */ interface IAggregator { /** * validate aggregated signature. * revert if the aggregated signature does not match the given list of operations. */ function validateSignatures(UserOperation[] calldata userOps, bytes calldata signature) external view; /** * validate signature of a single userOp * This method is should be called by bundler after EntryPoint.simulateValidation() returns (reverts) with ValidationResultWithAggregation * First it validates the signature over the userOp. Then it returns data to be used when creating the handleOps. * @param userOp the userOperation received from the user. * @return sigForUserOp the value to put into the signature field of the userOp when calling handleOps. * (usually empty, unless account and aggregator support some kind of "multisig" */ function validateUserOpSignature(UserOperation calldata userOp) external view returns (bytes memory sigForUserOp); /** * aggregate multiple signatures into a single value. * This method is called off-chain to calculate the signature to pass with handleOps() * bundler MAY use optimized custom code perform this aggregation * @param userOps array of UserOperations to collect the signatures from. * @return aggregatedSignature the aggregated signature */ function aggregateSignatures(UserOperation[] calldata userOps) external view returns (bytes memory aggregatedSignature); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; interface INonceManager { /** * Return the next nonce for this sender. * Within a given key, the nonce values are sequenced (starting with zero, and incremented by one on each userop) * But UserOp with different keys can come with arbitrary order. * * @param sender the account address * @param key the high 192 bit of the nonce * @return nonce a full nonce to pass for next UserOp with this sender. */ function getNonce(address sender, uint192 key) external view returns (uint256 nonce); /** * Manually increment the nonce of the sender. * This method is exposed just for completeness.. * Account does NOT need to call it, neither during validation, nor elsewhere, * as the EntryPoint will update the nonce regardless. * Possible use-case is call it with various keys to "initialize" their nonces to one, so that future * UserOperations will not pay extra for the first transaction with a given key. */ function incrementNonce(uint192 key) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /* solhint-disable no-inline-assembly */ /** * returned data from validateUserOp. * validateUserOp returns a uint256, with is created by `_packedValidationData` and parsed by `_parseValidationData` * @param aggregator - address(0) - the account validated the signature by itself. * address(1) - the account failed to validate the signature. * otherwise - this is an address of a signature aggregator that must be used to validate the signature. * @param validAfter - this UserOp is valid only after this timestamp. * @param validaUntil - this UserOp is valid only up to this timestamp. */ struct ValidationData { address aggregator; uint48 validAfter; uint48 validUntil; } //extract sigFailed, validAfter, validUntil. // also convert zero validUntil to type(uint48).max function _parseValidationData(uint validationData) pure returns (ValidationData memory data) { address aggregator = address(uint160(validationData)); uint48 validUntil = uint48(validationData >> 160); if (validUntil == 0) { validUntil = type(uint48).max; } uint48 validAfter = uint48(validationData >> (48 + 160)); return ValidationData(aggregator, validAfter, validUntil); } // intersect account and paymaster ranges. function _intersectTimeRange(uint256 validationData, uint256 paymasterValidationData) pure returns (ValidationData memory) { ValidationData memory accountValidationData = _parseValidationData(validationData); ValidationData memory pmValidationData = _parseValidationData(paymasterValidationData); address aggregator = accountValidationData.aggregator; if (aggregator == address(0)) { aggregator = pmValidationData.aggregator; } uint48 validAfter = accountValidationData.validAfter; uint48 validUntil = accountValidationData.validUntil; uint48 pmValidAfter = pmValidationData.validAfter; uint48 pmValidUntil = pmValidationData.validUntil; if (validAfter < pmValidAfter) validAfter = pmValidAfter; if (validUntil > pmValidUntil) validUntil = pmValidUntil; return ValidationData(aggregator, validAfter, validUntil); } /** * helper to pack the return value for validateUserOp * @param data - the ValidationData to pack */ function _packValidationData(ValidationData memory data) pure returns (uint256) { return uint160(data.aggregator) | (uint256(data.validUntil) << 160) | (uint256(data.validAfter) << (160 + 48)); } /** * helper to pack the return value for validateUserOp, when not using an aggregator * @param sigFailed - true for signature failure, false for success * @param validUntil last timestamp this UserOperation is valid (or zero for infinite) * @param validAfter first timestamp this UserOperation is valid */ function _packValidationData(bool sigFailed, uint48 validUntil, uint48 validAfter) pure returns (uint256) { return (sigFailed ? 1 : 0) | (uint256(validUntil) << 160) | (uint256(validAfter) << (160 + 48)); } /** * keccak function over calldata. * @dev copy calldata into memory, do keccak and drop allocated memory. Strangely, this is more efficient than letting solidity do it. */ function calldataKeccak(bytes calldata data) pure returns (bytes32 ret) { assembly { let mem := mload(0x40) let len := data.length calldatacopy(mem, data.offset, len) ret := keccak256(mem, len) } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; import "./UserOperation.sol"; interface IAccount { /** * Validate user's signature and nonce * the entryPoint will make the call to the recipient only if this validation call returns successfully. * signature failure should be reported by returning SIG_VALIDATION_FAILED (1). * This allows making a "simulation call" without a valid signature * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure. * * @dev Must validate caller is the entryPoint. * Must validate the signature and nonce * @param userOp the operation that is about to be executed. * @param userOpHash hash of the user's request data. can be used as the basis for signature. * @param missingAccountFunds missing funds on the account's deposit in the entrypoint. * This is the minimum amount to transfer to the sender(entryPoint) to be able to make the call. * The excess is left as a deposit in the entrypoint, for future calls. * can be withdrawn anytime using "entryPoint.withdrawTo()" * In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero. * @return validationData packaged ValidationData structure. use `_packValidationData` and `_unpackValidationData` to encode and decode * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure, * otherwise, an address of an "authorizer" contract. * <6-byte> validUntil - last timestamp this operation is valid. 0 for "indefinite" * <6-byte> validAfter - first timestamp this operation is valid * If an account doesn't use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure. * Note that the validation code cannot use block.timestamp (or block.number) directly. */ function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds) external returns (uint256 validationData); }
// 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/Create2.sol"; import "../../interfaces/ISandboxExecutor.sol"; import "../../utils/Errors.sol"; import "../../lib/LibSandbox.sol"; import "../../lib/LibExecutor.sol"; /** * @title Sandbox Executor * @dev Allows the sandbox contract for an account to execute low-level operations */ abstract contract SandboxExecutor is ISandboxExecutor { /** * @dev Ensures that a given caller is the sandbox for this account */ function _requireFromSandbox() internal view { if (msg.sender != LibSandbox.sandbox(address(this))) revert NotAuthorized(); } /** * @dev Allows the sandbox contract to execute low-level calls from this account */ function extcall(address to, uint256 value, bytes calldata data) external returns (bytes memory result) { _requireFromSandbox(); return LibExecutor._call(to, value, data); } /** * @dev Allows the sandbox contract to create contracts on behalf of this account */ function extcreate(uint256 value, bytes calldata bytecode) external returns (address) { _requireFromSandbox(); return LibExecutor._create(value, bytecode); } /** * @dev Allows the sandbox contract to create deterministic contracts on behalf of this account */ function extcreate2(uint256 value, bytes32 salt, bytes calldata bytecode) external returns (address) { _requireFromSandbox(); return LibExecutor._create2(value, salt, bytecode); } /** * @dev Allows arbitrary storage reads on this account from external contracts */ function extsload(bytes32 slot) external view returns (bytes32 value) { assembly { value := sload(slot) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/Context.sol"; import "./SandboxExecutor.sol"; /** * @title Base Executor * @dev Base configuration for all executors */ abstract contract BaseExecutor is Context, SandboxExecutor { function _beforeExecute() internal virtual {} function _isValidExecutor(address executor) internal view virtual returns (bool); }
// 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 pragma solidity ^0.8.13; interface ISandboxExecutor { function extcall(address to, uint256 value, bytes calldata data) external returns (bytes memory result); function extcreate(uint256 value, bytes calldata data) external returns (address); function extcreate2(uint256 value, bytes32 salt, bytes calldata bytecode) external returns (address); function extsload(bytes32 slot) external view returns (bytes32 value); }
{ "remappings": [ "account-abstraction/=lib/account-abstraction/contracts/", "erc6551/=lib/erc6551/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "multicall-authenticated/=lib/multicall-authenticated/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"entryPoint_","type":"address"},{"internalType":"address","name":"multicallForwarder","type":"address"},{"internalType":"address","name":"erc6551Registry","type":"address"},{"internalType":"address","name":"guardian","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccountLocked","type":"error"},{"inputs":[],"name":"ContractCreationFailed","type":"error"},{"inputs":[],"name":"ExceedsMaxLockTime","type":"error"},{"inputs":[],"name":"InvalidAccountProof","type":"error"},{"inputs":[],"name":"InvalidERC6551Registry","type":"error"},{"inputs":[],"name":"InvalidEntryPoint","type":"error"},{"inputs":[],"name":"InvalidImplementation","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"InvalidMulticallForwarder","type":"error"},{"inputs":[],"name":"InvalidOperation","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"OwnershipCycle","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"name":"LockUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"address","name":"implementation","type":"address"}],"name":"OverrideUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"hasPermission","type":"bool"}],"name":"PermissionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"entryPoint","outputs":[{"internalType":"contract IEntryPoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc6551Registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint8","name":"operation","type":"uint8"}],"name":"execute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint8","name":"operation","type":"uint8"}],"internalType":"struct BatchExecutor.Operation[]","name":"operations","type":"tuple[]"}],"name":"executeBatch","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint8","name":"operation","type":"uint8"},{"components":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NestedAccountExecutor.ERC6551AccountInfo[]","name":"proof","type":"tuple[]"}],"name":"executeNested","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"extcall","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"bytecode","type":"bytes"}],"name":"extcreate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"bytecode","type":"bytes"}],"name":"extcreate2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"extsload","outputs":[{"internalType":"bytes32","name":"value","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"magicValue","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"isValidSigner","outputs":[{"internalType":"bytes4","name":"magicValue","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockedUntil","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"overrides","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"permissions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"},{"internalType":"address[]","name":"implementations","type":"address[]"}],"name":"setOverrides","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"callers","type":"address[]"},{"internalType":"bool[]","name":"_permissions","type":"bool[]"}],"name":"setPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation","name":"userOp","type":"tuple"},{"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"internalType":"uint256","name":"missingAccountFunds","type":"uint256"}],"name":"validateUserOp","outputs":[{"internalType":"uint256","name":"validationData","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6101406040523060a0819052610120523480156200001c57600080fd5b5060405162003c5138038062003c518339810160408190526200003f916200010b565b8383838382828181876001600160a01b0381166200007057604051632039d3c960e01b815260040160405180910390fd5b6001600160a01b0390811660805281166200009d576040516246a29560e81b815260040160405180910390fd5b6001600160a01b0390811660c05290811660e0528216620000d15760405163754c753360e11b815260040160405180910390fd5b50506001600160a01b031661010052506200016895505050505050565b80516001600160a01b03811681146200010657600080fd5b919050565b600080600080608085870312156200012257600080fd5b6200012d85620000ee565b93506200013d60208601620000ee565b92506200014d60408601620000ee565b91506200015d60608601620000ee565b905092959194509250565b60805160a05160c05160e0516101005161012051613a4c6200020560003960008181610ca701528181610cf001528181610f8f01528181610fcf0152611100015260008181611a900152611e6b015260006111a801526000818161025a01528181610a63015261243f015260008181610a84015261241e0152600081816104eb0152818161149a015281816119d901526120960152613a4c6000f3fe6080604052600436106101dc5760003560e01c8063523e326011610102578063bc197c8111610095578063dd46706411610064578063dd4670641461058f578063ee9c6054146105af578063f23a6e61146105f0578063fc0c546a14610610576101eb565b8063bc197c811461052f578063c19d93fb1461054f578063ce0617ec14610564578063d087d2881461057a576101eb565b80638da5cb5b116100d15780638da5cb5b146104b0578063a4e2d634146104c5578063b0d691fe146104dc578063b709467c1461050f576101eb565b8063523e32601461043b57806352d1902d1461045b578063572b6c05146104705780637a8f735614610490576101eb565b80631fb1ecf01161017a57806343629a731161014957806343629a73146103d557806345a24e3e146103f55780634f1ef286146104155780635194544714610428576101eb565b80631fb1ecf01461035557806334715fb1146103755780633659cfe6146103955780633a871cdd146103b5576101eb565b8063150b7a02116101b6578063150b7a02146102945780631626ba7e146102cd5780631e2eaeaf146102ed5780631f9838b51461031a576101eb565b806301ffc9a7146101f3578063039721b114610228578063056d5afe14610248576101eb565b366101eb576101e9610648565b005b6101e9610648565b3480156101ff57600080fd5b5061021361020e366004612d33565b610751565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b506101e9610243366004612d92565b61077f565b34801561025457600080fd5b5061027c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161021f565b3480156102a057600080fd5b506102b46102af366004612ec7565b61096d565b6040516001600160e01b0319909116815260200161021f565b3480156102d957600080fd5b506102b46102e8366004612f73565b6109e0565b3480156102f957600080fd5b5061030c610308366004612fbe565b5490565b60405190815260200161021f565b34801561032657600080fd5b50610213610335366004612fd7565b600260209081526000928352604080842090915290825290205460ff1681565b610368610363366004613021565b610a0b565b60405161021f9190613140565b34801561038157600080fd5b5061027c610390366004613153565b610c7e565b3480156103a157600080fd5b506101e96103b0366004613199565b610c9d565b3480156103c157600080fd5b5061030c6103d03660046131b6565b610d85565b6103e86103e3366004613209565b610da4565b60405161021f919061324a565b34801561040157600080fd5b5061027c610410366004612f73565b610f3b565b6101e96104233660046132ac565b610f85565b6103686104363660046132fb565b611055565b34801561044757600080fd5b506102b461045636600461336b565b61109e565b34801561046757600080fd5b5061030c6110f3565b34801561047c57600080fd5b5061021361048b366004613199565b6111a6565b34801561049c57600080fd5b506101e96104ab366004612d92565b6111d8565b3480156104bc57600080fd5b5061027c611408565b3480156104d157600080fd5b506000544210610213565b3480156104e857600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061027c565b34801561051b57600080fd5b5061036861052a3660046133a6565b61142f565b34801561053b57600080fd5b506102b461054a36600461345d565b61147a565b34801561055b57600080fd5b5060035461030c565b34801561057057600080fd5b5061030c60005481565b34801561058657600080fd5b5061030c611496565b34801561059b57600080fd5b506101e96105aa366004612fbe565b61152f565b3480156105bb57600080fd5b5061027c6105ca36600461350a565b60016020908152600092835260408084209091529082529020546001600160a01b031681565b3480156105fc57600080fd5b506102b461060b36600461353f565b611616565b34801561061c57600080fd5b50610625611632565b604080519384526001600160a01b0390921660208401529082015260600161021f565b600080600061065561164a565b9250925092506000610668848484611658565b6001600160a01b0380821660009081526001602090815260408083206001600160e01b0319843516845290915290205491925016801561074a5760006106ad30611674565b9050600080826001600160a01b031684600036336040516020016106d494939291906135a7565b60408051601f19818403018152908290526106ee916135e5565b6000604051808303816000865af19150503d806000811461072b576040519150601f19603f3d011682016040523d82523d6000602084013e610730565b606091505b50915091508161074257805160208201fd5b805160208201f35b5050505050565b60008061075d836116af565b9050801561076e5750600192915050565b6107766116d4565b50600092915050565b600080600061078c61164a565b925092509250600061079f848484611658565b90506001600160a01b0381166107c85760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b038216146107f15760405163ea8e4eb560e01b815260040160405180910390fd5b6107f9611787565b8685811461081a5760405163b4fa3fb360e01b815260040160405180910390fd5b60005b818110156109615787878281811061083757610837613601565b905060200201602081019061084c9190613625565b6001600160a01b0384166000908152600260205260408120908c8c8581811061087757610877613601565b905060200201602081019061088c9190613199565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f394777a58092892d136a90c4bb7e4350c72ac50fba6a0208128677f36527dcf5838b8b848181106108e8576108e8613601565b90506020020160208101906108fd9190613199565b8a8a8581811061090f5761090f613601565b90506020020160208101906109249190613625565b604080516001600160a01b03948516815293909216602084015215159082015260600160405180910390a18061095981613658565b91505061081d565b50505050505050505050565b60008060008061097b61164a565b91945092509050336001600160a01b03831614801561099957508086145b80156109a457504683145b156109c25760405163b79e3f3f60e01b815260040160405180910390fd5b6109ca610648565b50630a85bd0160e11b925050505b949350505050565b60006109ed8484846117b4565b15610a005750630b135d3f60e11b610a04565b5060005b9392505050565b6060816000610a18611941565b90503660005b83811015610c3357868682818110610a3857610a38613601565b90506060020191506000826020016020810190610a559190613199565b905060408301356000610aad7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000873546878761194b565b9050826001600160a01b03163b600003610ada57604051631052dd2560e21b815260040160405180910390fd5b6001600160a01b0381163b15610b6a57806001600160a01b031663a4e2d6346040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c9190613671565b15610b6a57604051636315bfbb60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390526001600160a01b03841690636352211e90602401602060405180830381865afa925050508015610bcb575060408051601f3d908101601f19168201909252610bc89181019061368e565b60015b610be857604051631052dd2560e21b815260040160405180910390fd5b866001600160a01b0316816001600160a01b031614610c1a57604051631052dd2560e21b815260040160405180910390fd5b509450829150610c2b905081613658565b915050610a1e565b50610c3d826119d5565b610c5a5760405163ea8e4eb560e01b815260040160405180910390fd5b610c62611787565b610c6f8b8b8b8b8b611bbd565b9b9a5050505050505050505050565b6000610c88611d99565b610c9485858585611dd3565b95945050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610cee5760405162461bcd60e51b8152600401610ce5906136ab565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d376000805160206139d0833981519152546001600160a01b031690565b6001600160a01b031614610d5d5760405162461bcd60e51b8152600401610ce5906136f7565b610d6681611e4c565b60408051600080825260208201909252610d8291839190611f1b565b50565b6000610d8f61208b565b610d998484612103565b9050610a048261213b565b6060610db6610db1611941565b6119d5565b610dd35760405163ea8e4eb560e01b815260040160405180910390fd5b610ddb611787565b816000816001600160401b03811115610df657610df6612e12565b604051908082528060200260200182016040528015610e2957816020015b6060815260200190600190039081610e145790505b50905060005b82811015610f3057610f00868683818110610e4c57610e4c613601565b9050602002810190610e5e9190613743565b610e6c906020810190613199565b878784818110610e7e57610e7e613601565b9050602002810190610e909190613743565b60200135888885818110610ea657610ea6613601565b9050602002810190610eb89190613743565b610ec6906040810190613759565b8a8a87818110610ed857610ed8613601565b9050602002810190610eea9190613743565b610efb90608081019060600161379f565b611bbd565b828281518110610f1257610f12613601565b60200260200101819052508080610f2890613658565b915050610e2f565b509150505b92915050565b6000610f45611d99565b6109d88484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061218892505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610fcd5760405162461bcd60e51b8152600401610ce5906136ab565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110166000805160206139d0833981519152546001600160a01b031690565b6001600160a01b03161461103c5760405162461bcd60e51b8152600401610ce5906136f7565b61104582611e4c565b61105182826001611f1b565b5050565b6060611062610db1611941565b61107f5760405163ea8e4eb560e01b815260040160405180910390fd5b611087611787565b6110948686868686611bbd565b9695505050505050565b60006110e08484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121c592505050565b15610a005750630291f19360e51b610a04565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111935760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610ce5565b506000805160206139d083398151915290565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b60008060006111e561164a565b92509250925060006111f8848484611658565b90506001600160a01b0381166112215760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b0382161461124a5760405163ea8e4eb560e01b815260040160405180910390fd5b611252611787565b600061125d30611674565b9050806001600160a01b03163b60000361127a5761127a30612273565b8786811461129b5760405163b4fa3fb360e01b815260040160405180910390fd5b60005b818110156113fb578888828181106112b8576112b8613601565b90506020020160208101906112cd9190613199565b6001600160a01b0385166000908152600160205260408120908d8d858181106112f8576112f8613601565b905060200201602081019061130d9190612d33565b6001600160e01b0319168152602081019190915260400160002080546001600160a01b0319166001600160a01b03929092169190911790557f2c722487e90aca38ec1b074c3403210bd2bfb769b4da7f12f7bf0b9e37517c18848c8c8481811061137957611379613601565b905060200201602081019061138e9190612d33565b8b8b858181106113a0576113a0613601565b90506020020160208101906113b59190613199565b604080516001600160a01b0394851681526001600160e01b031993909316602084015292168183015290519081900360600190a1806113f381613658565b91505061129e565b5050505050505050505050565b60008060008061141661164a565b9250925092506114278383836122a7565b935050505090565b6060611439611d99565b610c94858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061234692505050565b6000611484610648565b5063bc197c8160e01b95945050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000604051631aab3f0d60e11b8152306004820152600060248201526001600160a01b0391909116906335567e1a90604401602060405180830381865afa158015611506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152a91906137ba565b905090565b600080600061153c61164a565b925092509250600061154f848484611658565b90506001600160a01b0381166115785760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b038216146115a15760405163ea8e4eb560e01b815260040160405180910390fd5b6115af426301e133806137d3565b8511156115cf576040516301814f7d60e31b815260040160405180910390fd5b6115d7611787565b60008590556040518581527fa7b24c66dd3269a292a60b3facdbb8f3e7557d1e19e64d99e0d6ee7250be63ad9060200160405180910390a15050505050565b6000611620610648565b5063f23a6e6160e01b95945050505050565b600080600061163f61164a565b925092509250909192565b600080600061163f306123bf565b6000806116668585856122a7565b9050610c9481868686612414565b6000610f357f97f795a08410e77dc9dbbaba3915f17c601e45642518dd578bd440d8775bfee46116a3846124e3565b8051906020012061254e565b60006001600160e01b03198216635194544760e01b1480610f355750610f358261255b565b60008060006116e161164a565b92509250925060006116f4848484611658565b6001600160a01b0380821660009081526001602090815260408083206001600160e01b0319843516845290915290205491925016801561074a57600080826001600160a01b031660003660405161174c9291906137e6565b600060405180830381855afa9150503d806000811461072b576040519150601f19603f3d011682016040523d82523d6000602084013e610730565b6000544210156117aa57604051636315bfbb60e01b815260040160405180910390fd5b6117b2612580565b565b600080838360408181106117ca576117ca613601565b919091013560f81c9150600090508181036118b1576117ed6020600086886137f6565b6117f691613820565b60001c905061181481604051806020016040528060008152506121c5565b15801561182a57506001600160a01b0381163014155b1561183a57600092505050610a04565b366000868661184d6040602083856137f6565b61185691613820565b6118619282906137f6565b915091506118a6838984848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506125ba92505050565b945050505050610a04565b60006118f38787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126a692505050565b9092509050600081600481111561190c5761190c61383e565b1461191d5760009350505050610a04565b61193682604051806020016040528060008152506121c5565b979650505050505050565b600061152a6126eb565b6040805160b78082018490526001600160a01b038516609783015260778201869052605782018790526e5af43d82803e903d91602b57fd5bf3603783015260288201889052733d60ad80600a3d3981f3363d3d373d3d3d363d736014830152815260d7810190915280516020909101206000906119c986828a61271a565b98975050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611a1857506001919050565b6000806000611a2561164a565b925092509250468314611b0b5730611a58611a3e611941565b731111000000000000000000000000000000001110190190565b6001600160a01b031603611a7157506001949350505050565b6040516333932be560e11b81526001600160a01b0386811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063672657ca90602401602060405180830381865afa158015611ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611afb9190613671565b15611b0b57506001949350505050565b6000611b188484846122a7565b9050806001600160a01b0316866001600160a01b031603611b3f5750600195945050505050565b6000611b4d82868686612414565b9050806001600160a01b0316876001600160a01b031603611b75575060019695505050505050565b6001600160a01b038082166000908152600260209081526040808320938b168352929052205460ff1615611bb0575060019695505050505050565b5060009695505050505050565b606060ff8216611c0f57611c08868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061234692505050565b9050610c94565b60001960ff831601611c79576000611c2630611674565b9050806001600160a01b03163b600003611c4357611c4330612273565b611c718187898888604051602001611c5d93929190613854565b604051602081830303815290604052612346565b915050610c94565b60011960ff831601611cfe57611cc58585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061218892505050565b604051602001611ce8919060609190911b6001600160601b031916815260140190565b6040516020818303038152906040529050610c94565b60021960ff831601611d80576000611d1960208286886137f6565b611d2291613820565b9050366000611d34866020818a6137f6565b91509150611d4488848484611dd3565b604051602001611d67919060609190911b6001600160601b031916815260140190565b6040516020818303038152906040529350505050610c94565b604051631cc6a69960e11b815260040160405180910390fd5b611da230611674565b6001600160a01b0316336001600160a01b0316146117b25760405163ea8e4eb560e01b815260040160405180910390fd5b60008083838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825192935087929150506020830188f591506001600160a01b038216611e435760405163a28c247360e01b815260040160405180910390fd5b50949350505050565b604051631506fd4d60e01b81526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690631506fd4d90602401602060405180830381865afa158015611eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed69190613671565b611ef35760405163340aafcd60e11b815260040160405180910390fd5b611efe610db1611941565b610d825760405163ea8e4eb560e01b815260040160405180910390fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611f5357611f4e83612744565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611fad575060408051601f3d908101601f19168201909252611faa918101906137ba565b60015b6120105760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610ce5565b6000805160206139d0833981519152811461207f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610ce5565b50611f4e8383836127e0565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146117b25760405162461bcd60e51b815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610ce5565b6000612125612112848461280b565b612120610140860186613759565b6117b4565b1561213257506000610f35565b50600192915050565b8015610d8257604051600090339060001990849084818181858888f193505050503d806000811461074a576040519150601f19603f3d011682016040523d82523d6000602084013e61074a565b805160009082906020820185f091506001600160a01b0382166121be5760405163a28c247360e01b815260040160405180910390fd5b5092915050565b6000806000806121d361164a565b92509250925060006121e68484846122a7565b9050806001600160a01b0316876001600160a01b03160361220e576001945050505050610f35565b600061221c82868686612414565b9050806001600160a01b0316886001600160a01b03160361224557600195505050505050610f35565b6001600160a01b038082166000908152600260209081526040808320938c168352929052205460ff166119c9565b61105160007f97f795a08410e77dc9dbbaba3915f17c601e45642518dd578bd440d8775bfee46122a2846124e3565b61283f565b60004684146122b857506000610a04565b826001600160a01b03163b6000036122d257506000610a04565b6040516331a9108f60e11b8152600481018390526001600160a01b03841690636352211e90602401602060405180830381865afa925050508015612333575060408051601f3d908101601f191682019092526123309181019061368e565b60015b61233f57506000610a04565b9050610a04565b60606000846001600160a01b0316848460405161236391906135e5565b60006040518083038185875af1925050503d80600081146123a0576040519150601f19603f3d011682016040523d82523d6000602084013e6123a5565b606091505b5092509050806123b757815160208301fd5b509392505050565b60408051606080825260808201909252600091829182918291906020820181803683370190505090506060604d60208301873c808060200190518101906124069190613880565b935093509350509193909250565b6000845b612463817f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612943565b15610c9457806001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156124a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ca9190613880565b919650945092506124dc8585856122a7565b9050612418565b60606040518060400160405280600e81526020016d604380600d600039806000f3fe7360901b815250826040518060600160405280602e81526020016139a2602e9139604051602001612538939291906138b9565b6040516020818303038152906040529050919050565b6000610a0483833061271a565b60006001600160e01b03198216636faff5f160e01b1480610f355750610f35826129f2565b60035461258b612a27565b60405160200161259d93929190613900565b60408051601f198184030181529190528051602090910120600355565b6000806000856001600160a01b0316631626ba7e60e01b86866040516024016125e4929190613936565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161262291906135e5565b600060405180830381855afa9150503d806000811461265d576040519150601f19603f3d011682016040523d82523d6000602084013e612662565b606091505b509150915081801561267657506020815110155b801561109457508051630b135d3f60e11b9061269b90830160209081019084016137ba565b149695505050505050565b60008082516041036126dc5760208301516040840151606085015160001a6126d087828585612a3a565b945094505050506126e4565b506000905060025b9250929050565b60006126f6336111a6565b8015612703575060143610155b15612715575060131936013560601c90565b503390565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6001600160a01b0381163b6127b15760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610ce5565b6000805160206139d083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6127e983612afe565b6000825111806127f65750805b15611f4e576128058383612b3e565b50505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610a04565b6000834710156128915760405162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610ce5565b81516000036128e25760405162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610ce5565b8282516020840186f590506001600160a01b038116610a045760405162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610ce5565b6000836001600160a01b03163b60ad1461295f57506000610a04565b600061296a85612b63565b9050806001600160a01b03163b600003612988576000915050610a04565b836001600160a01b0316816001600160a01b0316146129ab576000915050610a04565b6000806000806129ba89612b75565b93509350935093506129d087868686868661194b565b6001600160a01b0316896001600160a01b031614955050505050509392505050565b60006001600160e01b03198216630271189760e51b1480610f3557506301ffc9a760e01b6001600160e01b0319831614610f35565b366000612a32612bcd565b915091509091565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612a715750600090506003612af5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612ac5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612aee57600060019250925050612af5565b9150600090505b94509492505050565b612b0781612744565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a0483836040518060600160405280602781526020016139f060279139612c0f565b60006014600a600c843c505060005190565b60408051608080825260a0820190925260009182918291829182916020820181803683370190505090506080602d60208301883c80806020019051810190612bbd919061394f565b9450945094509450509193509193565b366000612bd9336111a6565b8015612be6575060143610155b15612c075760008036612bfa60148261398e565b92612a32939291906137f6565b600036612a32565b6060600080856001600160a01b031685604051612c2c91906135e5565b600060405180830381855af49150503d8060008114612c67576040519150601f19603f3d011682016040523d82523d6000602084013e612c6c565b606091505b50915091506110948683838760608315612ce7578251600003612ce0576001600160a01b0385163b612ce05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ce5565b50816109d8565b6109d88383815115612cfc5781518083602001fd5b8060405162461bcd60e51b8152600401610ce59190613140565b80356001600160e01b031981168114612d2e57600080fd5b919050565b600060208284031215612d4557600080fd5b610a0482612d16565b60008083601f840112612d6057600080fd5b5081356001600160401b03811115612d7757600080fd5b6020830191508360208260051b85010111156126e457600080fd5b60008060008060408587031215612da857600080fd5b84356001600160401b0380821115612dbf57600080fd5b612dcb88838901612d4e565b90965094506020870135915080821115612de457600080fd5b50612df187828801612d4e565b95989497509550505050565b6001600160a01b0381168114610d8257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e5057612e50612e12565b604052919050565b600082601f830112612e6957600080fd5b81356001600160401b03811115612e8257612e82612e12565b612e95601f8201601f1916602001612e28565b818152846020838601011115612eaa57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612edd57600080fd5b8435612ee881612dfd565b93506020850135612ef881612dfd565b92506040850135915060608501356001600160401b03811115612f1a57600080fd5b612f2687828801612e58565b91505092959194509250565b60008083601f840112612f4457600080fd5b5081356001600160401b03811115612f5b57600080fd5b6020830191508360208285010111156126e457600080fd5b600080600060408486031215612f8857600080fd5b8335925060208401356001600160401b03811115612fa557600080fd5b612fb186828701612f32565b9497909650939450505050565b600060208284031215612fd057600080fd5b5035919050565b60008060408385031215612fea57600080fd5b8235612ff581612dfd565b9150602083013561300581612dfd565b809150509250929050565b803560ff81168114612d2e57600080fd5b600080600080600080600060a0888a03121561303c57600080fd5b873561304781612dfd565b96506020880135955060408801356001600160401b038082111561306a57600080fd5b6130768b838c01612f32565b909750955085915061308a60608b01613010565b945060808a01359150808211156130a057600080fd5b818a0191508a601f8301126130b457600080fd5b8135818111156130c357600080fd5b8b60206060830285010111156130d857600080fd5b60208301945080935050505092959891949750929550565b60005b8381101561310b5781810151838201526020016130f3565b50506000910152565b6000815180845261312c8160208601602086016130f0565b601f01601f19169290920160200192915050565b602081526000610a046020830184613114565b6000806000806060858703121561316957600080fd5b843593506020850135925060408501356001600160401b0381111561318d57600080fd5b612df187828801612f32565b6000602082840312156131ab57600080fd5b8135610a0481612dfd565b6000806000606084860312156131cb57600080fd5b83356001600160401b038111156131e157600080fd5b840161016081870312156131f457600080fd5b95602085013595506040909401359392505050565b6000806020838503121561321c57600080fd5b82356001600160401b0381111561323257600080fd5b61323e85828601612d4e565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561329f57603f1988860301845261328d858351613114565b94509285019290850190600101613271565b5092979650505050505050565b600080604083850312156132bf57600080fd5b82356132ca81612dfd565b915060208301356001600160401b038111156132e557600080fd5b6132f185828601612e58565b9150509250929050565b60008060008060006080868803121561331357600080fd5b853561331e81612dfd565b94506020860135935060408601356001600160401b0381111561334057600080fd5b61334c88828901612f32565b909450925061335f905060608701613010565b90509295509295909350565b60008060006040848603121561338057600080fd5b833561338b81612dfd565b925060208401356001600160401b03811115612fa557600080fd5b600080600080606085870312156133bc57600080fd5b84356133c781612dfd565b93506020850135925060408501356001600160401b0381111561318d57600080fd5b600082601f8301126133fa57600080fd5b813560206001600160401b0382111561341557613415612e12565b8160051b613424828201612e28565b928352848101820192828101908785111561343e57600080fd5b83870192505b8483101561193657823582529183019190830190613444565b600080600080600060a0868803121561347557600080fd5b853561348081612dfd565b9450602086013561349081612dfd565b935060408601356001600160401b03808211156134ac57600080fd5b6134b889838a016133e9565b945060608801359150808211156134ce57600080fd5b6134da89838a016133e9565b935060808801359150808211156134f057600080fd5b506134fd88828901612e58565b9150509295509295909350565b6000806040838503121561351d57600080fd5b823561352881612dfd565b915061353660208401612d16565b90509250929050565b600080600080600060a0868803121561355757600080fd5b853561356281612dfd565b9450602086013561357281612dfd565b9350604086013592506060860135915060808601356001600160401b0381111561359b57600080fd5b6134fd88828901612e58565b60006bffffffffffffffffffffffff19808760601b16835284866014850137848301818560601b166014820152602881019250505095945050505050565b600082516135f78184602087016130f0565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b8015158114610d8257600080fd5b60006020828403121561363757600080fd5b8135610a0481613617565b634e487b7160e01b600052601160045260246000fd5b60006001820161366a5761366a613642565b5060010190565b60006020828403121561368357600080fd5b8151610a0481613617565b6000602082840312156136a057600080fd5b8151610a0481612dfd565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008235607e198336030181126135f757600080fd5b6000808335601e1984360301811261377057600080fd5b8301803591506001600160401b0382111561378a57600080fd5b6020019150368190038213156126e457600080fd5b6000602082840312156137b157600080fd5b610a0482613010565b6000602082840312156137cc57600080fd5b5051919050565b80820180821115610f3557610f35613642565b8183823760009101908152919050565b6000808585111561380657600080fd5b8386111561381357600080fd5b5050820193919092039150565b80356020831015610f3557600019602084900360031b1b1692915050565b634e487b7160e01b600052602160045260246000fd5b6bffffffffffffffffffffffff198460601b168152818360148301376000910160140190815292915050565b60008060006060848603121561389557600080fd5b8351925060208401516138a781612dfd565b80925050604084015190509250925092565b600084516138cb8184602089016130f0565b606085901b6001600160601b03191690830190815283516138f38160148401602088016130f0565b0160140195945050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b8281526040602082015260006109d86040830184613114565b6000806000806080858703121561396557600080fd5b8451935060208501519250604085015161397e81612dfd565b6060959095015193969295505050565b81810381811115610f3557610f3561364256fe3314601d573d3dfd5b363d3d373d3d6014360360143d5160601c5af43d6000803e80603e573d6000fd5b3d6000f3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220622e8fd59d5b1eb899f493e88d5ea40e561702143ac983ecc5c3e4ecaa8a4f2864736f6c634300081100330000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789000000000000000000000000ca1167915584462449ee5b4ea51c37fe81ecdccd000000000000000000000000000000006551c19487814612e58fe068137757580000000000000000000000002fe5ccb0d7ea195feb87987d3573f9fcce2b5d57
Deployed Bytecode
0x6080604052600436106101dc5760003560e01c8063523e326011610102578063bc197c8111610095578063dd46706411610064578063dd4670641461058f578063ee9c6054146105af578063f23a6e61146105f0578063fc0c546a14610610576101eb565b8063bc197c811461052f578063c19d93fb1461054f578063ce0617ec14610564578063d087d2881461057a576101eb565b80638da5cb5b116100d15780638da5cb5b146104b0578063a4e2d634146104c5578063b0d691fe146104dc578063b709467c1461050f576101eb565b8063523e32601461043b57806352d1902d1461045b578063572b6c05146104705780637a8f735614610490576101eb565b80631fb1ecf01161017a57806343629a731161014957806343629a73146103d557806345a24e3e146103f55780634f1ef286146104155780635194544714610428576101eb565b80631fb1ecf01461035557806334715fb1146103755780633659cfe6146103955780633a871cdd146103b5576101eb565b8063150b7a02116101b6578063150b7a02146102945780631626ba7e146102cd5780631e2eaeaf146102ed5780631f9838b51461031a576101eb565b806301ffc9a7146101f3578063039721b114610228578063056d5afe14610248576101eb565b366101eb576101e9610648565b005b6101e9610648565b3480156101ff57600080fd5b5061021361020e366004612d33565b610751565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b506101e9610243366004612d92565b61077f565b34801561025457600080fd5b5061027c7f000000000000000000000000000000006551c19487814612e58fe0681377575881565b6040516001600160a01b03909116815260200161021f565b3480156102a057600080fd5b506102b46102af366004612ec7565b61096d565b6040516001600160e01b0319909116815260200161021f565b3480156102d957600080fd5b506102b46102e8366004612f73565b6109e0565b3480156102f957600080fd5b5061030c610308366004612fbe565b5490565b60405190815260200161021f565b34801561032657600080fd5b50610213610335366004612fd7565b600260209081526000928352604080842090915290825290205460ff1681565b610368610363366004613021565b610a0b565b60405161021f9190613140565b34801561038157600080fd5b5061027c610390366004613153565b610c7e565b3480156103a157600080fd5b506101e96103b0366004613199565b610c9d565b3480156103c157600080fd5b5061030c6103d03660046131b6565b610d85565b6103e86103e3366004613209565b610da4565b60405161021f919061324a565b34801561040157600080fd5b5061027c610410366004612f73565b610f3b565b6101e96104233660046132ac565b610f85565b6103686104363660046132fb565b611055565b34801561044757600080fd5b506102b461045636600461336b565b61109e565b34801561046757600080fd5b5061030c6110f3565b34801561047c57600080fd5b5061021361048b366004613199565b6111a6565b34801561049c57600080fd5b506101e96104ab366004612d92565b6111d8565b3480156104bc57600080fd5b5061027c611408565b3480156104d157600080fd5b506000544210610213565b3480156104e857600080fd5b507f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d278961027c565b34801561051b57600080fd5b5061036861052a3660046133a6565b61142f565b34801561053b57600080fd5b506102b461054a36600461345d565b61147a565b34801561055b57600080fd5b5060035461030c565b34801561057057600080fd5b5061030c60005481565b34801561058657600080fd5b5061030c611496565b34801561059b57600080fd5b506101e96105aa366004612fbe565b61152f565b3480156105bb57600080fd5b5061027c6105ca36600461350a565b60016020908152600092835260408084209091529082529020546001600160a01b031681565b3480156105fc57600080fd5b506102b461060b36600461353f565b611616565b34801561061c57600080fd5b50610625611632565b604080519384526001600160a01b0390921660208401529082015260600161021f565b600080600061065561164a565b9250925092506000610668848484611658565b6001600160a01b0380821660009081526001602090815260408083206001600160e01b0319843516845290915290205491925016801561074a5760006106ad30611674565b9050600080826001600160a01b031684600036336040516020016106d494939291906135a7565b60408051601f19818403018152908290526106ee916135e5565b6000604051808303816000865af19150503d806000811461072b576040519150601f19603f3d011682016040523d82523d6000602084013e610730565b606091505b50915091508161074257805160208201fd5b805160208201f35b5050505050565b60008061075d836116af565b9050801561076e5750600192915050565b6107766116d4565b50600092915050565b600080600061078c61164a565b925092509250600061079f848484611658565b90506001600160a01b0381166107c85760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b038216146107f15760405163ea8e4eb560e01b815260040160405180910390fd5b6107f9611787565b8685811461081a5760405163b4fa3fb360e01b815260040160405180910390fd5b60005b818110156109615787878281811061083757610837613601565b905060200201602081019061084c9190613625565b6001600160a01b0384166000908152600260205260408120908c8c8581811061087757610877613601565b905060200201602081019061088c9190613199565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f394777a58092892d136a90c4bb7e4350c72ac50fba6a0208128677f36527dcf5838b8b848181106108e8576108e8613601565b90506020020160208101906108fd9190613199565b8a8a8581811061090f5761090f613601565b90506020020160208101906109249190613625565b604080516001600160a01b03948516815293909216602084015215159082015260600160405180910390a18061095981613658565b91505061081d565b50505050505050505050565b60008060008061097b61164a565b91945092509050336001600160a01b03831614801561099957508086145b80156109a457504683145b156109c25760405163b79e3f3f60e01b815260040160405180910390fd5b6109ca610648565b50630a85bd0160e11b925050505b949350505050565b60006109ed8484846117b4565b15610a005750630b135d3f60e11b610a04565b5060005b9392505050565b6060816000610a18611941565b90503660005b83811015610c3357868682818110610a3857610a38613601565b90506060020191506000826020016020810190610a559190613199565b905060408301356000610aad7f000000000000000000000000000000006551c19487814612e58fe068137757587f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec873546878761194b565b9050826001600160a01b03163b600003610ada57604051631052dd2560e21b815260040160405180910390fd5b6001600160a01b0381163b15610b6a57806001600160a01b031663a4e2d6346040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c9190613671565b15610b6a57604051636315bfbb60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390526001600160a01b03841690636352211e90602401602060405180830381865afa925050508015610bcb575060408051601f3d908101601f19168201909252610bc89181019061368e565b60015b610be857604051631052dd2560e21b815260040160405180910390fd5b866001600160a01b0316816001600160a01b031614610c1a57604051631052dd2560e21b815260040160405180910390fd5b509450829150610c2b905081613658565b915050610a1e565b50610c3d826119d5565b610c5a5760405163ea8e4eb560e01b815260040160405180910390fd5b610c62611787565b610c6f8b8b8b8b8b611bbd565b9b9a5050505050505050505050565b6000610c88611d99565b610c9485858585611dd3565b95945050505050565b6001600160a01b037f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec163003610cee5760405162461bcd60e51b8152600401610ce5906136ab565b60405180910390fd5b7f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec6001600160a01b0316610d376000805160206139d0833981519152546001600160a01b031690565b6001600160a01b031614610d5d5760405162461bcd60e51b8152600401610ce5906136f7565b610d6681611e4c565b60408051600080825260208201909252610d8291839190611f1b565b50565b6000610d8f61208b565b610d998484612103565b9050610a048261213b565b6060610db6610db1611941565b6119d5565b610dd35760405163ea8e4eb560e01b815260040160405180910390fd5b610ddb611787565b816000816001600160401b03811115610df657610df6612e12565b604051908082528060200260200182016040528015610e2957816020015b6060815260200190600190039081610e145790505b50905060005b82811015610f3057610f00868683818110610e4c57610e4c613601565b9050602002810190610e5e9190613743565b610e6c906020810190613199565b878784818110610e7e57610e7e613601565b9050602002810190610e909190613743565b60200135888885818110610ea657610ea6613601565b9050602002810190610eb89190613743565b610ec6906040810190613759565b8a8a87818110610ed857610ed8613601565b9050602002810190610eea9190613743565b610efb90608081019060600161379f565b611bbd565b828281518110610f1257610f12613601565b60200260200101819052508080610f2890613658565b915050610e2f565b509150505b92915050565b6000610f45611d99565b6109d88484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061218892505050565b6001600160a01b037f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec163003610fcd5760405162461bcd60e51b8152600401610ce5906136ab565b7f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec6001600160a01b03166110166000805160206139d0833981519152546001600160a01b031690565b6001600160a01b03161461103c5760405162461bcd60e51b8152600401610ce5906136f7565b61104582611e4c565b61105182826001611f1b565b5050565b6060611062610db1611941565b61107f5760405163ea8e4eb560e01b815260040160405180910390fd5b611087611787565b6110948686868686611bbd565b9695505050505050565b60006110e08484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121c592505050565b15610a005750630291f19360e51b610a04565b6000306001600160a01b037f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec16146111935760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610ce5565b506000805160206139d083398151915290565b7f000000000000000000000000ca1167915584462449ee5b4ea51c37fe81ecdccd6001600160a01b0390811691161490565b60008060006111e561164a565b92509250925060006111f8848484611658565b90506001600160a01b0381166112215760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b0382161461124a5760405163ea8e4eb560e01b815260040160405180910390fd5b611252611787565b600061125d30611674565b9050806001600160a01b03163b60000361127a5761127a30612273565b8786811461129b5760405163b4fa3fb360e01b815260040160405180910390fd5b60005b818110156113fb578888828181106112b8576112b8613601565b90506020020160208101906112cd9190613199565b6001600160a01b0385166000908152600160205260408120908d8d858181106112f8576112f8613601565b905060200201602081019061130d9190612d33565b6001600160e01b0319168152602081019190915260400160002080546001600160a01b0319166001600160a01b03929092169190911790557f2c722487e90aca38ec1b074c3403210bd2bfb769b4da7f12f7bf0b9e37517c18848c8c8481811061137957611379613601565b905060200201602081019061138e9190612d33565b8b8b858181106113a0576113a0613601565b90506020020160208101906113b59190613199565b604080516001600160a01b0394851681526001600160e01b031993909316602084015292168183015290519081900360600190a1806113f381613658565b91505061129e565b5050505050505050505050565b60008060008061141661164a565b9250925092506114278383836122a7565b935050505090565b6060611439611d99565b610c94858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061234692505050565b6000611484610648565b5063bc197c8160e01b95945050505050565b60007f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789604051631aab3f0d60e11b8152306004820152600060248201526001600160a01b0391909116906335567e1a90604401602060405180830381865afa158015611506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152a91906137ba565b905090565b600080600061153c61164a565b925092509250600061154f848484611658565b90506001600160a01b0381166115785760405163ea8e4eb560e01b815260040160405180910390fd5b336001600160a01b038216146115a15760405163ea8e4eb560e01b815260040160405180910390fd5b6115af426301e133806137d3565b8511156115cf576040516301814f7d60e31b815260040160405180910390fd5b6115d7611787565b60008590556040518581527fa7b24c66dd3269a292a60b3facdbb8f3e7557d1e19e64d99e0d6ee7250be63ad9060200160405180910390a15050505050565b6000611620610648565b5063f23a6e6160e01b95945050505050565b600080600061163f61164a565b925092509250909192565b600080600061163f306123bf565b6000806116668585856122a7565b9050610c9481868686612414565b6000610f357f97f795a08410e77dc9dbbaba3915f17c601e45642518dd578bd440d8775bfee46116a3846124e3565b8051906020012061254e565b60006001600160e01b03198216635194544760e01b1480610f355750610f358261255b565b60008060006116e161164a565b92509250925060006116f4848484611658565b6001600160a01b0380821660009081526001602090815260408083206001600160e01b0319843516845290915290205491925016801561074a57600080826001600160a01b031660003660405161174c9291906137e6565b600060405180830381855afa9150503d806000811461072b576040519150601f19603f3d011682016040523d82523d6000602084013e610730565b6000544210156117aa57604051636315bfbb60e01b815260040160405180910390fd5b6117b2612580565b565b600080838360408181106117ca576117ca613601565b919091013560f81c9150600090508181036118b1576117ed6020600086886137f6565b6117f691613820565b60001c905061181481604051806020016040528060008152506121c5565b15801561182a57506001600160a01b0381163014155b1561183a57600092505050610a04565b366000868661184d6040602083856137f6565b61185691613820565b6118619282906137f6565b915091506118a6838984848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506125ba92505050565b945050505050610a04565b60006118f38787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126a692505050565b9092509050600081600481111561190c5761190c61383e565b1461191d5760009350505050610a04565b61193682604051806020016040528060008152506121c5565b979650505050505050565b600061152a6126eb565b6040805160b78082018490526001600160a01b038516609783015260778201869052605782018790526e5af43d82803e903d91602b57fd5bf3603783015260288201889052733d60ad80600a3d3981f3363d3d373d3d3d363d736014830152815260d7810190915280516020909101206000906119c986828a61271a565b98975050505050505050565b60007f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d27896001600160a01b0316826001600160a01b031603611a1857506001919050565b6000806000611a2561164a565b925092509250468314611b0b5730611a58611a3e611941565b731111000000000000000000000000000000001110190190565b6001600160a01b031603611a7157506001949350505050565b6040516333932be560e11b81526001600160a01b0386811660048301527f0000000000000000000000002fe5ccb0d7ea195feb87987d3573f9fcce2b5d57169063672657ca90602401602060405180830381865afa158015611ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611afb9190613671565b15611b0b57506001949350505050565b6000611b188484846122a7565b9050806001600160a01b0316866001600160a01b031603611b3f5750600195945050505050565b6000611b4d82868686612414565b9050806001600160a01b0316876001600160a01b031603611b75575060019695505050505050565b6001600160a01b038082166000908152600260209081526040808320938b168352929052205460ff1615611bb0575060019695505050505050565b5060009695505050505050565b606060ff8216611c0f57611c08868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061234692505050565b9050610c94565b60001960ff831601611c79576000611c2630611674565b9050806001600160a01b03163b600003611c4357611c4330612273565b611c718187898888604051602001611c5d93929190613854565b604051602081830303815290604052612346565b915050610c94565b60011960ff831601611cfe57611cc58585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061218892505050565b604051602001611ce8919060609190911b6001600160601b031916815260140190565b6040516020818303038152906040529050610c94565b60021960ff831601611d80576000611d1960208286886137f6565b611d2291613820565b9050366000611d34866020818a6137f6565b91509150611d4488848484611dd3565b604051602001611d67919060609190911b6001600160601b031916815260140190565b6040516020818303038152906040529350505050610c94565b604051631cc6a69960e11b815260040160405180910390fd5b611da230611674565b6001600160a01b0316336001600160a01b0316146117b25760405163ea8e4eb560e01b815260040160405180910390fd5b60008083838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050825192935087929150506020830188f591506001600160a01b038216611e435760405163a28c247360e01b815260040160405180910390fd5b50949350505050565b604051631506fd4d60e01b81526001600160a01b0382811660048301527f0000000000000000000000002fe5ccb0d7ea195feb87987d3573f9fcce2b5d571690631506fd4d90602401602060405180830381865afa158015611eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed69190613671565b611ef35760405163340aafcd60e11b815260040160405180910390fd5b611efe610db1611941565b610d825760405163ea8e4eb560e01b815260040160405180910390fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611f5357611f4e83612744565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611fad575060408051601f3d908101601f19168201909252611faa918101906137ba565b60015b6120105760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610ce5565b6000805160206139d0833981519152811461207f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610ce5565b50611f4e8383836127e0565b336001600160a01b037f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d278916146117b25760405162461bcd60e51b815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610ce5565b6000612125612112848461280b565b612120610140860186613759565b6117b4565b1561213257506000610f35565b50600192915050565b8015610d8257604051600090339060001990849084818181858888f193505050503d806000811461074a576040519150601f19603f3d011682016040523d82523d6000602084013e61074a565b805160009082906020820185f091506001600160a01b0382166121be5760405163a28c247360e01b815260040160405180910390fd5b5092915050565b6000806000806121d361164a565b92509250925060006121e68484846122a7565b9050806001600160a01b0316876001600160a01b03160361220e576001945050505050610f35565b600061221c82868686612414565b9050806001600160a01b0316886001600160a01b03160361224557600195505050505050610f35565b6001600160a01b038082166000908152600260209081526040808320938c168352929052205460ff166119c9565b61105160007f97f795a08410e77dc9dbbaba3915f17c601e45642518dd578bd440d8775bfee46122a2846124e3565b61283f565b60004684146122b857506000610a04565b826001600160a01b03163b6000036122d257506000610a04565b6040516331a9108f60e11b8152600481018390526001600160a01b03841690636352211e90602401602060405180830381865afa925050508015612333575060408051601f3d908101601f191682019092526123309181019061368e565b60015b61233f57506000610a04565b9050610a04565b60606000846001600160a01b0316848460405161236391906135e5565b60006040518083038185875af1925050503d80600081146123a0576040519150601f19603f3d011682016040523d82523d6000602084013e6123a5565b606091505b5092509050806123b757815160208301fd5b509392505050565b60408051606080825260808201909252600091829182918291906020820181803683370190505090506060604d60208301873c808060200190518101906124069190613880565b935093509350509193909250565b6000845b612463817f00000000000000000000000041c8f39463a868d3a88af00cd0fe7102f30e44ec7f000000000000000000000000000000006551c19487814612e58fe06813775758612943565b15610c9457806001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156124a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ca9190613880565b919650945092506124dc8585856122a7565b9050612418565b60606040518060400160405280600e81526020016d604380600d600039806000f3fe7360901b815250826040518060600160405280602e81526020016139a2602e9139604051602001612538939291906138b9565b6040516020818303038152906040529050919050565b6000610a0483833061271a565b60006001600160e01b03198216636faff5f160e01b1480610f355750610f35826129f2565b60035461258b612a27565b60405160200161259d93929190613900565b60408051601f198184030181529190528051602090910120600355565b6000806000856001600160a01b0316631626ba7e60e01b86866040516024016125e4929190613936565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161262291906135e5565b600060405180830381855afa9150503d806000811461265d576040519150601f19603f3d011682016040523d82523d6000602084013e612662565b606091505b509150915081801561267657506020815110155b801561109457508051630b135d3f60e11b9061269b90830160209081019084016137ba565b149695505050505050565b60008082516041036126dc5760208301516040840151606085015160001a6126d087828585612a3a565b945094505050506126e4565b506000905060025b9250929050565b60006126f6336111a6565b8015612703575060143610155b15612715575060131936013560601c90565b503390565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6001600160a01b0381163b6127b15760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610ce5565b6000805160206139d083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6127e983612afe565b6000825111806127f65750805b15611f4e576128058383612b3e565b50505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610a04565b6000834710156128915760405162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610ce5565b81516000036128e25760405162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610ce5565b8282516020840186f590506001600160a01b038116610a045760405162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610ce5565b6000836001600160a01b03163b60ad1461295f57506000610a04565b600061296a85612b63565b9050806001600160a01b03163b600003612988576000915050610a04565b836001600160a01b0316816001600160a01b0316146129ab576000915050610a04565b6000806000806129ba89612b75565b93509350935093506129d087868686868661194b565b6001600160a01b0316896001600160a01b031614955050505050509392505050565b60006001600160e01b03198216630271189760e51b1480610f3557506301ffc9a760e01b6001600160e01b0319831614610f35565b366000612a32612bcd565b915091509091565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612a715750600090506003612af5565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612ac5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612aee57600060019250925050612af5565b9150600090505b94509492505050565b612b0781612744565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610a0483836040518060600160405280602781526020016139f060279139612c0f565b60006014600a600c843c505060005190565b60408051608080825260a0820190925260009182918291829182916020820181803683370190505090506080602d60208301883c80806020019051810190612bbd919061394f565b9450945094509450509193509193565b366000612bd9336111a6565b8015612be6575060143610155b15612c075760008036612bfa60148261398e565b92612a32939291906137f6565b600036612a32565b6060600080856001600160a01b031685604051612c2c91906135e5565b600060405180830381855af49150503d8060008114612c67576040519150601f19603f3d011682016040523d82523d6000602084013e612c6c565b606091505b50915091506110948683838760608315612ce7578251600003612ce0576001600160a01b0385163b612ce05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ce5565b50816109d8565b6109d88383815115612cfc5781518083602001fd5b8060405162461bcd60e51b8152600401610ce59190613140565b80356001600160e01b031981168114612d2e57600080fd5b919050565b600060208284031215612d4557600080fd5b610a0482612d16565b60008083601f840112612d6057600080fd5b5081356001600160401b03811115612d7757600080fd5b6020830191508360208260051b85010111156126e457600080fd5b60008060008060408587031215612da857600080fd5b84356001600160401b0380821115612dbf57600080fd5b612dcb88838901612d4e565b90965094506020870135915080821115612de457600080fd5b50612df187828801612d4e565b95989497509550505050565b6001600160a01b0381168114610d8257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e5057612e50612e12565b604052919050565b600082601f830112612e6957600080fd5b81356001600160401b03811115612e8257612e82612e12565b612e95601f8201601f1916602001612e28565b818152846020838601011115612eaa57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612edd57600080fd5b8435612ee881612dfd565b93506020850135612ef881612dfd565b92506040850135915060608501356001600160401b03811115612f1a57600080fd5b612f2687828801612e58565b91505092959194509250565b60008083601f840112612f4457600080fd5b5081356001600160401b03811115612f5b57600080fd5b6020830191508360208285010111156126e457600080fd5b600080600060408486031215612f8857600080fd5b8335925060208401356001600160401b03811115612fa557600080fd5b612fb186828701612f32565b9497909650939450505050565b600060208284031215612fd057600080fd5b5035919050565b60008060408385031215612fea57600080fd5b8235612ff581612dfd565b9150602083013561300581612dfd565b809150509250929050565b803560ff81168114612d2e57600080fd5b600080600080600080600060a0888a03121561303c57600080fd5b873561304781612dfd565b96506020880135955060408801356001600160401b038082111561306a57600080fd5b6130768b838c01612f32565b909750955085915061308a60608b01613010565b945060808a01359150808211156130a057600080fd5b818a0191508a601f8301126130b457600080fd5b8135818111156130c357600080fd5b8b60206060830285010111156130d857600080fd5b60208301945080935050505092959891949750929550565b60005b8381101561310b5781810151838201526020016130f3565b50506000910152565b6000815180845261312c8160208601602086016130f0565b601f01601f19169290920160200192915050565b602081526000610a046020830184613114565b6000806000806060858703121561316957600080fd5b843593506020850135925060408501356001600160401b0381111561318d57600080fd5b612df187828801612f32565b6000602082840312156131ab57600080fd5b8135610a0481612dfd565b6000806000606084860312156131cb57600080fd5b83356001600160401b038111156131e157600080fd5b840161016081870312156131f457600080fd5b95602085013595506040909401359392505050565b6000806020838503121561321c57600080fd5b82356001600160401b0381111561323257600080fd5b61323e85828601612d4e565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561329f57603f1988860301845261328d858351613114565b94509285019290850190600101613271565b5092979650505050505050565b600080604083850312156132bf57600080fd5b82356132ca81612dfd565b915060208301356001600160401b038111156132e557600080fd5b6132f185828601612e58565b9150509250929050565b60008060008060006080868803121561331357600080fd5b853561331e81612dfd565b94506020860135935060408601356001600160401b0381111561334057600080fd5b61334c88828901612f32565b909450925061335f905060608701613010565b90509295509295909350565b60008060006040848603121561338057600080fd5b833561338b81612dfd565b925060208401356001600160401b03811115612fa557600080fd5b600080600080606085870312156133bc57600080fd5b84356133c781612dfd565b93506020850135925060408501356001600160401b0381111561318d57600080fd5b600082601f8301126133fa57600080fd5b813560206001600160401b0382111561341557613415612e12565b8160051b613424828201612e28565b928352848101820192828101908785111561343e57600080fd5b83870192505b8483101561193657823582529183019190830190613444565b600080600080600060a0868803121561347557600080fd5b853561348081612dfd565b9450602086013561349081612dfd565b935060408601356001600160401b03808211156134ac57600080fd5b6134b889838a016133e9565b945060608801359150808211156134ce57600080fd5b6134da89838a016133e9565b935060808801359150808211156134f057600080fd5b506134fd88828901612e58565b9150509295509295909350565b6000806040838503121561351d57600080fd5b823561352881612dfd565b915061353660208401612d16565b90509250929050565b600080600080600060a0868803121561355757600080fd5b853561356281612dfd565b9450602086013561357281612dfd565b9350604086013592506060860135915060808601356001600160401b0381111561359b57600080fd5b6134fd88828901612e58565b60006bffffffffffffffffffffffff19808760601b16835284866014850137848301818560601b166014820152602881019250505095945050505050565b600082516135f78184602087016130f0565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b8015158114610d8257600080fd5b60006020828403121561363757600080fd5b8135610a0481613617565b634e487b7160e01b600052601160045260246000fd5b60006001820161366a5761366a613642565b5060010190565b60006020828403121561368357600080fd5b8151610a0481613617565b6000602082840312156136a057600080fd5b8151610a0481612dfd565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008235607e198336030181126135f757600080fd5b6000808335601e1984360301811261377057600080fd5b8301803591506001600160401b0382111561378a57600080fd5b6020019150368190038213156126e457600080fd5b6000602082840312156137b157600080fd5b610a0482613010565b6000602082840312156137cc57600080fd5b5051919050565b80820180821115610f3557610f35613642565b8183823760009101908152919050565b6000808585111561380657600080fd5b8386111561381357600080fd5b5050820193919092039150565b80356020831015610f3557600019602084900360031b1b1692915050565b634e487b7160e01b600052602160045260246000fd5b6bffffffffffffffffffffffff198460601b168152818360148301376000910160140190815292915050565b60008060006060848603121561389557600080fd5b8351925060208401516138a781612dfd565b80925050604084015190509250925092565b600084516138cb8184602089016130f0565b606085901b6001600160601b03191690830190815283516138f38160148401602088016130f0565b0160140195945050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b8281526040602082015260006109d86040830184613114565b6000806000806080858703121561396557600080fd5b8451935060208501519250604085015161397e81612dfd565b6060959095015193969295505050565b81810381811115610f3557610f3561364256fe3314601d573d3dfd5b363d3d373d3d6014360360143d5160601c5af43d6000803e80603e573d6000fd5b3d6000f3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220622e8fd59d5b1eb899f493e88d5ea40e561702143ac983ecc5c3e4ecaa8a4f2864736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789000000000000000000000000ca1167915584462449ee5b4ea51c37fe81ecdccd000000000000000000000000000000006551c19487814612e58fe068137757580000000000000000000000002fe5ccb0d7ea195feb87987d3573f9fcce2b5d57
-----Decoded View---------------
Arg [0] : entryPoint_ (address): 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
Arg [1] : multicallForwarder (address): 0xcA1167915584462449EE5b4Ea51c37fE81eCDCCD
Arg [2] : erc6551Registry (address): 0x000000006551c19487814612e58FE06813775758
Arg [3] : guardian (address): 0x2FE5ccb0d7Ea195FEb87987d3573F9fcCE2b5D57
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789
Arg [1] : 000000000000000000000000ca1167915584462449ee5b4ea51c37fe81ecdccd
Arg [2] : 000000000000000000000000000000006551c19487814612e58fe06813775758
Arg [3] : 0000000000000000000000002fe5ccb0d7ea195feb87987d3573f9fcce2b5d57
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.