solidity: helloworld实现

发布时间 2023-08-24 11:47:58作者: 若-飞

刚学,先来个helloWeb3

编译器采用remix:https://remix.ethereum.org/

 

写一个helloworld合约:

新建一个文件:helloworld.sol:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract HelloWorldSolidity {
    string public stringHelloSolidity = "Hello Solidity";
    function HelloWeb3() public pure returns (string memory) {
        return "Hello Web3";
    }
}

编译:Auto compile打勾

 

 

部署:

部署以后:

 

点击HelloWeb3