Skip to content

Commit

Permalink
veNFTE on Base
Browse files Browse the repository at this point in the history
  • Loading branch information
westonnelson committed Jan 2, 2024
1 parent a8f63a6 commit c5b2ea1
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 155 deletions.
2 changes: 1 addition & 1 deletion components/navbar/HamburgerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const HamburgerMenu = () => {
Bridge NFTE
</Text>
</Link>
<Link href="/staking" legacyBehavior>
<Link href="https://www.sushi.com/pool/add/v2/8453" legacyBehavior>
<Text
style="subtitle1"
css={{
Expand Down
2 changes: 1 addition & 1 deletion components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const Navbar = () => {
</DropdownMenuItem>
<DropdownMenuItem
as={Link}
href="/staking"
href="https://www.sushi.com/pool/add/v2/8453"
css={{
display: 'flex',
py: '$3',
Expand Down
2 changes: 1 addition & 1 deletion components/quests/styled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const QuestGridheaderText = styled(Text, {

export const QuestXPButton = styled(Box, {
background: '$gray6',
border: '2px solid #6BE481',
border: '2px solid #0420FF',
borderRadius: '10px',
padding: '10px 30px',
})
Expand Down
5 changes: 2 additions & 3 deletions pages/launch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import StakingList from "components/staking/StakingList";
import StakeList from "components/staking/StakeList";
import ClaimList from "components/staking/ClaimList";

import {useAPR, useMounted, useStakingLP} from "hooks";
import {useMounted, useStakingLP} from "hooks";

import {OFT_CHAINS, base} from "utils/chains";
import {formatBN} from "utils/numbers";
Expand All @@ -36,7 +36,6 @@ const LaunchPage = () => {
const chain = OFT_CHAINS.find((chain) => chain.id === base.id)
const isMounted = useMounted()
const [activeTab, setActiveTab] = useState('stakes')
const { APR } = useAPR(undefined, chain || OFT_CHAINS[0])
const { address } = useAccount()
const { data: lp } = useStakingLP(chain?.LPNFTE, { refreshInterval: 5000 })
const { data: nfteData } : { data: any } = useContractReads({
Expand Down Expand Up @@ -434,7 +433,7 @@ const LaunchPage = () => {
width: '100%'
}}
>
{`${APR}%`}

</Text>
</Flex>
<Flex css={{
Expand Down
4 changes: 2 additions & 2 deletions pages/staking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import StakingList from "components/staking/StakingList";
import StakeList from "components/staking/StakeList";
import ClaimList from "components/staking/ClaimList";

import {useAPR, useMounted, useStakingLP} from "hooks";
import { useMounted, useStakingLP} from "hooks";

import {OFT_CHAINS} from "utils/chains";
import {formatBN} from "utils/numbers";
Expand Down Expand Up @@ -422,7 +422,7 @@ const StakingPage = () => {
gap: 5
}}
>
<Text style="body4">APR</Text>
<Text style="body4"></Text>
</Flex>
</Flex>
<Text
Expand Down
4 changes: 2 additions & 2 deletions pages/staking/pool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const PoolPage = () => {
<Flex
direction="column"
>
<Text css={{ fontSize: 'inherit' }}>{`Add Liquidity Successful`}</Text>
<Text css={{ fontSize: 'inherit' }}>{`Successfully Added Liquidity`}</Text>
<Link
href={`${base.blockExplorers.etherscan.url}/tx/${tx?.hash}`}
target="_blank"
Expand Down Expand Up @@ -692,7 +692,7 @@ const PoolPage = () => {
}
}}
>
<Text style="body3"><h2> 1. Add liquidity to the NFTE-WETH pool on SushiSwap. </h2>2. Lock up the resulting NFTE/WETH LP token received (NFTE/WETH LP). <br></br> 3. The longer you lock your NFTE/WETH LP token (1 year max), the more veNFTE you get, and the greater your rewards and voting power. <Text style="body3" as={Link} css={{ fontWeight: 'bold', '&:hover': { textDecoration: 'underline' } }} href="https://docs.nftearth.exchange/nfte-token/xnfte-and-nfte-staking" target="_blank"><h1>Learn more about veNFTE staking in the docs.</h1></Text></Text>
<Text style="body3"><h2> 1. Add liquidity to the NFTE-WETH pool on SushiSwap to get NFTE LP Tokens. </h2>2. Lock your NFTE/WETH LP tokens received (NFTE/WETH LP). <br></br> 3. The longer you lock your NFTE/WETH LP tokens (1 year max), and the total amount locked determines the veNFTE you get. veNFTE is the key to greater rewards and voting power. <Text style="body3" as={Link} css={{ fontWeight: 'bold', '&:hover': { textDecoration: 'underline' } }} href="https://docs.nftearth.exchange/nfte-token/xnfte-and-nfte-staking" target="_blank"><h1>Learn more about veNFTE staking in the docs.</h1></Text></Text>
</Flex>
</Flex>
</Layout>
Expand Down
29 changes: 15 additions & 14 deletions pages/staking/stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {FC, useCallback, useEffect, useState} from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {faCircleInfo} from "@fortawesome/free-solid-svg-icons";
import {useAccount, useContractReads} from "wagmi";
import {ContractFunctionConfig, formatEther, parseUnits} from "viem";
import {ContractFunctionConfig, formatEther} from "viem";
import {useRouter} from "next/router";
import Link from "next/link";
import dayjs from "dayjs";
Expand All @@ -24,6 +24,7 @@ import AlertChainSwitch from "../../components/common/AlertChainSwitch";
import Decimal from "decimal.js-light";
import {NFTEOFT, NFTE_LP, VE_NFTE} from "../../utils/contracts";
import { base } from "utils/chains";
import { parseUnits } from "viem";

export const MAX_LOCK_PERIOD_IN_DAYS = 365; // 1y
export const MIN_LOCK_PERIOD_IN_DAYS = 7; // 1w
Expand All @@ -33,16 +34,16 @@ const StakingChainPage: FC = () => {
const [activeTab, setActiveTab] = useState('staking')
const [valueEth, setValueEth] = useState<string>('0')
const [duration, setDuration] = useState<string>('0')
const [maxDuration, setMaxDuration] = useState<string>('52')
const [maxDuration, setMaxDuration] = useState<string>('365')
const [enableUnStake, setEnableUnStake] = useState<boolean>(false)
const { address } = useAccount()
const mounted = useMounted()
const router = useRouter()

const addresses: Record<string, string> = {
'NFTEOFT': NFTEOFT,
'veNFTE': VE_NFTE,
'NFTE': NFTEOFT,
'NFTE/WETH LP Token': NFTE_LP,
'veNFTE': VE_NFTE,
}

const { data: nfteData } : { data: any } = useContractReads<
Expand Down Expand Up @@ -96,18 +97,18 @@ const StakingChainPage: FC = () => {
}
}

const handleSetDuration = (val: string) => {
let newVal = parseInt(val)
if (newVal < 0) {
newVal = 0
}
function handleSetDuration(val: string) {
let newVal = parseInt(val);
if (newVal < 0) {
newVal = 0
}

if (newVal > +maxDuration) {
newVal = +maxDuration
}
if (newVal > +maxDuration) {
newVal = +maxDuration;
}

setDuration(`${newVal}`)
}
setDuration(`${newVal}`);
}

const handleSetMaxValue = useCallback(() => {
const val = new Decimal(formatEther(BigInt(nfteLPBalance?.result || 0), 'wei'))
Expand Down
24 changes: 1 addition & 23 deletions public/icons/currency/nftelp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 1 addition & 23 deletions public/icons/currency/venfte.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions stitches.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export const { createTheme, keyframes, styled, globalCss, getCssText } =
//Primary
primary1: '#110c19',
primary2: '#221833',
primary3: '#33254c',
primary4: '#443166',
primary5: '#553d80',
primary6: '#654999',
primary3: '#0420FF',
primary4: '#0420FF',
primary5: '#0420FF',
primary6: '#0420FF',
primary7: '#FF0420',
primary8: '#FF0420',
primary9: '#FF0420',
Expand Down
163 changes: 83 additions & 80 deletions utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ export const OFT_CHAINS : OFTChain[] = [
darkIconUrl: '/icons/arbitrum-nova-icon-light.svg',
coingeckoNetworkId: 'arbitrum-nova'
},*/
{
id: optimism.id,
lzId: 111,
name: optimism.name,
address: '0x8637725aDa78db0674a679CeA2A5e0A0869EF4A1',
lightIconUrl: '/icons/optimism-icon-dark.svg',
darkIconUrl: '/icons/optimism-icon-light.svg',
coingeckoNetworkId: 'optimistic-ethereum'
},
{
id: polygon.id,
lzId: 109,
Expand All @@ -264,7 +273,29 @@ export const OFT_CHAINS : OFTChain[] = [
lightIconUrl: '/icons/polygon-icon-dark.svg',
darkIconUrl: '/icons/polygon-icon-light.svg',
coingeckoNetworkId: 'polygon-pos'
},
},
{ id: arbitrum.id,
lzId: 110,
name: arbitrum.name,
routePrefix: 'arbitrum',
address: '0x51B902f19a56F0c8E409a34a215AD2673EDF3284',
LPNFTE: '0x82496243c0a1a39c5c6250bf0115c134Ba76698c',
veNFTE: '0xE57bd15448C3b2D1dBAD598775DD2F36F93EBf90',
feeDistributor: '0x9138A2e628f92a42397B3B600E86047AE49aCa98',
/*uniProxy: '0x82FcEB07a4D01051519663f6c1c919aF21C27845',*/
lightIconUrl: '/icons/arbitrum-icon-dark.svg',
darkIconUrl: '/icons/arbitrum-icon-light.svg',
coingeckoNetworkId: 'arbitrum-one'
},
{
id: linea.id,
lzId: 183,
name: linea.name,
address: '0x2140Ea50bc3B6Ac3971F9e9Ea93A1442665670e4',
lightIconUrl: '/icons/linea-icon-dark.svg',
darkIconUrl: '/icons/linea-icon-light.svg',
coingeckoNetworkId: 'linea'
},
{
id: mainnet.id,
lzId: 101,
Expand All @@ -274,15 +305,6 @@ export const OFT_CHAINS : OFTChain[] = [
darkIconUrl: '/icons/eth-icon-light.svg',
coingeckoNetworkId: 'ethereum'
},
{
id: optimism.id,
lzId: 111,
name: optimism.name,
address: '0x8637725aDa78db0674a679CeA2A5e0A0869EF4A1',
lightIconUrl: '/icons/optimism-icon-dark.svg',
darkIconUrl: '/icons/optimism-icon-light.svg',
coingeckoNetworkId: 'optimistic-ethereum'
},
/* {
id: bsc.id,
lzId: 102,
Expand All @@ -300,30 +322,8 @@ export const OFT_CHAINS : OFTChain[] = [
lightIconUrl: '/icons/base-icon-dark.svg',
darkIconUrl: '/icons/base-icon-light.svg',
coingeckoNetworkId: 'base'
},*/
{
id: linea.id,
lzId: 183,
name: linea.name,
address: '0x2140Ea50bc3B6Ac3971F9e9Ea93A1442665670e4',
lightIconUrl: '/icons/linea-icon-dark.svg',
darkIconUrl: '/icons/linea-icon-light.svg',
coingeckoNetworkId: 'linea'
},
{ id: arbitrum.id,
lzId: 110,
name: arbitrum.name,
routePrefix: 'arbitrum',
address: '0x51B902f19a56F0c8E409a34a215AD2673EDF3284',
LPNFTE: '0x82496243c0a1a39c5c6250bf0115c134Ba76698c',
veNFTE: '0xE57bd15448C3b2D1dBAD598775DD2F36F93EBf90',
feeDistributor: '0x9138A2e628f92a42397B3B600E86047AE49aCa98',
/*uniProxy: '0x82FcEB07a4D01051519663f6c1c919aF21C27845',*/
lightIconUrl: '/icons/arbitrum-icon-dark.svg',
darkIconUrl: '/icons/arbitrum-icon-light.svg',
coingeckoNetworkId: 'arbitrum-one'
},
/*{
{
id: polygonZkEvm.id,
lzId: 158,
name: polygonZkEvm.name,
Expand Down Expand Up @@ -381,6 +381,44 @@ export const getAlchemyNetworkName = (chainId: number) => {

export default [
DefaultChain,

/*{
...arbitrumNova,
lightIconUrl: '/icons/arbitrum-nova-icon-dark.svg',
darkIconUrl: '/icons/arbitrum-nova-icon-light.svg',
reservoirBaseUrl: 'https://api-arbitrum-nova.reservoir.tools',
proxyApi: '/api/reservoir/arbitrum-nova',
routePrefix: 'arbitrum-nova',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COMMUNITY,
},*/
{
...optimism,
name: 'Optimism',
lightIconUrl: '/icons/optimism-icon-dark.svg',
darkIconUrl: '/icons/optimism-icon-light.svg',
reservoirBaseUrl: 'https://api-optimism.reservoir.tools',
proxyApi: '/api/reservoir/optimism',
routePrefix: 'optimism',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'optimism',
collectionSetId: process.env.NEXT_PUBLIC_OPTIMISM_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_OPTIMISM_COMMUNITY,
},
{
...polygon,
lightIconUrl: '/icons/polygon-icon-dark.svg',
darkIconUrl: '/icons/polygon-icon-light.svg',
reservoirBaseUrl: 'https://api-polygon.reservoir.tools',
proxyApi: '/api/reservoir/polygon',
routePrefix: 'polygon',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'matic-network',
collectionSetId: process.env.NEXT_PUBLIC_POLYGON_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_POLYGON_COMMUNITY,
},
{
...arbitrum,
lightIconUrl: '/icons/arbitrum-icon-dark.svg',
Expand All @@ -393,18 +431,18 @@ export default [
collectionSetId: process.env.NEXT_PUBLIC_ARBITRUM_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ARBITRUM_COMMUNITY,
},
/*{
...arbitrumNova,
lightIconUrl: '/icons/arbitrum-nova-icon-dark.svg',
darkIconUrl: '/icons/arbitrum-nova-icon-light.svg',
reservoirBaseUrl: 'https://api-arbitrum-nova.reservoir.tools',
proxyApi: '/api/reservoir/arbitrum-nova',
routePrefix: 'arbitrum-nova',
{
...linea,
lightIconUrl: '/icons/linea-icon-dark.svg',
darkIconUrl: '/icons/linea-icon-light.svg',
reservoirBaseUrl: 'https://api-linea.reservoir.tools',
proxyApi: '/api/reservoir/linea',
routePrefix: 'linea',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COMMUNITY,
},*/
collectionSetId: process.env.NEXT_PUBLIC_LINEA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_LINEA_COMMUNITY,
},
{
...mainnet,
name: 'Ethereum',
Expand All @@ -418,31 +456,8 @@ export default [
collectionSetId: process.env.NEXT_PUBLIC_ETH_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ETH_COMMUNITY,
},
{
...polygon,
lightIconUrl: '/icons/polygon-icon-dark.svg',
darkIconUrl: '/icons/polygon-icon-light.svg',
reservoirBaseUrl: 'https://api-polygon.reservoir.tools',
proxyApi: '/api/reservoir/polygon',
routePrefix: 'polygon',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'matic-network',
collectionSetId: process.env.NEXT_PUBLIC_POLYGON_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_POLYGON_COMMUNITY,
},
/*{
...optimism,
name: 'Optimism',
lightIconUrl: '/icons/optimism-icon-dark.svg',
darkIconUrl: '/icons/optimism-icon-light.svg',
reservoirBaseUrl: 'https://api-optimism.reservoir.tools',
proxyApi: '/api/reservoir/optimism',
routePrefix: 'optimism',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'optimism',
collectionSetId: process.env.NEXT_PUBLIC_OPTIMISM_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_OPTIMISM_COMMUNITY,
},


// {
// ...zora,
// name: 'Zora',
Expand Down Expand Up @@ -477,18 +492,6 @@ export default [
coingeckoId: 'base',
collectionSetId: process.env.NEXT_PUBLIC_BASE_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_BASE_COMMUNITY,
},*/
{
...linea,
lightIconUrl: '/icons/linea-icon-dark.svg',
darkIconUrl: '/icons/linea-icon-light.svg',
reservoirBaseUrl: 'https://api-linea.reservoir.tools',
proxyApi: '/api/reservoir/linea',
routePrefix: 'linea',
apiKey: process.env.RESERVOIR_API_KEY,
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_LINEA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_LINEA_COMMUNITY,
},
/*{
...polygonZkEvm,
Expand Down
2 changes: 1 addition & 1 deletion utils/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,4 @@ function formatBN(
}
}

export { formatDollar, formatBN, formatNumber }
export { formatDollar, formatBN, formatNumber }

0 comments on commit c5b2ea1

Please sign in to comment.