Comments on L2 integration#1772
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1772 +/- ##
=======================================
Coverage 76.90% 76.90%
=======================================
Files 24 24
Lines 983 983
Branches 186 186
=======================================
Hits 756 756
Misses 203 203
Partials 24 24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// the same `Gateway.v2_submit` transaction that issues the preceding | ||
| /// `UnlockNativeToken(recipient = L1Adaptor, amount = X)` command. The paired | ||
| /// unlock funds this contract; the paired CallContract consumes the funds and | ||
| /// sweeps any residual back to the BEEFY-signed `recipient`. Both commands execute |
There was a problem hiding this comment.
Maybe we should add a note about the recipient: it’s typically an EOA, but if it’s a contract, it must be able to receive ETH. Otherwise, the ETH could become trapped in the adapter and potentially be exploited. Some kind of disclaimer—perhaps surfaced in the UI—would be helpful.
|
Once this is merged, we should update the scope of the HackenProof reports. There’s been some confusion—for example: |
| /// @dev End users on the L2 call `sendTokenAndCall` and `sendEtherAndCall` directly to | ||
| /// bridge ERC20 / native ETH back to Ethereum and onward to Polkadot. These | ||
| /// functions pull funds from the caller in the same call — via | ||
| /// `safeTransferFrom(msg.sender, address(this), inputAmount)` for ERC20 or | ||
| /// `require(msg.value == inputAmount)` for native ETH — and forward the pulled | ||
| /// amount straight to the SpokePool deposit. No function in this contract moves |
There was a problem hiding this comment.
It might also be worth adding a note about the recipient. This address is used to receive any funds that may be trapped if a call fails on mainnet. Additionally, if fees are not profitable, assets will be returned to this address on the original L2.
It’s usually an EOA, but if it’s a contract, it must be able to receive assets on both L2 and mainnet.
To hopefully reduce invalid bug bounty reports.