Skip to content

Commit

Permalink
♻️ Fix SignatureCheckerLib values (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
rholterhus authored Jan 10, 2025
1 parent cc133a9 commit af902c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/SignatureCheckerLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ library SignatureCheckerLib {
mstore(d, 0x40) // The offset of the `signature` in the calldata.
mstore(add(m, 0x44), 65) // Length of the signature.
mstore(add(m, 0x64), r) // `r`.
mstore(add(m, 0x84), mload(0x60)) // `s`.
mstore8(add(m, 0xa4), mload(0x20)) // `v`.
mstore(add(m, 0x84), shr(1, shl(1, vs))) // `s`.
mstore8(add(m, 0xa4), add(shr(255, vs), 27)) // `v`.
isValid := staticcall(gas(), signer, m, 0xa5, d, 0x20)
isValid := and(eq(mload(d), f), isValid)
break
Expand Down
1 change: 1 addition & 0 deletions test/SignatureCheckerLib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ contract SignatureCheckerLibTest is SoladyTest {
bytes32 hash = TEST_SIGNED_MESSAGE_HASH;
bytes memory signature = SIGNATURE;
_checkSignature(true, signer, hash, signature, true);
_checkSignature(false, signer, hash, signature, true);
vm.etch(signer, "");
_checkSignature(false, signer, hash, signature, false);
}
Expand Down

0 comments on commit af902c3

Please sign in to comment.