You are viewing a single comment's thread from:

RE: Solidity开发指南

in #starnotelast month
  1. 版本申明
  2. 引用
  3. 合约主体
  4. 注释
// 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;
    }
}