Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Create5
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./Create3.sol";
error NotOwner();
error NotAuthorized();
error ZeroAddress();
error DomainAlreadyExists();
contract Create5 {
mapping(bytes32 => address) public domainOwner;
mapping(bytes32 => mapping(address => bool)) public isOperator;
event DomainCreated(address indexed owner, bytes32 indexed domain);
event DomainOwnershipTransferred(bytes32 indexed domain, address indexed newOwner);
event DomainOperatorUpdated(bytes32 indexed domain, address indexed operator, bool isAuthorized);
event Deployed(address indexed submitter, address indexed finalAddress, bytes32 indexed domain, bytes32 salt);
function _onlyDomainOwner(bytes32 domain) internal view {
if (domainOwner[domain] != msg.sender) revert NotOwner();
}
function _onlyAuthorized(bytes32 domain) internal view {
address o = domainOwner[domain];
if (!(msg.sender == o || isOperator[domain][msg.sender])) revert NotAuthorized();
}
function createDomain(bytes32 tag) external returns (bytes32 domain) {
domain = keccak256(abi.encodePacked(msg.sender, tag));
if (domainOwner[domain] != address(0)) revert DomainAlreadyExists();
domainOwner[domain] = msg.sender;
emit DomainCreated(msg.sender, domain);
}
function transferDomainOwnership(bytes32 domain, address newOwner) external {
_onlyDomainOwner(domain);
if (newOwner == address(0)) revert ZeroAddress();
domainOwner[domain] = newOwner;
emit DomainOwnershipTransferred(domain, newOwner);
}
function setDomainOperator(bytes32 domain, address operator, bool authorized) external {
_onlyDomainOwner(domain);
isOperator[domain][operator] = authorized;
emit DomainOperatorUpdated(domain, operator, authorized);
}
function deploy(bytes32 domain, bytes32 salt, bytes calldata initCode)
external
payable
returns (address deployed)
{
_onlyAuthorized(domain);
deployed = Create3.create3(keccak256(abi.encodePacked(domain, salt)), initCode, msg.value);
emit Deployed(msg.sender, deployed, domain, salt);
}
function computeAddress(bytes32 domain, bytes32 salt) external view returns (address) {
return Create3.addressOf(keccak256(abi.encodePacked(domain, salt)));
}
}//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; // https://github.com/0xsequence/create3/blob/master/contracts/Create3.sol /** @title A library for deploying contracts EIP-3171 style. @author Agustin Aguilar <[email protected]> */ library Create3 { error ErrorCreatingProxy(); error ErrorCreatingContract(); error TargetAlreadyExists(); /** @notice The bytecode for a contract that proxies the creation of another contract @dev If this code is deployed using CREATE2 it can be used to decouple `creationCode` from the child contract address 0x67363d3d37363d34f03d5260086018f3: 0x00 0x67 0x67XXXXXXXXXXXXXXXX PUSH8 bytecode 0x363d3d37363d34f0 0x01 0x3d 0x3d RETURNDATASIZE 0 0x363d3d37363d34f0 0x02 0x52 0x52 MSTORE 0x03 0x60 0x6008 PUSH1 08 8 0x04 0x60 0x6018 PUSH1 18 24 8 0x05 0xf3 0xf3 RETURN 0x363d3d37363d34f0: 0x00 0x36 0x36 CALLDATASIZE cds 0x01 0x3d 0x3d RETURNDATASIZE 0 cds 0x02 0x3d 0x3d RETURNDATASIZE 0 0 cds 0x03 0x37 0x37 CALLDATACOPY 0x04 0x36 0x36 CALLDATASIZE cds 0x05 0x3d 0x3d RETURNDATASIZE 0 cds 0x06 0x34 0x34 CALLVALUE val 0 cds 0x07 0xf0 0xf0 CREATE addr */ bytes internal constant PROXY_CHILD_BYTECODE = hex"67_36_3d_3d_37_36_3d_34_f0_3d_52_60_08_60_18_f3"; // KECCAK256_PROXY_CHILD_BYTECODE = keccak256(PROXY_CHILD_BYTECODE); bytes32 internal constant KECCAK256_PROXY_CHILD_BYTECODE = 0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f; /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Creates a new contract with given `_creationCode` and `_salt` @param _salt Salt of the contract creation, resulting address will be derivated from this value only @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address @return addr of the deployed contract, reverts on error */ function create3(bytes32 _salt, bytes memory _creationCode) internal returns (address addr) { return create3(_salt, _creationCode, 0); } /** @notice Creates a new contract with given `_creationCode` and `_salt` @param _salt Salt of the contract creation, resulting address will be derivated from this value only @param _creationCode Creation code (constructor) of the contract to be deployed, this value doesn't affect the resulting address @param _value In WEI of ETH to be forwarded to child contract @return addr of the deployed contract, reverts on error */ function create3(bytes32 _salt, bytes memory _creationCode, uint256 _value) internal returns (address addr) { // Creation code bytes memory creationCode = PROXY_CHILD_BYTECODE; // Get target final address addr = addressOf(_salt); if (codeSize(addr) != 0) revert TargetAlreadyExists(); // Create CREATE2 proxy address proxy; assembly { proxy := create2(0, add(creationCode, 32), mload(creationCode), _salt)} if (proxy == address(0)) revert ErrorCreatingProxy(); // Call proxy with final init code (bool success,) = proxy.call{ value: _value }(_creationCode); if (!success || codeSize(addr) == 0) revert ErrorCreatingContract(); } /** @notice Computes the resulting address of a contract deployed using address(this) and the given `_salt` @param _salt Salt of the contract creation, resulting address will be derivated from this value only @return addr of the deployed contract, reverts on error @dev The address creation formula is: keccak256(rlp([keccak256(0xff ++ address(this) ++ _salt ++ keccak256(childBytecode))[12:], 0x01])) */ function addressOf(bytes32 _salt) internal view returns (address) { address proxy = address( uint160( uint256( keccak256( abi.encodePacked( hex'ff', address(this), _salt, KECCAK256_PROXY_CHILD_BYTECODE ) ) ) ) ); return address( uint160( uint256( keccak256( abi.encodePacked( hex"d6_94", proxy, hex"01" ) ) ) ) ); } }
{
"optimizer": {
"enabled": true,
"runs": 1000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"DomainAlreadyExists","type":"error"},{"inputs":[],"name":"ErrorCreatingContract","type":"error"},{"inputs":[],"name":"ErrorCreatingProxy","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"TargetAlreadyExists","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"submitter","type":"address"},{"indexed":true,"internalType":"address","name":"finalAddress","type":"address"},{"indexed":true,"internalType":"bytes32","name":"domain","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"bytes32","name":"domain","type":"bytes32"}],"name":"DomainCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"domain","type":"bytes32"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"isAuthorized","type":"bool"}],"name":"DomainOperatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"domain","type":"bytes32"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"DomainOwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes32","name":"domain","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tag","type":"bytes32"}],"name":"createDomain","outputs":[{"internalType":"bytes32","name":"domain","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"domain","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"initCode","type":"bytes"}],"name":"deploy","outputs":[{"internalType":"address","name":"deployed","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"domainOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"domain","type":"bytes32"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"authorized","type":"bool"}],"name":"setDomainOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"domain","type":"bytes32"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferDomainOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052348015600f57600080fd5b506109ca8061001f6000396000f3fe6080604052600436106100705760003560e01c8063ba8d6bdb1161004e578063ba8d6bdb1461011f578063d26cdd201461013f578063d76fad2314610175578063f3f4fb741461018857600080fd5b80631dc9a3b914610075578063481286e6146100975780638a8d9e7c146100d4575b600080fd5b34801561008157600080fd5b50610095610090366004610836565b6101b6565b005b3480156100a357600080fd5b506100b76100b2366004610862565b610265565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100e057600080fd5b5061010f6100ef366004610836565b600160209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016100cb565b34801561012b57600080fd5b5061009561013a366004610884565b6102a8565b34801561014b57600080fd5b506100b761015a3660046108c9565b6000602081905290815260409020546001600160a01b031681565b6100b76101833660046108e2565b61031c565b34801561019457600080fd5b506101a86101a33660046108c9565b6103eb565b6040519081526020016100cb565b6101bf826104d5565b6001600160a01b0381166101ff576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091559051909184917f8bb7d7eff7c587ea3b21179a1f381ee2b595a1d74772dab0b67bf0bfff1a09e39190a35050565b60006102a18383604051602001610286929190918252602082015260400190565b60405160208183030381529060405280519060200120610528565b9392505050565b6102b1836104d5565b60008381526001602090815260408083206001600160a01b03861680855290835292819020805460ff1916851515908117909155905190815285917ff2d7e1f7b33f42e4141af15bdcfbccf419f6bc66375b6f8a9967617f660f81bb910160405180910390a3505050565b60006103278561062a565b6040805160208101879052908101859052610393906060016040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152503492506106a3915050565b905084816001600160a01b0316336001600160a01b03167fd579261046780ec80c4dae1bc57abdb62c58df8af1531e63b4e8bcc08bcf46ec876040516103db91815260200190565b60405180910390a4949350505050565b6040516bffffffffffffffffffffffff193360601b1660208201526034810182905260009060540160408051601f1981840301815291815281516020928301206000818152928390529120549091506001600160a01b03161561047a576040517fbd45fcaf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff191633908117909155905183927f971a45439c53f47a2d64fee67b95ba678b17781bc1ba0eb9ba6fa7dd2a53ebd091a3919050565b6000818152602081905260409020546001600160a01b03163314610525576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b604080517fff0000000000000000000000000000000000000000000000000000000000000060208083019190915230606090811b6bffffffffffffffffffffffff19908116602185015260358401959095527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f605580850191909152845180850390910181526075840185528051908301207fd6940000000000000000000000000000000000000000000000000000000000006095850152901b90931660978201527f010000000000000000000000000000000000000000000000000000000000000060ab8201528151608c81830301815260ac909101909152805191012090565b6000818152602081905260409020546001600160a01b0316338114806106695750600082815260016020908152604080832033845290915290205460ff165b61069f576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408051808201909152601081527f67363d3d37363d34f03d5260086018f30000000000000000000000000000000060208201526000906106e385610528565b9150813b1561071e576040517fcd43efa100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000858251602084016000f590506001600160a01b03811661076c576040517fbbd2fe8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816001600160a01b031685876040516107879190610965565b60006040518083038185875af1925050503d80600081146107c4576040519150601f19603f3d011682016040523d82523d6000602084013e6107c9565b606091505b505090508015806107d95750833b155b15610810576040517f53de54b900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050509392505050565b80356001600160a01b038116811461083157600080fd5b919050565b6000806040838503121561084957600080fd5b823591506108596020840161081a565b90509250929050565b6000806040838503121561087557600080fd5b50508035926020909101359150565b60008060006060848603121561089957600080fd5b833592506108a96020850161081a565b9150604084013580151581146108be57600080fd5b809150509250925092565b6000602082840312156108db57600080fd5b5035919050565b600080600080606085870312156108f857600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561091d57600080fd5b8501601f8101871361092e57600080fd5b803567ffffffffffffffff81111561094557600080fd5b87602082840101111561095757600080fd5b949793965060200194505050565b6000825160005b81811015610986576020818601810151858301520161096c565b50600092019182525091905056fea26469706673582212202eee1cf699dad9324a7e00512b30c86fbcad433463e9adcef13770a79a2dd99d64736f6c634300081c0033
Deployed Bytecode
0x6080604052600436106100705760003560e01c8063ba8d6bdb1161004e578063ba8d6bdb1461011f578063d26cdd201461013f578063d76fad2314610175578063f3f4fb741461018857600080fd5b80631dc9a3b914610075578063481286e6146100975780638a8d9e7c146100d4575b600080fd5b34801561008157600080fd5b50610095610090366004610836565b6101b6565b005b3480156100a357600080fd5b506100b76100b2366004610862565b610265565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100e057600080fd5b5061010f6100ef366004610836565b600160209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016100cb565b34801561012b57600080fd5b5061009561013a366004610884565b6102a8565b34801561014b57600080fd5b506100b761015a3660046108c9565b6000602081905290815260409020546001600160a01b031681565b6100b76101833660046108e2565b61031c565b34801561019457600080fd5b506101a86101a33660046108c9565b6103eb565b6040519081526020016100cb565b6101bf826104d5565b6001600160a01b0381166101ff576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091559051909184917f8bb7d7eff7c587ea3b21179a1f381ee2b595a1d74772dab0b67bf0bfff1a09e39190a35050565b60006102a18383604051602001610286929190918252602082015260400190565b60405160208183030381529060405280519060200120610528565b9392505050565b6102b1836104d5565b60008381526001602090815260408083206001600160a01b03861680855290835292819020805460ff1916851515908117909155905190815285917ff2d7e1f7b33f42e4141af15bdcfbccf419f6bc66375b6f8a9967617f660f81bb910160405180910390a3505050565b60006103278561062a565b6040805160208101879052908101859052610393906060016040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152503492506106a3915050565b905084816001600160a01b0316336001600160a01b03167fd579261046780ec80c4dae1bc57abdb62c58df8af1531e63b4e8bcc08bcf46ec876040516103db91815260200190565b60405180910390a4949350505050565b6040516bffffffffffffffffffffffff193360601b1660208201526034810182905260009060540160408051601f1981840301815291815281516020928301206000818152928390529120549091506001600160a01b03161561047a576040517fbd45fcaf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff191633908117909155905183927f971a45439c53f47a2d64fee67b95ba678b17781bc1ba0eb9ba6fa7dd2a53ebd091a3919050565b6000818152602081905260409020546001600160a01b03163314610525576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b604080517fff0000000000000000000000000000000000000000000000000000000000000060208083019190915230606090811b6bffffffffffffffffffffffff19908116602185015260358401959095527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f605580850191909152845180850390910181526075840185528051908301207fd6940000000000000000000000000000000000000000000000000000000000006095850152901b90931660978201527f010000000000000000000000000000000000000000000000000000000000000060ab8201528151608c81830301815260ac909101909152805191012090565b6000818152602081905260409020546001600160a01b0316338114806106695750600082815260016020908152604080832033845290915290205460ff165b61069f576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60408051808201909152601081527f67363d3d37363d34f03d5260086018f30000000000000000000000000000000060208201526000906106e385610528565b9150813b1561071e576040517fcd43efa100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000858251602084016000f590506001600160a01b03811661076c576040517fbbd2fe8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816001600160a01b031685876040516107879190610965565b60006040518083038185875af1925050503d80600081146107c4576040519150601f19603f3d011682016040523d82523d6000602084013e6107c9565b606091505b505090508015806107d95750833b155b15610810576040517f53de54b900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050509392505050565b80356001600160a01b038116811461083157600080fd5b919050565b6000806040838503121561084957600080fd5b823591506108596020840161081a565b90509250929050565b6000806040838503121561087557600080fd5b50508035926020909101359150565b60008060006060848603121561089957600080fd5b833592506108a96020850161081a565b9150604084013580151581146108be57600080fd5b809150509250925092565b6000602082840312156108db57600080fd5b5035919050565b600080600080606085870312156108f857600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561091d57600080fd5b8501601f8101871361092e57600080fd5b803567ffffffffffffffff81111561094557600080fd5b87602082840101111561095757600080fd5b949793965060200194505050565b6000825160005b81811015610986576020818601810151858301520161096c565b50600092019182525091905056fea26469706673582212202eee1cf699dad9324a7e00512b30c86fbcad433463e9adcef13770a79a2dd99d64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.