4

Say you have some Solidity code and something doesn't work and you'd like for somebody to take a look at it and do some quick tests.

What is an efficient way to share Solidity code with others?

eth
  • 85,679
  • 53
  • 285
  • 406
euri10
  • 4,640
  • 5
  • 24
  • 55

2 Answers2

5

A very practical way is to use the gist feature of the browser-solidity

  1. Paste your code in the browser-solidity, click on the Publish Gist button: publish screenshot
  2. This will create for you a gist, just copy the url: https://gist.github.com/anonymous/b28692c94b053febe27bbb3692bb31ad gist
  3. Now you can create a direct link in your question to the browser-solidity that other can test instantly: https://chriseth.github.io/browser-solidity/?gist=https://gist.github.com/anonymous/b28692c94b053febe27bbb3692bb31ad
euri10
  • 4,640
  • 5
  • 24
  • 55
  • A quick illustration of testing with browser-solidity: http://ethereum.stackexchange.com/a/2836/42 – eth Apr 14 '16 at 15:56
2

Good answer by euri10 already....

If you are just looking for a tool that allows you to send a hunk of code to another person so they can look at it and maybe check your syntax and make some changes, https://codeshare.io/ is a great tool.

It doesn't have Solidity syntax highlighting, but it allows multiple people to work on a single piece of code at the same time, has a short and easy-to-share URL, and is helpful in some circumstances.

Namely, it is great when you are sharing some code with a friend or coworker or two. If you want to post to stackexchange or reddit or something else, using a gist is a more efficient and safe way (as not everyone can edit a gist).

tayvano
  • 15,961
  • 4
  • 45
  • 74