warp icon indicating copy to clipboard operation
warp copied to clipboard

Abi memory

Open rjnrohit opened this issue 2 years ago • 1 comments

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 avatar May 22 '23 12:05 rjnrohit

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

rjnrohit avatar Jun 22 '23 07:06 rjnrohit