CN1Storage

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "test.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.20;\r
\r
contract CN1Storage {\r
    address public immutable admin;\r
    string private _cn1;\r
\r
    event CN1Updated(string oldValue, string newValue);\r
\r
    error NotAdmin();\r
    error ValueTooLong();\r
\r
    uint256 public constant MAX_LEN = 1024;\r
\r
    constructor(string memory initial) {\r
        admin = msg.sender;\r
        _set(initial);\r
    }\r
\r
    modifier onlyAdmin() {\r
        if (msg.sender != admin) revert NotAdmin();\r
        _;\r
    }\r
\r
    function cn1() external view returns (string memory) {\r
        return _cn1;\r
    }\r
\r
    function updateCN1(string calldata newValue) external onlyAdmin {\r
        _set(newValue);\r
    }\r
\r
    function _set(string memory v) internal {\r
        if (bytes(v).length > MAX_LEN) revert ValueTooLong();\r
        string memory old = _cn1;\r
        _cn1 = v;\r
        emit CN1Updated(old, v);\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x797715ad3fb2bd22f9647bd8b43c3f70ed0fa738|verified:true|block:23746711|tx:0x88766dbaab7bc2bb2e72ada764a94c9a37ffaf2c241efceb2be8df84248983e7|first_check:1762518917

Submitted on: 2025-11-07 13:35:18

Comments

Log in to comment.

No comments yet.