Solidity IDE地址:Remix - Ethereum IDE
点击进入后在contract文件夹下创建合约
合约代码如下:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
contract SimpleStorage{
bool hasFavorNum=true;
uint256 favorNum=5;
string favorNums="five";
int256 num=6;
address myAddress=0xdE136BC30A657656A093eaf30CeD9D338B568eB5;
bytes32 favorite= "5";
function store(uint256 _favorNum)public {
favorNum=_favorNum;
}
//view,pure
function retrive() public view returns (uint256){
return favorNum;
}
function retrive2() public pure returns (uint256){
return (1+1);
}
}
Win10系统Ctrl+s保存后可以点击部署