Skip to content

Commit

Permalink
chore: gas bad
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Oct 15, 2024
1 parent 04e0743 commit 5d62bcf
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/helpers/ERC7739ReplaySafeWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ library ERC7739ReplaySafeWrapper {
digest := keccak256(m, 0xa0) //domain separator

// Hash typed data
mstore(0x00, 0x1901000000000000) // Store "\x19\x01".
mstore(0x1a, digest) // Store the domain separator.
mstore(0x3a, structHash) // Store the struct hash.
digest := keccak256(0x18, 0x42)
// Restore the part of the free memory slot that was overwritten.
mstore(0x3a, 0)
mstore(m, 0x1901) // Store "\x19\x01".
mstore(add(m, 0x20), digest) // Store the domain separator.
mstore(add(m, 0x40), structHash) // Store the struct hash.
digest := keccak256(add(m, 0x1e), 0x42)
}
}

Expand Down Expand Up @@ -167,12 +165,10 @@ library ERC7739ReplaySafeWrapper {
digest := keccak256(m, 0xa0) //domain separator

// Hash typed data
mstore(0x00, 0x1901000000000000) // Store "\x19\x01".
mstore(0x1a, digest) // Store the domain separator.
mstore(0x3a, structHash) // Store the struct hash.
digest := keccak256(0x18, 0x42)
// Restore the part of the free memory slot that was overwritten.
mstore(0x3a, 0)
mstore(m, 0x1901) // Store "\x19\x01".
mstore(add(m, 0x20), digest) // Store the domain separator.
mstore(add(m, 0x40), structHash) // Store the struct hash.
digest := keccak256(add(m, 0x1e), 0x42)
}
}

Expand Down

0 comments on commit 5d62bcf

Please sign in to comment.