Skip to content

Conversation

grod220
Copy link
Member

@grod220 grod220 commented May 27, 2025

Closes #46 (credit to @bonedaddy for first report)

Formerly, the escrow account was something the user could supply where unwrapped tokens could be held. The only requirement was for the owner to be the wrapped mint authority. After some thinking and audits, it's worth revisiting. In the annoying case, someone else could unwrap through your escrow, leaving you to find another to unwrap through. If they were malicious, they could unwrap through your escrow and re-wrap through say hundreds of very small accounts. This would leave you, on the client side, scrambling to unwrap through those accounts. In general, this frontrunning is a griefing attack surface.

This PR adds validation that requires the escrow to be a ATA associated with the wrapped mint. That way, everyone on that mint shares a deterministic bucket to unwrap from.

Changes to:

  • Program processor
  • CLI
  • tests

Javascript updates in #109

@grod220
Copy link
Member Author

grod220 commented May 28, 2025

Pulling out javascript code into another PR for cleaner separation

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Just a couple of small things, looks great overall!

@grod220 grod220 force-pushed the escrow-refactor branch from 5bf2c97 to cfdc71c Compare May 30, 2025 07:45
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

@grod220 grod220 merged commit 6c29a88 into main May 30, 2025
11 checks passed
@grod220 grod220 deleted the escrow-refactor branch May 30, 2025 10:23
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.

Escrow Account Should Probably Be Enforced To Be An ATA
2 participants