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

testnet #369

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions packages/app/src/components/account/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const networkAvatar = (chain: ChainId | undefined) => {
return "/arbitrum.svg";
case ChainId.Mainnet:
return "/ethereum.png";
case ChainId.Goerli:
return "/ethereum.png";
default:
return "";
}
Expand Down
12 changes: 6 additions & 6 deletions packages/app/src/components/deposit/UnstakeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ export default UnstakeModal;

const getWithdrawLink = (protocolName: ProtocolName): string => {
switch (protocolName) {
case "audius":
return "https://docs.audius.org/token/staking#staking-on-audius";
// case "audius":
// return "https://docs.audius.org/token/staking#staking-on-audius";
case "graph":
return "https://thegraph.com/docs/en/network/delegating/#the-delegation-tax";
case "livepeer":
return "https://www.figment.io/resources/livepeer-staking-delegation-guide-2";
case "matic":
return "https://polygon.technology/staking/";
// case "livepeer":
// return "https://www.figment.io/resources/livepeer-staking-delegation-guide-2";
// case "matic":
// return "https://polygon.technology/staking/";
}
};
42 changes: 21 additions & 21 deletions packages/app/src/components/deposit/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ export const getUnlockDateForProtocol = (
return "Loading...";
}
}
case "audius": {
const unstakeDate = blockTimestampToDate(lock.timestamp);
const unlockDate = new Date(unstakeDate);
unlockDate.setDate(unstakeDate.getDate() + 7);
const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
return getTimeRemainingLabel(minutesUntilUnlock);
}
case "livepeer": {
const unstakeDate = blockTimestampToDate(lock.timestamp);
const unlockDate = new Date(unstakeDate);
unlockDate.setDate(unstakeDate.getDate() + 7);
const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
return getTimeRemainingLabel(minutesUntilUnlock);
}
case "matic": {
const unstakeDate = blockTimestampToDate(lock.timestamp);
const unlockDate = new Date(unstakeDate);
unlockDate.setDate(unstakeDate.getDate() + 2);
const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
return getTimeRemainingLabel(minutesUntilUnlock);
}
// case "audius": {
// const unstakeDate = blockTimestampToDate(lock.timestamp);
// const unlockDate = new Date(unstakeDate);
// unlockDate.setDate(unstakeDate.getDate() + 7);
// const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
// return getTimeRemainingLabel(minutesUntilUnlock);
// }
// case "livepeer": {
// const unstakeDate = blockTimestampToDate(lock.timestamp);
// const unlockDate = new Date(unstakeDate);
// unlockDate.setDate(unstakeDate.getDate() + 7);
// const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
// return getTimeRemainingLabel(minutesUntilUnlock);
// }
// case "matic": {
// const unstakeDate = blockTimestampToDate(lock.timestamp);
// const unlockDate = new Date(unstakeDate);
// unlockDate.setDate(unstakeDate.getDate() + 2);
// const minutesUntilUnlock = minutesBetweenDates(now, unlockDate);
// return getTimeRemainingLabel(minutesUntilUnlock);
// }
}
};

Expand Down
5 changes: 3 additions & 2 deletions packages/app/src/components/deposit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import UnstakeModal from "./UnstakeModal";
import WithdrawModal from "./WithdrawModal";
import Faucet from "components/faucet";
import { useLocks } from "utils/useUnstakeEvents";
import { useAPY } from "utils/useAPY";
// import { useAPY } from "utils/useAPY";
import { useRewards } from "utils/useRewards";

