Mark Spanbroek 78b87cd138 Move index field from AbiDecoder into Tuple
Fixes faiing decoding test.
2021-12-01 10:59:31 +01:00
2021-11-25 09:33:40 +01:00
2021-12-01 10:58:23 +01:00
2021-11-30 15:14:57 +01:00
2021-11-30 09:43:28 +01:00
2021-12-01 10:58:23 +01:00

Contract ABI

Implements encoding of parameters according to the Ethereum Contract ABI Specification.

Installation

Use the Nimble package manager to add contractabi to an existing project. Add the following to its .nimble file:

requires "https://github.com/status-im/nim-contract-abi >= 0.1.0 & < 0.2.0"

Usage

import contractabi
import stint

# encode unsigned integers, booleans, enums
AbiEncoder.encode(42'u8)

# encode uint256
AbiEncoder.encode(42.u256)

# encode byte arrays and sequences
AbiEncoder.encode([1'u8, 2'u8, 3'u8])
AbiEncoder.encode(@[1'u8, 2'u8, 3'u8])

# encode tuples
AbiEncoder.encode( (42'u8, @[1'u8, 2'u8, 3'u8], true) )
Description
Contract ABI Encoding
Readme
Languages
Nim 100%