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/libraries/web3-py.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,8 +98,8 @@ python compile.py
98
98
99
99
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:
100
100
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.
103
103
104
104
You can now proceed with deploying the contract to Polkadot Hub, as outlined in the next section.
105
105
@@ -114,14 +114,30 @@ To deploy your compiled contract to Polkadot Hub using Web3.py, you'll need an a
114
114
!!!warning
115
115
Never commit or share your private key. Exposed keys can lead to immediate theft of all associated funds.
116
116
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
+
117
125
## Interact with the Contract
118
126
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.
0 commit comments