-
Notifications
You must be signed in to change notification settings - Fork 8
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
[NTRN-483] fix: claim generator rewards #49
Conversation
contracts/lockdrop/src/contract.rs
Outdated
rwi.base_reward_token.to_string(), | ||
)? | ||
.amount; | ||
base_reward_received = reward_token_balance - prev_ntrn_balance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are here, let's use checked_sub
to feel 🦀 extra safe 🦀?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contract: becomes extra safe after single minus-to-checked_sub replacement
also contract: still has dozens of unsafe sub and sum operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task: https://p2pvalidator.atlassian.net/browse/NTRN-483
this PR:
motivation:
Generator's base reward token is a native astro token bridged via IBC, not a cw20 token. This cw20-based behaviour would broke user's claim calls to the lockdrop contract when generator is assigned a vesting account in the corresponding vesting contract.
related PRs: