Skip to content

feat: add send generic input#438

Open
brunomenezes wants to merge 2 commits intofeat/add-abi-encoding-and-decodingfrom
feat/add-send-generic-input
Open

feat: add send generic input#438
brunomenezes wants to merge 2 commits intofeat/add-abi-encoding-and-decodingfrom
feat/add-send-generic-input

Conversation

@brunomenezes
Copy link
Collaborator

@brunomenezes brunomenezes commented Feb 27, 2026

Summary

The code changes in this PR achieve feature parity in terms of a user be able to send transactions (i.e. deposits through portals and generic input through the input box).

Even though the add-input is the simplest in terms of smart contract interface, it was the last to be added as it depends on the PR #434 (ABI encoding/decoding support), since we provide ways for the user to choose how they want to send the data i.e. using a raw hex value, or a string to be converted to hex, or ABI encoding to define the input to be sent.

PS: Currently I am skipping the CI step to publish the test reports to coveralls. It is having service outage for a couple of days at the moment of writing. They don't have an ETA, more details here: https://status.coveralls.io/

closes: #435

@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dave Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-arbitrum-mainnet Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-arbitrum-sepolia Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-base-mainnet Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-base-sepolia Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-mainnet Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-optimism-mainnet Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-optimism-sepolia Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-sepolia Ready Ready Preview, Comment Mar 2, 2026 3:37pm
rollups-explorer-workshop Ready Ready Preview, Comment Mar 2, 2026 3:37pm

Request Review

@brunomenezes brunomenezes moved this from Todo to Waiting review in Rollups SDK Feb 27, 2026
@brunomenezes brunomenezes linked an issue Feb 27, 2026 that may be closed by this pull request
3 tasks
@vfusco vfusco requested a review from Copilot February 28, 2026 21:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the Dave webapp to send generic inputs to an application via the Cartesi InputBox, with multiple input encoding modes (raw hex, string-to-hex, and ABI-based encoding) to reach feature parity with existing “send” flows.

Changes:

  • Introduces a new GenericInputForm with validation, ABI/spec selection, and encoding helpers.
  • Wires “Input” into the Send menu/modal and passes JSON_ABI specifications into the form.
  • Temporarily disables publishing Coveralls reports in CI.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
apps/dave/src/components/transactions/GenericInputForm/index.tsx Main generic input UI and transaction execution flow
apps/dave/src/components/transactions/GenericInputForm/useGenericInputForm.tsx Form setup, validation wiring, and transformed values/spec selection
apps/dave/src/components/transactions/GenericInputForm/validations.ts Field validators for app address, hex input, ABI inputs/params
apps/dave/src/components/transactions/GenericInputForm/utils.ts ABI parsing/spec generation, tuple flattening, and argument encoding helpers
apps/dave/src/components/transactions/GenericInputForm/types.ts Form and ABI-related types
apps/dave/src/components/transactions/GenericInputForm/initialValues.ts Initial form values
apps/dave/src/components/transactions/GenericInputForm/context.tsx Mantine form context for the feature
apps/dave/src/components/transactions/GenericInputForm/hooks/useInputBoxAddInput.tsx Wagmi simulate/write/wait wrapper for InputBox addInput
apps/dave/src/components/transactions/GenericInputForm/AbiFields.tsx ABI method/spec selection and display of encoded hex output
apps/dave/src/components/transactions/GenericInputForm/AbiFunctionName.tsx Function selection UI for JSON_ABI specs
apps/dave/src/components/transactions/GenericInputForm/AbiFunctionParams.tsx Function argument inputs (incl. tuple handling)
apps/dave/src/components/transactions/GenericInputForm/TupleComponents.tsx Recursive tuple component rendering
apps/dave/src/components/transactions/GenericInputForm/AbiParameter.tsx ABI-params entry flow for encoding without selectors
apps/dave/src/components/transactions/GenericInputForm/FunctionSignature.tsx Function signature/label rendering helpers
apps/dave/src/components/send/SendMenu.tsx Enables “Input” send action and forwards filtered specifications
apps/dave/src/components/send/SendModal.tsx Renders GenericInputForm for generic_input transaction type
apps/dave/src/components/send/SendProvider.tsx Stores specifications in send state for generic input actions
apps/dave/src/components/send/SendContexts.tsx Extends send state/action types to include specifications
apps/dave/src/components/send/hooks.tsx Updates sendGenericInput action signature to accept specs
.github/workflows/ci.yml Disables Coveralls publish step
Comments suppressed due to low confidence (1)

apps/dave/src/components/transactions/GenericInputForm/AbiFunctionParams.tsx:55

  • Typo in data-testid: empty-inputs-argments-alert should be empty-inputs-arguments-alert to avoid propagating the misspelling into tests and tooling.
                            data-testid="empty-inputs-argments-alert"
                        >

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


type SendMenuProps = { application: Application };

const jsonAbiOnly = (spec: DbSpecification) => spec.mode === "json_abi";
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

jsonAbiOnly is a boolean predicate, so filter(jsonAbiOnly, ...) does not narrow the DbSpecification union type. That forces as casts later and makes it easy to accidentally pass non-JSON_ABI specs. Consider making jsonAbiOnly a proper type guard and/or mapping the list to the exact {id, name, abi} shape expected by GenericInputForm.

Suggested change
const jsonAbiOnly = (spec: DbSpecification) => spec.mode === "json_abi";
const jsonAbiOnly = (
spec: DbSpecification,
): spec is Extract<DbSpecification, { mode: "json_abi" }> =>
spec.mode === "json_abi";

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The current is fine. Later there will be a refactoring and the GenericInputForm may be removed.

cc: @vfusco

Comment on lines +126 to +129
application={state.application}
specifications={
state.specifications as GenericInputFormSpecification[]
}
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

This cast hides the fact that DbSpecification is a union (some variants do not have an abi field). If anything other than mode: "json_abi" slips into state.specifications, GenericInputForm will break at runtime. Prefer narrowing the type earlier (e.g., store only JSON_ABI specs in state) or mapping to the GenericInputFormSpecification shape without using as casts.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is fine by the reason above. The list of specifications from the state is expected to be already filtered by Specs with mode json_abi.

cc: @vfusco

@brunomenezes brunomenezes force-pushed the feat/add-abi-encoding-and-decoding branch from 959af0b to 6101d4d Compare March 2, 2026 13:09
* Support to raw hex value added.
* Support to string to hex added.
* Support ABI encoding added.
@brunomenezes brunomenezes force-pushed the feat/add-send-generic-input branch from 5d156e4 to 15ae89f Compare March 2, 2026 13:32
@brunomenezes brunomenezes force-pushed the feat/add-send-generic-input branch from 15ae89f to e612f01 Compare March 2, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting review

Development

Successfully merging this pull request may close these issues.

Input Box: add support to send generic input

2 participants