Documentation Index
Fetch the complete documentation index at: https://docs.rentr.live/llms.txt
Use this file to discover all available pages before exploring further.
What it does
RentrEscrow is a single-file Solidity contract on Base that escrows USDC for the duration of every rental. It has three external entrypoints:
| Function | Caller | When |
|---|---|---|
createRental(rentalId, owner, amount, fee, endTime) | Renter | At checkout. Pulls amount + fee USDC into the contract. |
release(rentalId) | Operator | At rental end — pays owner + treasury. |
refund(rentalId) | Operator | On a successful dispute — returns full deposit to renter. |
Design choices
- Single 256-bit storage slot per rental. Owner address (160 bits), amount (96 bits), fee (96 bits), endTime (64 bits), status (8 bits) — packed for gas efficiency.
- Custom errors over revert strings. Cheaper, more informative.
- Checks-Effects-Interactions pattern throughout. No reentrancy attack surface.
_safeTransferFrom/_safeTransferwrappers for ERC-20 — handles tokens that return false vs. revert (USDC follows the standard but defensive coding is free).- Admin can rotate operator via
setOperator()— meant for migrating from hot relayer to multisig. - No pause / kill switch. Intentional — keeps the trust surface minimal. If we ever want one, we’d add it before going to mainnet.
Roles
| Role | Default value | Can do |
|---|---|---|
| Renter | Whoever called createRental | Nothing post-creation; the contract is the source of truth |
| Owner | Set at createRental time | Nothing — funds get pushed to them, no pull needed |
| Operator | Backend EOA (or multisig in prod) | Call release and refund anytime |
| Admin | Backend EOA (or multisig) | Rotate the operator |
| Treasury | Set at deploy time | Receives the 1 USDC platform fee per release |

