Contract Source Code:
File 1 of 1 : sdaemon0xDeployer.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; contract sdaemon0x_Deployer { event OwnershipTransferred(address indexed from, address indexed to); event ContractDeployed(string name, address indexed addr); address public _owner; mapping (string=>address) private _contracts; constructor() { _owner = msg.sender; } function setOwner(address _to) external onlyOwner() { _owner = _to; emit OwnershipTransferred(_owner, _to); } modifier onlyOwner() { require (msg.sender == _owner); _; } function computeAddress(bytes32 salt, bytes32 bytecodeHash) external view onlyOwner returns (address addr) { address deployer = address(this); assembly { let ptr := mload(0x40) mstore(add(ptr, 0x40), bytecodeHash) mstore(add(ptr, 0x20), salt) mstore(ptr, deployer) let start := add(ptr, 0x0b) mstore8(start, 0xff) addr := keccak256(start, 85) } } function deployContract(string memory name_, bytes32 salt, bytes memory bytecode) external onlyOwner returns (address addr) { require (bytecode.length > 0); assembly { addr := create2(0, add(bytecode, 0x20), mload(bytecode), salt) } require(addr != address(0)); _contracts[name_] = addr; emit ContractDeployed(name_, addr); } function getContract(string memory name_) external view onlyOwner returns (address) { return _contracts[name_]; } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.