Simulator
Last updated
Was this helpful?
Last updated
Was this helpful?
We recommend that you prepare a before using the contract simulator.
If you do not want to prepare the solc compiler, it is necessary to prepare a Remix environment or Remix local browser.
The code is in https://github.com/seeleteam/go-seele
Copy the solc compiler to this path, and copy the solidity file in it too.
SimpleStorage.sol:
When a smart contract created successfully, the contract address will be stored.
Use the global contract address (if -c not specified) and set(21) function to call contract.
Verify the set function:
The following demonstration is done using the online version.
Prepare the smart contract source code:
Run the following commands to change into go-seele/cmd/vm directory, then run the command go build.
Create and deploy contract using the input hex string acquired from step three.
The string "Succeed to create contract!" means creation is successful, the deployment address might be different from the address above but that will not affect anything.
Then switch back to the contract simulator to execute the contract.
The string "Succeed to call contract!" indicates function call successful.
Switch to contract simulator, then call the get function.
When the string "Succeed to call contract!" is shown and the result is 21, then the function is running correctly!
Remix-IDE is a browser based IDE for solidity development, you can use the online version at , or download it from to install it locally.
And copy the smart contract source code to the text area. Click the Start to compile on the right to start compile. Ignore the yellow warnings, due to the source code version difference, the compiler will issue warnings.
Select Run on the right, as shown in the picture with an arrow point to it. Click the Deploy button at the middle section of the page at the right.
After successful deployment as shown in picture. Open the log detail section for log details, click on [vm] for details. Copy the content in the Input section, as below
Pick a random number such as 21 for testing. You could pick any number that you like. Enter the number at the right side in the Set field. The execution log will show up in the area marked grey. Click on this log line item for detail. Copy the content in the Input field.
Similar to set function, click on the get button. If the log shows up in the log field then means the function call is successful. Click on the log line item for detail. Copy the content from the input field.