先来写一个合约

pragma solidity >=0.4.22 <0.6.0;

contract SimpleWithDefault{
    
    string public name;
    
    constructor(string memory _name) public{
        name=_name;
    }
    
    function setName(string memory _name) public{
        name=_name;
    }
    
    function getName() public view returns(string memory){
        return name;
    }
    
}







然后我们部署在ropsten
在构造函数输入hello world




然后需要获取构造函数的abi
可以用这个网站
https://abi.hashex.org/








然后验证合约
https://etherscan.io











 


版权声明:本文为qq_33781658原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_33781658/article/details/89278396