Skip to content

Commit 19c84e2

Browse files
authored
Merge pull request #1 from RequestNetwork/draft/thirsty-hooks
chore: Replace Goerli with Sepolia
2 parents 6873619 + a2ccbd9 commit 19c84e2

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

app/page.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ enum APP_STATUS {
4444
}
4545

4646
export default function Home() {
47-
const [storageChain, setStorageChain] = useState("5");
48-
const [expectedAmount, setExpectedAmount] = useState("");
49-
const [currency, setCurrency] = useState(
50-
"5_0xBA62BCfcAaFc6622853cca2BE6Ac7d845BC0f2Dc"
47+
const [storageChain, setStorageChain] = useState(
48+
storageChains.keys().next().value,
5149
);
50+
const [expectedAmount, setExpectedAmount] = useState("");
51+
const [currency, setCurrency] = useState(currencies.keys().next().value);
5252
const [paymentRecipient, setPaymentRecipient] = useState("");
5353
const [payerIdentity, setPayerIdentity] = useState("");
5454
const [dueDate, setDueDate] = useState("");
@@ -77,7 +77,7 @@ export default function Home() {
7777

7878
try {
7979
const _request = await requestClient.fromRequestId(
80-
requestData!.requestId
80+
requestData!.requestId,
8181
);
8282
let _requestData = _request.getData();
8383
const paymentTx = await payRequest(_requestData, signer);
@@ -129,14 +129,14 @@ export default function Home() {
129129

130130
try {
131131
const _request = await requestClient.fromRequestId(
132-
requestData!.requestId
132+
requestData!.requestId,
133133
);
134134
const _requestData = _request.getData();
135135
alert(`Checking if payer has sufficient funds...`);
136136
const _hasSufficientFunds = await hasSufficientFunds(
137137
_requestData,
138138
address as string,
139-
{ provider: provider }
139+
{ provider: provider },
140140
);
141141
alert(`_hasSufficientFunds = ${_hasSufficientFunds}`);
142142
if (!_hasSufficientFunds) {
@@ -151,7 +151,7 @@ export default function Home() {
151151
const _hasErc20Approval = await hasErc20Approval(
152152
_requestData,
153153
address as string,
154-
provider
154+
provider,
155155
);
156156
alert(`_hasErc20Approval = ${_hasErc20Approval}`);
157157
if (!_hasErc20Approval) {
@@ -204,7 +204,7 @@ export default function Home() {
204204
},
205205
expectedAmount: parseUnits(
206206
expectedAmount as `${number}`,
207-
currencies.get(currency)!.decimals
207+
currencies.get(currency)!.decimals,
208208
).toString(),
209209
payee: {
210210
type: Types.Identity.TYPE.ETHEREUM_ADDRESS,
@@ -244,7 +244,7 @@ export default function Home() {
244244
try {
245245
setStatus(APP_STATUS.PERSISTING_TO_IPFS);
246246
const request = await requestClient.createRequest(
247-
requestCreateParameters
247+
requestCreateParameters,
248248
);
249249

250250
setStatus(APP_STATUS.PERSISTING_ON_CHAIN);
@@ -457,13 +457,16 @@ export default function Home() {
457457
<br></br>
458458
<ul>
459459
<li>
460-
&#8226; Get FAU on Goerli using the{" "}
461-
<Link href="https://erc20faucet.com/" target="_blank">
462-
ERC20 Faucet by peppersec
460+
&#8226; Get FAU on Sepolia using the{" "}
461+
<Link
462+
href="https://sepolia.etherscan.io/address/0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C#writeContract#F4"
463+
target="_blank"
464+
>
465+
mint function on the FaucetToken contract by peppersec
463466
</Link>
464467
</li>
465468
<li>
466-
&#8226; Get USDC on Goerli using the{" "}
469+
&#8226; Get USDC on Sepolia using the{" "}
467470
<Link href="https://usdcfaucet.com/" target="_blank">
468471
USDC Faucet by blockpatron
469472
</Link>
@@ -483,8 +486,8 @@ export default function Home() {
483486
onClick={() =>
484487
switchNetwork?.(
485488
chains.find(
486-
(chain) => chain.network === requestData?.currencyInfo.network
487-
)?.id
489+
(chain) => chain.network === requestData?.currencyInfo.network,
490+
)?.id,
488491
)
489492
}
490493
className={styles.h9_w96}

config/currency.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ interface ICurrency extends Types.RequestLogic.ICurrency {
1212
// key: {chainId}_{checksummedAddress}
1313
export const currencies = new Map<string, ICurrency>([
1414
[
15-
"5_0xBA62BCfcAaFc6622853cca2BE6Ac7d845BC0f2Dc",
15+
"11155111_0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C",
1616
{
1717
name: "FaucetToken",
1818
symbol: "FAU",
19-
value: "0xBA62BCfcAaFc6622853cca2BE6Ac7d845BC0f2Dc",
20-
chainId: 5,
21-
network: "goerli",
19+
value: "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C",
20+
chainId: 11155111,
21+
network: "sepolia",
2222
decimals: 18,
2323
type: Types.RequestLogic.CURRENCY.ERC20,
2424
},
2525
],
2626
[
27-
"5_0x07865c6E87B9F70255377e024ace6630C1Eaa37F",
27+
"11155111_0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
2828
{
2929
name: "USD Coin",
3030
symbol: "USDC",
31-
value: "0x07865c6E87B9F70255377e024ace6630C1Eaa37F",
32-
chainId: 5,
33-
network: "goerli",
31+
value: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
32+
chainId: 11155111,
33+
network: "sepolia",
3434
decimals: 6,
3535
type: Types.RequestLogic.CURRENCY.ERC20,
3636
},

config/rainbow-kit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { configureChains, createConfig } from "wagmi";
1111
import {
1212
mainnet,
13-
goerli,
13+
sepolia,
1414
gnosis,
1515
polygon,
1616
celo,
@@ -26,10 +26,11 @@ import { publicProvider } from "wagmi/providers/public";
2626
export const { chains, publicClient, webSocketPublicClient } = configureChains(
2727
[
2828
mainnet,
29+
sepolia,
2930
{
3031
...gnosis,
3132
iconUrl:
32-
"https://raw.githubusercontent.com/gnosischain/media-kit/main/Logos/01%20Chain/Background/SVG/LogomarkChain-Vertical-Cream_onMoss.svg",
33+
"https://raw.githubusercontent.com/gnosischain/media-kit/main/Logos/Owl_Logo%20-%20Mark.svg",
3334
},
3435
polygon,
3536
optimism,
@@ -39,7 +40,6 @@ export const { chains, publicClient, webSocketPublicClient } = configureChains(
3940
celo,
4041
fantom,
4142
moonbeam,
42-
goerli,
4343
],
4444
[publicProvider()],
4545
);

config/storage-chain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ interface StorageChain {
77
// key: {chainId}
88
export const storageChains = new Map<string, StorageChain>([
99
[
10-
"5",
10+
"11155111",
1111
{
12-
name: "Goerli",
12+
name: "Sepolia",
1313
type: "testnet",
14-
gateway: "https://goerli.gateway.request.network/",
14+
gateway: "https://sepolia.gateway.request.network/",
1515
},
1616
],
1717
[
1818
"100",
1919
{
2020
name: "Gnosis",
2121
type: "mainnet",
22-
gateway: "https://xdai.gateway.request.network/",
22+
gateway: "https://gnosis.gateway.request.network/",
2323
},
2424
],
2525
]);

0 commit comments

Comments
 (0)