Step 1 - Sponsor sends 0.02 ETH
diff --git a/frontend/src/pages/sponsorships/add.tsx b/frontend/src/pages/sponsorships/add.tsx
new file mode 100644
index 0000000..467586c
--- /dev/null
+++ b/frontend/src/pages/sponsorships/add.tsx
@@ -0,0 +1,112 @@
+import LoadingIndicator from "@/components/LoadingIndicator";
+import MainFooter from "@/components/MainFooter";
+import MainHeader from "@/components/MainHeader";
+import Head from "next/head";
+import { useAccount, useSimulateContract, useWriteContract } from "wagmi";
+import { abi } from "../../../../backend/ignition/deployments/chain-84532/artifacts/SponsorshipQueueModule#SponsorshipQueue.json";
+import deployed_addresses from "../../../../backend/ignition/deployments/chain-84532/deployed_addresses.json";
+import { Address, parseEther } from "viem";
+import ErrorIndicator from "@/components/ErrorIndicator";
+
+export default function AddSponsorship() {
+ console.debug("AddSponsorship");
+
+ const { address, isConnecting, isReconnecting } = useAccount();
+ console.debug("address:", address);
+ console.debug("isConnecting:", isConnecting);
+ console.debug("isReconnecting:", isReconnecting);
+
+ if (isConnecting || isReconnecting) {
+ return
+ }
+
+ return (
+ <>
+
+
Sponsors π«Άπ½
+
+
+
+
+
+
+
+ Become a Sponsor π
+
+
+
+ Your sponsorship will cover the estimated cost for
+ delivering education to one out-of-school child.
+
+
+
+ {!address ? (
+
+ ) : (
+
+ )}
+
+
+
+ >
+ );
+}
+
+export function SimulateContractButton() {
+ console.debug("SimulateContractButton");
+
+ const deploymentAddress: Address = deployed_addresses["SponsorshipQueueModule#SponsorshipQueue"] as `0x${string}`;
+ console.debug("deploymentAddress:", deploymentAddress);
+
+ const { isPending, isError, error, isSuccess } = useSimulateContract({
+ abi,
+ address: deploymentAddress,
+ functionName: "addSponsorship",
+ value: parseEther("0.002")
+ })
+ console.debug("isPending:", isPending);
+ console.debug("isError:", isError);
+ console.debug("error:", error);
+ console.debug("isSuccess:", isSuccess);
+
+ if (isPending) {
+ return
+ }
+
+ if (isError) {
+ return
+ }
+
+ return
+}
+
+export function WriteContractButton() {
+ console.debug("WriteContractButton");
+
+ const deploymentAddress: Address = deployed_addresses["SponsorshipQueueModule#SponsorshipQueue"] as `0x${string}`;
+ console.debug("deploymentAddress:", deploymentAddress);
+
+ const { writeContract } = useWriteContract();
+ return (
+
+ )
+}