From 959bebe9719e4c0151fe4eea0a2a7629b87190fe Mon Sep 17 00:00:00 2001 From: viet-nv Date: Mon, 23 Sep 2024 16:05:15 +0700 Subject: [PATCH 1/2] feat(treasury-grant): add new batch of users --- .../components/ChooseGrantModal.tsx | 15 +- src/pages/ElasticSnapshot/data/data.json | 175215 ++++++++------- src/pages/ElasticSnapshot/data/vesting.json | 35 + 3 files changed, 87680 insertions(+), 87585 deletions(-) diff --git a/src/pages/ElasticSnapshot/components/ChooseGrantModal.tsx b/src/pages/ElasticSnapshot/components/ChooseGrantModal.tsx index 2679683f1e..d5cbafc749 100644 --- a/src/pages/ElasticSnapshot/components/ChooseGrantModal.tsx +++ b/src/pages/ElasticSnapshot/components/ChooseGrantModal.tsx @@ -52,6 +52,16 @@ export default function ChooseGrantModal({ // C: t`Opt out.`, } + const accountOnlyOptionB = [ + '0x3872afe887ced05d353252a88a2acebdacda5071', + '0x87b1594e6e8b8fee7b14cd77a5c2324e31a7bcd4', + '0x2244cfdb499a05c8f08a548f75a13c7485fe9433', + '0xee2147fcf090ce08095e65a3c9e193c459364d5b', + '0x00e6bc5f73ef330c5f553554dcec8a863db84a23', + '0xcab9760e56bfd28803b41cac1e6616704aa5ecce', + '0xd5c6519a51a840398c4444c2fbd9d34820baa10c', + ] + const [loading, setLoading] = useState(false) const [selectedOption, setSelectedOption] = useState(userSelectedOption || '') useEffect(() => { @@ -131,12 +141,13 @@ export default function ChooseGrantModal({ {Object.keys(options).map(opt => { + const disabled = opt === 'A' && accountOnlyOptionB.includes(account?.toLowerCase()) return ( @@ -258,7 +261,7 @@ export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveV Phase 1 - {format(userData?.value || 0)} + {phase3Info ? format(phase3Info.vestedAmount || 0) : format(userData?.value || 0)} @@ -275,6 +278,24 @@ export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveV {isNull ? 'N/A' : format(totalPhase2Value || 0)} + {phase3Info && ( + <> + + + + Phase 3 + + + {format(phase3Info.value - (phase3Info.vestedAmount || 0))} + + + + )} diff --git a/src/pages/ElasticSnapshot/components/Vesting.tsx b/src/pages/ElasticSnapshot/components/Vesting.tsx index 7ddb3173a6..e9d81b7965 100644 --- a/src/pages/ElasticSnapshot/components/Vesting.tsx +++ b/src/pages/ElasticSnapshot/components/Vesting.tsx @@ -90,6 +90,14 @@ export interface VestingInterface { proof: string[] } +// wallets that request to change address due to compromise or loss +// https://team-kyber.atlassian.net/browse/EX-2157 +const disableWallets = [ + '0xd1bbca0dfde1f51ccd17e33de1a7ead48faa1d68', + '0x194eda5c8302bc8550e3e918b36520d138fba8ae', + '0x12a2455cca45d8f6d9149f0e996260ae49eda8b4', +] + export default function Vesting({ userSelectedOption, userVestingData, @@ -162,6 +170,8 @@ export default function Vesting({ const claimablePercent = unlockedPercent - claimedPercent + const isRemoved = disableWallets.includes(account?.toLowerCase() || '') + return ( <> {show && proof && ( @@ -185,6 +195,11 @@ export default function Vesting({ {upToSmall && account ? shortenAddress(1, account) : account} + {isRemoved && ( + + This wallet has been removed from Treasury Grant + + )} @@ -225,7 +240,7 @@ export default function Vesting({ setShow(true)} > Claim diff --git a/src/pages/ElasticSnapshot/data/data.json b/src/pages/ElasticSnapshot/data/data.json index 7ffa0a5b0b..5e9e6b1b65 100644 --- a/src/pages/ElasticSnapshot/data/data.json +++ b/src/pages/ElasticSnapshot/data/data.json @@ -87581,54 +87581,5 @@ } } ] - }, - { - "user_address": "0x3872afe887ced05d353252a88a2acebdacda5071", - "total_usd": 1999.51, - "total_liquidity_usd": 1999.51, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0x87b1594e6e8b8fee7b14cd77a5c2324e31a7bcd4", - "total_usd": 1020.78, - "total_liquidity_usd": 1020.78, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0x2244cfdb499a05c8f08a548f75a13c7485fe9433", - "total_usd": 27325.42, - "total_liquidity_usd": 27325.42, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0xee2147fcf090ce08095e65a3c9e193c459364d5b", - "total_usd": 585721.92, - "total_liquidity_usd": 585721.92, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0x00e6bc5f73ef330c5f553554dcec8a863db84a23", - "total_usd": 197918.5, - "total_liquidity_usd": 197918.5, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0xcab9760e56bfd28803b41cac1e6616704aa5ecce", - "total_usd": 2375.41, - "total_liquidity_usd": 2375.41, - "total_fee_usd": 0, - "positions": [] - }, - { - "user_address": "0xd5c6519a51a840398c4444c2fbd9d34820baa10c", - "total_usd": 82.82, - "total_liquidity_usd": 82.82, - "total_fee_usd": 0, - "positions": [] } ] diff --git a/src/pages/ElasticSnapshot/data/phase3.json b/src/pages/ElasticSnapshot/data/phase3.json new file mode 100644 index 0000000000..da241fdd83 --- /dev/null +++ b/src/pages/ElasticSnapshot/data/phase3.json @@ -0,0 +1,40 @@ +[ + { + "receiver": "0x3872afe887ced05d353252a88a2acebdacda5071", + "vestingAmount": 1999510000, + "value": 1999.51 + }, + { + "receiver": "0x87b1594e6e8b8fee7b14cd77a5c2324e31a7bcd4", + "vestingAmount": 1020780000, + "value": 1020.78 + }, + { + "receiver": "0x2244cfdb499a05c8f08a548f75a13c7485fe9433", + "vestingAmount": 27325420000, + "value": 27325.42 + }, + { + "receiver": "0xee2147fcf090ce08095e65a3c9e193c459364d5b", + "vestingAmount": 585721920000, + "value": 585721.92 + }, + { + "receiver": "0x00e6bc5f73ef330c5f553554dcec8a863db84a23", + "vestingAmount": 197918498300, + "value": 197918.5, + "vestedAmount": 19657.410552 + }, + { + "receiver": "0xcab9760e56bfd28803b41cac1e6616704aa5ecce", + "vestingAmount": 2375410000, + "value": 2375.41, + "vestedAmount": 174.442519 + }, + { + "receiver": "0xd5c6519a51a840398c4444c2fbd9d34820baa10c", + "vestingAmount": 82820000, + "value": 82.82, + "vestedAmount": 21.632833 + } +] diff --git a/src/pages/ElasticSnapshot/data/vesting.json b/src/pages/ElasticSnapshot/data/vesting.json index ac4fde5812..3a4aa7695a 100644 --- a/src/pages/ElasticSnapshot/data/vesting.json +++ b/src/pages/ElasticSnapshot/data/vesting.json @@ -11733,40 +11733,5 @@ "receiver": "0xff9c6e3acc07792649644e97e358ec60ad22b018", "vestingAmount": 73527830000, "value": 73527.83 - }, - { - "receiver": "0x3872afe887ced05d353252a88a2acebdacda5071", - "vestingAmount": 1999510000, - "value": 1999.51 - }, - { - "receiver": "0x87b1594e6e8b8fee7b14cd77a5c2324e31a7bcd4", - "vestingAmount": 1020780000, - "value": 1020.78 - }, - { - "receiver": "0x2244cfdb499a05c8f08a548f75a13c7485fe9433", - "vestingAmount": 27325420000, - "value": 27325.42 - }, - { - "receiver": "0xee2147fcf090ce08095e65a3c9e193c459364d5b", - "vestingAmount": 585721920000, - "value": 585721.92 - }, - { - "receiver": "0x00e6bc5f73ef330c5f553554dcec8a863db84a23", - "vestingAmount": 197918498300, - "value": 197918.5 - }, - { - "receiver": "0xcab9760e56bfd28803b41cac1e6616704aa5ecce", - "vestingAmount": 2375410000, - "value": 2375.41 - }, - { - "receiver": "0xd5c6519a51a840398c4444c2fbd9d34820baa10c", - "vestingAmount": 82820000, - "value": 82.82 } ] diff --git a/src/pages/ElasticSnapshot/index.tsx b/src/pages/ElasticSnapshot/index.tsx index 1eaf489383..55e43959c4 100644 --- a/src/pages/ElasticSnapshot/index.tsx +++ b/src/pages/ElasticSnapshot/index.tsx @@ -26,6 +26,7 @@ import TreasuryGrantAndInstantClaim from './components/TreasuryGrantAndInstantCl import Vesting, { VestingInterface } from './components/Vesting' import poolsByCategoriesRaw from './data/category.json' import data from './data/data.json' +import phase3 from './data/phase3.json' import vestingOptionA from './data/vesting/optionA.json' import vestingOptionAPhase2 from './data/vesting/optionA_phase2.json' import vestingOptionB from './data/vesting/optionB.json' @@ -142,6 +143,7 @@ export default function ElasticSnapshot() { const vestingA = vestingOptionA.find(item => item.claimData.receiver.toLowerCase() === account?.toLowerCase()) const vestingB = vestingOptionB.find(item => item.claimData.receiver.toLowerCase() === account?.toLowerCase()) + const phase3Info = phase3.find(item => item.receiver.toLowerCase() === account?.toLowerCase()) const vestingAPhase2 = vestingOptionAPhase2.find( item => item.claimData.receiver.toLowerCase() === account?.toLowerCase(), @@ -149,7 +151,7 @@ export default function ElasticSnapshot() { const vestingBPhase2 = vestingOptionBPhase2.find( item => item.claimData.receiver.toLowerCase() === account?.toLowerCase(), ) - const userHaveVestingData = !!(vestingA || vestingB || vestingAPhase2 || vestingBPhase2) + const userHaveVestingData = !!(vestingA || vestingB || vestingAPhase2 || vestingBPhase2 || phase3Info) const categories = ['category 1', 'category 2', 'category 3', 'category 4', 'category 5'] @@ -285,7 +287,7 @@ export default function ElasticSnapshot() { Total Amount (USD) - {userInfo ? format(userInfo.total_usd) : '--'} + {phase3Info ? format(phase3Info.value) : userInfo ? format(userInfo.total_usd) : '--'} @@ -306,7 +308,7 @@ export default function ElasticSnapshot() { - {userInfo ? format(userInfo.total_liquidity_usd) : '--'} + {phase3Info ? format(phase3Info.value) : userInfo ? format(userInfo.total_liquidity_usd) : '--'} @@ -339,7 +341,7 @@ export default function ElasticSnapshot() { {tab === 'snapshot' ? ( <> - {userInfo && } + {(userInfo || phase3Info) && }