How to do it...

  1. To share/store small snippets of code, you can use gist. The process is mostly manual and requires you to copy and paste the code and then share it with someone. You can access gist from https://gist.github.com/.

  1. The Remix IDE ships with an option to publish your contract files directly to an anonymous public gist. Click the publish to Gist option in the top-left panel of the Remix IDE. Clicking it will publish all your contract code to a public gist. Take extra care while doing this for your confidential files, as it will make everything public.
  2. You can also use EthFiddle, which is a minimalistic IDE with code sharing features. It is targeted at solidity smart contracts and you can access it from https://ethfiddle.com/, as shown in the following screenshot:

  1. Once you have the source code in place, you can share the code by clicking the share button on the top panel. It will display a link that can be shared with others.

  2. The tool also comes with a built-in solidity compiler, which can be used to compile your contract. Click the Compile button in the top-right panel to do so. You can enable the auto-compile checkbox to compile the contract in real time.

  3. To change the compiler version, click on the dropdown next to the Compile button.

  1. Click on the Compiler Errors tab in the bottom panel to check whether your code has any syntax errors.

  2. Click on the Compiler Output tab to see the output of the successfully compiled code.
  3. Once the contract compiles successfully, you can deploy the contract by clicking the Deploy button.

  4. You can change the from address, value, and gas, or proceed with the default values. It will deploy the contract to the tool's built-in Ethereum network, as shown in the following screenshot:

  1. To interact with the deployed contracts, use the contract panel on the right-hand side of the tool. You can use it to read/write from the contract. Click the Call button to perform transactions, and you can see the relevant details right below the button, shown as follows:

  1. Apart from these features, EthFiddle also stores code shared recently. You can access it by clicking the Recent Fiddles button in the bottom panel.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.162.37