Rippo/docs
Source

Contracts

RippoMilestoneBook: functions, events, errors, the accounting rule and how to verify a deployment.

RippoMilestoneBook#

Address: 0x0B3A35aB5de03173CF0B1A8Cd1522Bfb3FE76B09. Constructor: (address stableToken) = USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168. Solidity 0.8.28, no owner, no fee, no proxy, no pause.

openDeal(worker, asset, reviewWindow, termsHash, uint128[] amounts, uint64[] deadlines) payable → dealId addMilestone(dealId, amount, deadline) payable → index client only approve(dealId, index) client only submit(dealId, index, deliveryHash) worker only, before deadline waive(dealId, index) worker only releaseAfterReview(dealId, index) anyone, after the review window refundAfterDeadline(dealId, index) anyone, after the deadline, unsubmitted only withdraw(asset) → amount pulls your credit getDeal · getMilestone · getMilestones · dealCount · credit(account, asset) · held(asset) event DealOpened · MilestoneAdded · MilestoneSubmitted · MilestoneReleased · MilestoneRefunded · Withdrawn

The accounting rule#

For each asset, held(asset) equals the open milestone amounts plus unwithdrawn credits, and the contract always holds at least that much. The invariant test drives random clients and workers through every path, in ETH and in a 6-decimal token, and checks that rule after every step. Tokens that arrive short (fee on transfer) are refused.

Verify a deployment#

cd contracts && ./setup.sh && forge build --force && cd .. npm run contracts:artifacts -- --check npm run verify-deployment -- --book <address> --book-tx <creation tx>

Status#

The Solidity source and every test ship with the code under contracts/; rerun the suite on a chain fork before relying on any edit. Start with a small amount: no admin can rescue funds.