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 20 internal transactions
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21398472 | 36 days ago | Contract Creation | 0 ETH | |||
21201215 | 63 days ago | Contract Creation | 0 ETH | |||
21195940 | 64 days ago | Contract Creation | 0 ETH | |||
21195859 | 64 days ago | Contract Creation | 0 ETH | |||
21195841 | 64 days ago | Contract Creation | 0 ETH | |||
21195824 | 64 days ago | Contract Creation | 0 ETH | |||
21186910 | 65 days ago | Contract Creation | 0 ETH | |||
21183437 | 66 days ago | Contract Creation | 0 ETH | |||
21175318 | 67 days ago | Contract Creation | 0 ETH | |||
21175295 | 67 days ago | Contract Creation | 0 ETH | |||
21175230 | 67 days ago | Contract Creation | 0 ETH | |||
21123414 | 74 days ago | Contract Creation | 0 ETH | |||
20887491 | 107 days ago | Contract Creation | 0 ETH | |||
20463774 | 166 days ago | Contract Creation | 0 ETH | |||
20434140 | 170 days ago | Contract Creation | 0 ETH | |||
20395193 | 176 days ago | Contract Creation | 0 ETH | |||
20272227 | 193 days ago | Contract Creation | 0 ETH | |||
20261806 | 195 days ago | Contract Creation | 0 ETH | |||
20228266 | 199 days ago | Contract Creation | 0 ETH | |||
20213364 | 201 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:
ERC6551Registry
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "openzeppelin-contracts/utils/Create2.sol"; import "./interfaces/IERC6551Registry.sol"; import "./lib/ERC6551BytecodeLib.sol"; contract ERC6551Registry is IERC6551Registry { error InitializationFailed(); function createAccount( address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 salt, bytes calldata initData ) external returns (address) { bytes memory code = ERC6551BytecodeLib.getCreationCode( implementation, chainId, tokenContract, tokenId, salt ); address _account = Create2.computeAddress(bytes32(salt), keccak256(code)); if (_account.code.length != 0) return _account; emit AccountCreated(_account, implementation, chainId, tokenContract, tokenId, salt); _account = Create2.deploy(0, bytes32(salt), code); if (initData.length != 0) { (bool success, ) = _account.call(initData); if (!success) revert InitializationFailed(); } return _account; } function account( address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 salt ) external view returns (address) { bytes32 bytecodeHash = keccak256( ERC6551BytecodeLib.getCreationCode( implementation, chainId, tokenContract, tokenId, salt ) ); return Create2.computeAddress(bytes32(salt), bytecodeHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Create2.sol) pragma solidity ^0.8.20; /** * @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 Not enough balance for performing a CREATE2 deploy. */ error Create2InsufficientBalance(uint256 balance, uint256 needed); /** * @dev There's no code to deploy. */ error Create2EmptyBytecode(); /** * @dev The deployment failed. */ error Create2FailedDeployment(); /** * @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) { if (address(this).balance < amount) { revert Create2InsufficientBalance(address(this).balance, amount); } if (bytecode.length == 0) { revert Create2EmptyBytecode(); } /// @solidity memory-safe-assembly assembly { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) } if (addr == address(0)) { revert Create2FailedDeployment(); } } /** * @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: UNLICENSED pragma solidity ^0.8.0; interface IERC6551Registry { event AccountCreated( address account, address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 salt ); function createAccount( address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 seed, bytes calldata initData ) external returns (address); function account( address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 salt ) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library ERC6551BytecodeLib { function getCreationCode( address implementation_, uint256 chainId_, address tokenContract_, uint256 tokenId_, uint256 salt_ ) internal pure returns (bytes memory) { return abi.encodePacked( hex"3d60ad80600a3d3981f3363d3d373d3d3d363d73", implementation_, hex"5af43d82803e903d91602b57fd5bf3", abi.encode(salt_, chainId_, tokenContract_, tokenId_) ); } }
{ "remappings": [ "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "@openzeppelin/=lib/openzeppelin-contracts/contracts/", "@openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "erc6551/=lib/reference/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "reference/=lib/reference/", "sstore2/=lib/reference/lib/sstore2/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"Create2EmptyBytecode","type":"error"},{"inputs":[],"name":"Create2FailedDeployment","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"Create2InsufficientBalance","type":"error"},{"inputs":[],"name":"InitializationFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"salt","type":"uint256"}],"name":"AccountCreated","type":"event"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"account","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"initData","type":"bytes"}],"name":"createAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506104ff806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80635e9bc5361461003b578063da7323b31461006a575b600080fd5b61004e610049366004610339565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610387565b6100ac565b60008061008d87878787876101f2565b805160209091012090506100a1838261025b565b979650505050505050565b6000806100bc89898989896101f2565b905060006100d48660001b838051906020012061025b565b90506001600160a01b0381163b156100ef5791506100a19050565b604080516001600160a01b0383811682528c811660208301528183018c90528a1660608201526080810189905260a0810188905290517f07fba7bba1191da7ee1155dcfa0030701c9c9a9cc34a93b991fc6fd0c9268d8f9181900360c00190a161015b6000878461026f565b905083156101e5576000816001600160a01b0316868660405161017f929190610438565b6000604051808303816000865af19150503d80600081146101bc576040519150601f19603f3d011682016040523d82523d6000602084013e6101c1565b606091505b50509050806101e357604051630337323560e31b815260040160405180910390fd5b505b9998505050505050505050565b60408051602081018390529081018590526001600160a01b0384166060828101919091526080820184905290869060a00160408051601f19818403018152908290526102419291602001610448565b604051602081830303815290604052905095945050505050565b60006102688383306102f3565b9392505050565b60008347101561029f5760405163392efb2b60e21b81524760048201526024810185905260440160405180910390fd5b81516000036102c157604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661026857604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b80356001600160a01b038116811461033457600080fd5b919050565b600080600080600060a0868803121561035157600080fd5b61035a8661031d565b94506020860135935061036f6040870161031d565b94979396509394606081013594506080013592915050565b600080600080600080600060c0888a0312156103a257600080fd5b6103ab8861031d565b9650602088013595506103c06040890161031d565b9450606088013593506080880135925060a088013567ffffffffffffffff808211156103eb57600080fd5b818a0191508a601f8301126103ff57600080fd5b81358181111561040e57600080fd5b8b602082850101111561042057600080fd5b60208301945080935050505092959891949750929550565b8183823760009101908152919050565b733d60ad80600a3d3981f3363d3d373d3d3d363d7360601b8152606083901b6bffffffffffffffffffffffff191660148201526e5af43d82803e903d91602b57fd5bf360881b60288201528151600090815b818110156104b7576020818601810151603786840101520161049a565b5060009201603701918252509291505056fea264697066735822122050d1d25a0848d93a343402d5cb6764d535d46307c9a977a5804365938f2a72eb64736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635e9bc5361461003b578063da7323b31461006a575b600080fd5b61004e610049366004610339565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610387565b6100ac565b60008061008d87878787876101f2565b805160209091012090506100a1838261025b565b979650505050505050565b6000806100bc89898989896101f2565b905060006100d48660001b838051906020012061025b565b90506001600160a01b0381163b156100ef5791506100a19050565b604080516001600160a01b0383811682528c811660208301528183018c90528a1660608201526080810189905260a0810188905290517f07fba7bba1191da7ee1155dcfa0030701c9c9a9cc34a93b991fc6fd0c9268d8f9181900360c00190a161015b6000878461026f565b905083156101e5576000816001600160a01b0316868660405161017f929190610438565b6000604051808303816000865af19150503d80600081146101bc576040519150601f19603f3d011682016040523d82523d6000602084013e6101c1565b606091505b50509050806101e357604051630337323560e31b815260040160405180910390fd5b505b9998505050505050505050565b60408051602081018390529081018590526001600160a01b0384166060828101919091526080820184905290869060a00160408051601f19818403018152908290526102419291602001610448565b604051602081830303815290604052905095945050505050565b60006102688383306102f3565b9392505050565b60008347101561029f5760405163392efb2b60e21b81524760048201526024810185905260440160405180910390fd5b81516000036102c157604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661026857604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b80356001600160a01b038116811461033457600080fd5b919050565b600080600080600060a0868803121561035157600080fd5b61035a8661031d565b94506020860135935061036f6040870161031d565b94979396509394606081013594506080013592915050565b600080600080600080600060c0888a0312156103a257600080fd5b6103ab8861031d565b9650602088013595506103c06040890161031d565b9450606088013593506080880135925060a088013567ffffffffffffffff808211156103eb57600080fd5b818a0191508a601f8301126103ff57600080fd5b81358181111561040e57600080fd5b8b602082850101111561042057600080fd5b60208301945080935050505092959891949750929550565b8183823760009101908152919050565b733d60ad80600a3d3981f3363d3d373d3d3d363d7360601b8152606083901b6bffffffffffffffffffffffff191660148201526e5af43d82803e903d91602b57fd5bf360881b60288201528151600090815b818110156104b7576020818601810151603786840101520161049a565b5060009201603701918252509291505056fea264697066735822122050d1d25a0848d93a343402d5cb6764d535d46307c9a977a5804365938f2a72eb64736f6c63430008140033
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.