Skip to content

Commit

Permalink
fix: check approval address is not 0x0 (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 authored Jan 29, 2024
1 parent 385240f commit fdeb738
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/BC_fusion/TokenRecoverPortal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ contract TokenRecoverPortal is System, ReentrancyGuardUpgradeable {
_;
}

modifier approverlAddressInit() {
if (approvalAddress == address(0)) revert ApprovalAddressNotInitialize();
_;
}

function pause() external onlyAssetProtector {
_paused = true;
emit Paused();
Expand Down Expand Up @@ -84,6 +89,8 @@ contract TokenRecoverPortal is System, ReentrancyGuardUpgradeable {
error InBlackList();
// @notice signature: 0xf2771a99
error OnlyAssetProtector();
// @notice signature: 0x79028fde
error ApprovalAddressNotInitialize();

/*----------------- events -----------------*/
// This event is triggered whenever a call to #pause succeeds.
Expand Down Expand Up @@ -121,7 +128,7 @@ contract TokenRecoverPortal is System, ReentrancyGuardUpgradeable {
bytes calldata ownerSignature,
bytes calldata approvalSignature,
bytes32[] calldata merkleProof
) external merkelRootReady whenNotPaused nonReentrant {
) external merkelRootReady approverlAddressInit whenNotPaused nonReentrant {
// Recover the owner address and check signature.
bytes memory ownerAddr =
_verifySecp256k1Sig(ownerPubKey, ownerSignature, _tmSignatureHash(tokenSymbol, amount, msg.sender));
Expand Down

0 comments on commit fdeb738

Please sign in to comment.