From c5b2ea18beb67ff3b57104fb3dd0b328284353a8 Mon Sep 17 00:00:00 2001 From: Weston Date: Tue, 2 Jan 2024 16:34:59 -0600 Subject: [PATCH] veNFTE on Base --- components/navbar/HamburgerMenu.tsx | 2 +- components/navbar/index.tsx | 2 +- components/quests/styled/index.tsx | 2 +- pages/launch/index.tsx | 5 +- pages/staking/index.tsx | 4 +- pages/staking/pool.tsx | 4 +- pages/staking/stake.tsx | 29 ++--- public/icons/currency/nftelp.svg | 24 +--- public/icons/currency/venfte.svg | 24 +--- stitches.config.ts | 8 +- utils/chains.ts | 163 ++++++++++++++-------------- utils/numbers.ts | 2 +- 12 files changed, 114 insertions(+), 155 deletions(-) diff --git a/components/navbar/HamburgerMenu.tsx b/components/navbar/HamburgerMenu.tsx index 93ad2ef10..a9c763052 100644 --- a/components/navbar/HamburgerMenu.tsx +++ b/components/navbar/HamburgerMenu.tsx @@ -190,7 +190,7 @@ const HamburgerMenu = () => { Bridge NFTE - + { { 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({ @@ -434,7 +433,7 @@ const LaunchPage = () => { width: '100%' }} > - {`${APR}%`} + { gap: 5 }} > - APR + { - {`Add Liquidity Successful`} + {`Successfully Added Liquidity`} { } }} > -

1. Add liquidity to the NFTE-WETH pool on SushiSwap.

2. Lock up the resulting NFTE/WETH LP token received (NFTE/WETH LP).

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.

Learn more about veNFTE staking in the docs.

+

1. Add liquidity to the NFTE-WETH pool on SushiSwap to get NFTE LP Tokens.

2. Lock your NFTE/WETH LP tokens received (NFTE/WETH LP).

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.

Learn more about veNFTE staking in the docs.

diff --git a/pages/staking/stake.tsx b/pages/staking/stake.tsx index 013818a17..c8d3eaed8 100644 --- a/pages/staking/stake.tsx +++ b/pages/staking/stake.tsx @@ -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"; @@ -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 @@ -33,16 +34,16 @@ const StakingChainPage: FC = () => { const [activeTab, setActiveTab] = useState('staking') const [valueEth, setValueEth] = useState('0') const [duration, setDuration] = useState('0') - const [maxDuration, setMaxDuration] = useState('52') + const [maxDuration, setMaxDuration] = useState('365') const [enableUnStake, setEnableUnStake] = useState(false) const { address } = useAccount() const mounted = useMounted() const router = useRouter() const addresses: Record = { - 'NFTEOFT': NFTEOFT, - 'veNFTE': VE_NFTE, + 'NFTE': NFTEOFT, 'NFTE/WETH LP Token': NFTE_LP, + 'veNFTE': VE_NFTE, } const { data: nfteData } : { data: any } = useContractReads< @@ -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')) diff --git a/public/icons/currency/nftelp.svg b/public/icons/currency/nftelp.svg index fb1884713..2efc14166 100644 --- a/public/icons/currency/nftelp.svg +++ b/public/icons/currency/nftelp.svg @@ -1,23 +1 @@ - - Created with Fabric.js 3.5.0 - - - Layer 1 - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/public/icons/currency/venfte.svg b/public/icons/currency/venfte.svg index b82b3f5ec..166934d54 100644 --- a/public/icons/currency/venfte.svg +++ b/public/icons/currency/venfte.svg @@ -1,23 +1 @@ - -Created with Fabric.js 3.5.0 - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/stitches.config.ts b/stitches.config.ts index ecb26d743..dbb31858b 100644 --- a/stitches.config.ts +++ b/stitches.config.ts @@ -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', diff --git a/utils/chains.ts b/utils/chains.ts index 0edb476a2..fbea79f4b 100644 --- a/utils/chains.ts +++ b/utils/chains.ts @@ -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, @@ -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, @@ -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, @@ -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, @@ -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', @@ -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', @@ -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', @@ -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, diff --git a/utils/numbers.ts b/utils/numbers.ts index d41971fdb..cdb63398e 100644 --- a/utils/numbers.ts +++ b/utils/numbers.ts @@ -160,4 +160,4 @@ function formatBN( } } -export { formatDollar, formatBN, formatNumber } +export { formatDollar, formatBN, formatNumber } \ No newline at end of file