345-以太坊部署合约验证合约

 





先来写一个合约

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版权协议,转载请附上原文出处链接和本声明。