From 1d4dbff3c5cde02ddb05b86212d169cb4c6f76c6 Mon Sep 17 00:00:00 2001
From: Alec Chen <93971719+0xAlec@users.noreply.github.com>
Date: Fri, 20 Sep 2024 11:05:18 -0400
Subject: [PATCH] update contract
---
src/app/page.tsx | 2 +-
src/components/TransactionWrapper.test.tsx | 4 +++-
src/components/TransactionWrapper.tsx | 6 +++---
src/constants.ts | 12 +++++++++---
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/app/page.tsx b/src/app/page.tsx
index d2ab17d..cab923f 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -38,7 +38,7 @@ export default function Page() {
{address ? (
-
+
) : (
{
describe('TransactionWrapper', () => {
it('should renders', () => {
- renderWithProviders();
+ renderWithProviders(
+ ,
+ );
const transaction = screen.getByText('Transact');
expect(transaction).toBeInTheDocument();
});
diff --git a/src/components/TransactionWrapper.tsx b/src/components/TransactionWrapper.tsx
index 850faff..9a39324 100644
--- a/src/components/TransactionWrapper.tsx
+++ b/src/components/TransactionWrapper.tsx
@@ -10,20 +10,20 @@ import type {
TransactionError,
TransactionResponse,
} from '@coinbase/onchainkit/transaction';
-import type { ContractFunctionParameters } from 'viem';
+import type { Address, ContractFunctionParameters } from 'viem';
import {
BASE_SEPOLIA_CHAIN_ID,
mintABI,
mintContractAddress,
} from '../constants';
-export default function TransactionWrapper() {
+export default function TransactionWrapper({ address }: { address: Address }) {
const contracts = [
{
address: mintContractAddress,
abi: mintABI,
functionName: 'mint',
- args: [],
+ args: [address],
},
] as unknown as ContractFunctionParameters[];
diff --git a/src/constants.ts b/src/constants.ts
index 090b20d..86309b6 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -1,11 +1,17 @@
export const BASE_SEPOLIA_CHAIN_ID = 84532;
-export const mintContractAddress = '0x11b4128A343d9aB02bED83050c952f383EAb6B24';
+export const mintContractAddress = '0xA3e40bBe8E8579Cd2619Ef9C6fEA362b760dac9f';
export const mintABI = [
{
- inputs: [],
+ inputs: [
+ {
+ internalType: 'address',
+ name: 'to',
+ type: 'address',
+ },
+ ],
name: 'mint',
outputs: [],
- stateMutability: 'nonpayable',
+ stateMutability: 'public',
type: 'function',
},
] as const;