NethermindEth / warp

Warp - Bringing Solidity to Starknet at warp speed. Warp is a Solidity to Cairo Compiler, this allows teams to write/migrate Solidity to Cairo for easy onboarding into the StarkNet ecosystem.
https://nethermind.io/warp/
Apache License 2.0
754 stars 70 forks source link

Abi memory #1066

Open rjnrohit opened 1 year ago

rjnrohit commented 1 year ago

The embed cairo0 code has been transformed in abiEncode.ts and abiDecode.ts file to correspoding cairo1 version as well adopting the latest memory layout proposed for WARP.

Modals traits such as ByteAccessorTrait and DynamicArrayUtilTrait has been added for bytes_access.cairo and dynamic_array_utils.cairo files. Some of the existing methods of the traits is still yet to be implemented though.

trait DynamicArrayUtilTrait {
    // WARP Memory Dynamic Arrays Utils
    fn dynamic_array_copy_felt(ref self: WarpMemory, to_loc: felt252, to_index: felt252, to_final_index: felt252, from_loc: felt252, from_index: felt252);
....
}
trait ByteAccessorTrait {
    fn byte256_at_index(base: u256, index: felt252) -> felt252;
   ....
}

After these traits methods implementation would be done then we remaining ts files inside cairoUtilFuncGen/abi folder needs to be transformed adopting the implemented trait and newer cairo1 changes.

will go in after #1045

rjnrohit commented 1 year ago

The embed cairo0 code has been transformed in abiEncode.ts and abiDecode.ts file to correspoding cairo1 version as well adopting the latest memory layout proposed for WARP.

Modals traits such as ByteAccessorTrait and DynamicArrayUtilTrait has been added for bytes_access.cairo and dynamic_array_utils.cairo files. Some of the existing methods of the traits is still yet to be implemented though.

trait DynamicArrayUtilTrait { // WARP Memory Dynamic Arrays Utils fn dynamic_array_copy_felt(ref self: WarpMemory, to_loc: felt252, to_index: felt252, to_final_index: felt252, from_loc: felt252, from_index: felt252); .... } trait ByteAccessorTrait { fn byte256_at_index(base: u256, index: felt252) -> felt252; .... } After these traits methods implementation would be done then we remaining ts files inside cairoUtilFuncGen/abi folder needs to be transformed adopting the implemented trait and newer cairo1 changes.

will go in after https://github.com/NethermindEth/warp/pull/1045