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

Fix/ warn if collateral return is being directed to another owner #946

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

rhyslbw
Copy link
Member

@rhyslbw rhyslbw commented Sep 11, 2024

See commit message

Examples

These were produced by inverting logic, it's not how the pictured DApp behaves 😁
Screenshot from 2024-09-11 08-26-36
With both an error (blocking) and warning
Screenshot from 2024-09-11 08-27-53

It's currently possible for an adversarial DApp to craft a transaction that intentionally consumes collateral,
with the return owned by an address it controls. This fix reduces the risk by warning the user, however we
cannot block the transaction given the collateral could be provided by another source. Ideally we could block
if the return is not being sent to the input supplier, but that would require a costly input resolution, which
is not acceptable here.
Copy link

sonarcloud bot commented Sep 11, 2024

Copy link
Member

@AngelCastilloB AngelCastilloB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⭐

@rhyslbw rhyslbw merged commit d38c488 into main Sep 11, 2024
2 checks passed
@rhyslbw rhyslbw deleted the fix/guard-collateral-return branch September 11, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants