Skip to content

Commit

Permalink
added signature check in beforeRoyaltyClaim hook
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPilou committed Jan 29, 2024
1 parent e411795 commit 72fee02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/ABKYCModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ contract ABKYCModule is IABKYCModule, AccessControlUpgradeable {
* @param _user user address
* @param _signature signature generated by AB Backend and signed by AB KYC Signer
*/
function beforeRoyaltyClaim(address _user, bytes calldata _signature) external view {}
function beforeRoyaltyClaim(address _user, bytes calldata _signature) external view {
bytes32 digest = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", keccak256(abi.encodePacked(_user, currentNonce)))
);
if (digest.recover(_signature) != defaultSigner) revert ABErrors.NO_KYC();
}

// ____ __ ___ __ _
// / __ \____ / /_ __ / | ____/ /___ ___ (_)___
Expand Down

0 comments on commit 72fee02

Please sign in to comment.