This article shows you how to use the TYMLEZ Smart Contract Explorer to run the vehicle transfer flow.
This article is based on the vehicle transfer flow. Instead of using the CLI, you can use the Smart Contract Explorer to run the flow instead.
You need to log in to the TBSP UI with a user to access all the explorers.
Log in to the TBSP UI
First, log in via the TBSP UI with a user and the generated password:
Once logged in, navigate to the smart contract explorer:
Create an asset with the asset explorer
Before deploying the smart contract, create a digital asset using the Asset Explorer.
In the Asset Explorer, click on the "+" button on the far-right corner:
The following pop-up will appear:
In the field Asset Type, select an existing asset type.
For this smart contract, let's create a sample_car type asset.
In this example, let's enter the amount of 1.
Create the asset.
The asset is displayed in the asset explorer:
Select the vehicle transfer smart contract
On the sidebar, navigate to "Smart Contract Explorer":
Here, you will see the different contract templates available.
Select the vehicle transfer flow:
As outlined in the vehicle transfer smart contract tutorial for the CLI, deploying this specific template will create a digital asset and transfer this asset between different owners with a specific acceptance condition.
Publish and deploy the Smart Contract
The SC_vehicleTransfer contract template contains a number of elements:
- the contract template you have chosen
- a short description of the contract template
- functions, which are execution instructions for the smart contract.
Specifically, these functions are
Publish the smart contract
To publish the smart contract, use the init function.
You must provide an argument, which is the inspection date.
This inspection date is the specific acceptance condition.
To begin, enter the ID of an existing digital asset from above.
Click the Publish button to create a smart contract instance.
After publishing the smart contract, you can view this specific instance by clicking on Open Instance.
The smart contract ID is then displayed:
In the contract instance, you can see the state of the smart contract as well as the result of the call.
Alternatively, you can also access the state of the contract, which is stored in the database, by clicking on the Get State button.
Execute smart contract
Execute the smart contract by placing a call.
In the Functions section, navigate to the getInspectionDate tab and click on Call:
Here, the call returns the message that no inspection date has been set.
Now, in the Functions tab, navigate to the setInspectionDate.
As a next step, let's provide an inspection date falling within the last 12 months, using the format YYYY-MM-DD:
Now, click on the tab getLastInspectionDate to see the new inspection date:
Since the inspection date is set, let's transfer the asset.
Navigate to the transferVehicle tab and retrieve the asset ID by clicking GET STATE:
Now, enter the assets, the public keys of the next owner, as well as the desired amount.
If the transfer is successful, a transaction ID will be shown:
To see the state of the contract, click the GET STATE button.
In the output, you will see that the contract has finished:
Return to the main explorers page.