Video
B 站视频:5分钟完成在Conflux高性能公链上的智能合约编译部署和执行
Step 1.Install related packages
npm install -g solc truffle
Step 2.Download and unzip file
压缩包
Step 3.Write Contract
eg. Contract1.sol
pragma solidity >=0.4.23;
contract Contract1{
string _field;
function get()public view returns (string memory){
return _field;
}
function set(string memory field)public{
_field=field;
}
}
Step 4. Compile Contract and Deploy Contract
truffle compile ;& node .\helper\deploy.js {ContractName}
Step 5. Call Contract
node .\src\main.js