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(svm): consistent anchor token constraints #694

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Reinis-FRP
Copy link
Contributor

@Reinis-FRP Reinis-FRP commented Oct 25, 2024

We were unnecessarily restricting relayer token account in the fill instruction to be canonically derived from the relayer and mint addresses. By replacing associated_token constraints with token constraints this would allow the relayer to pass any token account as long as its mint and authority matches.

Overall, we want to use canonical token accounts for vault and fill/slow fill recipients (hence, associated_token constraints) and any valid token accounts for all others.

Also, some of mint accounts were incorrectly using token constraints for their program account checks. Event the checks are implemented the same way (account being owned by the token program), Anchor error message is slightly different.

Fixes: https://linear.app/uma/issue/ACX-2925/instructionsfillrs-consistent-token-imports

Copy link

linear bot commented Oct 25, 2024

Signed-off-by: Reinis Martinsons <[email protected]>
@Reinis-FRP Reinis-FRP marked this pull request as ready for review October 25, 2024 14:09
Signed-off-by: Reinis Martinsons <[email protected]>
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.

1 participant