Skip to content

Commit

Permalink
add link to mint permit underlying token & use permit super token as …
Browse files Browse the repository at this point in the history
…default payment option
  • Loading branch information
kasparkallas authored Sep 22, 2023
1 parent c0fd457 commit a3dbfae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const SelectPaymentOption: FC<PaymentOptionSelectorProps> = ({

if (value.superToken) {
setSelectedToken(
tokenList.tokens.find(
widgetTokenList.tokens.find(
({ address }) =>
address.toLowerCase() === value.superToken.address.toLowerCase(),
) ?? null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Box } from "@mui/material";
import { FC } from "react";

import Link from "../../Link";
import { goerliPermitTokens } from "../widget-preview/WidgetPreview";

const TermsAndPrivacy: FC = () => (
<Box
Expand All @@ -12,6 +13,19 @@ const TermsAndPrivacy: FC = () => (
left: "540px",
}}
>
<Link
sx={{
fontWeight: 600,
}}
target="_blank"
href={`https://goerli.etherscan.io/token/${
goerliPermitTokens.find((x) => (x.tags ?? []).includes("underlying"))!
.address
}#writeContract#F4`}
>
{"Click here to mint Permit Super Token's underlying token on Goerli!"}
</Link>
<br />
<Link
data-testid="terms-link"
href="https://www.superfluid.finance/termsofuse/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const mumbaiPermitTokens: TokenInfo[] = [
},
];

const goerliPermitTokens: TokenInfo[] = [
export const goerliPermitTokens: TokenInfo[] = [
{
address: "0x19E6F96A887D0a27d60ef63942d7BF707fb1aD08",
name: "PERMIT: Super fUSDC Fake Token",
Expand Down Expand Up @@ -81,7 +81,7 @@ const goerliPermitTokens: TokenInfo[] = [

export const widgetTokenList = {
...tokenList,
tokens: [...tokenList.tokens, ...goerliPermitTokens],
tokens: [...goerliPermitTokens, ...tokenList.tokens],
// ...mumbaiPermitTokens,
} as SuperTokenList;

Expand Down
8 changes: 6 additions & 2 deletions apps/widget-builder/src/hooks/useDemoMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import {
} from "@superfluid-finance/widget";
import { useCallback } from "react";
import { useFormContext } from "react-hook-form";
import { Address } from "viem";

import {
DisplaySettings,
goerliPermitTokens,
Layout,
WidgetProps,
} from "../components/widget-preview/WidgetPreview";
Expand Down Expand Up @@ -111,10 +113,12 @@ const demoPaymentDetails: PaymentDetails = {
const defaultPaymentDetails: PaymentDetails = {
paymentOptions: [
{
receiverAddress: "0xf26ce9749f29e61c25d0333bce2301cb2dfd3a22", // rebounder
receiverAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", // vitalik.eth
chainId: supportedNetwork.goerli.id,
superToken: {
address: "0x8ae68021f6170e5a766be613cea0d75236ecca9a", // fUSDCx
address: goerliPermitTokens.find((x) =>
(x.tags ?? []).includes("supertoken"),
)!.address as Address,
},
flowRate: {
amountEther: "1",
Expand Down

0 comments on commit a3dbfae

Please sign in to comment.