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": []
}
}}
Submitted on: 2025-10-30 13:19:34
Comments
Log in to comment.
No comments yet.