fvm-std
fvm-std is a crate that supply base tool for developer to write contract with RUST more convenient
1. Types
Here some simple types that we provide for developers to write contract easier.
H256
H256
is a 32-length bytes, in order to express block hash. There are methods implement
H160
H160
is a 20-length bytes, in order to express address, there are methods implement
Address
Address
is a alias for H160
, also a method implement
Notice: to_hex_string
is different to to_string
, the latter will only print part of the content, if it is too long
Log level
level for developer to use with event log. more details see in section log
// CRITICAL ERROR WARNING NOTICE INFO DEBUG
2. Log
we have supplied several tool macros method for developer to print log in contract, include
critical!()
, error!()
, warning!()
, notice!()
, info!()
, debug!()
Demo
3. Event
supply event for developer used in contract.
demo