Skip to content

Comments

Neo mamba tool#62

Open
helloissariel wants to merge 3 commits intoXSpoonAi:mainfrom
helloissariel:neo-mamba
Open

Neo mamba tool#62
helloissariel wants to merge 3 commits intoXSpoonAi:mainfrom
helloissariel:neo-mamba

Conversation

@helloissariel
Copy link
Contributor

Summary

  • Add 12 Neo N3 on-chain operation tools built on neo-mamba's ChainFacade
  • Add _compat.py — idempotent neo-mamba compatibility patches (error handling + timeout)
  • Add neo_transaction_tools_demo.py — comprehensive demo with read-only and live modes

New Tools (12)

Read-only (5, no private key needed):

Tool File Description
NeoGetBalanceTool balance_tools.py Query NEP-17 token balances
NeoTestInvokeTool invoke_tools.py Test invoke contracts (free, read-only)
NeoEstimateGasTool invoke_tools.py Estimate GAS cost before sending
NeoMultiSigCreateTool multisig_tools.py Create multi-signature accounts
NeoContractStorageTool storage_tools.py Query contract storage entries

Transaction (7, require NEO_PRIVATE_KEY):

Tool File Description
NeoTransferTool transfer_tools.py Transfer NEO/GAS/NEP-17 tokens
NeoNep11TransferTool transfer_tools.py Transfer NEP-11 NFTs
NeoInvokeContractTool invoke_tools.py State-changing contract invocation
NeoBatchInvokeTool invoke_tools.py Batch multiple calls in one tx
NeoClaimGasTool governance_action_tools.py Claim unclaimed GAS
NeoVoteTool governance_action_tools.py Vote for consensus candidates
NeoDeployContractTool deploy_tools.py Deploy smart contracts

Architecture

  • _compat.py patches applied once via __init__.py before any tool import
  • Patches fix two neo-mamba bugs: _do_post error handling crash + 3s default timeout
  • Subclassing not viable (upstream uses explicit super(NeoRpcClient, self) causing recursion)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82dcd4115c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

elif arg_type in ("string", "str"):
parsed.append(str(value))
elif arg_type in ("boolean", "bool"):
parsed.append(bool(value))

Choose a reason for hiding this comment

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

P2 Badge Parse explicit booleans without truthy string coercion

The boolean branch uses bool(value), which turns any non-empty string into True; for example, {"type":"Boolean","value":"false"} is parsed as true. Because _parse_contract_args is shared by invoke/test/batch/estimate tools, callers that pass stringified JSON booleans can silently execute the opposite contract path, including unintended state-changing behavior.

Useful? React with 👍 / 👎.

elif arg_type == "hash256":
parsed.append(types.UInt256.from_string(str(value)))
elif arg_type == "array":
parsed.append(_parse_contract_args(value))

Choose a reason for hiding this comment

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

P2 Badge Preserve empty array args when parsing nested Array values

The Array parser recurses into _parse_contract_args(value), but that helper returns None for empty lists, so { "type": "Array", "value": [] } is emitted as null rather than an empty array. Contracts that distinguish empty arrays from null will return incorrect results or fault, which makes valid calls with empty-list parameters unreliable.

Useful? React with 👍 / 👎.

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