Skip to content

Commit

Permalink
update contract
Browse files Browse the repository at this point in the history
  • Loading branch information
alissacrane-cb committed Aug 13, 2024
1 parent cf8dc27 commit 48a25d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
33 changes: 7 additions & 26 deletions src/components/TransactionWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ import type {
TransactionResponse,
} from '@coinbase/onchainkit/transaction';
import type { Address, ContractFunctionParameters } from 'viem';
import { parseEther } from 'viem';
import {
BASE_SEPOLIA_CHAIN_ID,
collectionAddress,
comment,
mintABI,
mintContractAddress,
mintReferral,
quantity,
tokenId,
clickContractABI,
clickContractAddress,
} from '../constants';

type TransactionWrapperParams = {
Expand All @@ -30,22 +24,12 @@ type TransactionWrapperParams = {
export default function TransactionWrapper({
address,
}: TransactionWrapperParams) {
const mintTo = address;

const contracts = [
{
address: mintContractAddress,
abi: mintABI,
functionName: 'mint',
args: [
mintTo,
BigInt(quantity),
collectionAddress,
BigInt(tokenId),
mintReferral,
comment,
],
value: parseEther('0.000111'),
address: clickContractAddress,
abi: clickContractABI,
functionName: 'click',
args: [],
},
] as unknown as ContractFunctionParameters[];

Expand All @@ -67,10 +51,7 @@ export default function TransactionWrapper({
onError={handleError}
onSuccess={handleSuccess}
>
<TransactionButton
className="mt-0 mr-auto ml-auto w-[450px] max-w-full text-[white]"
text="Collect"
/>
<TransactionButton className="mt-0 mr-auto ml-auto w-[450px] max-w-full text-[white]" />
<TransactionStatus>
<TransactionStatusLabel />
<TransactionStatusAction />
Expand Down
13 changes: 13 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
export const BASE_SEPOLIA_CHAIN_ID = 84532;

export const clickContractAddress =
'0x67c97D1FB8184F038592b2109F854dfb09C77C75';

export const clickContractABI = [
{
type: 'function',
name: 'click',
inputs: [],
outputs: [],
stateMutability: 'nonpayable',
},
] as const;

export const collectionAddress = '0xd6915560d3bb24aec04dc42ef409921ed1931510';
export const comment = 'testing';
export const mintContractAddress = '0x777777722D078c97c6ad07d9f36801e653E356Ae';
Expand Down

0 comments on commit 48a25d5

Please sign in to comment.