rename verifySig into recoverSigner
This commit is contained in:
parent
f5c1b56060
commit
c0ba796183
|
@ -101,7 +101,7 @@ contract GiftBucket {
|
||||||
function redeem(Redeem calldata _redeem, bytes calldata sig) external {
|
function redeem(Redeem calldata _redeem, bytes calldata sig) external {
|
||||||
require(block.timestamp < expirationTime, "expired gift");
|
require(block.timestamp < expirationTime, "expired gift");
|
||||||
|
|
||||||
address recipient = verifySig(_redeem, sig);
|
address recipient = recoverSigner(_redeem, sig);
|
||||||
|
|
||||||
Gift storage gift = gifts[recipient];
|
Gift storage gift = gifts[recipient];
|
||||||
require(gift.amount > 0, "not found");
|
require(gift.amount > 0, "not found");
|
||||||
|
@ -135,7 +135,7 @@ contract GiftBucket {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifySig(Redeem memory _redeem, bytes memory sig) internal view returns(address) {
|
function recoverSigner(Redeem memory _redeem, bytes memory sig) internal view returns(address) {
|
||||||
require(sig.length == 65, "bad signature length");
|
require(sig.length == 65, "bad signature length");
|
||||||
|
|
||||||
bytes32 r;
|
bytes32 r;
|
||||||
|
|
Loading…
Reference in New Issue