Skip to content
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: add ifo for solv #11116

Merged
merged 44 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0d2422d
fix: 🐛 ifo listapie
chef-ryan Jan 7, 2025
645420f
fix: 🐛 update contract
chef-ryan Jan 7, 2025
303b84d
test listapie
chef-ryan Jan 7, 2025
9a2fc1b
fix tests
chef-ryan Jan 7, 2025
175b0a6
change params
chef-ryan Jan 7, 2025
e0aa398
save
chef-ryan Jan 7, 2025
c2afc6e
remove node config in web
chef-ryan Jan 7, 2025
107964f
adjust ifo paramters
chef-ryan Jan 8, 2025
4b6c77f
adjust params
chef-ryan Jan 8, 2025
ffe9cbb
adjust params
chef-ryan Jan 8, 2025
5d4c7b3
fix: 🐛 adjust params
chef-ryan Jan 8, 2025
8a012f1
feat: 🎸 Update icake contract
chef-ryan Jan 8, 2025
6a159c4
feat: 🎸 adjust ratio
chef-ryan Jan 8, 2025
8aaf60b
fix: 🐛 Fix bridge cake
chef-ryan Jan 8, 2025
a2ebb47
rebase
chef-ryan Jan 9, 2025
41f7e0b
chore: 🤖 update to new test contract
chef-ryan Jan 8, 2025
354cadc
fix: 🐛 build
chef-ryan Jan 8, 2025
a09e690
chore: 🤖 contract abi fix
chef-ryan Jan 8, 2025
97eec1d
fix: 🐛 fix vesting display
chef-ryan Jan 8, 2025
ee47a31
fix: 🐛 ifo
chef-ryan Jan 9, 2025
23db1ad
fix: 🐛 Do small refactor and fix vesting status display prolbem
chef-ryan Jan 9, 2025
45ab95c
save
chef-ryan Jan 9, 2025
a2987c6
claim usdt -> claim
chef-ryan Jan 10, 2025
b4850ef
feat: 🎸 Add override rate logic
chef-ryan Jan 10, 2025
c0fe4c5
fix: ratio display
chef-ryan Jan 10, 2025
6aabb7b
fix: 🐛 fix display bug
chef-ryan Jan 10, 2025
3bf5e8f
feat: 🎸 next round
chef-ryan Jan 10, 2025
a62fa36
fix: 🐛 Fix claimable issue
chef-ryan Jan 13, 2025
163c43e
fix
chef-ryan Jan 13, 2025
489304d
feat: 🎸 Add Solv Ifo
chef-ryan Jan 14, 2025
d7d0f0b
feat: 🎸 refactor
chef-ryan Jan 14, 2025
715e3b5
fix: 🐛 fix build errors
chef-ryan Jan 14, 2025
e3c7fbf
fix: 🐛 Fix data
chef-ryan Jan 14, 2025
239061d
update time
chef-ryan Jan 14, 2025
e80e4eb
fix text
chef-ryan Jan 14, 2025
89d130a
fix image
chef-ryan Jan 14, 2025
2a95b4c
fix svg
chef-ryan Jan 14, 2025
ea505a3
fix
chef-ryan Jan 14, 2025
e2fb541
fix: 🐛 fix claim button text
chef-ryan Jan 14, 2025
b2e5168
remove
chef-ryan Jan 14, 2025
b25cfcd
fix: 🐛 fix typo
chef-ryan Jan 14, 2025
b4ca146
fix units
chef-ryan Jan 14, 2025
a612d4f
add soon
chef-ryan Jan 14, 2025
def8e6c
fix i18n
chef-ryan Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rebase
chef-ryan committed Jan 9, 2025
commit a2ebb47bb633adf15460d401993050b1397931cc
29 changes: 29 additions & 0 deletions apps/web/src/components/AdPanel/Ads/AdListapie.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useTranslation } from '@pancakeswap/localization'
import { BodyText } from '../BodyText'
import { AdButton } from '../Button'
import { AdCard } from '../Card'
import { Countdown } from '../Countdown'
import { AdPlayerProps } from '../types'
import { getImageUrl } from '../utils'

