区块链服务 BCS-合约示例

时间:2023-11-01 16:15:48

合约示例

  1. 进入在线编译器 https://remix.ethereum.org
  2. 创建solidity合约文件,并粘贴示例合约。

    pragma solidity ^0.4.26;contract SimpleStorage {    uint storedData;    function set(uint x) public {        storedData = x;    }    function get() public view returns (uint) {        return storedData;    }}

  3. 编译solidity合约,并复制bytecode结构体中的object值为合约字节码。

    {"linkReferences": {},"object":"***","opcodes": "****","sourceMap": "****"}

support.huaweicloud.com/devg01-bcs/bcs_devg_01_058.html