ModifiersPlay

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/ModifiersPlay.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import "./utils/UiProjectStamp.sol";
contract ModifiersPlay is UiProjectStamp {
    mapping(address=>bool) public allowed;
    event Granted(address indexed who);
    event Ping(address indexed by);
    constructor(bytes32 u) UiProjectStamp(u) {}
    modifier onlyAllowed(){ require(allowed[msg.sender],"not allowed"); _; }
    function grantAccess(address a) external { allowed[a]=true; emit Granted(a); }
    function restrictedPing() external onlyAllowed { emit Ping(msg.sender); }
}
"
    },
    "contracts/utils/UiProjectStamp.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

abstract contract UiProjectStamp {
    bytes32 private immutable _BUILD_HASH;
    uint48  private immutable _BUILT_AT;
    uint16  private immutable _VARIANT;

    constructor(bytes32 uiLabelHash_) {
        bytes32 w = keccak256(abi.encode(block.chainid, msg.sender, uiLabelHash_));
        _BUILD_HASH = keccak256(abi.encode(w, address(this)));
        _BUILT_AT   = uint48(block.timestamp);
        _VARIANT    = uint16(uint256(_BUILD_HASH));
    }
    function project() public view returns (bytes32 buildHash, uint48 builtAt, uint16 variant) {
        return (_BUILD_HASH, _BUILT_AT, _VARIANT);
    }
}
"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "evmVersion": "cancun",
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    }
  }
}}

Tags:
Factory|addr:0xc6ec181193e795785b7ee3d45d29f5561b0bc795|verified:true|block:23471203|tx:0x9a544d3b8b7bdc2d03154a64c0bef5244fb205772144c0433eb8f3bcd7dfd5b3|first_check:1759219856

Submitted on: 2025-09-30 10:10:56

Comments

Log in to comment.

No comments yet.