-
Notifications
You must be signed in to change notification settings - Fork 101
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
Locked gno claim 2 #405
Locked gno claim 2 #405
Conversation
CLA Assistant Lite: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
|
Hey @nenadV91 , great job!
Thank you! |
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.
Have not tested the app, just reviewed the code.
Left a couple of nitpicks/suggestions
const chainNames = { | ||
[SupportedChainId.MAINNET]: 'mainnet', | ||
[SupportedChainId.RINKEBY]: 'rinkeby', | ||
[SupportedChainId.XDAI]: 'gnosisChain', | ||
} |
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.
I think we probably have that mapping somewhere else, don't we?
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.
const promise = | ||
chunkCache.get(path) ?? | ||
(fetch( | ||
`https://raw.githubusercontent.com/gnosis/locked-gno-cow-merkle-distro/${DISTRO_REPO_BRANCH_NAME}/${path}` | ||
).then((res) => res.json()) as Promise<Record<string, Claim>>) | ||
chunkCache.set(path, promise) |
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.
Nitpick: could it exit earlier in case there's a cache hit and avoid overwriting the cached value on every call?
@@ -0,0 +1,159 @@ | |||
[ |
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.
I think this was talked about while I was away, but wouldn't be better to store the claim indexes in the same repo as the claim files instead of adding them to the Cowswap's repo like was done for the airdrop?
Or we expect the amount to be significantly smaller that this is acceptable?
I'm personally not very found of having them here.
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.
I second this. I think these are the indexes but, anyways, nice to have to the merkle data project, right?
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.
i think the history got mixed from the develop merge, could you fix it please
It is impossible to claim COW from locked GNO in GC (neither here nor in #364 pr) However, it should work based on the commenthttps://github.com/gnosis/cowswap/pull/2599#issuecomment-1084459113 |
This is because the tooltip shows the total vested balance at the current moment, while in the field we show the amount that can be claimed now, which is the difference of the vested balance and the amount that has been already claimed earlier. We should maybe change the field label to "Claimable" to make this difference more clear? |
On rinkeby the test deployment of the vesting contract uses a special COW token (0xc50c011B7a2B960D6cb4ac93deFd04A529fDDB3a). We couldn’t use the existing COW token on rinkeby because we needed to fund the vesting contract with a large number of COW so all the existing accounts can be used for testing.
Hum, was that on Rinkeby? Looking at the token transfer history of our testing COW token, I can't see any transfer of 1438, but only one with 16, so it looks like it went through as expected. |
@jfschwarz , thank you for the explanation! Anyways, I will retest this issue again with another account. Thanks! |
I have retested changes, so now everything looks much-much better.
|
This is fixed already in this extra PR (I don't have rights to commit to this branch directly)
This is actually not the previously claimed balance, but the amount that became vested since you last claimed. So it is correct that the claim button is enabled and the user could theoretically claim every 5 minutes (or however frequently they want).
This button also got fixed in the other PR (the current link is broken). I think the purpose of the link is to give the user confidence and transparency into the contract interaction that will be triggered by pressing the Claim button. So it should really be the vesting contract. |
@jfschwarz , I have not recorded the video, but in my case I meant that the amount was not immediately updated. |
I've noticed another issue, when you logout the locked GNO card is not hidden and it stays there with previously connected account data |
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 worked great for me the claiming!
Codewise looks good too.
I would think is good to merge as soon as we get Elena's stamp.
One small detail, please don't need to fix, just commenting. The icons and logos are wrong, because that is the logo for vCOW to COW conversion. It could be GNO and COW logos, or COW to COW. Same for the COW logo in the profile, it could have a GNO small image overign the logo to differentiate from the other. Again, not important at all.
What is important though, is to coordinate this with the backend, specially after the change from @nenadV91 where now we use the locked COW also for the discount.
When do we want to release this?
@@ -0,0 +1,159 @@ | |||
[ |
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.
I second this. I think these are the indexes but, anyways, nice to have to the merkle data project, right?
const COW = COW_TOKENS[SupportedChainId.MAINNET] | ||
|
||
export const MERKLE_DROP_CONTRACT_ADDRESSES: Record<number, string> = { | ||
[SupportedChainId.MAINNET]: '0x64646f112FfD6F1B7533359CFaAF7998F23C8c40', |
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.
Are these already the final ones with the right allocation?
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.
Should we maybe leave the fee discount out of scope for now? Especially considering that work has to be done on the back-end for this first, I think this additional aspect should not block us from releasing the claiming feature. (People are already asking for the claim UI.)
src/custom/state/cowToken/hooks.ts
Outdated
|
||
if (account) { | ||
if (vCowBalance) tmpBalance = JSBI.add(tmpBalance, vCowBalance.quotient) | ||
if (lockedGnoBalance) tmpBalance = JSBI.add(tmpBalance, lockedGnoBalance.quotient) |
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.
I think this is not quite correct: We're adding the entire allocation without taking into account how much of it has already been claimed by the user. That share of the allocation that has been claimed is already in the user's wallet as COW and as such is already counted towards the fee discount.
We should use the useCowFromLockedGnoBalances
hook instead and then only add allocated - claimed
here.
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.
@jfschwarz Good point, I've added fix for this in this PR #460 (in case we want to add this to fee discount).
a047ad4
to
6ed5e05
Compare
Hey @nenadV91 , great changes! Could you please take a look at it? |
Also, I have created related issue #487 that might be fixed later. |
* use new rinkeby contracts * fix merkle drop contract address on GC * more specific names * localize vesting start date * improve copy * fix contract address link
* Add cow from locked GNO to combined balance * Add shimmer effect and handle disconnect
* Added some fixes * Update combined balance calculation * Added comments for locked GNO timestamps * Move locked GNO start date to const file * Moved some other locked GNO dates to const file * Added some PR updates * Small update
30fac7a
to
17234fb
Compare
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.
LGTM now!
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.
Looks good code-wise, have not tested the app though
Summary