StringStorage

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/redir.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.0;\r
\r
contract StringStorage {\r
    address public owner;\r
    string private storedString;\r
\r
    constructor() {\r
        owner = msg.sender;\r
    }\r
\r
    modifier onlyOwner() {\r
        require(msg.sender == owner, "Only owner can call this");\r
        _;\r
    }\r
\r
    // 插入字串(限制 64 bytes)\r
    function insertString(string calldata input) external onlyOwner {\r
        require(bytes(input).length <= 64, "String exceeds 64 bytes");\r
        storedString = input;\r
    }\r
\r
    // 任何人都可以讀取字串\r
    function readString() external view returns (string memory) {\r
        return storedString;\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x0f68b4713df28e09baae6332daf355360539283c|verified:true|block:23688464|tx:0xf40c76b8da49970aac70670f71aed25f88b5a79c5af63ad204b3c5e92b077eda|first_check:1761826771

Submitted on: 2025-10-30 13:19:34

Comments

Log in to comment.

No comments yet.