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

Bug: missing validation when set_currency used in a batch #915

Open
dmoka opened this issue Sep 30, 2024 · 0 comments
Open

Bug: missing validation when set_currency used in a batch #915

dmoka opened this issue Sep 30, 2024 · 0 comments

Comments

@dmoka
Copy link
Contributor

dmoka commented Sep 30, 2024

Description

When we use utility.batch and have set_currency as first extrinsic, then we don't do any validation for the specified currrency.

It can lead to problem like:

Eg. the old DAI token with id 2. There seems be still some of it in our chain ( at least issuance shows something )
if you try to set currency to 2 - it would fail, because it is not accepted
however, if you use set currency as first tx in batch, and set it to 2 -> this would work, because there is old old price from oracle ( from block 2,188,027 ).
so you could pay with this asset.

Problematic code:

Some(Call::set_currency { currency }) => *currency,

Solution

We could use the same check we have in set currency extrinsic, so check if it is in accepted currencies or has XYK DOT pool. Probably, we should use the same function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants