In the first task of deploying a contract, we have learned how to deploy an on-chain contract,
If not, you can refer to the official tutorial and the tutorial of joio.eth.
Develop DAPP
Note: This tutorial must use the following supporting contracts (Comments) to use this DAPP normally, otherwise the operation will report an error!
https://explorer.condor.systems/address/0x9b6c936c9fa2a9e3fCbB10C2163a148e7A47CB7B/contracts#address-tabs
The second task needs to write a testnet application (dapp). At this time, we can use the contract in the first task to perform various contract operations.
Here I will take the dapp released by myself as an example to illustrate.
Open my dapp example address
Click “Fork Repl”, the repository name and introduction can be confirmed directly without changing.
After Fork, the code will be automatically opened, and then we only need to modify a few codes
Modify the RPC address in pages/index.tsx
Modify abi and contract address in hooks/useCommentsContract.ts
In fact, I have replaced the RPC address here with the correct one, which can be skipped here.
This is my open source contract, you can copy the code and redeploy it
Get the contract address and copy it directly in the lower right corner after deployment
If the contract has been verified, you can see copy abi
in the Code
column of the block browser
If the contract is not verified, you can find abi on remix
, just copy the following [ … ]
array
Copy and replace the contract address and abi obtained above into the file in the previous step
After the replacement, just click “RUN” in the middle of the top
If the wallet cannot be connected, it is recommended to open a new window.
Then we can link the wallet and switch to the CONDOR test network to interact
We can see our interactions on the block explorer
Interaction record of block explorer
If there is anything unclear about the above, please share , thank you