Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"settings": {
"evmVersion": "cancun",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
},
"sources": {
"project/contracts/Reviews.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Reviews {
event ReviewPosted(
address indexed from,
uint8 indexed rating,
uint256 timestamp,
string message
);
uint16 public constant MAX_MESSAGE_BYTES = 512;
function postReview(string calldata message, uint8 rating) external {
require(rating >= 1 && rating <= 5, "rating 1..5");
require(bytes(message).length <= MAX_MESSAGE_BYTES, "too long");
emit ReviewPosted(msg.sender, rating, block.timestamp, message);
}
}
"
}
}
}}
Submitted on: 2025-09-26 20:53:06
Comments
Log in to comment.
No comments yet.