fix(withdrawer): update AstriaWithdrawer to check that withdrawal value is sufficient #1148
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.
Summary
update AstriaWithdrawer to check that withdrawal value is sufficient. for example, say a bridged asset is multiplied by 10^9 upon bridging to the rollup from the sequencer. you should not be able to withdraw some value <10^9, as this is not a valid asset amount on the sequencer, as it's smaller than the smallest denomination on the sequencer. this updates the contract to perform that check. the alternative is to update the withdrawer not to send sequencer withdrawals with value=0, but this method is better for ux as it won't allow a user to make an invalid withdrawal in the first place.
Background
found while debugging
Changes
10^assetWithdrawalDecimals
Testing
unit test