Closed 0xpolarzero closed 7 months ago
Update OpenZeppelin ECDSA to Solady.
ECDSA.toEthSignedMessageHash
ECDSA.recoverCalldata
It saves a total of 552 gas on each call to claimWithSignature.
claimWithSignature
- bytes32 prefixedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", messageHash)); - address recoveredSigner = ECDSA.recover(prefixedHash, _signature); # saves 93 gas + bytes32 prefixedHash = ECDSA.toEthSignedMessageHash(messageHash); # saves 459 gas + address recoveredSigner = ECDSA.recoverCalldata(prefixedHash, _signature);
Update OpenZeppelin ECDSA to Solady.
ECDSA.toEthSignedMessageHash
to retrieve the prefixed hash.ECDSA.recoverCalldata
with the signature as calldata to recover the signer.It saves a total of 552 gas on each call to
claimWithSignature
.