Plasm Network also supports solidity. Solidity is a smart contract language mainly used on Ethereum. If you have already built applications by using Solidity, you can also deploy the contracts on Plasm Network.
In this tutorial, we will use the Solang compiler, a compiler for solidity language developed by Hyperledger Labs. Let's install the compiler using the original instruction below.
Or using the following cargo command:
// linux userssudo apt install llvm openssl libxml2-dev// mac usersbrew install llvm openssl libxml2-devcargo install --git https://github.com/hyperledger-labs/solang --tag m8
solang binary should be available in your environment.
You can write any solidity contracts just like the development on Ethereum. Since this is a tutorial, we will use a
flipper contract which is available below.
Let's compile it using
substrate target to make it compatible with Plasm Network.
wget https://raw.githubusercontent.com/hyperledger-labs/solang/master/examples/flipper.solsolang flipper.sol
As a result, two files should be available in your current directory :
flipper.wasm (optimized WASM binary) and
flipper.json (smart contract metadata).
Let's deploy the compiled
flipper.contract ( this was
flipper.json in previous versions) using our standard Plasm Portal UI.
The next step is to create an instance of the uploaded smart contract WASM code.
After making the instance, we can interact with the smart contract using the UI portal just like an ink! smart contract described in the previous chapter.
More examples are available in the Solang repository:
Have fun and good luck!
Here you will find a tutorial:
Any questions? Feel free to ask us on our Discord tech channel.