blockchain:ether.jsを使用したdapps開発
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| blockchain:ether.jsを使用したdapps開発 [2022/05/11 00:51] – dot | blockchain:ether.jsを使用したdapps開発 [2022/08/04 08:56] (現在) – dot | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | |||
| ====== ether.jsを使用したDApps開発 ====== | ====== ether.jsを使用したDApps開発 ====== | ||
| 行 7: | 行 6: | ||
| 下記手順を実行するか、上記リポジトリを利用してください。 | 下記手順を実行するか、上記リポジトリを利用してください。 | ||
| + | |||
| + | ===== 前提 ===== | ||
| + | |||
| + | [[blockchain: | ||
| + | |||
| + | MetaMask を使用しますので、[[blockchain: | ||
| ===== Reactプロジェクトの生成 ===== | ===== Reactプロジェクトの生成 ===== | ||
| 行 102: | 行 107: | ||
| const [provider, setProvider] = useState(null); | const [provider, setProvider] = useState(null); | ||
| const [counter, setCounter] = useState(null); | const [counter, setCounter] = useState(null); | ||
| - | const [account, setAccount] = useState(); | + | const [account, setAccount] = useState(null); |
| - | const [count, setCount] = useState(); | + | const [count, setCount] = useState(null); |
| - | const [transactionHash, | + | const [transactionHash, |
| - | const [transactionInfo, | + | const [transactionInfo, |
| // counterAddress と counterAbi は環境によって書き換える必要があります。 | // counterAddress と counterAbi は環境によって書き換える必要があります。 | ||
| 行 247: | 行 252: | ||
| </ | </ | ||
| + | 「connect」をクリックすると MetaMask が立ち上がりますので、使用するアカウントを選択します。 | ||
| + | |||
| + | アカウントが選択できたら他のボタンをクリックすることで Counter スマートコントラクトの各メソッドが実行できます。 | ||
| {{: | {{: | ||
blockchain/ether.jsを使用したdapps開発.1652230301.txt.gz · 最終更新: by dot
