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: withdraw bep20 error #2

Merged
merged 3 commits into from
Nov 22, 2023
Merged

fix: withdraw bep20 error #2

merged 3 commits into from
Nov 22, 2023

Conversation

owen-reorg
Copy link
Collaborator

No description provided.

@@ -45,6 +46,11 @@ contract L2StandardBridgeBot is Ownable {
} else {
require(msg.value == delegationFee, "BEP20 withdrawal: msg.value does not equal to delegationFee");

IERC20 l2Token = IERC20(_l2Token);
bool approveSuccess = l2Token.approve(L2_STANDARD_BRIDGE_ADDRESS, _amount + l2Token.allowance(address(this), L2_STANDARD_BRIDGE_ADDRESS));
require(approveSuccess, "BEP20 withdrawal: approve failed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to confirm that whether this two require are necessary.

@bendanzhentan bendanzhentan merged commit 43ac826 into main Nov 22, 2023
2 checks passed
@bendanzhentan bendanzhentan deleted the bep20-test branch November 22, 2023 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants