Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check approval address is not 0x0 #476

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading