Sepolia Testnet

Contract

0xc3c7546A441b491Feea031B4aFCe26411f9Ad5B6

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
0x6080604064537002024-08-07 10:08:0093 days ago1723025280IN
 Create: UsersSBTCollectionFactory
0 ETH0.0203490529.34255194

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UsersSBTCollectionFactory

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 4 : UsersSBTCollectionFactory.sol
// SPDX-License-Identifier: MIT
// Factory for Public Mintable User NFT Collection

pragma solidity 0.8.21;

import "./Ownable.sol";
import "./UsersSBTCollectionProxy.sol";


contract UsersSBTCollectionFactory is  Ownable{

    mapping(address => bool) public factoryOperators;

    constructor(){
        factoryOperators[msg.sender] = true;
    }

    function deployProxyFor(
        address _implAddress, 
        address _creator,
        string memory name_,
        string memory symbol_,
        string memory _baseurl,
        address _wrapper
    ) public returns(address proxy) 
    {
        require(factoryOperators[msg.sender], "Only for operator");
        proxy = address(new UsersSBTCollectionProxy(
            _implAddress, 
            _creator,
            name_,
            symbol_,
            _baseurl,
            _wrapper
        ));
    }
    ///////////////////////////////////////////
    /////  Admin functions     ////////////////
    ///////////////////////////////////////////      
    function setOperatorStatus(address _operator, bool _isValid) external onlyOwner {
        factoryOperators[_operator] = _isValid;
    }
}

File 2 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(msg.sender);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 4 : UsersSBTCollectionProxy.sol
// SPDX-License-Identifier: MIT
// Proxy for Public Mintable User NFT Collection
pragma solidity 0.8.21;

import "./Proxy.sol";

