MATIC Price: $0.538016 (-1.71%)
Gas: 30.9 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Parent Transaction Hash Block From To
450227212023-07-13 8:43:42375 days ago1689237822  Contract Creation0 MATIC
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PixelynxOwnership

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 260 runs

Other Settings:
default evmVersion
File 1 of 3 : PixelynxOwnership.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4 <0.9.0;

import {Context} from '@openzeppelin/contracts/utils/Context.sol';
import {IPixelynxOwnership} from 'interfaces/IPixelynxOwnership.sol';

contract PixelynxOwnership is IPixelynxOwnership, Context {
    address public deployer;

    // ERRORS
    error NotADeployedContract();
    // END ERRORS

    mapping(address => bool) private _deployedContracts;
    // deployedContracts[userAddress] == the amount they own of that token
    mapping(address => mapping(address => uint256)) private _userDeployedContractsOwnedTokensCount;

    constructor(address _deployer) {
        deployer = _deployer;
    }

    /**
     * @dev Throws if called by a account which is not the deployer
     */
    modifier isDeployer() {
        require(deployer == _msgSender(), 'deployer only');
        _;
    }

    /// @inheritdoc IPixelynxOwnership
    function isDeployedContract(address deployedContract) external view returns (bool) {
        return _deployedContracts[deployedContract];
    }

    /// @inheritdoc IPixelynxOwnership
    function setDeployedContract(address deployedContract) external isDeployer {
        _deployedContracts[deployedContract] = true;
    }

    /// @inheritdoc IPixelynxOwnership
    function ownershipTransferStateUpdate(address from, address to) external {
        address caller = _msgSender();
        if (!_deployedContracts[caller]) revert NotADeployedContract();

        // dont take of dead addresses as it always come from that
        if (from != address(0) && _userDeployedContractsOwnedTokensCount[caller][from] > 0) {
            _userDeployedContractsOwnedTokensCount[caller][from]--;
        }
        _userDeployedContractsOwnedTokensCount[caller][to]++;
    }

    /// @inheritdoc IPixelynxOwnership
    function userOwnershipCheck(address[] memory contractAddresses, address user) external view returns (bool) {
        if (contractAddresses.length == 0) return true; // No contracts to check
        for (uint256 i = 0; i < contractAddresses.length; i++) {
            if (_userDeployedContractsOwnedTokensCount[contractAddresses[i]][user] > 0) return true; // User holds ownership of at least one contract
        }
        return false; // User doesnt hold ownership of any of the contracts
    }
}

File 2 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 3 of 3 : IPixelynxOwnership.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4 <0.9.0;

interface IPixelynxOwnership {
    /**
     * Check if the contract is deployed
     */
    function isDeployedContract(address deployedContract) external view returns (bool);
    /**
     * Set the deployed contract address
     */
    function setDeployedContract(address deployedContract) external;

    /**
     * Set the transfer state of ownership
     */
    function ownershipTransferStateUpdate(address from, address to) external;

