Skip to content

feat(smart-contracts): BatchConversionContract 0.2.0 mainnet artifact#1743

Merged
yomarion merged 9 commits into
masterfrom
smart-contracts/batch-conversion-0.2.0-deployment
Jun 24, 2026
Merged

feat(smart-contracts): BatchConversionContract 0.2.0 mainnet artifact#1743
yomarion merged 9 commits into
masterfrom
smart-contracts/batch-conversion-0.2.0-deployment

Conversation

@yomarion

@yomarion yomarion commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description of the changes

Main addition:

  1. BatchConversionContract artifact for 0.2.0 (merged in fix(smart-contracts): address stranded balance issues for ERC20 #1741 and chore: audit finding "Fee Address Is Using transfer" #1739 )

The code changes only affect local commands:

  • yarn hardhat deploy-contracts-through-deployer:
  1. Improved error handling for lack of funds, and absence of ADMIN_PRIVATE_KEY
  2. Don't try to configure contracts that could not be deployed (still do for previously deployed contracts)
  • yarn hardhat verify-contract-from-deployer
  1. Improved error handling with useful verbosity

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds the BatchConversionPayments 0.2.0 mainnet artifact and improves error handling in the CREATE2 deployment and verification scripts. The artifact addition and most script changes are straightforward; the main correctness fixes address previously noted bugs (typo in status string, return vs continue in the deploy loop, signer guard, and optional chaining on error objects).

  • Artifact: New 0.2.0.json ABI and mainnet deployment address registered in index.ts; the default exported version remains 0.1.0 for backwards compatibility.
  • deploy.ts / xdeployer.ts: deployOneWithCreate2 now returns a typed {deployed, address} object; the loop in deployWithCreate2FromList correctly uses continue to skip setup only for failed contracts; xdeploy gains an early throw when ADMIN_PRIVATE_KEY is absent and a friendly message for insufficient-funds failures.
  • compute-one-address.ts / verify.ts: Better diagnostic logging on error paths and verification progress.

Confidence Score: 4/5

Safe to merge after addressing or accepting the WEB3_PROVIDER_URL logging concern; the artifact addition and deploy loop fixes are correct.

The artifact addition and loop-control fixes are solid. One concrete finding remains: a new console.warn logs WEB3_PROVIDER_URL verbatim, which can expose embedded API keys (e.g., Infura/Alchemy project secrets) in CI/CD logs. Whether that risk is acceptable in a deployer-only script is a judgment call, but it is a real credential-exposure path introduced by this PR.

packages/smart-contracts/scripts-create2/compute-one-address.ts — the new console.warn on error logs the full WEB3_PROVIDER_URL, including any embedded API key.

Important Files Changed

Filename Overview
packages/smart-contracts/scripts-create2/compute-one-address.ts Added a console.warn on error that logs WEB3_PROVIDER_URL, potentially exposing embedded API keys in CI logs
packages/smart-contracts/scripts-create2/deploy.ts Return type of deployOneWithCreate2 changed from string to {deployed, address}; deployWithCreate2FromList now uses continue instead of return on failure, preserving the loop for subsequent contracts
packages/smart-contracts/scripts-create2/xdeployer.ts Added early guard for missing signer, friendly error for insufficient funds, and address log before deployment attempt
packages/smart-contracts/scripts-create2/verify.ts Network assertion moved outside the loop and debug logging added for better visibility during verification runs
packages/smart-contracts/src/lib/artifacts/BatchConversionPayments/index.ts New 0.2.0 entry added with mainnet address; default version remains 0.1.0 for backwards compatibility
packages/smart-contracts/src/lib/artifacts/BatchConversionPayments/0.2.0.json New ABI artifact for BatchConversionPayments 0.2.0; ABI matches expected interface with batch payment functions and admin setters
packages/smart-contracts/README.md Minor wording improvement to section heading

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[deployWithCreate2FromList] --> B{for each contract}
    B --> C[deployOneWithCreate2]
    C --> D[xdeploy - CREATE2]
    D --> E{deployment result}
    E -->|deployed=true| F[deployed = 'success']
    E -->|already on-chain| G[deployed = 'yes']
    E -->|error| H[deployed stays 'no']
    F & G --> I{deployed !== 'no'?}
    H --> I
    I -->|yes| J[setupContract]
    I -->|no - continue| B
    J --> B
    B -->|done| K[Complete]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[deployWithCreate2FromList] --> B{for each contract}
    B --> C[deployOneWithCreate2]
    C --> D[xdeploy - CREATE2]
    D --> E{deployment result}
    E -->|deployed=true| F[deployed = 'success']
    E -->|already on-chain| G[deployed = 'yes']
    E -->|error| H[deployed stays 'no']
    F & G --> I{deployed !== 'no'?}
    H --> I
    I -->|yes| J[setupContract]
    I -->|no - continue| B
    J --> B
    B -->|done| K[Complete]
Loading

Reviews (8): Last reviewed commit: "compute-one-address warning cleanup" | Re-trigger Greptile

Comment thread packages/smart-contracts/scripts-create2/deploy.ts
Comment thread packages/smart-contracts/scripts-create2/deploy.ts Outdated
Comment thread packages/smart-contracts/scripts-create2/xdeployer.ts Outdated
Comment thread packages/smart-contracts/scripts-create2/deploy.ts Outdated
@yomarion yomarion force-pushed the smart-contracts/batch-conversion-0.2.0-deployment branch from 2223de5 to 88abae0 Compare June 22, 2026 16:06
@yomarion yomarion force-pushed the smart-contracts/batch-conversion-0.2.0-deployment branch from 88abae0 to 2c936eb Compare June 23, 2026 13:21
@yomarion yomarion changed the title chore(smart-contracts): local xdeployer errors handling feat(smart-contracts): BatchConversionContract 0.2.0 mainnet artifact Jun 23, 2026
@MantisClone MantisClone requested a review from LeoSlrRf June 24, 2026 13:24

@rodrigopavezi rodrigopavezi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@MantisClone MantisClone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved 👍 pending the small comment below 👇 🚧

I traced the SDK path: v0.2.0 is registered, and payment + approval both use the same version option.

Main note: this is opt-in. Default is still v0.1.0, so RF needs to pass version: '0.2.0' to use the new mainnet contract.

Small ops note: manual setup reruns also need the v0.2.0 address passed explicitly, otherwise the fallback points at v0.1.0.

I agree with Greptile’s warning here:

compute-one-address.ts — the catch block emits a misleading "Unknown error" warning for intentional validation failures, which could slow down debugging of deployment issues.

I checked the code too: the catch also wraps known config/validation errors like missing salt, missing deployer address, or invalid initcode as “Unknown error.”

@yomarion yomarion enabled auto-merge (squash) June 24, 2026 16:11
@yomarion yomarion merged commit f194280 into master Jun 24, 2026
10 checks passed
@yomarion yomarion deleted the smart-contracts/batch-conversion-0.2.0-deployment branch June 24, 2026 16:24
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.

4 participants