Module: ABI

Defined in:
lib/abicoder.rb,
lib/abicoder.rb,
lib/abicoder/types.rb,
lib/abicoder/parser.rb,
lib/abicoder/decoder.rb,
lib/abicoder/encoder.rb

Defined Under Namespace

Classes: Address, Array, Bool, Bytes, Decoder, DecodingError, Encoder, EncodingError, FixedArray, FixedBytes, Int, String, Tuple, Type, Uint, ValueError, ValueOutOfBounds

Constant Summary collapse

BYTE_EMPTY =

todo/check: use auto-freeze string literals magic comment - why? why not?

todo/fix: move BYTE_EMPTY, BYTE_ZERO, BYTE_ONE to upstream to bytes gem

and make "global" constants - why? why not?
"".b.freeze
BYTE_ZERO =
"\x00".b.freeze
BYTE_ONE =

note: used for encoding bool for now

"\x01".b.freeze
UINT_MAX =

same as 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

2**256 - 1
UINT_MIN =
0
INT_MAX =

same as 57896044618658097711785492504343953926634992332820282019728792003956564819967

2**255 - 1
INT_MIN =

same as -57896044618658097711785492504343953926634992332820282019728792003956564819968

-2**255      ## same as -57896044618658097711785492504343953926634992332820282019728792003956564819968

Class Method Summary collapse

Class Method Details

.decode(types, data, raise_errors = false) ⇒ Object Also known as: decode_abi



50
51
52
# File 'lib/abicoder.rb', line 50

def self.decode( types, data, raise_errors = false )
    decoder.decode( types, data, raise_errors )
end

.decoderObject



41
42
43
# File 'lib/abicoder.rb', line 41

def self.decoder
  @decoder ||= Decoder.new
end

.encode(types, args) ⇒ Object Also known as: encode_abi



46
47
48
# File 'lib/abicoder.rb', line 46

def self.encode( types, args )
    encoder.encode( types, args )
end

.encoderObject



38
39
40
# File 'lib/abicoder.rb', line 38

def self.encoder
  @encoder ||= Encoder.new
end