Skip to content

Commit

Permalink
update contract
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec committed Sep 20, 2024
1 parent d8fc45f commit 1d4dbff
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 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
4 changes: 3 additions & 1 deletion src/components/TransactionWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const renderWithProviders = (component: JSX.Element) => {

describe('TransactionWrapper', () => {
it('should renders', () => {
renderWithProviders(<TransactionWrapper />);
renderWithProviders(
<TransactionWrapper address="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" />,
);
const transaction = screen.getByText('Transact');
expect(transaction).toBeInTheDocument();
});
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;

0 comments on commit 1d4dbff

Please sign in to comment.