- 版本申明
- 引用
- 合约主体
- 注释
// SPDX-License-Identifier: MIT //开源协议
pragma solidity ^0.8.20;//申明版本,最低0.8.20
/*
* 这是注释段落
*
*/
import "./first_interface.sol"; //引用文件
contract SimpleStorage {
//合约主体
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}