type Props = {
Expand Down Expand Up @@ -51,7 +51,8 @@ const Deposit: FC<Props> = ({
const hasPermit = stakers[protocolName].hasPermit;

const { locks } = useLocks(stakers[protocolName], tenderTokenBalance);
const { apy } = useAPY(stakers[protocolName]);
// const { apy } = useAPY(stakers[protocolName]);
const apy = "10";
const { rewards } = useRewards(stakers[protocolName], tokenBalance, tenderTokenBalance);
const isSafeContext = useIsGnosisSafe();

Expand Down
5 changes: 3 additions & 2 deletions packages/app/src/pages/stakers/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from "next/link";
import Image from "next/image";
import { useRouter } from "next/router";
import { constants } from "ethers";
import { ChainId, Config, DAppProvider, useEthers, useTokenBalance, Arbitrum, Mainnet } from "@usedapp/core";
import { ChainId, Config, DAppProvider, useEthers, useTokenBalance, Arbitrum, Mainnet, Goerli } from "@usedapp/core";
import { addresses } from "@tender/contracts/src/index";
import styled from "styled-components";
import Deposit from "../../components/deposit";
Expand Down Expand Up @@ -264,12 +264,13 @@ export const getStaticProps = async () => {
const CHAIN_URL_MAPPING = {
[ChainId.Mainnet]: process.env.RPC_ETHEREUM ?? "",
[ChainId.Arbitrum]: process.env.RPC_ARBITRUM ?? "",
[ChainId.Goerli]: process.env.RPC_ETHEREUM_GOERLI ?? "",
};

const config: TenderizeConfig = {
portisApiKey: process.env.PORTIS_API_KEY ?? "",
chainUrlMapping: CHAIN_URL_MAPPING,
supportedChains: [Mainnet.chainId, Arbitrum.chainId],
supportedChains: [Mainnet.chainId, Arbitrum.chainId, Goerli.chainId],
};

return {
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export const addresses: Record<string, ProtocolAddresses> = {
},
graph: {
faucet: getAddress("0x3f25C4669d08516CDeB183C4e02726eBF81a1A17", "0x3f25C4669d08516CDeB183C4e02726eBF81a1A17"),
token: getAddress("0xc944E90C64B2c07662A292be6244BDf05Cda44a7", "0x53466090C5bfba99B147aB0c43E212e6E8a3Fb90"),
tenderizer: getAddress("0xe66F3ab2f5621FE12ebf37754E1Af6d05b329A07", "0xd76D6107AdD240e619aCfE7503f6F93413E072E7"),
tenderToken: getAddress("0xC29f5611DCd89bC5d3a19762783D3006BC2aD2Ac", "0xBc2EB1EEa4221F8Ce242C0A46E0B16944cd7788F"),
tenderSwap: getAddress("0xF56F61F8181d118c010Ca9c5f1e9e447e37B207e", "0xCb8979852ef7Ae339BFDBD08D26cE8396f3c5Dc4"),
lpToken: getAddress("0xAd93b1beF320fbbB9D1645dFAFc7550FC254F272", "0x8CfA4082dB29D2Af5acFeDA395f31e7ebBfc93e3"),
tenderFarm: getAddress("0xb27DC46D1aF96c998cFF05B99c081b54b19d4b6F", "0x97338956D9C0eC11205Bf02A7Ed9e66F20E3daEd"),
token: getAddress("0x2dCEf26C842Cf85c12f44d1eFb21Ad887c2646c6", "0x2dCEf26C842Cf85c12f44d1eFb21Ad887c2646c6"),
tenderizer: getAddress("0x35D1c56991211CA2e3FF0bFC2D7955a0f11480cF", "0x35D1c56991211CA2e3FF0bFC2D7955a0f11480cF"),
tenderToken: getAddress("0x8cc75e9B710F3Ff38C3157D8e7f4533271034793", "0x8cc75e9B710F3Ff38C3157D8e7f4533271034793"),
tenderSwap: getAddress("0xBDAc0A0b57D508Ec8cF204879f53a2275bBdF674", "0xBDAc0A0b57D508Ec8cF204879f53a2275bBdF674"),
lpToken: getAddress("0x5ddB6684E00DB8D02184877c0D27dC3f3ee6Fbc8", "0x5ddB6684E00DB8D02184877c0D27dC3f3ee6Fbc8"),
tenderFarm: getAddress("0xa39A2e4D3a63FAeCfe5306d9e14B48efe622a2fE", "0xa39A2e4D3a63FAeCfe5306d9e14B48efe622a2fE"),
},
matic: {
faucet: getAddress("0xC9563Ba7a194D8C132Fec90F3723bA62BCcDc29c", "0xC9563Ba7a194D8C132Fec90F3723bA62BCcDc29c"),
Expand Down
54 changes: 3 additions & 51 deletions packages/shared/src/data/stakers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChainId } from "@usedapp/core";

export type Staker = {
name: "livepeer" | "graph" | "matic" | "audius";
name: "graph";
subgraphId: string;
title: string;
available: boolean;
Expand All @@ -10,7 +10,7 @@ export type Staker = {
bwTenderLogo: string;
neonLogo: string;
path: string;
symbol: "LPT" | "GRT" | "MATIC" | "AUDIO";
symbol: "GRT";
chainId: ChainId;
hasPermit: boolean;
apy: string;
Expand All @@ -24,22 +24,6 @@ export const isProduction = () => {
};

export const stakers: Record<ProtocolName, Staker> = {
livepeer: {
name: "livepeer",
path: "/stakers/livepeer",
title: "Livepeer",
subgraphId: "Livepeer",
available: true,
logo: "livepeer.svg",
bwLogo: "LPT.svg",
bwTenderLogo: "tenderLPT.svg",
neonLogo: "landing/neon-lpt.png",
symbol: "LPT",
chainId: ChainId.Arbitrum,
hasPermit: true,
apy: "0",
tvl: 0,
},
graph: {
name: "graph",
path: "/stakers/graph",
Expand All @@ -51,41 +35,9 @@ export const stakers: Record<ProtocolName, Staker> = {
bwTenderLogo: "tenderGRT.svg",
neonLogo: "landing/neon-grt.png",
symbol: "GRT",
chainId: ChainId.Mainnet,
chainId: ChainId.Goerli,
hasPermit: false,
apy: "0",
tvl: 0,
},
matic: {
name: "matic",
path: "/stakers/matic",
title: "Polygon",
subgraphId: "Matic",
available: true,
logo: "maticLogo.svg",
bwLogo: "MATIC.svg",
bwTenderLogo: "tenderMATIC.svg",
neonLogo: "landing/neon-matic.png",
symbol: "MATIC",
chainId: ChainId.Mainnet,
hasPermit: false,
apy: "0",
tvl: 0,
},
audius: {
name: "audius",
path: "/stakers/audius",
title: "Audius",
subgraphId: "Audius",
available: true,
logo: "AUDIO.svg",
bwLogo: "AUDIO.svg",
bwTenderLogo: "tenderAUDIO.svg",
neonLogo: "landing/neon-audio.png",
symbol: "AUDIO",
chainId: ChainId.Mainnet,
hasPermit: true,
apy: "0",
tvl: 0,
},
};
1 change: 1 addition & 0 deletions packages/shared/src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const ENDPOINTS: Endpoints = {
[ChainId.Arbitrum]: "https://api.thegraph.com/subgraphs/name/tenderize/tenderize-arbitrum",
[ChainId.Mainnet]: "https://api.thegraph.com/subgraphs/name/tenderize/tenderize-ethereum",
[ChainId.Hardhat]: "http://127.0.0.1:8000/subgraphs/name/tenderize/tenderize-localhost",
[ChainId.Goerli]: "https://api.thegraph.com/subgraphs/name/tenderize/tenderizer-goerli",
};

interface Endpoints {
Expand Down