-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(protocol): Strike price to token grants #15506
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
amount += _getAmountUnlocked(r.grants[i]); | ||
uint128 perGrantAmount; | ||
|
||
perGrantAmount = _getAmountUnlocked(r.grants[i]); |
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.
it will be great to merge these 3 lines into the _getAmountUnlocked and rename it as _getAmountAndCostUnlocked
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.
Here is a logical error: r.amountWithdrawn
is the total amount withdrawn for all grants assigned to this address, previously this is ok, but now each grant has a different strike price, you have to calculated the cost per grant with its own amountWithdrawn
. The Recipient must be modified to remove amountWithdrawn
and put amountWithdrawn
inside each grant`. How tests didn't capture this?
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.
Done.
Tests were not catching because i set the strikePrices to 0 every existing tests, and added 2 new, but they did not intermediary steps, just X years after 100% fully unlocks, so this kind of case did not come up. Now i modified all files to have a non-zero strike price.
Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>
I prefer another implementation in #15522 with minimal changes. |
TKO tokens now shall be bought when withdrawn for a strike price (per TKO in stable token) - it still can be 0.