Skip to content

Compilation broken on main: 800+ errors due to missing enum variants and duplicate #[contractimpl] items #508

Description

@Peaostrel

Description

The main branch currently fails to compile out of the box. Running cargo check or cargo test in the root or inside the escrow directory yields over 800 compilation errors (specifically in escrow/src/lib.rs).

The failures primarily stem from two structural issues in the contract codebase:

1. Missing Enum Variants (E0599)

Several variants used throughout the contract logic are completely missing from their respective enum definitions (DataKey and EscrowError).

  • Missing EscrowError variants: LegalHoldBlocksCancelFunding, CancelFundingNotOpen, RefundNotCancelled, NoContributionToRefund
  • Missing DataKey variants: InvestorRefunded, DistributedPrincipal

Someone likely added the logic for refunds and cancellations but forgot to declare the corresponding enum keys at the top of the file.

2. Duplicate Implementations / Macro Conflicts (E0034)

The Soroban #[contractimpl] macro throws multiple multiple applicable items in scope errors for generated XDR specifications (e.g., spec_xdr_get_escrow, spec_xdr_fund, spec_xdr_is_settleable).
This indicates that LiquifactEscrow likely has duplicate methods defined across multiple impl blocks, or there is a structural macro conflict in how #[contractimpl] is applied.

Steps to Reproduce

  1. Clone the repository and checkout main.
  2. Run cargo check inside the escrow crate or workspace root.

Snippet of the errors:
```rust
error[E0599]: no variant, associated function, or constant named RefundNotCancelled found for enum EscrowError in the current scope
error[E0599]: no variant, associated function, or constant named InvestorRefunded found for enum DataKey in the current scope
error[E0034]: multiple applicable items in scope for spec_xdr_fund
```

Expected Behavior

The base main branch should compile and pass cargo check successfully without cascading syntax and scoping errors. It needs a quick structural fix to declare the missing enums and remove duplicate implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions