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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33781658/article/details/89278396




先来写一个合约

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











猜你喜欢

转载自blog.csdn.net/qq_33781658/article/details/89278396