Skip to content

create_vault's multi-Address parameter list has no type-safety distinction between its several Address arguments #358

Description

@1nonlypiece

create_vault takes nine parameters, five of which are plain Address or Option<Address> values with no distinguishing newtype: usdc_token, creator, verifier, success_destination, and failure_destination. Rust's type system doesn't prevent a caller (or a client-generation bug, or a copy-paste error in an integrating backend) from accidentally passing these in the wrong order — e.g. transposing creator and usdc_token, or success_destination and failure_destination — since all are the exact same Address type positionally. This is exactly the kind of parameter-list risk that motivated the crate-wide #![allow(clippy::too_many_arguments)] in the first place. Consider introducing lightweight newtype wrappers (or at minimum, thorough integration-level tests exercising the exact call-site argument order against contract-interface.json's documented parameter names) to reduce this transposition risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions