Skip to content

Commit f6aa9ef

Browse files
committed
add deploy page fixes
1 parent c018369 commit f6aa9ef

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.snippets/code/smart-contracts/dev-environments/hardhat/get-started/hardhat-node-output.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<pre><code>Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/
1+
```bash
2+
Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/
23

34
Accounts
45
========
@@ -58,7 +59,7 @@
5859
Private Key: 0xea6c44ac03bff858b476bba40716402b03e41b8e97e276d1baec7c37d42484a0
5960

6061
Account #17: 0xbDA5747bFD65F08deb54cb465eB87D40e51B197E (10000 ETH)
61-
Private Key: 0x689af8efa8c651a91ad287602527f3af2fe9f6501a7ac4b061667b5a93e037fd
62+
Private Key: 0x689af8efa8c651a91ad287602527f3af6b827f2a8bce2897751d06a843f644967b1
6263

6364
Account #18: 0xdD2FD4581271e230360230F9337D5c0430Bf44C0 (10000 ETH)
6465
Private Key: 0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0
@@ -68,5 +69,5 @@
6869

6970
WARNING: These accounts, and their private keys, are publicly known.
7071
Any funds sent to them on Mainnet or any other live network WILL BE LOST.
71-
</code></pre>
72+
```
7273

smart-contracts/dev-environments/hardhat/compile-and-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Start the local Hardhat network with:
4747
npx hardhat node
4848
```
4949

50-
This command will launch a local Ethereum network on `http://127.0.0.1:8545` with 20 test accounts, each pre-funded with 10,000 ETH. The network will display all RPC calls and contract deployments in real-time.
50+
This command will launch a local Ethereum network on `http://127.0.0.1:8545` with 19 test accounts, each pre-funded with 10,000 ETH. The network will display all RPC calls and contract deployments in real-time.
5151

5252
The output will be something like this:
5353

smart-contracts/dev-environments/hardhat/deploy-a-contract.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This guide will use the Polkadot Hub TestNet as the target network. Here's how t
2929
npx hardhat vars get PRIVATE_KEY
3030
```
3131
32-
4. Update your Hardhat configuration file with network settings for the Polkadot network you want to target.
32+
4. Update your Hardhat configuration file with network settings with your local development node URL.
3333
3434
```javascript title="hardhat.config.js"
3535
require("@nomicfoundation/hardhat-toolbox");
@@ -38,10 +38,10 @@ This guide will use the Polkadot Hub TestNet as the target network. Here's how t
3838
const PRIVATE_KEY = vars.get("PRIVATE_KEY");
3939
4040
module.exports = {
41-
solidity: "0.8.24",
41+
solidity: "0.8.28",
4242
networks: {
43-
polkadotHubTestnet: {
44-
url: "https://rpc.polkadot-hub.io/testnet",
43+
polkadotHubLocal: {
44+
url: "http://localhost:8545",
4545
chainId: 1111,
4646
accounts: [PRIVATE_KEY]
4747
}
@@ -52,21 +52,21 @@ This guide will use the Polkadot Hub TestNet as the target network. Here's how t
5252
5. Deploy your contract using Ignition:
5353
5454
```bash
55-
npx hardhat ignition deploy ./ignition/modules/MyToken.js --network polkadotHubTestnet
55+
npx hardhat ignition deploy ./ignition/modules/Lock.js --network polkadotHubTestnet
5656
```
5757
5858
## Interaction with Your Contract
5959
6060
Once deployed, you can create a script to interact with your contract. To do so, create a file called `scripts/interact.js` and add some logic to interact with the contract.
6161
62-
For example, for the default `MyToken.sol` contract, you can use the following file that connects to the contract at its address and retrieves the `unlockTime`, which represents when funds can be withdrawn. The script converts this timestamp into a readable date and logs it. It then checks the contract's balance and displays it. Finally, it attempts to call the withdrawal function on the contract, but it catches and logs the error message if the withdrawal is not yet allowed (e.g., before `unlockTime`).
62+
For example, for the default `Lock.sol` contract, you can use the following file that connects to the contract at its address and retrieves the `unlockTime`, which represents when funds can be withdrawn. The script converts this timestamp into a readable date and logs it. It then checks the contract's balance and displays it. Finally, it attempts to call the withdrawal function on the contract, but it catches and logs the error message if the withdrawal is not yet allowed (e.g., before `unlockTime`).
6363

6464
```javascript title="interact.js"
65-
--8<-- 'code/develop/smart-contracts/dev-environments/hardhat/interact.js'
65+
--8<-- 'code/smart-contracts/dev-environments/hardhat/interact.js'
6666
```
6767

6868
Run your interaction script.
6969

7070
```bash
71-
npx hardhat run scripts/interact.js --network polkadotHubTestnet
71+
npx hardhat run scripts/interact.js --network polkadotHubLocal
7272
```

0 commit comments

Comments
 (0)