contract UsersSBTCollectionProxy is Proxy {

    struct AddressSlot {
        address value;
    }
    /**
     * @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 Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    constructor(
        address _implAddress, 
        address _creator,
        string memory name_,
        string memory symbol_,
        string memory _baseurl,
        address _wrapper
    ) 
    {
        getAddressSlot(_IMPLEMENTATION_SLOT).value = _implAddress;
        emit Upgraded(_implAddress);
        (bool success, ) = 
        _implAddress.delegatecall(
            abi.encodeWithSignature(
                "initialize(address,string,string,string,address)"
                , _creator, name_, symbol_, _baseurl, _wrapper
            )
        );
        require(success, "Construction failed");
    }


    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        return getAddressSlot(_IMPLEMENTATION_SLOT).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
        }
    }
}

File 4 of 4 : Proxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overridden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

Settings
{
  "remappings": [
    "@uniswap/=lib/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@Uopenzeppelin/=lib/openzeppelin-contracts-upgradeable/",
    "@envelop-protocol-v1/=lib/envelop-protocol-v1/",
    "@envelop-subscription/=lib/subscription/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "envelop-protocol-v1/=lib/envelop-protocol-v1/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "subscription/=lib/subscription/"
  ],
  "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 ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_implAddress","type":"address"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"_baseurl","type":"string"},{"internalType":"address","name":"_wrapper","type":"address"}],"name":"deployProxyFor","outputs":[{"internalType":"address","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"factoryOperators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_isValid","type":"bool"}],"name":"setOperatorStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361003c565b336000908152600160208190526040909120805460ff1916909117905561008c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610abd8061009b6000396000f3fe60806040523480156200001157600080fd5b50600436106200006a5760003560e01c806359119a41146200006f578063715018a614620000885780638da5cb5b14620000925780639e1c842714620000bc578063f2fde38b14620000f3578063fffcf427146200010a575b600080fd5b62000086620000803660046200037b565b62000121565b005b6200008662000156565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b620000e2620000cd366004620003bb565b60016020526000908152604090205460ff1681565b6040519015158152602001620000b3565b6200008662000104366004620003bb565b6200016e565b6200009f6200011b3660046200048b565b620001f1565b6200012b62000294565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6200016062000294565b6200016c600062000300565b565b6200017862000294565b6001600160a01b038116620001e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b620001ee8162000300565b50565b3360009081526001602052604081205460ff16620002465760405162461bcd60e51b815260206004820152601160248201527027b7363c903337b91037b832b930ba37b960791b6044820152606401620001da565b8686868686866040516200025a9062000350565b6200026b969594939291906200059c565b604051809103906000f08015801562000288573d6000803e3d6000fd5b50979650505050505050565b33620002a86000546001600160a01b031690565b6001600160a01b0316146200016c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001da565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61047e806200060a83390190565b80356001600160a01b03811681146200037657600080fd5b919050565b600080604083850312156200038f57600080fd5b6200039a836200035e565b915060208301358015158114620003b057600080fd5b809150509250929050565b600060208284031215620003ce57600080fd5b620003d9826200035e565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200040857600080fd5b813567ffffffffffffffff80821115620004265762000426620003e0565b604051601f8301601f19908116603f01168101908282118183101715620004515762000451620003e0565b816040528381528660208588010111156200046b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060008060c08789031215620004a557600080fd5b620004b0876200035e565b9550620004c0602088016200035e565b9450604087013567ffffffffffffffff80821115620004de57600080fd5b620004ec8a838b01620003f6565b955060608901359150808211156200050357600080fd5b620005118a838b01620003f6565b945060808901359150808211156200052857600080fd5b506200053789828a01620003f6565b9250506200054860a088016200035e565b90509295509295509295565b6000815180845260005b818110156200057c576020818501810151868301820152016200055e565b506000602082860101526020601f19601f83011685010191505092915050565b600060018060a01b038089168352808816602084015260c06040840152620005c860c084018862000554565b8381036060850152620005dc818862000554565b90508381036080850152620005f2818762000554565b92505080841660a08401525097965050505050505056fe608060405234801561001057600080fd5b5060405161047e38038061047e83398101604081905261002f9161026d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0388169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a26000866001600160a01b031686868686866040516024016100ba959493929190610352565b60408051601f198184030181529181526020820180516001600160e01b0316630413beed60e11b179052516100ef91906103b0565b600060405180830381855af49150503d806000811461012a576040519150601f19603f3d011682016040523d82523d6000602084013e61012f565b606091505b50509050806101845760405162461bcd60e51b815260206004820152601360248201527f436f6e737472756374696f6e206661696c656400000000000000000000000000604482015260640160405180910390fd5b505050505050506103cc565b80516001600160a01b03811681146101a757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101dd5781810151838201526020016101c5565b50506000910152565b600082601f8301126101f757600080fd5b81516001600160401b0380821115610211576102116101ac565b604051601f8301601f19908116603f01168101908282118183101715610239576102396101ac565b8160405283815286602085880101111561025257600080fd5b6102638460208301602089016101c2565b9695505050505050565b60008060008060008060c0878903121561028657600080fd5b61028f87610190565b955061029d60208801610190565b60408801519095506001600160401b03808211156102ba57600080fd5b6102c68a838b016101e6565b955060608901519150808211156102dc57600080fd5b6102e88a838b016101e6565b945060808901519150808211156102fe57600080fd5b5061030b89828a016101e6565b92505061031a60a08801610190565b90509295509295509295565b6000815180845261033e8160208601602086016101c2565b601f01601f19169290920160200192915050565b600060018060a01b03808816835260a0602084015261037460a0840188610326565b83810360408501526103868188610326565b9050838103606085015261039a8187610326565b9250508084166080840152509695505050505050565b600082516103c28184602087016101c2565b9190910192915050565b60a4806103da6000396000f3fe608060405236601057600e6013565b005b600e5b604960457f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b604b565b565b3660008037600080366000845af43d6000803e8080156069573d6000f35b3d6000fdfea2646970667358221220effc9e02664a90bc23e7a7021edf2ae0e060206628c9e60cb9d2a0cfe10acf2a64736f6c63430008150033a2646970667358221220799df4944e5ea8a5bd37c69eee0bcb9fb2400fa18e75f3103c64255dd48d06a764736f6c63430008150033

Deployed Bytecode

0x60806040523480156200001157600080fd5b50600436106200006a5760003560e01c806359119a41146200006f578063715018a614620000885780638da5cb5b14620000925780639e1c842714620000bc578063f2fde38b14620000f3578063fffcf427146200010a575b600080fd5b62000086620000803660046200037b565b62000121565b005b6200008662000156565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b620000e2620000cd366004620003bb565b60016020526000908152604090205460ff1681565b6040519015158152602001620000b3565b6200008662000104366004620003bb565b6200016e565b6200009f6200011b3660046200048b565b620001f1565b6200012b62000294565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6200016062000294565b6200016c600062000300565b565b6200017862000294565b6001600160a01b038116620001e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b620001ee8162000300565b50565b3360009081526001602052604081205460ff16620002465760405162461bcd60e51b815260206004820152601160248201527027b7363c903337b91037b832b930ba37b960791b6044820152606401620001da565b8686868686866040516200025a9062000350565b6200026b969594939291906200059c565b604051809103906000f08015801562000288573d6000803e3d6000fd5b50979650505050505050565b33620002a86000546001600160a01b031690565b6001600160a01b0316146200016c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001da565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61047e806200060a83390190565b80356001600160a01b03811681146200037657600080fd5b919050565b600080604083850312156200038f57600080fd5b6200039a836200035e565b915060208301358015158114620003b057600080fd5b809150509250929050565b600060208284031215620003ce57600080fd5b620003d9826200035e565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200040857600080fd5b813567ffffffffffffffff80821115620004265762000426620003e0565b604051601f8301601f19908116603f01168101908282118183101715620004515762000451620003e0565b816040528381528660208588010111156200046b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060008060c08789031215620004a557600080fd5b620004b0876200035e565b9550620004c0602088016200035e565b9450604087013567ffffffffffffffff80821115620004de57600080fd5b620004ec8a838b01620003f6565b955060608901359150808211156200050357600080fd5b620005118a838b01620003f6565b945060808901359150808211156200052857600080fd5b506200053789828a01620003f6565b9250506200054860a088016200035e565b90509295509295509295565b6000815180845260005b818110156200057c576020818501810151868301820152016200055e565b506000602082860101526020601f19601f83011685010191505092915050565b600060018060a01b038089168352808816602084015260c06040840152620005c860c084018862000554565b8381036060850152620005dc818862000554565b90508381036080850152620005f2818762000554565b92505080841660a08401525097965050505050505056fe608060405234801561001057600080fd5b5060405161047e38038061047e83398101604081905261002f9161026d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0388169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a26000866001600160a01b031686868686866040516024016100ba959493929190610352565b60408051601f198184030181529181526020820180516001600160e01b0316630413beed60e11b179052516100ef91906103b0565b600060405180830381855af49150503d806000811461012a576040519150601f19603f3d011682016040523d82523d6000602084013e61012f565b606091505b50509050806101845760405162461bcd60e51b815260206004820152601360248201527f436f6e737472756374696f6e206661696c656400000000000000000000000000604482015260640160405180910390fd5b505050505050506103cc565b80516001600160a01b03811681146101a757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101dd5781810151838201526020016101c5565b50506000910152565b600082601f8301126101f757600080fd5b81516001600160401b0380821115610211576102116101ac565b604051601f8301601f19908116603f01168101908282118183101715610239576102396101ac565b8160405283815286602085880101111561025257600080fd5b6102638460208301602089016101c2565b9695505050505050565b60008060008060008060c0878903121561028657600080fd5b61028f87610190565b955061029d60208801610190565b60408801519095506001600160401b03808211156102ba57600080fd5b6102c68a838b016101e6565b955060608901519150808211156102dc57600080fd5b6102e88a838b016101e6565b945060808901519150808211156102fe57600080fd5b5061030b89828a016101e6565b92505061031a60a08801610190565b90509295509295509295565b6000815180845261033e8160208601602086016101c2565b601f01601f19169290920160200192915050565b600060018060a01b03808816835260a0602084015261037460a0840188610326565b83810360408501526103868188610326565b9050838103606085015261039a8187610326565b9250508084166080840152509695505050505050565b600082516103c28184602087016101c2565b9190910192915050565b60a4806103da6000396000f3fe608060405236601057600e6013565b005b600e5b604960457f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b604b565b565b3660008037600080366000845af43d6000803e8080156069573d6000f35b3d6000fdfea2646970667358221220effc9e02664a90bc23e7a7021edf2ae0e060206628c9e60cb9d2a0cfe10acf2a64736f6c63430008150033a2646970667358221220799df4944e5ea8a5bd37c69eee0bcb9fb2400fa18e75f3103c64255dd48d06a764736f6c63430008150033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.