Caduceus testnet deployment DApp tutorial — IDE Development Contract
IDE tool peparation
Enter ide.caduceus.foundation/ to open IDE’s online development website
Install MetaMask plugin-in
This plug-in is a plug-in package for Google Chrome browser, which is not provided by other browsers.
Please refer to “Use of MetaMask” for details.
Top-up test coins
If the address already has CMP test coins, skip this step.
If there is no CMP test currency, please refer to “Use of MetaMask”.
IDE connects to MetaMask
The key data items are circled with red boxes and their order is marked by numbers
Number 1 in Figure 4–1 indicates clicking will show the right window
Number 2 in Figure 4–1 indicates the MetaMask window will pop up
Tip: If the MetaMask connection window does not pop up, please open MetaMask and select QuiGon to test the network in the network display
Number 3 in Figure 4–1 indicates the selected account
Number 4 in Figure 4–1 indicates Figure 4–2 will pop up when clicked
Number 1 in Figure 4–2 means click to complete the connection
Figure4–1
Figure4–2
Use IDE To Write Contract
Write Contract
Create the contract file Storage.sol according to the sequence in Figure 5–1
Figure5–1
Compile the contract
Write the contract according to the content in the red box at number 1 in Figure 5–2
Number 2 in Figure 5–2 means that clicking will show the right window
Number 3 in Figure 5–2 indicates the compiler version is 0.4.16
Number 4 in Figure 5–2 indicates the contract development language is Solidity
Number 5 in Figure 5–2 indicates the contract can be compiled by clicking
Figure5–2
Use IDE to publish contract
Release contract
Click on number 1 in Figure 6–1 to open the window on the right
The network published at number 2 in Figure 6–1
Number 3 in Figure 6–1 indicates the address where the contract is released
Number 4 in Figure 6–1 indicates the contract document to be released
Number 5 in Figure 6–1 indicates that the contract will be released by clicking, and a window with number 6 will pop up
Number 6 in Figure 6–1 indicates that it will be published to the internet after clicking
Figure6–1
View contract
Open the contract deployment details in Figure 6–3 after executing the sequence according to Figure 6–2
Number 1 in Figure 6–2 means the MetaMask plug-in will be opened after clicking
Number 2 in Figure 6–2 represents the chain of the release contract
Number 3 in Figure 6–2 indicates the address where the contract is issued
Number 4 in Figure 6–2 means to switch to the Activity option after clicking
Number 5 in Figure 6–2 represents the released contract
Number 1 in Figure 6–3 indicates the details of contract deployment
Figure6–2
Figure6–3
Call contract
Number 1 in Figure 6–4 indicates calling the contract method
Number 2 in Figure 6–4 indicates the confirmation call
Number 1 in Figure 6–5 represents the contract transaction details
Figure6–4
Figure6–5
RPC release contract
Get the contract CODE
To obtain the contract CODE, please refer to the numerical order in Figure 7–1
Figure7–1
The CODE code composition of the entire storage.sol contract: 0x+”object” (object is the actual data in Figure 1–1)
In the window opened above, the CODE code of GetInt() is 0x55551669, and the CODE code of SetInt() is 0x853b2d29
Release contract
{"jsonrpc":"2.0","method":"eth_sendTransaction","params":
[{"from":"0xF60a4716edAbDc1479C9b2562989a9cA106063dA","gas":"0x100000","gasPrice":"0x9184e72a","data":"0x60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635555166914610054578063853b2d291461007d578063bcdfe0d5146100a0575b600080fd5b341561005f57600080fd5b61006761012f565b6040518082815260200191505060405180910390f35b341561008857600080fd5b61009e6004808035906020019091905050610139565b005b34156100ab57600080fd5b6100b3610144565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f45780820151818401525b6020810190506100d8565b50505050905090810190601f1680156101215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000805490505b90565b806000819055505b50565b61014c610188565b6040805190810160405280600581526020017f48656c6c6f00000000000000000000000000000000000000000000000000000081525090505b90565b6020604051908101604052806000815250905600a165627a7a7230582021d6b54379a6cedb247400035c5af00c11c9942f9a9e4b61765392d3387139ab0029"}],
"id":1
}result:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2ea05c409a972809c2633228650fad1cc6213e11300b2b4d352e4abfe05e853e"
}
Query contract address
{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x2ea05c409a972809c2633228650fad1cc6213e11300b2b4d352e4abfe05e853e"],"id":1}
:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xed15aebf9661bd132c1851efb71008fdb3aebf58163cfb7c1003b9920f2ba04e",
"blockNumber": "0x31d5",
"contractAddress": "0x506fb30eeac47da87503a0c12223c9482b06891e",
"cumulativeGasUsed": null,
"from": "0xf60a4716edabdc1479c9b2562989a9ca106063da",
"gasUsed": "0x20180",
"logs": null,
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": null,
"transactionHash": "0x2ea05c409a972809c2633228650fad1cc6213e11300b2b4d352e4abfe05e853e",
"transactionIndex": "0x0"
}
}
Modify the contract
{"jsonrpc":"2.0","method":"eth_sendTransaction","params":
[{
"from":"0xF60a4716edAbDc1479C9b2562989a9cA106063dA",
"to":"0x506fb30eeac47da87503a0c12223c9482b06891e",
"gas":"0x10000",
"gasPrice":"0x9184e72a",
"data":"0x853b2d290000000000000000000000000000000000000000000000000000000000009855"
}],
"id":1
}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xd0ec57fe80bdcc8a90bec6115e6820e970b5691604c1427ff2015b1fd7462b63"
}
Query the result cf “Modify Contract”
{"jsonrpc":"2.0","method":"eth_call","params":
[{
"from":"0xF60a4716edAbDc1479C9b2562989a9cA106063dA",
"to":"0x506fb30eeac47da87503a0c12223c9482b06891e",
"gas":"0x10000",
"gasPrice":"0x9184e72a",
"data":"0x55551669"
},
"latest"
],
"id":1
}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000009855"
}
For more information: caduceus.foundation / info@caduceus.foundation