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_ZERO =
BYTE_EMPTY = “”.b.freeze
"\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
- .decode(types, data, raise_errors = false) ⇒ Object (also: decode_abi)
- .decoder ⇒ Object
- .encode(types, args) ⇒ Object (also: encode_abi)
- .encoder ⇒ Object
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 |
.decoder ⇒ Object
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 |
.encoder ⇒ Object
38 39 40 |
# File 'lib/abicoder.rb', line 38 def self.encoder @encoder ||= Encoder.new end |