Skip to content

fix(scripts): support Vec<(Address, u32)> in invoke.mjs parseArg - #180

Open
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/invoke-mjs-vec-tuple-156
Open

fix(scripts): support Vec<(Address, u32)> in invoke.mjs parseArg#180
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/invoke-mjs-vec-tuple-156

Conversation

@rafaio1

@rafaio1 rafaio1 commented Aug 21, 2026

Copy link
Copy Markdown

Summary

Fixes #156

Problem

scripts/invoke.mjs's parseArg() function only handles three scalar argument shapes (address, u32, i128). The release() contract function accepts recipients as Vec<(Address, u32)>, making it impossible to invoke release or release_issue from the CLI.

Fix

Adds a vec-tuple-address-u32 type handler that parses a JSON array of [address, bps] pairs and encodes them as the correct Soroban ScVal tuple vector using nativeToScVal.

Usage

node scripts/invoke.mjs release issue_id 'vec-tuple-address-u32:[["GADDR...",5000],["GADDR...",5000]]'

Testing

  • Verified encoding produces valid ScVal structure matching Soroban SDK expectations
  • Existing scalar types remain unchanged and backward compatible

The release() contract function accepts recipients as Vec<(Address, u32)>,
but parseArg() only handled scalar types (address, u32, i128). This made
it impossible to invoke release or release_issue from the CLI.

Adds vec-tuple-address-u32 type that parses a JSON array of [address, bps]
pairs and encodes them as the correct Soroban ScVal tuple vector.

Usage: node scripts/invoke.mjs release issue_id 'vec-tuple-address-u32:[["GADDR...",5000],["GADDR...",5000]]'

Closes MergeFi#156
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

scripts/invoke.mjs cannot encode a Vec<(Address,u32)> argument — cannot invoke release/release_issue at all

1 participant