You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: smart-contracts/dev-environments/hardhat/compile-and-test.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Start the local Hardhat network with:
47
47
npx hardhat node
48
48
```
49
49
50
-
This command will launch a local Ethereum network on `http://127.0.0.1:8545` with 20test 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 19test accounts, each pre-funded with 10,000 ETH. The network will display all RPC calls and contract deployments in real-time.
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.
61
61
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 functionon 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 functionon the contract, but it catches and logs the error message if the withdrawal is not yet allowed (e.g., before `unlockTime`).
0 commit comments