import { Coinbase, Wallet } from "@coinbase/coinbase-sdk";
import { createPublicClient, decodeAbiParameters, http, keccak256, toBytes } from 'viem';
import { base } from 'viem/chains'
import os from "os";
import dotenv from "dotenv";
dotenv.config();
// https://developers.circle.com/stablecoins/evm-smart-contracts contains the CCTP contract addresses
const BASE_TOKEN_MESSENGER_ADDRESS = "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962";
const ARBITRUM_MESSAGE_TRANSMITTER_ADDRESS = "0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca";
// https://developers.circle.com/stablecoins/usdc-on-main-networks contains the USDC contract addresses on chains
const USDC_BASE_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
const tokenMessengerAbi = [
{
inputs: [
{ internalType: "uint256", name: "amount", type: "uint256" },
{ internalType: "uint32", name: "destinationDomain", type: "uint32" },
{ internalType: "bytes32", name: "mintRecipient", type: "bytes32" },
{ internalType: "address", name: "burnToken", type: "address" },
],
name: "depositForBurn",
outputs: [
{ internalType: "uint64", name: "_nonce", type: "uint64" },
],
stateMutability: "nonpayable",
type: "function",
},
];
const messageTransmitterAbi = [
{
inputs: [
{ internalType: "bytes", name: "message", type: "bytes" },
{ internalType: "bytes", name: "attestation", type: "bytes" },
],
name: "receiveMessage",
outputs: [
{ internalType: "bool", name: "success", type: "bool" },
],
stateMutability: "nonpayable",
type: "function",
},
];