Crates.io | api3-common |
lib.rs | api3-common |
version | 0.0.1 |
source | src |
created_at | 2022-06-23 13:39:26.102629 |
updated_at | 2022-06-23 13:39:26.102629 |
description | The common crate for API3 DAPI Server contracts |
homepage | |
repository | |
max_upload_size | |
id | 611885 |
size | 70,763 |
This is the common crate for porting solidity API3 contracts to Rust based chains. As for different chains, the same processing logic would be applied, it is natural to abstract common processes. The main design is as follows:
common/src/beacon.rs
, it contains all the methods used in the original DapiServer.sol
.
All the methods are implemented the same as in the solidity contracts. To ensure everything works in the respective chains,
the chain specific operations are abstracted into traits so that each chain could have its own implementation. The following traits
are implemented:
common/src/beacon::Storage
handles the load/save of item type T in the chaincommon/src/whitelist.rs:20
handles the whitelist functions in the specific chaincommon/src/access::AccessControlRegistry
handles the access control related function in the specific chaincommon/src/beacon::SignatureManger
handles the onchain signature verification