Skip to content

Commit

Permalink
update contract
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec committed Sep 19, 2024
1 parent d8fc45f commit 47f4546
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Page() {
</div>
</div>
{address ? (
<TransactionWrapper />
<TransactionWrapper address={address}/>
) : (
<WalletWrapper
className="w-[450px] max-w-full"
Expand Down
6 changes: 3 additions & 3 deletions src/components/TransactionWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[];

Expand Down
12 changes: 9 additions & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -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;
19 changes: 15 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -11,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true,
"plugins": [
{
Expand All @@ -20,6 +24,13 @@
],
"baseUrl": "."
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 47f4546

Please sign in to comment.