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

Authorized reimbursements in the L1BitcoinDepositor contract #804

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

lukasz-zimnoch
Copy link
Member

If someone front-runs the Relayer Bot to call the initializeDeposit function, the Relayer Bot's transaction will be reverted, wasting a substantial amount of gas since the validation of duplicate deposits is performed very late in the process, in the tBTC Bridge smart contract. This is cost-effective to the front-runner, as the refund mechanism attempts to make callers slightly net-positive.

To mitigate the above, anyone is allowed to relay deposits but reimbursement only occurs for a closed set of relayers.

If someone front-runs the Relayer Bot to call the `initializeDeposit` function,
the Relayer Bot's transaction will be reverted, wasting a substantial amount of
gas since the validation of duplicate deposits is performed very late in the
process, in the tBTC `Bridge` smart contract. This is cost-effective to the
front-runner, as the refund mechanism attempts to make callers slightly
net-positive.

To mitigate the above, anyone is allowed to relay deposits but reimbursement
only occurs for a closed set of relayers.
@tomaszslabon tomaszslabon merged commit d98594c into main Apr 3, 2024
38 checks passed
@tomaszslabon tomaszslabon deleted the authorized-refunds branch April 3, 2024 12:24
tomaszslabon added a commit that referenced this pull request Apr 3, 2024
Depends on: #804

Here we add the missing zero-address checks to prevent incorrectly set
values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛓️ solidity Solidity contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants