Skip to content

Deposit refundsΒ #512

@guidanoli

Description

@guidanoli

πŸ“š Specification

Draft on HackMD

πŸ“ˆ Subtasks

Based on the specification, we list all contracts-related tasks below.
The tasks are ordered in such a way that is easier to implement them.

  • Add IRefundOutputBuilder
  • Add RefundOutputBuilder
  • Add RefundOutputBuilder to deployment script (and Cannonfile)
  • Add wasInputFinalized function to IOutputsMerkleRootValidator
  • Implement wasInputFinalized function in AbstractConsensus
  • Add IRefundOutputBuilder field to WithdrawalConfig struct
  • Move NotForeclosed from IApplicationWithdrawal to IApplicationForeclosure
  • Add getRefundOutputBuilder function to IApplicationRefund interface
  • Add validateInput function to IApplicationRefund interface
  • Add issueRefund function to IApplicationRefund interface
  • Add wasRefundIssued function to IApplicationRefund interface
  • Add getNumberOfIssuedRefunds function to IApplicationRefund interface

⛓️‍πŸ’₯ Breaking changes

No breaking changes would be added with this feature.

πŸ§ͺ Tests

Based on the expected behavior of the new entrypoints and parameters,
here are some test cases that should validate their correct implementation.

  • Deploy app with address zero as refund output builder
  • Deploy app with fuzzed refund output builder and test getters and event
  • Ensure initial issued-refund count is zero
  • Ensure no refunds were issued initially
  • Attempt to validate invalid input index
  • Attempt to validate invalid input
  • Add fuzzed input and validate it on the app contract
  • Attempt to issue refund when app is not foreclosed
  • Attempt to issue refund for invalid input index
  • Attempt to issue refund for invalid input
  • Attempt to issue refund for finalized input
  • Attempt to issue refund for non-deposit input
  • Attempt to issue refund for same input twice
  • Issue refund with fuzzed Ether deposit and test events/getters
  • Issue refund with fuzzed ERC-20 deposit and test events/getters
  • Issue refund with fuzzed ERC-721 deposit and test events/getters
  • Issue refund with fuzzed single ERC-1155 deposit and test events/getters
  • Issue refund with fuzzed batch ERC-1155 deposit and test events/getters

Metadata

Metadata

Assignees

Labels

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions