Remix
Last updated
Last updated
Below we show a quick Solidity smart contract, compiled using Remix(https://remix.ethereum.org/) and deployed through the Script web wallet (https://wallet.script.tv/).
In this example, weβll make a limited edition SRC-20 token (SRC-20 equivalent, SRC stands for Script Network Token) on top of Script blockchain to denote the early adopters of Script protocol β the Script supporters who have run Lightning Nodes on the Script testnet.
We can start with a basic token smart contract.We can start with a basic token smart contract.
To compile this Solidity code, we can use the Remix Ethereum compiler(https://remix.ethereum.org/). (Another benefit of using an Ethereum-compatible VM for Script β much of the extensive Ethereum dev tools can be used here as well.)
Weβll walk through this process step by step, but for more in-depth instructions on using Remix, see the documentation here (https://remix-ide.readthedocs.io/en/latest/index.html).
Next, create a new file in Remix. Once the code is entered, click the Solidity Compiler button on the far left.
Next, youβll want to set the Compiler to required version used in solidity code, and in the Contract field βContract_Nameβ is selected. Then click the blue button that says βContract_Name.solβ.
Your smart contract is now compiled! Now for the moment letβs go over to the Script wallet.
Next, open your Script wallet or create a new one. Once youβre logged in, select the Contract tab from the wallet menu.
The Contract screen will ask you for two outputs from your compiled smart contract: the ABI/JSON Interface, and the Byte Code. Go back to Remix, and you can copy both by clicking the buttons βABIβ and βBytecodeβ under the βCompilation Detailsβ button. Then, paste each into the Script wallet and click βDeploy Contractβ.
Your contract is now live on the Script Testnet. Make sure to record your contract address.
Now you can try out the different functions for this contract, for example:
totalSupply
symbol
transfer
balanceOf
Other users can sign in to the Smart Contracts and interact with your smart contract as well. They will need to know both the contract address and the ABI/JSON interface data. Thatβs a bit unwieldy, but an example of one of the ease-of-use improvements that will come with future versions of the Script smart contract interface (for example, that ABI data could be made to auto-populate when a given smart contract address is entered).