-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(abi): support all primitive types
- Loading branch information
Showing
2 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,49 @@ | ||
# Solidity ABI | ||
# Solidity ABIA | ||
|
||
An straightforward solidity ABI implementation in rust. | ||
An straightforward solidity ABI implementation for zink. | ||
|
||
Currently only used by the zink language, so the provided features | ||
is syncing with the development of zink. | ||
This library only contains a part of the solidity ABI implementation, | ||
if you are looking for a complete implementation of solidity ABI | ||
in rust, see [alloy-core][alloy-core]. | ||
|
||
If you are looking for a complete implementation of solidity ABI | ||
in rust, plz check [alloy-core](https://github.com/alloy-rs/core). | ||
## Static Types | ||
|
||
Only rust primitive types are supported in this static type port, | ||
|
||
| rust | solidity | | ||
|--------|-----------| | ||
| `i8` | `int8` | | ||
| `u8` | `uint8` | | ||
| `i16` | `int16` | | ||
| `u16` | `uint16` | | ||
| `i32` | `int32` | | ||
| `u32` | `uint32` | | ||
| `i64` | `int64` | | ||
| `u64` | `uint64` | | ||
| `i128` | `int128` | | ||
| `u128` | `uint128` | | ||
| `bool` | `bool` | | ||
|
||
|
||
## Dynamic Types | ||
|
||
The implementation of dynamic arguments follows [use-of-dynamic-types][dyn-types], | ||
same as the static types, only ports the rust types: | ||
|
||
| rust | solidity | | ||
|------------|-----------| | ||
| `Vec<u8>` | `bytes` | | ||
| `[u8; 20]` | `address` | | ||
| `String` | `string` | | ||
|
||
More complex types are currently not supported. | ||
|
||
|
||
## LICENSE | ||
|
||
GPL-3.0 | ||
|
||
|
||
[alloy-core]: https://github.com/alloy-rs/core | ||
[dyn-types]: https://docs.soliditylang.org/en/latest/abi-spec.html#use-of-dynamic-types | ||
[zink]: https://github.com/zink-lang/zink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters