Skip to content

Commit 8b1dce5

Browse files
committed
add a few more edits to more closely align this with other library guides
1 parent 3aadae0 commit 8b1dce5

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

smart-contracts/libraries/web3-py.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ python compile.py
9898

9999
After executing the script, the Solidity contract is compiled into standard EVM bytecode. The ABI and bytecode are saved into files with `.json` and `.bin` extensions, respectively:
100100

101-
- **ABI file** (`abis/Storage.json`): Provides a JSON interface describing the contract's functions and how to interact with it.
102-
- **Bytecode file** (`artifacts/Storage.bin`): Contains the low-level machine code executable on EVM that represents the compiled smart contract ready for blockchain deployment.
101+
- **ABI file (`abis/Storage.json`)**: Provides a JSON interface describing the contract's functions and how to interact with it.
102+
- **Bytecode file (`artifacts/Storage.bin`)**: Contains the low-level machine code executable on EVM that represents the compiled smart contract ready for blockchain deployment.
103103
104104
You can now proceed with deploying the contract to Polkadot Hub, as outlined in the next section.
105105
@@ -114,14 +114,30 @@ To deploy your compiled contract to Polkadot Hub using Web3.py, you'll need an a
114114
!!!warning
115115
Never commit or share your private key. Exposed keys can lead to immediate theft of all associated funds.
116116
117+
To run the script, execute the following command:
118+
119+
```bash
120+
python deploy.py
121+
```
122+
123+
After running this script, your contract will be deployed to Polkadot Hub, and its address will be printed in your terminal. You can use this address for future contract interactions.
124+
117125
## Interact with the Contract
118126
119-
After deployment, interact with your contract using Web3.py methods. The example below demonstrates how to set and retrieve a number. Be sure to replace the `INSERT_RPC_URL`, `INSERT_PRIVATE_KEY`, and `INSERT_CONTRACT_ADDRESS` placeholders with your specific values:
127+
After deployment, interact with your contract using Web3.py methods. The example below demonstrates how to set and retrieve a number.
120128
121129
```python title="update_storage.py"
122130
--8<-- "code/smart-contracts/libraries/web3-py/update_storage.py"
123131
```
124132
133+
Be sure to replace the `INSERT_RPC_URL`, `INSERT_PRIVATE_KEY`, and `INSERT_CONTRACT_ADDRESS` placeholders with your specific values.
134+
135+
To interact with the contract, run:
136+
137+
```bash
138+
python update_storage.py
139+
```
140+
125141
## Where to Go Next
126142
127143
<div class="grid cards" markdown>

0 commit comments

Comments
 (0)