    /**
     * Check if user owns all the contracts
     */
    function userOwnershipCheck(address[] memory contractAddresses, address user) external view returns (bool);
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "contracts/=solidity/contracts/",
    "ds-test/=lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "interfaces/=solidity/interfaces/",
    "isolmate/=lib/isolmate/src/",
    "openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "operator-filter-registry/=lib/operator-filter-registry/src/",
    "prb-test/=lib/prb-test/src/",
    "prb/test/=lib/prb-test/src/",
    "test/=solidity/test/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 260
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_deployer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotADeployedContract","type":"error"},{"inputs":[],"name":"deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deployedContract","type":"address"}],"name":"isDeployedContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"ownershipTransferStateUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"deployedContract","type":"address"}],"name":"setDeployedContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"contractAddresses","type":"address[]"},{"internalType":"address","name":"user","type":"address"}],"name":"userOwnershipCheck","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161059338038061059383398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610500806100936000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630222cf591461005c5780636290caec146100845780639f10cad3146100b0578063d5f39488146100c5578063e6ca51c9146100f0575b600080fd5b61006f61006a366004610342565b610103565b60405190151581526020015b60405180910390f35b61006f610092366004610419565b6001600160a01b031660009081526001602052604090205460ff1690565b6100c36100be366004610419565b6101b4565b005b6000546100d8906001600160a01b031681565b6040516001600160a01b03909116815260200161007b565b6100c36100fe36600461043b565b610229565b60008251600003610116575060016101ae565b60005b83518110156101a85760006002600086848151811061013a5761013a61046e565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b031681526020019081526020016000205411156101965760019150506101ae565b806101a08161049a565b915050610119565b50600090505b92915050565b6000546001600160a01b031633146102025760405162461bcd60e51b815260206004820152600d60248201526c6465706c6f796572206f6e6c7960981b604482015260640160405180910390fd5b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b3360008181526001602052604090205460ff1661025957604051632b4537f560e01b815260040160405180910390fd5b6001600160a01b0383161580159061029557506001600160a01b0380821660009081526002602090815260408083209387168352929052205415155b156102d3576001600160a01b03808216600090815260026020908152604080832093871683529290529081208054916102cd836104b3565b91905055505b6001600160a01b03808216600090815260026020908152604080832093861683529290529081208054916103068361049a565b9190505550505050565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b038116811461033d57600080fd5b919050565b6000806040838503121561035557600080fd5b823567ffffffffffffffff8082111561036d57600080fd5b818501915085601f83011261038157600080fd5b813560208282111561039557610395610310565b8160051b604051601f19603f830116810181811086821117156103ba576103ba610310565b6040529283528183019350848101820192898411156103d857600080fd5b948201945b838610156103fd576103ee86610326565b855294820194938201936103dd565b965061040c9050878201610326565b9450505050509250929050565b60006020828403121561042b57600080fd5b61043482610326565b9392505050565b6000806040838503121561044e57600080fd5b61045783610326565b915061046560208401610326565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016104ac576104ac610484565b5060010190565b6000816104c2576104c2610484565b50600019019056fea2646970667358221220c2b922e654b96ff2799e2cf4e23d1198dc490547c89d0b7db184df02dd800cd664736f6c634300080e00330000000000000000000000006dbef368ccdee6bb18554e893fb58eaa93f51e2b

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630222cf591461005c5780636290caec146100845780639f10cad3146100b0578063d5f39488146100c5578063e6ca51c9146100f0575b600080fd5b61006f61006a366004610342565b610103565b60405190151581526020015b60405180910390f35b61006f610092366004610419565b6001600160a01b031660009081526001602052604090205460ff1690565b6100c36100be366004610419565b6101b4565b005b6000546100d8906001600160a01b031681565b6040516001600160a01b03909116815260200161007b565b6100c36100fe36600461043b565b610229565b60008251600003610116575060016101ae565b60005b83518110156101a85760006002600086848151811061013a5761013a61046e565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b031681526020019081526020016000205411156101965760019150506101ae565b806101a08161049a565b915050610119565b50600090505b92915050565b6000546001600160a01b031633146102025760405162461bcd60e51b815260206004820152600d60248201526c6465706c6f796572206f6e6c7960981b604482015260640160405180910390fd5b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b3360008181526001602052604090205460ff1661025957604051632b4537f560e01b815260040160405180910390fd5b6001600160a01b0383161580159061029557506001600160a01b0380821660009081526002602090815260408083209387168352929052205415155b156102d3576001600160a01b03808216600090815260026020908152604080832093871683529290529081208054916102cd836104b3565b91905055505b6001600160a01b03808216600090815260026020908152604080832093861683529290529081208054916103068361049a565b9190505550505050565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b038116811461033d57600080fd5b919050565b6000806040838503121561035557600080fd5b823567ffffffffffffffff8082111561036d57600080fd5b818501915085601f83011261038157600080fd5b813560208282111561039557610395610310565b8160051b604051601f19603f830116810181811086821117156103ba576103ba610310565b6040529283528183019350848101820192898411156103d857600080fd5b948201945b838610156103fd576103ee86610326565b855294820194938201936103dd565b965061040c9050878201610326565b9450505050509250929050565b60006020828403121561042b57600080fd5b61043482610326565b9392505050565b6000806040838503121561044e57600080fd5b61045783610326565b915061046560208401610326565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016104ac576104ac610484565b5060010190565b6000816104c2576104c2610484565b50600019019056fea2646970667358221220c2b922e654b96ff2799e2cf4e23d1198dc490547c89d0b7db184df02dd800cd664736f6c634300080e0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000006dbef368ccdee6bb18554e893fb58eaa93f51e2b

-----Decoded View---------------
Arg [0] : _deployer (address): 0x6DbEf368ccDEE6Bb18554E893Fb58eAa93F51E2B

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000006dbef368ccdee6bb18554e893fb58eaa93f51e2b


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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.