Complexity: High
Problem: When an investor funds an invoice, the RWA token must be locked and USDC released to the borrower automatically.
Scope: Build the CollateralEscrow contract that accepts an RWA token as collateral, holds USDC from the investor, and releases it to the borrower at agreed LTV. Key methods: lock_collateral(token_id, borrower, investor, usdc_amount, ltv, due_date), release_funds(), repay(amount), get_escrow(escrow_id), get_status(escrow_id)
Acceptance criteria: Funds locked correctly. USDC released to borrower on release_funds(). Collateral returned on full repayment.
Files to create:
contracts/collateral-escrow/src/lib.rs
contracts/collateral-escrow/src/types.rs
contracts/collateral-escrow/src/storage.rs
contracts/collateral-escrow/src/errors.rs
contracts/collateral-escrow/Cargo.toml
Complexity: High
Problem: When an investor funds an invoice, the RWA token must be locked and USDC released to the borrower automatically.
Scope: Build the CollateralEscrow contract that accepts an RWA token as collateral, holds USDC from the investor, and releases it to the borrower at agreed LTV. Key methods: lock_collateral(token_id, borrower, investor, usdc_amount, ltv, due_date), release_funds(), repay(amount), get_escrow(escrow_id), get_status(escrow_id)
Acceptance criteria: Funds locked correctly. USDC released to borrower on release_funds(). Collateral returned on full repayment.
Files to create:
contracts/collateral-escrow/src/lib.rs
contracts/collateral-escrow/src/types.rs
contracts/collateral-escrow/src/storage.rs
contracts/collateral-escrow/src/errors.rs
contracts/collateral-escrow/Cargo.toml