There are snippets and functions of Solidity code provided on this Ethereum Stack Exchange and other sites. What are ways to quickly test them, possibly debug a little, and play around?
[Ethereum] How to quickly test a Solidity function
contract-debuggingcontract-developmentremixsoliditytesting
Best Answer
One way is to use Remix, the browser-based Solidity realtime compiler and runtime Solidity (formerly named browser-solidity).
contract
if needed. (Example:contract C { ... }
.)Contract
tab and thenCreate
to instantiate the contract.bytes1
...bytes32
, use a quoted hex string, example"0xabcdef"
forbytes3
.bytes
, use an array of hex strings, example:["0xab", "0xcd", "0xef"]
.strings
, make sure they are quoted.[]
, example:["hello", 42, "0xabcd"]
Here is an example screenshot: