Skip to main content

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:

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

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.