test(integration): withdrawing a fake L2 token#2061
Conversation
🦋 Changeset detectedLatest commit: 0293749 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7305517 to
eb926e2
Compare
|
Can you add a changeset for the integration tests? |
d302a2a to
71ddfa7
Compare
| '0x' | ||
| ) | ||
| await env.relayXDomainMessages(withdrawalTx) | ||
| await env.waitForXDomainTransaction(withdrawalTx, Direction.L2ToL1) |
There was a problem hiding this comment.
Ideally I would assert that this transaction does not emit an ERC20WithdrawalFinalized event, but I did not see a logs field on the remoteTx object which this returns.
It's been a while since I've worked with the cross-domain testing utils, am I missing something?
Codecov Report
@@ Coverage Diff @@
## develop #2061 +/- ##
========================================
Coverage 74.58% 74.58%
========================================
Files 79 79
Lines 2554 2554
Branches 401 401
========================================
Hits 1905 1905
Misses 649 649
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
71ddfa7 to
0293749
Compare
|
@elenadimitrova I've requested your review as this test implements the bridge withdrawal bug which we've received several false positive reports on. |
Description
Adds an integration test demonstrating that a commonly perceived vulnerability does not in fact exist.
Specifically, there appears to an obvious bug which would allow an attacker to withdraw a fake ERC20 token from L2 in exchange for a real ERC20 (such as WBTC) token on L1. There is no check in the L2StandardBridge, however the withdrawal is prevented from finalizing by a check in the L1StandardBridge.