Skip bad withdrawals#29
Merged
dapplion merged 2 commits intoib-withdrawal-contract-partfrom Mar 16, 2023
Merged
Conversation
028a6c0 to
79e7f64
Compare
Barichek
reviewed
Mar 10, 2023
| ) internal returns (bool success) { | ||
| // Skip withdrawal that burns tokens to avoid a revert condition | ||
| // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/dad73159df3d3053c72b5e430fa8164330f18068/contracts/token/ERC20/ERC20.sol#L278 | ||
| if (_receiver == address(0)) { |
Contributor
There was a problem hiding this comment.
Why this is necessary? Burn of mGNO token will be done with account equal to address of withdrawals contract.
contracts/SBCDepositContract.sol
Outdated
| } | ||
|
|
||
| // Skip withdrawal for 0 tokens | ||
| if (_amount == 0) { |
Contributor
There was a problem hiding this comment.
Does it cause the process to revert? If not, possibly we should process it.
Member
Author
There was a problem hiding this comment.
With current tokens there's no condition that can cause a revert. However what's the point of processing a withdrawal for 0 value? A system transaction does not have any other result than a change in state which won't happen
Contributor
There was a problem hiding this comment.
I agree that no state changes will happen.
My suggestion was only that we can remove this extra conditions if they do not change anything (except of burned gas).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skip bad withdrawals to ensure that a revert can only be triggered by insolvency of stake tokens