Skip to content

Commit

Permalink
update readme with latest details
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalbuilds committed Aug 11, 2024
1 parent 37a69ee commit 364c624
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 239 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Mode Testnet - https://sepolia.explorer.mode.network/address/0xc8E2B6AC668AC47ff

OP Sepolia Testnet - https://optimism-sepolia.blockscout.com/address/0x2AAC535db31DB35D13AECe36Ea7954A2089D55bE

Fraxtal Testnet - https://holesky.fraxscan.com/address/0x301Ab38c7f652FA23C7Ba1fa182E36665Dac0fC2

## Features

### Simplified Cross-Chain Payments
Expand Down
8 changes: 2 additions & 6 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
ERC20_ABI,
SPOKEPOOL_ABI,
TOKEN_ADDRESS_BY_SYMBOL,
ZKBOB_DIRECT_DEPOSIT_ABI,
} from "misc"
import { createPublicClient, createWalletClient, custom, http } from "viem"
import * as chains from "viem/chains"
Expand Down Expand Up @@ -78,10 +77,7 @@ export default function Home() {

const chainId = await walletClient.getChainId()

const chain = CHAINS[chainId]

// const publicClient = () =>
// configureChains([chain], [alchemyProvider({ apiKey: 'wFen0yW-EwjPyr49Cyg2x2nNARSt7Os0' })]).publicClient({ chainId: chainId })
const chain = CHAINS[chainId];

const publicClient = createPublicClient({
chain,
Expand Down Expand Up @@ -247,7 +243,7 @@ export default function Home() {
TOKEN_ADDRESS_BY_SYMBOL[paymentAsset][
(await getChainDetails()).chain.name.toLowerCase()
],
"0x1111111254eeb25477b68fb85ed929f73a960582"
"0x1111111254eeb25477b68fb85ed929f73a960582" // 1inch router
)
const caller = (await getChainDetails()).address
const swapFromTokenAddress =
Expand Down
12 changes: 6 additions & 6 deletions frontend/app/preference/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ const Merchantpreference: React.FC = () => {
),
})

const contractAddress = (
siteConfig.crosspayaddress as Record<number, `0x${string}`>
)[chainId]
if (!contractAddress) {
toast.error("Contract not deployed on this network")
}
const contractAddress = (
siteConfig.crosspayaddress as Record<number, `0x${string}`>
)[chainId]
if (!contractAddress) {
toast.error("Contract not deployed on this network")
}

const [address] = await walletClient.getAddresses()

Expand Down
10 changes: 7 additions & 3 deletions frontend/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ export type SiteConfig = typeof siteConfig

export const siteConfig = {
name: "Cross-Chain MerchantsPay",
description:
"Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.",
description: "Connecting merchants with customers , a payment infrastructure designed to make it easy for merchants to accept payments in any token on multiple chains",
mainNav: [

],
links: {
twitter: "https://twitter.com/0xkamal7",
docs: "https://ui.shadcn.com",
},
crosspayaddress: "0x6328a8e5529dd322A5583b5EEFfc48a2dc2c3A0f"
crosspayaddress: {
84532: "0xC0204113CcC43D83De06191C082ea696C65466f9", // Base Sepolia
56: "0xc8E2B6AC668AC47ffE8814E86aDCb966C6AA3d5b", // Mode Sepolia
11155420: "0x2AAC535db31DB35D13AECe36Ea7954A2089D55bE", // OP Sepolia
2522: "0x301Ab38c7f652FA23C7Ba1fa182E36665Dac0fC2" // fRAXTAL Holesky
}
}
223 changes: 1 addition & 222 deletions frontend/misc.ts
Original file line number Diff line number Diff line change
@@ -1,225 +1,4 @@
export const ZKBOB_DIRECT_DEPOSIT_ABI = [
{
inputs: [
{ internalType: 'address', name: '_pool', type: 'address' },
{ internalType: 'address', name: '_token', type: 'address' },
{ internalType: 'uint256', name: '_denominator', type: 'uint256' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint256[]', name: 'indices', type: 'uint256[]' }],
name: 'CompleteDirectDepositBatch',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
],
name: 'OwnershipTransferred',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'uint256', name: 'nonce', type: 'uint256' },
{ indexed: false, internalType: 'address', name: 'receiver', type: 'address' },
{ indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' },
],
name: 'RefundDirectDeposit',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'sender', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'nonce', type: 'uint256' },
{ indexed: false, internalType: 'address', name: 'fallbackUser', type: 'address' },
{
components: [
{ internalType: 'bytes10', name: 'diversifier', type: 'bytes10' },
{ internalType: 'bytes32', name: 'pk', type: 'bytes32' },
],
indexed: false,
internalType: 'struct ZkAddress.ZkAddress',
name: 'zkAddress',
type: 'tuple',
},
{ indexed: false, internalType: 'uint64', name: 'deposit', type: 'uint64' },
],
name: 'SubmitDirectDeposit',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint64', name: 'fee', type: 'uint64' }],
name: 'UpdateDirectDepositFee',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint40', name: 'timeout', type: 'uint40' }],
name: 'UpdateDirectDepositTimeout',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'address', name: 'manager', type: 'address' }],
name: 'UpdateOperatorManager',
type: 'event',
},
{
inputs: [
{ internalType: 'uint256[]', name: '_indices', type: 'uint256[]' },
{ internalType: 'uint256', name: '_out_commit', type: 'uint256' },
],
name: 'collect',
outputs: [
{ internalType: 'uint256', name: 'total', type: 'uint256' },
{ internalType: 'uint256', name: 'totalFee', type: 'uint256' },
{ internalType: 'uint256', name: 'hashsum', type: 'uint256' },
{ internalType: 'bytes', name: 'message', type: 'bytes' },
],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_fallbackUser', type: 'address' },
{ internalType: 'uint256', name: '_amount', type: 'uint256' },
{ internalType: 'bytes', name: '_rawZkAddress', type: 'bytes' },
],
name: 'directDeposit',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_fallbackUser', type: 'address' },
{ internalType: 'uint256', name: '_amount', type: 'uint256' },
{ internalType: 'string', name: '_zkAddress', type: 'string' },
],
name: 'directDeposit',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'directDepositFee',
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'directDepositNonce',
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'directDepositTimeout',
outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: '_index', type: 'uint256' }],
name: 'getDirectDeposit',
outputs: [
{
components: [
{ internalType: 'address', name: 'fallbackReceiver', type: 'address' },
{ internalType: 'uint96', name: 'sent', type: 'uint96' },
{ internalType: 'uint64', name: 'deposit', type: 'uint64' },
{ internalType: 'uint64', name: 'fee', type: 'uint64' },
{ internalType: 'uint40', name: 'timestamp', type: 'uint40' },
{ internalType: 'enum IZkBobDirectDeposits.DirectDepositStatus', name: 'status', type: 'uint8' },
{ internalType: 'bytes10', name: 'diversifier', type: 'bytes10' },
{ internalType: 'bytes32', name: 'pk', type: 'bytes32' },
],
internalType: 'struct IZkBobDirectDeposits.DirectDeposit',
name: '',
type: 'tuple',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_from', type: 'address' },
{ internalType: 'uint256', name: '_value', type: 'uint256' },
{ internalType: 'bytes', name: '_data', type: 'bytes' },
],
name: 'onTokenTransfer',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'operatorManager',
outputs: [{ internalType: 'contract IOperatorManager', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'owner', outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function' },
{ inputs: [], name: 'pool', outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function' },
{ inputs: [], name: 'pool_id', outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function' },
{
inputs: [{ internalType: 'uint256[]', name: '_indices', type: 'uint256[]' }],
name: 'refundDirectDeposit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: '_index', type: 'uint256' }],
name: 'refundDirectDeposit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{ inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{
inputs: [{ internalType: 'uint64', name: '_fee', type: 'uint64' }],
name: 'setDirectDepositFee',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint40', name: '_timeout', type: 'uint40' }],
name: 'setDirectDepositTimeout',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'contract IOperatorManager', name: '_operatorManager', type: 'address' }],
name: 'setOperatorManager',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{ inputs: [], name: 'token', outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function' },
{
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
name: 'transferOwnership',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
]


export const SPOKEPOOL_ABI = [
{
anonymous: false,
Expand Down
4 changes: 2 additions & 2 deletions frontend/utils/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { http } from 'wagmi'
import { baseSepolia, mainnet, modeTestnet, sepolia } from 'wagmi/chains'
import { baseSepolia, mainnet, modeTestnet, optimismSepolia, sepolia } from 'wagmi/chains'
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config'

const chains = [mainnet, sepolia , modeTestnet , baseSepolia] as const
Expand All @@ -16,7 +16,7 @@ export const config = defaultWagmiConfig({
projectId: 'ebc8b79c899ea9b36db43c39aea67728',
metadata,
transports: {
[mainnet.id]: http(),
[optimismSepolia.id]: http(),
[sepolia.id]: http(),
[modeTestnet.id]: http(),
[baseSepolia.id]: http(),
Expand Down

0 comments on commit 364c624

Please sign in to comment.