remix 的基本使用
- 在 contract 文件夹下编写 4_My_contract.sol 文件
- 编写基本代码(注意指定编译版本)
pragma solidity 0.5.2;
contract MyContract {
string value;
constructor() public {
value = "myValue";
}
function get() public view returns(string memory) {
return value;
}
function set(string memory _value) public {
value = _value;
}
}
- 在 solidity compiler 下指定编译版本 compiler 为 0.5.2+ 编译 compile 4_My_contract.sol
- 在 deploy & run transactions 下, 选择 环境 environment 为 javascript VM (London) 并部署 deploy
- 进行测试前面编写的函数