If you don’t have it already, download the Google Chrome web browser. We will be using it exclusively.
Go ahead and get the CyberMiles MetaMask plug-in; the link will take you to the official Google Chrome store.
Visit CyberMiles’ testnet faucet to get your 1,000 free CyberMiles Tokens (CMT). Simply paste your account address into the “Account” field.
Note: To get your account, simply click on “Account 1” of the MetaMask plug-in (which you just installed). Within seconds, your MetaMask wallet will display 1,000 new CMT.
Now open CyberMiles’ free online smart contract editor and paste in some raw code (click on “view raw” in the bottom right of your screen).
The code will auto-compile. If not, click the “Start to compile” button in the Compile tab of the free online code editor.
Switch over to the Run tab (in between the Compile and Settings tabs).
Type a message on the right hand side of the red deploy button (over the text, which currently reads string _creationMessage), and don’t forget to use double quotes around the message that you are typing.
Once your message is typed in “with quotes,” click the red Deploy button.
Keep an eye out for the CyberMiles MetaMask pop-up because you will need to “Confirm” the transaction with a single mouse click. If you do not get the pop-up, look in the upper right side of your Chrome browser for the notification (1).
1 notification for you to click and accept
The pop-ups are pretty obvious, so you should not have any issues.
Test the contract by clicking the red sayHello button, on the side of your screen.
To check the output, click on the green tick in the box beneath your code. This will open up the latest transaction and allow you to view the logs.
You will see, once you scroll down inside the grey logging area, that the immutable data has been successfully recorded, specifically:
Click the red “TerminateTheContract” button to remove the contract code and all of its storage (i.e. the counter and owner variables) from the blockchain. Keeping in mind that while the contract no longer exists on the network, the event logs are immutable and will remain indefinitely. Also, remember that all of your transactions, too, will be permanently displayed on the CyberMiles block explorer.
If you have any questions about the CyberMiles blockchain, feel free to leave a comment.
Please get in touch with us at CyberMiles if you would like more information about developing smart contracts.