8.1 开发合约

  • 开发HelloWorld合约
  1. pragma solidity^0.4.23;
  2. contract HelloWorld {
  3. address public owner;
  4. string public info;
  5. constructor(address _owner) public {
  6. owner = _owner;
  7. }
  8. function saySomething(string _str) public returns(string) {
  9. info = _str;
  10. return info;
  11. }
  12. }
  • 使用remix测试和本地调试(也可选择使用catalyst)HelloWorld-remix