ユーザ用ツール

サイト用ツール


blockchain:goerliテストネットの使用_remix編

文書の過去の版を表示しています。


Goerliテストネットの使用(Remix編)

前提

Goerli テストネットの使用(Hardhat編)を参考に Goerli で使用できる 0.05 ETH を取得しておいてください。

スマートコントラクトの実装

  1. Remix に接続する。
  2. 「contracts」を右クリックし「New File」をクリック
  3. ファイル名に「Counter.sol」と入力
  4. 以下 Counter.sol のソースをコピーアンドペーストする
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
 
contract Counter {
  uint public count;
 
  // Function to get the current count
  function get() public view returns (uint) {
    return count;
  }
 
  // Function to increment count by 1
  function inc() public {
    count += 1;
  }
 
  // Function to decrement count by 1
  function dec() public {
    count -= 1;
  }
}
  1. エディタ上で「Ctrl+S」と打ち込むと Counter.sol が保存されてコンパイルまで自動的に行われる
blockchain/goerliテストネットの使用_remix編.1654049366.txt.gz · 最終更新: 2022/06/01 02:09 by dot