Crate evm_coder

Source
Expand description

§evm-coder

Library for seamless call translation between Rust and Solidity code

By encoding solidity definitions in Rust, this library also provides generation of solidity interfaces for ethereum developers

§Overview

Most of this library functionality shouldn’t be used directly, but via macros

Re-exports§

pub use self::abi::AbiDecode;
pub use self::abi::AbiDecoder;
pub use self::abi::AbiEncode;
pub use self::abi::AbiEncoder;

Modules§

abi
Implementation of EVM RLP reader/writer
custom_signature
A module for custom signature support.
types
Solidity type definitions (aliases from solidity name to rust type) To be used in solidity_interface definitions, to make sure there is no type conflict between Rust code and generated definitions

Macros§

dummy_contract
Implement dummy Contract trait, used for tests Allows contract methods to return either T, or Result<T, String> for any T
event_topic
Returns solidity topic (hash) by its textual representation
fn_selector
Returns solidity function selector (first 4 bytes of hash) by its textual representation
generate_stubgen
Generate “tests”, which will generate solidity code on execution and print it to stdout Script at .maintain/scripts/generate_api.sh can split this output from test runtime
make_signature
Macro to create signatures of types and functions.

Structs§

DummyPost
Example of PostInfo, used in tests

Enums§

ERC165Call
Implementation of ERC165 is implicitly generated for all interfaces in solidity_interface, this structure holds parsed data for ERC165Call subvariant

Traits§

Call
Parseable EVM call, this trait should be implemented with solidity_interface macro
Callable
Type callable with ethereum message, may be implemented by solidity_interface macro on interface implementation, or for externally-owned real EVM contract
Contract
Contract configuration
ToLog
Implementation of this trait should not be written manually, instead use crate::ToLog proc macros.
ToTopic
Only items implementing ToTopic may be used as #[indexed] field in crate::ToLog macro usage.

Type Aliases§

ResultOf
Contract specific result type
ResultWithPostInfoOf
Contract specific result type

Attribute Macros§

solidity_interface
Derives call enum implementing crate::Callable and crate::Call from impl block.

Derive Macros§

AbiCoder
Macro to include support for structures and enums in Solidity.
ToLog
Derives ToLog for enum