feat(contract): add write function support via --write flag#297
Open
Ad-Capital wants to merge 5 commits intorsksmart:mainfrom
Open
feat(contract): add write function support via --write flag#297Ad-Capital wants to merge 5 commits intorsksmart:mainfrom
Ad-Capital wants to merge 5 commits intorsksmart:mainfrom
Conversation
Adds a --write flag to the contract command that lets users call nonpayable and payable functions on verified contracts. Includes Solidity type coercion, pre-flight simulation via simulateContract, payable RBTC value handling with balance check, and confirmation receipt with explorer link.
Add confirmation prompt before irreversible transaction submission Validate ABI structure from external API before use Reject scientific notation in RBTC value input Enforce bytesN length constraints in coerceArg Sanitize simulation error messages in external mode Wrap writeContract and waitForTransactionReceipt in try/catch Wire --wallet flag through to contract command Display full function signatures for overloaded functions Use indexed keys for arg prompts to avoid name collisions Add null guard after ABI function lookup Handle fixed/ufixed Solidity types in coerceArg Add build step to contract:write script, remove hardcoded address Rename ReadContract to contractCommand with backward-compatible alias
Add int/uint bounds and sign validation in coerceArg Apply isExternal error sanitization to submission catch block Validate input.type fields in validateAbi Use indexed arg keys in read path prompt Replace walletClient.account! with explicit null guard Use full function signatures in read function selector Add Object.hasOwn guard for wallet name lookup in viemProvider Add contract:read npm script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a --write flag to the contract command that lets users call nonpayable and payable functions on verified contracts. Includes Solidity type coercion, pre-flight simulation via simulateContract, payable RBTC value handling with balance check, and confirmation receipt with explorer link.