generated from eigerco/beerus
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Solidity ABI encode functions and utils (#279)
<!--- Please provide a general summary of your changes in the title above --> Added various traits/utils for supporting Solidity-like ABI encode functions. This includes the traits : - `SolAbiEncodeTrait` : providing equivalents for Solidity `abi.encode` and `abi.encodePacked` - `SolAbiEncodeSelectorTrait` : for Solidity `abi.encodeWithSelector` - `SolAbiDecodeTrait` : for Solidity `abi.decode` - `SolBytesTrait` : Providing utilities for easy conversion of types into Solidity-like `bytes1`, `bytes2`, ..., `bytes32` types Also added some helpers for `alexandria_bytes::Bytes`, such as : - `Bytes` <-> Cairo's `ByteArray` & `bytes31` function options - Debug & Display traits for `Bytes`, to allow printing `Bytes` as a hex string ## Pull Request type <!-- Please try to limit your pull request to one type; submit multiple pull requests if needed. --> Please check the type of change your PR introduces: - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no API changes) - [ ] Build-related changes - [ ] Documentation content changes - [ ] Other (please describe): Issue Number: #274 ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this does introduce a breaking change, please describe the impact and migration path for existing applications below. -->
- Loading branch information
1 parent
946e6e2
commit c1a604e
Showing
14 changed files
with
1,166 additions
and
3 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
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
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
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
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
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
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,6 +1,7 @@ | ||
mod base64; | ||
mod reversible; | ||
mod rlp; | ||
mod sol_abi; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pub mod decode; | ||
pub mod encode; | ||
pub mod encode_as; | ||
pub mod sol_bytes; | ||
|
||
use decode::{SolAbiDecodeTrait}; | ||
use encode::{SolAbiEncodeSelectorTrait, SolAbiEncodeTrait}; | ||
use encode_as::{SolAbiEncodeAsTrait}; | ||
use sol_bytes::{SolBytesTrait}; |
Oops, something went wrong.