export const AdListPieListing = (props: AdPlayerProps) => {
const { t } = useTranslation()

return (
<AdCard imageUrl={getImageUrl('listapie')} {...props}>
<BodyText mb="8px">{t('Listapie IFO starts in')}</BodyText>

<Countdown
targetTime={3000 + new Date().getTime() / 1000}
subtleColor="rgba(0,0,0,.6)"
background="linear-gradient(180deg, #FCC631 0%, #FF9D00 100%)"
color="black"
mb="8px"
/>

<AdButton variant="text" isExternalLink>
thechefpenguin marked this conversation as resolved.
Show resolved Hide resolved
{t('Get Started')}
</AdButton>
</AdCard>
)
}
5 changes: 5 additions & 0 deletions apps/web/src/components/AdPanel/config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMatchBreakpoints } from '@pancakeswap/uikit'
import { useMemo } from 'react'
import { AdCakeStaking } from './Ads/AdCakeStaking'
import { AdListPieListing } from './Ads/AdListapie'
import { AdOptionsTrading } from './Ads/AdOptionsTrading'
import { AdPCSX } from './Ads/AdPCSX'
import { AdRocker } from './Ads/AdRocker'
@@ -36,6 +37,10 @@ export const useAdConfig = () => {
priority: Priority.FIRST_AD,
shouldRender: [shouldRenderOnPage],
},
{
id: 'listapie',
component: <AdListPieListing />,
},
{
id: 'ad-springboard',
component: <AdSpringboard />,
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { CAKE } from '@pancakeswap/tokens'
import { Box, Flex, IfoSkeletonCardDetails, Skeleton, Text, TooltipText, useTooltip } from '@pancakeswap/uikit'
import { BIG_ONE_HUNDRED } from '@pancakeswap/utils/bigNumber'
import { formatNumber, getBalanceNumber } from '@pancakeswap/utils/formatBalance'
import { DAY_IN_SECONDS } from '@pancakeswap/utils/getTimePeriods'
import BigNumber from 'bignumber.js'
import { useStablecoinPrice } from 'hooks/useStablecoinPrice'
import { ReactNode, useMemo } from 'react'
@@ -141,6 +140,20 @@ const MaxTokenEntry = ({
)
}

function timeUntilDiffTime(diffTime: number): string {
if (diffTime <= 0) {
return 'The time has already passed.'
memoyil marked this conversation as resolved.
Show resolved Hide resolved
}

const diffInHours = Math.floor(diffTime / (60 * 60))
const diffInDays = Math.floor(diffInHours / 24)

if (diffInDays >= 1) {
return `${diffInDays} day(s)`
memoyil marked this conversation as resolved.
Show resolved Hide resolved
}
return `${diffInHours} hour(s)`
}

const IfoCardDetails: React.FC<React.PropsWithChildren<IfoCardDetailsProps>> = ({
isEligible,
poolId,
@@ -151,6 +164,7 @@ const IfoCardDetails: React.FC<React.PropsWithChildren<IfoCardDetailsProps>> = (
const { t } = useTranslation()
const { status, currencyPriceInUSD } = publicIfoData
const poolCharacteristic = publicIfoData[poolId]
console.log('---', poolCharacteristic)
const walletCharacteristic = walletIfoData[poolId]
const hasTax = poolCharacteristic?.hasTax

@@ -220,7 +234,8 @@ const IfoCardDetails: React.FC<React.PropsWithChildren<IfoCardDetailsProps>> = (
)

const durationInSeconds = ifo.version >= 3.2 ? poolCharacteristic?.vestingInformation?.duration ?? 0 : 0
const vestingDays = Math.ceil(durationInSeconds / DAY_IN_SECONDS)
// const vestingDays = Math.ceil(durationInSeconds / DAY_IN_SECONDS)
const vestingCountdown = timeUntilDiffTime(durationInSeconds)

/* Format end */
const renderBasedOnIfoStatus = () => {
@@ -276,9 +291,9 @@ const IfoCardDetails: React.FC<React.PropsWithChildren<IfoCardDetailsProps>> = (
/>
<FooterEntry
label={t('Vesting schedule:')}
value={`${vestingDays} days`}
tooltipContent={t('The vested tokens will be released linearly over a period of %days% days.', {
days: vestingDays,
value={vestingCountdown}
tooltipContent={t('The vested tokens will be released linearly over a period of %countdown%.', {
thechefpenguin marked this conversation as resolved.
Show resolved Hide resolved
countdown: vestingCountdown,
})}
/>
</>
4 changes: 3 additions & 1 deletion packages/localization/src/config/translations.json
Original file line number Diff line number Diff line change
@@ -3678,5 +3678,7 @@
"Please fix form errors.": "Please fix form errors.",
"Title is required": "Title is required",
"Content is required": "Content is required",
"Please provide valid choices": "Please provide valid choices"
"Please provide valid choices": "Please provide valid choices",
"The vested tokens will be released linearly over a period of %countdown%.": "The vested tokens will be released linearly over a period of %countdown%.",
"Listapie IFO starts in": "Listapie IFO starts in"
}