Skip to content

Commit

Permalink
feat: update production data for instant claim
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Feb 1, 2024
1 parent eff9a2c commit fa32f4e
Show file tree
Hide file tree
Showing 7 changed files with 2,685 additions and 11,276 deletions.
17 changes: 9 additions & 8 deletions src/pages/ElasticSnapshot/components/InstantClaimModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const TableBody = styled(TableHeader)<{ backgroundColor?: string }>`

const format = (value: number) => formatDisplayNumber(value, { style: 'currency', significantDigits: 7 })

const contractAddresses = ['', '', '0x41b9a47dB6edB468633B4c2863d5eBE5EE23b12b', '']
// const contractAddresses = ['', '', '0x41b9a47dB6edB468633B4c2863d5eBE5EE23b12b', '']
const contractAddress = '0xD0806364e9672EF21039Dc4DC84651B9b535E535'

const ContractInterface = new Interface(InstantAbi)

Expand All @@ -72,10 +73,10 @@ export default function InstantClaimModal({ onDismiss }: { onDismiss: () => void
const { account, chainId } = useActiveWeb3React()
const { library } = useWeb3React()

const ethereumContract = useReadingContract(contractAddresses[0], ContractInterface, ChainId.MAINNET)
const optimismContract = useReadingContract(contractAddresses[1], ContractInterface, ChainId.OPTIMISM)
const polygonContract = useReadingContract(contractAddresses[2], ContractInterface, ChainId.MATIC)
const avalancheContract = useReadingContract(contractAddresses[3], ContractInterface, ChainId.AVAXMAINNET)
const ethereumContract = useReadingContract(contractAddress, ContractInterface, ChainId.MAINNET)
const optimismContract = useReadingContract(contractAddress, ContractInterface, ChainId.OPTIMISM)
const polygonContract = useReadingContract(contractAddress, ContractInterface, ChainId.MATIC)
const avalancheContract = useReadingContract(contractAddress, ContractInterface, ChainId.AVAXMAINNET)

const [claimed, setClaimed] = useState([true, true, true, true])

Expand Down Expand Up @@ -192,12 +193,12 @@ export default function InstantClaimModal({ onDismiss }: { onDismiss: () => void
name: 'Kyberswap Instant Grant',
version: '1',
chainId: selectedNetworkToClaim,
verifyingContract: contractAddresses[selectedIndex],
verifyingContract: contractAddress,
},
message: {
leafIndex: userData[selectedIndex]?.claimData?.index,
termsAndConditions:
'I accept KyberSwap’s Terms and Conditions published here https://bafkreic3csqhyqrz3wir2wd7sn2owrsuwbn4aakbaje5zmmpoy2dmbdlyi.ipfs.w3s.link',
'By confirming this transaction, I agree to the KyberSwap Elastic Recovered Asset Redemption Terms which can be found at this link https://bafkreiclpbxs5phtgmdicdxp4v6iul5agoadbd4u7vtut23dmoifiirqli.ipfs.w3s.link',
},
}),
])
Expand All @@ -217,7 +218,7 @@ export default function InstantClaimModal({ onDismiss }: { onDismiss: () => void
library
?.getSigner()
.sendTransaction({
to: contractAddresses[selectedIndex],
to: contractAddress,
data: encodedData,
})
.then(tx => {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/ElasticSnapshot/components/Vesting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ export default function Vesting({ userSelectedOption }: { userSelectedOption: st

const [show, setShow] = useState(false)

if (!userVestingData) return null
const fakeCondition = 1 + 1 === 2
// TODO: hide to release instant grant
if (!userVestingData || fakeCondition) return null

const totalAmount = userVestingData.claimData.vestingAmount / 10 ** 6

Expand Down
Loading

0 comments on commit fa32f4e

Please sign in to comment.