Skip to content

fix(base): centralize legacy contract detection#108

Open
dirtybits wants to merge 1 commit into
mainfrom
fix/base-contract-address-heuristic
Open

fix(base): centralize legacy contract detection#108
dirtybits wants to merge 1 commit into
mainfrom
fix/base-contract-address-heuristic

Conversation

@dirtybits

@dirtybits dirtybits commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • route the legacy on_chain_program_id EVM check through the shared isEvmShapedAddress helper
  • preserve configured Base-contract fallback for legacy non-EVM program IDs
  • add regression coverage for both fallback cases

Test Plan

  • npm test --workspace @agentvouch/web -- --maxWorkers=1 --no-fileParallelism __tests__/lib/baseListing-currency.test.ts
  • npm run typecheck
  • npm run lint:web
  • npm exec -- prettier --check web/lib/adapters/baseListing.ts web/__tests__/lib/baseListing-currency.test.ts
  • git diff --check

Not run

  • Full web build was not run; this is a small, server-safe helper cleanup with targeted tests, lint, and typecheck coverage.

Note

Low Risk
Small helper refactor in Base listing adapter with targeted unit tests; behavior for non-EVM legacy IDs is explicitly preserved.

Overview
getExpectedBaseContract now decides whether legacy on_chain_program_id can stand in for evm_contract_address via shared isEvmShapedAddress from chainAddress, replacing an inline startsWith("0x") check.

When evm_contract_address is missing, EVM-shaped legacy IDs still go through requireBaseEvmAddress; Solana-style (non-0x) legacy IDs are skipped and the configured Base contract is used instead of treating the program id as a contract.

Regression tests cover both the EVM legacy fallback and the non-EVM ignore path in baseListing-currency.test.ts.

Reviewed by Cursor Bugbot for commit 702d40a. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8c29411a-a6b6-4878-820a-ff20a4174a5c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant