@@ -13,25 +13,26 @@ Before we start, please make sure you have the following tools installed:
1313## Getting Started
1414
1515Create a directory named ` coin-flip{:bash} ` in your filesystem.
16- Open a terminal with ` coin-flip ` as the working directory and run ` forge init contracts ` to create a new Solidity project.
17- You will see a new directory in ` coin-flip ` named ` contracts ` . ` contracts/src ` is where all your contract code will be.
16+ We will use this directory as the working directory for the rest of the tutorial.
17+ Let's initialize a new project in ` coin-flip{:bash} ` by running ` forge init contracts{:bash} ` .
18+
19+ This will create a new directory in ` coin-flip{:bash} ` named ` contracts/src ` , which will contain the smart contract code.
1820
1921``` bash copy
2022mkdir coin-flip
2123cd coin-flip
2224forge init contracts
2325```
2426
25- Run ` cd contracts ` to make it your terminal's working directory — the following commands will need to be run from here.
26- Next, install the Pyth Entropy SDK by running the following commands.
27+ Now we will install the Pyth Entropy SDK in the ` contracts ` directory.
2728
2829``` bash copy
2930cd contracts
3031npm init -y
3132npm install @pythnetwork/entropy-sdk-solidity
3233```
3334
34- Add a ` remappings.txt ` file to ` contracts ` directory with the following content.
35+ Add a ` remappings.txt ` file to ` contracts ` directory with the following content to tell Foundry where to find the Pyth Entropy SDK .
3536
3637``` text copy
3738@pythnetwork/entropy-sdk-solidity/=node_modules/@pythnetwork/entropy-sdk-solidity
@@ -97,8 +98,8 @@ contract CoinFlip {
9798
9899Users will invoke the ` request ` method to initiate a coin flip, paying a fee in the process.
99100The method first retrieves the fee required to request a random number from Entropy.
100- It then includes the fee in the ` requestV2 ` method call to Entropy.
101- Finally, the method emits a ` FlipRequested ` event with a ` sequenceNumber ` . This event is also defined in the code snippet above.
101+ It then includes the fee in the ` requestV2{:bash} ` method call to Entropy.
102+ Finally, the method emits a ` FlipRequested{:bash} ` event with a ` sequenceNumber ` . This event is also defined in the code snippet above.
102103
103104### Handle the callback
104105
@@ -187,7 +188,7 @@ Deployed to: 0x8676ba0Dd492AB9813BC21D5Dce318427d1d73ae
187188Transaction hash: 0x2178aa6d402c94166a93e81822248d00dd003827675ebd49b3c542970f5a0189
188189```
189190
190- Let’ s export the coin flip contract address as environment variable for later use:
191+ Let' s export the coin flip contract address as environment variable for later use:
191192
192193``` bash copy
193194export COINFLIP_ADDRESS=< Deployed to address from above>
0 commit comments