Step1 - Install the Solo-Chain as Solo-Chain documentation instructs. Here is release address.
Step2 - Run the Solo-Chain.
Step1 - Open SmartX and select the python language and blank template. Copy the code in OEP4Sample.py to editor.
Step1 - Clicking the "Compile" button to compile the smart contract. ABI and AVM will be generated and Opcode will be displayed at the bottom.
Step2 - Deploy the contract
Input basic information and click the "Deploy" button.
The Chrome browser will open Cyano wallet automatically and a confirmation of deployment is required .
Note: You can click setting icon in the upper right corner to open setting and then select the Private-Net. Your account needs to have enough balance to execute the deployment.
After the success of deployment, a contract hash will be generated.
Step1 - Add an account
Input your account private key (hex string) and click the "OK" button.
Step2 - Select the function you want to invoke and run
The log result for successful invocation
pip install punica
We use tutorial-token as an example. Now we install tutorialtoken-box
mkdir tutorialtokencd tutorialtokenpunica unbox tutorialtoken
Note: Before compilation, you can modify the code if you want to. The contract ope4_token.py locates under /tutorialtoken/contracts.
punica compile
The result:
CompileCompile oep4_token.pycompiled, Thank you
punica deploy
The result:
Using network 'testNet'.Deploy failed...Contract has been deployed...Contract address is 0xd7b6a47966770c1545bf74c16426b26c0a238b16...
Note: The reason why the result occurs "Deploy failed..." is that the contract has already been deployed.
punica invoke
Using network 'testNet'.Running invocation: oep4_token_abi.jsonUnlock default payer account...Invoking initInvoke successfulInvoke result: 0x00Invoking nameInvoke successfulInvoke result: 0x4458546f6b656eInvoking symbolInvoke successfulInvoke result: 0x4458Invoking decimalsInvoke successfulInvoke result: 0x0aInvoking totalSupplyInvoke successfulInvoke result: 0x0000e8890423c78a00Invoking balanceOfInvoke successfulInvoke result: 0xInvoking transferUnlock signers account...Invoke failed, Please input gasLimit >= 20000 and gasPrice >= 500Invoking transferMultiUnlock signers account...Invoke failed, [NeoVmService] vm execute state fault!Invoking allowanceUnlock signers account...Invoke failed, Please input gasLimit >= 20000 and gasPrice >= 500Invoking transferFromUnlock signers account...Invoke failed, Please input gasLimit >= 20000 and gasPrice >= 500Invoking approveInvoke successfulInvoke result: 0x00