From 7978195955d328e4934092acc4fd56ab71fc94fb Mon Sep 17 00:00:00 2001 From: Oba Date: Fri, 29 Nov 2024 18:02:47 +0100 Subject: [PATCH] fix: use mcopy for full words (#14) --- src/CairoLib.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/CairoLib.sol b/src/CairoLib.sol index d4a8875..bf9b9d9 100644 --- a/src/CairoLib.sol +++ b/src/CairoLib.sol @@ -169,9 +169,7 @@ library CairoLib { // Copy full words. Because of the Cairo -> Solidity conversion, // each full word is 32 bytes long, but contains 31 bytes of information. for { let i := 0 } lt(i, fullWordsLength) { i := add(i, 1) } { - let word := mload(fullWordsPtr) - let storedWord := shl(8, word) - mstore(resultPtr, storedWord) + mcopy(resultPtr, add(fullWordsPtr, 1), 31) resultPtr := add(resultPtr, 31) fullWordsPtr := add(fullWordsPtr, 32) }