contracts

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package contracts provides canonical USDC contract addresses and on-chain verification utilities for supported EVM chains.

Index

Constants

This section is empty.

Variables

View Source
var CanonicalUSDC = map[int64]string{
	1:        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
	8453:     "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
	84532:    "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
	11155111: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
}

CanonicalUSDC maps chain IDs to their official USDC contract addresses.

Functions

func IsCanonical

func IsCanonical(chainID int64, addr common.Address) bool

IsCanonical checks whether the given address matches the canonical USDC contract for the specified chain.

func LookupUSDC

func LookupUSDC(chainID int64) (common.Address, error)

LookupUSDC returns the canonical USDC contract address for the given chain.

func VerifyOnChain

func VerifyOnChain(
	ctx context.Context,
	caller ContractCaller,
	addr common.Address,
) error

VerifyOnChain calls symbol() and decimals() on the contract to confirm it is a USDC token (symbol == "USDC", decimals == 6).

Types

type ContractCaller

type ContractCaller interface {
	CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
}

ContractCaller abstracts the eth_call method for on-chain verification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL