Discover more of LineaScan's tools and services in one place.
Contract Source Code:
File 1 of 1 : TokenFactory.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; contract TokenFactory { address public owner; address public implementation; event Upgraded(address indexed implementation); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(tx.origin); } modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } function upgradeTo(address newImplementation) external onlyOwner { _upgradeTo(newImplementation); } function transferOwnership(address newOwner) external onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _upgradeTo(address newImplementation) private { if (newImplementation != address(0)) { require(newImplementation.code.length > 0, "Invalid implementation address"); } implementation = newImplementation; emit Upgraded(newImplementation); } function _transferOwnership(address newOwner) private { address oldOwner = owner; owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } receive() external payable {} fallback() external payable { address impl = implementation; require(impl != address(0), "Implementation not set"); assembly { calldatacopy(0, 0, calldatasize()) if delegatecall(gas(), impl, 0, calldatasize(), 0, 0) { returndatacopy(0, 0, returndatasize()) return(0, returndatasize()) } returndatacopy(0, 0, returndatasize()) revert(0, returndatasize()) } } }
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.
My Name Tag:
Private Note:
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.