Skip to content

Commit

Permalink
fix: use mcopy for full words (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou authored Nov 29, 2024
1 parent 876daa0 commit 7978195
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/CairoLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7978195

Please sign in to comment.