Skip to main content
Remix might not default to the Contract tab
Source Link
eth
  • 86.6k
  • 54
  • 289
  • 418

One way is to use Remix, the browser-based Solidity realtime compiler and runtime Solidity (formerly named browser-solidity).

  1. Paste the code in Remix.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Contract tab and then Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes1 ... bytes32, use a quoted hex string, example "0xabcdef" for bytes3.
  • For bytes, use an array of hex strings, example: ["0xab", "0xcd", "0xef"].
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

One way is to use Remix, the browser-based Solidity realtime compiler and runtime Solidity (formerly named browser-solidity).

  1. Paste the code in Remix.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes1 ... bytes32, use a quoted hex string, example "0xabcdef" for bytes3.
  • For bytes, use an array of hex strings, example: ["0xab", "0xcd", "0xef"].
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

One way is to use Remix, the browser-based Solidity realtime compiler and runtime Solidity (formerly named browser-solidity).

  1. Paste the code in Remix.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Contract tab and then Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes1 ... bytes32, use a quoted hex string, example "0xabcdef" for bytes3.
  • For bytes, use an array of hex strings, example: ["0xab", "0xcd", "0xef"].
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

update to remix and handling of bytes
Source Link
eth
  • 86.6k
  • 54
  • 289
  • 418

One way is to use the browser-basedRemix, the browser-based Solidity realtime compiler and runtime Solidity Solidity realtime compiler and runtime Solidity.(formerly named browser-solidity).

  1. Paste the code in Solidity BrowserRemix.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes (and bytes1 ... bytes32), use a quoted hex string, example: "0xabcdef"0xabcdef"" would work for bytes3.
  • For bytes or, use an array of hex strings, example: bytes3["0xab", "0xcd", "0xef"].
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

EDIT: https://ethereum.github.io/browser-solidity is the new location

One way is to use the browser-based Solidity realtime compiler and runtime Solidity.

  1. Paste the code in Solidity Browser.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes (and bytes1 ... bytes32), use a quoted hex string, example: "0xabcdef" would work for bytes or bytes3.
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

EDIT: https://ethereum.github.io/browser-solidity is the new location

One way is to use Remix, the browser-based Solidity realtime compiler and runtime Solidity (formerly named browser-solidity).

  1. Paste the code in Remix.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes1 ... bytes32, use a quoted hex string, example "0xabcdef" for bytes3.
  • For bytes, use an array of hex strings, example: ["0xab", "0xcd", "0xef"].
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

replaced http://ethereum.stackexchange.com/ with https://ethereum.stackexchange.com/
Source Link

One way is to use the browser-based Solidity realtime compiler and runtime Solidity.

  1. Paste the code in Solidity Browser.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes (and bytes1 ... bytes32), use a quoted hex string, example: "0xabcdef" would work for bytes or bytes3.
  • For strings, make sure they are quoted.
  • For large numberslarge numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encodedABI encoded.

Here is an exampleexample screenshot:

enter image description here

EDIT: https://ethereum.github.io/browser-solidity is the new location

One way is to use the browser-based Solidity realtime compiler and runtime Solidity.

  1. Paste the code in Solidity Browser.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes (and bytes1 ... bytes32), use a quoted hex string, example: "0xabcdef" would work for bytes or bytes3.
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

EDIT: https://ethereum.github.io/browser-solidity is the new location

One way is to use the browser-based Solidity realtime compiler and runtime Solidity.

  1. Paste the code in Solidity Browser.
  2. Wrap the function inside a contract if needed. (Example: contract C { ... }.)
  3. Click Create to instantiate the contract.
  4. Enter the desired input next to the function.
  • For bytes (and bytes1 ... bytes32), use a quoted hex string, example: "0xabcdef" would work for bytes or bytes3.
  • For strings, make sure they are quoted.
  • For large numbers, make sure they are quoted too.
  • For an array, use [], example: ["hello", 42, "0xabcd"]
  1. Click the function to get the Result. The Result is ABI encoded.

Here is an example screenshot:

enter image description here

EDIT: https://ethereum.github.io/browser-solidity is the new location

large numbers need to be quoted
Source Link
eth
  • 86.6k
  • 54
  • 289
  • 418
Loading
https://ethereum.github.io/browser-solidity is the new location
Source Link
eth
  • 86.6k
  • 54
  • 289
  • 418
Loading
Source Link
eth
  • 86.6k
  • 54
  • 289
  • 418
Loading