Skip to content

Commit 47a8d74

Browse files
committed
Start 2nd edition to improve the Flow tutorial
Improve structures, wordings, correct typos, and etc. based on the later published blog posts elsewhere.
1 parent c70b3a2 commit 47a8d74

File tree

3 files changed

+331
-3
lines changed

3 files changed

+331
-3
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ module.exports = {
8585
'/tutorial/first-steps',
8686
'/tutorial/minting-service',
8787
'/tutorial/lazy-minting',
88+
'/tutorial/mint-nftstorage-polygon',
8889
'/tutorial/gallery-app',
8990
'/tutorial/using-nfts-in-games',
9091
'/tutorial/flow-nft-marketplace'

docs/tutorial/first-steps.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ On [the getting started page for Ethers](https://docs.ethers.io/v5/getting-start
7373

7474
### Gather the needed details
7575

76-
For this tutorial, we're going to connect to a smart contract called `Greeter` that's included with a new [Hardhat](https://hardhat.io) project. It's been deployed to the Ropsten testnet at the address `0xE0282e76237B8eB19A5D08e1741b8b3e2691Dadd`, and you can find details about it on the [EtherScan Ropsten block explorer](https://ropsten.etherscan.io) by searching for that address, which should take you to [the address detail view](https://ropsten.etherscan.io/address/0xE0282e76237B8eB19A5D08e1741b8b3e2691Dadd).
76+
For this tutorial, we're going to connect to a smart contract called `Greeter` that's included with a new [Hardhat](https://hardhat.org/) project. It's been deployed to the Ropsten testnet at the address `0xE0282e76237B8eB19A5D08e1741b8b3e2691Dadd`, and you can find details about it on the [EtherScan Ropsten block explorer](https://ropsten.etherscan.io) by searching for that address, which should take you to [the address detail view](https://ropsten.etherscan.io/address/0xE0282e76237B8eB19A5D08e1741b8b3e2691Dadd).
7777

7878
Ethers has a [Contract API](https://docs.ethers.io/v5/api/contract/contract/) that abstracts over the details of the blockchain and lets us interact with smart contracts as if they were regular JavaScript objects named `Contract`.
7979

@@ -95,6 +95,9 @@ In the `hello-eth` folder, next to `ethers-5.1.esm.min.js`, create a file called
9595
<script type="module">
9696
import { ethers } from "./ethers-5.1.esm.min.js";
9797
//const ethers = require('ethers')
98+
99+
//Create a constant to maniputale the DOM:
100+
const contractReturn = document.querySelector('.output');
98101
99102
const GREETER_ADDRESS = '0xE0282e76237B8eB19A5D08e1741b8b3e2691Dadd'
100103
const GREETER_ABI = `[{"inputs":[{"internalType":"string","name":"_greeting","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"greet","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_greeting","type":"string"}],"name":"setGreeting","outputs":[],"stateMutability":"nonpayable","type":"function"}]`
@@ -110,13 +113,14 @@ In the `hello-eth` folder, next to `ethers-5.1.esm.min.js`, create a file called
110113
const greeting = await greeterContract.greet();
111114
112115
// Write the greeting result to the DOM.
113-
document.getElementById('output').innerHTML = greeting;
116+
contractReturn.textContent = greeting;
114117
}
115118
getGreeting();
116119
</script>
117120
</head>
118121
<body>
119-
<div id="output" />
122+
<div class="output">
123+
</div>
120124
</body>
121125
</html>
122126
```

0 commit comments

Comments
 (0)