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

cw20 allowance expiration can be set to a block height or timestamp in the past #628

Closed
harryscholes opened this issue Jan 10, 2022 · 1 comment · Fixed by #793
Closed
Assignees
Milestone

Comments

@harryscholes
Copy link
Contributor

Expirations are not validated when allowances are created,

if let Some(exp) = expires {

only when they are used

if a.expires.is_expired(block) {

This is not a huge problem, as the expiration can be updated to a future block height or timestamp, or removed entirely. Should we add validation that the block height or timestamp is in the future when creating a new allowance? Happy to make a PR for this if there is interest.

NB this was found in an audit of Mars protocol in a contract that was forked from the cw-plus cw20-base contract.

@ethanfrey ethanfrey added this to the v0.15.0 milestone Aug 15, 2022
@ethanfrey
Copy link
Member

Happy for this addition. It seems like it slipped off our plate

chipshort added a commit that referenced this issue Sep 5, 2022
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 a pull request may close this issue.

3 participants