Skip to main content

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:
FunctionCallerWhen
createRental(rentalId, owner, amount, fee, endTime)RenterAt checkout. Pulls amount + fee USDC into the contract.
release(rentalId)OperatorAt rental end — pays owner + treasury.
refund(rentalId)OperatorOn 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 / _safeTransfer wrappers 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

RoleDefault valueCan do
RenterWhoever called createRentalNothing post-creation; the contract is the source of truth
OwnerSet at createRental timeNothing — funds get pushed to them, no pull needed
OperatorBackend EOA (or multisig in prod)Call release and refund anytime
AdminBackend EOA (or multisig)Rotate the operator
TreasurySet at deploy timeReceives the 1 USDC platform fee per release
The contract has no upgradability. To change behavior, deploy a new contract and migrate. This trades flexibility for security — no admin can suddenly drain funds via a backdoor.

Lifecycle

See the lifecycle page for diagrams and step-by-step state transitions.

Source code

Open source, MIT licensed: github.com/justexo-hash/rentr/tree/main/programs/rentr-escrow-evm Built with Foundry. 20 tests pass (14 unit + 1 fuzz pass over create/release/refund).

Addresses

See addresses for deployed contract addresses on Base mainnet and Base Sepolia.

Security

See security for the audit status (currently unaudited) and what we’ve done in lieu of an external review.