2 个不稳定版本
| 0.2.0 | 2024年1月1日 |
|---|---|
| 0.1.0 | 2024年1月1日 |
#7 在 #u256
917 每月下载量
用于 cargo-stylus-check
6KB
79 行
用于以太坊和合金类型之间安全类型转换的包
目前支持以下类型转换:
ethers::types::H160到alloy_primitives::Addressalloy_primitives::Address到ethers::types::H160ethers::types::U256到alloy_primitives::U256alloy_primitives::U256到ethers::types::U256ethers::types::Bytes到alloy_primitives::Bytesalloy_primitives::Bytes到ethers::types::Bytes
示例
let ethers_address: ethers::types::H160 = ethers::types::H160::random();
let alloy_address: alloy_primitives::Address = ethers_address_to_alloy(ethers_address);
let ethers_u256: ethers::types::U256 = ethers::types::U256::from_dec_str("126731272983");
let alloy_u256: alloy_primitives::U256 = ethers_u256_to_alloy(ethers_u256);
依赖项
~27–43MB
~810K SLoC