Skip to content

Conditional deposit and auto-refund engine on Base L2. Lock funds with verifiable conditions, auto-refund if not met, and build trust for presales, crowdfunding and on-chain commitments — integrated with Base Pay, EAS and oracles

License

Notifications You must be signed in to change notification settings

kirillshpilevski/SafeReturn

Repository files navigation

SafeReturn

Secure, upgradeable asset-recovery and controlled withdrawal system for Base network.

Overview

SafeReturn provides a trustworthy, governance-aware mechanism for managing protected funds, delayed withdrawals, automated recovery logic, and USDC payouts through Base Pay integration.

Architecture

Core Modules

  • WithdrawalRequestModule: Request management with timelock mechanics
  • ApprovalModule: Multi-role approval system with threshold-based logic
  • TreasuryModule: USDC vault with Base Pay integration
  • RecoveryModule: Emergency freeze/thaw state machine
  • UpgradeModule: UUPS upgradeable pattern for long-term maintainability

Roles

  • Owner: Contract owner with upgrade rights
  • Admin: Can approve requests and manage thresholds
  • Guardian: Emergency recovery and vault freeze capabilities
  • Executor: Execute approved withdrawals

Development

forge build
forge test

Deployment

forge script script/DeploySafeReturn.s.sol --rpc-url base-sepolia --broadcast

Features

  • Timelock-protected withdrawals
  • Multi-signature approval system
  • Fast-track mode for small amounts
  • Emergency vault freeze
  • UUPS upgradeable proxies
  • Base network optimized

Deployed Contracts

Base Sepolia (Testnet)

See deployments directory for detailed configuration and testing commands.

Testing

forge test -vv

Security

All contracts upgradeable using UUPS with strict access controls.

License

MIT

About

Conditional deposit and auto-refund engine on Base L2. Lock funds with verifiable conditions, auto-refund if not met, and build trust for presales, crowdfunding and on-chain commitments — integrated with Base Pay, EAS and oracles

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published