[−][src]Module clarity::abi
A module to simplify ABI encoding
For simplicity, it is based on tokens. You have to specify a list of tokens and they will be automatically encoded.
Additionally there are helpers to help deal with deriving a function signatures.
This is not a full fledged implemementation of ABI encoder, it is more like a bunch of helpers that would help to successfuly encode a contract call.
Limitation
Currently this module can only serialize types that can be represented by a Token.
Unfortunately if you need to support custom type that is not currently supported you are welcome to open an issue on issues page,
or do the serialization yourself by converting your custom type into a [u8; 32]
array and creating a proper Token instance.
Enums
SerializedToken | Representation of a serialized token. |
Token | A token represents a value of parameter of the contract call. |
Functions
derive_method_id | Given a signature it derives a Method ID |
derive_signature | Raw derive for a Keccak256 digest from a string |
encode_call | A helper function that encodes both signature and a list of tokens. |
encode_tokens | This one is a very simplified ABI encoder that takes a bunch of tokens, and serializes them. |