Skip to content

refactor(contracts): remove minDeposit floor #1515

Closed

Description

@alpergundogdu

Delete the network minimum-deposit parameter and its enforcement. (Seller-side per-voucher ceiling already bounds service to what's funded; gas already bounds channel spam.)

  • Contract PaymentChannel.sol: delete minDeposit (:141), DEFAULT_MIN_DEPOSIT (:92-95), setMinDeposit (:889-895), MinDepositUpdated (:280), DepositBelowMinimum (:290), both openChannel checks (:390,:419), constructor init (:361). Add if (deposit == 0) revert ZeroAmount(); (minDeposit was the only zero-guard). Rename MIN_DEPOSIT_FLOOR (:72) → MIN_RATE_FLOOR — reused for rate bounds (:351,:911,:990), keep it.
  • Rust ripple: drop minDeposit() ABI decl (crates/incentive/src/payment_channel.rs:113, crates/e2e/src/bindings.rs:128); drop DepositBelowMinimum decoding + open-side ChannelOpenFailureReason::InsufficientDeposit (crates/incentive/src/channel_open_error.rs) — keep the seller-side voucher InsufficientDeposit; remove clamp-up-to-minDeposit logic (crates/node/src/buyer_channel.rs, crates/cli/src/commands/fetch.rs, channel.rs).
  • Tests: replace test_openChannel_revertsBelowMinDeposit (contracts/test/PaymentChannel.t.sol:351-354) with a zero-deposit-reverts test; drop setMinDeposit test (:890); regen .gas-snapshot; fix 10-USDC-min fixtures (anvil_settlement_e2e.rs:139, cli_bundle_pull_channel_id.rs, cli_fetch_resume.rs, cli_fetch_topup.rs, e2e/src/client.rs:34).
    ADR upkeep (factual, not rationale): drop the min-deposit references in ADR 003 (:30,46,87,211,233,444,493,541), ADR 009 (:122,147), ADR 016 (:577), so canon doesn't describe a removed param. (Strike if you'd rather batch ADR edits separately.)
  • Acceptance: openChannel accepts any deposit > 0, reverts on 0; forge + Rust CI green; no dangling minDeposit refs.
  • Coordination: buyer open path overlaps Issue 1 (rename + clamp removal).

Metadata

Metadata

Assignees

Labels

area:contractsrust

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions