daimo-eth / daimo

Your own bank, on ethereum
https://daimo.com
GNU General Public License v3.0
327 stars 27 forks source link
Screenshot

Daimo is a stablecoin personal bank

Today, we run on USDC on Base. Cross-chain transfers and more coming soon.

No seed phrases. Keys are generated in your phone's secure enclave and never leave. You can add multiple devices and create Passkey backups to secure your account. Under the hood, it's a ERC-4337 contract wallet.

The mission is to make an excellent experience. Sound assets, secure cryptography, your coins in your control.

FAQ

Security

Audits

Past audits of the Daimo codebase can be found in the audits folder:

Bug Bounty Program

Daimo hosts a bug bounty program on Immunefi. Learn more on SECURITY.md.

Development

Daimo is under active development. Now in App Store and Play Store with an invite code. Coming soon: desktop app, no invite code, cross-chain support.

Architecture **READMEs for each app and package.** - [apps/daimo-mobile](apps/daimo-mobile) mobile app. Typescript + Expo - [apps/daimo-web](apps/daimo-web) web app, including deep links. Typescript + NextJS - [packages/contract](packages/contract) contracts, Solidity + Forge - [packages/daimo-api](packages/daimo-api) API, including indexer. Typescript + Node - [packages/daimo-common](packages/daimo-common) data models common to apps and API. Typescript - [packages/daimo-expo-enclave](packages/daimo-expo-enclave) hardware enclave interface. Typescript, Kotlin, Swift + Expo native module - [packages/daimo-userop](packages/daimo-userop) account abstraction interface. Typescript
Dev quickstart Clone the repo, loading submodules. ```sh git clone git@github.com:daimo-eth/daimo --recurse-submodules ``` Build the app. ```sh node --version # ensure you have node 21+ npm i npm run build ``` Run the iPhone Simulator in XCode. (If you're not on a Mac, see the Android quick start below.) Get the latest simulator build from Expo; message us if you need access. Drag-drop the build into the simulator to install. Copy the example `.env` file to use the remote, hosted API. ```sh cd apps/daimo-mobile cp .env.example .env ``` Finally, run the app in the simulator. ```sh npm run dev ``` **Use invite code `testnet`.** Once you create an account, you should automatically get some testnet USDC from the faucet. > Expo apps come in two layers: a native layer and a React Native (Typescript) > layer. Whenever you add a native module or update `@daimo/expo-enclave`, you > must rebuild the native app. For details, see `apps/daimo-mobile`.
Dev quickstart: Android - **Ensure you have the correct Java version.** Version 20 doesn't work, Java 17 works. - You need to `ANDROID_HOME` to the local Android SDK. - Install Android Studio, and create an emulator. - Download latest Android internal distribution build from Expo, and install it in the emulator. All other instructions are the same as above. After `npm run dev`, type `a` to open the Android simulator. You should now have both side-by-side. See the mobile `package.json` for details.
Dev quickstart: contracts Install Foundry. ```sh curl -L https://foundry.paradigm.xyz | bash # Reload your terminal, then run: foundryup ``` Build the contracts. ```sh forge build ``` For commands to run tests and recompute code coverage, see `ci.yml`.
Dev quickstart: API `daimo-mobile` and `daimo-web` both rely on `daimo-api`. By default: - `daimo-mobile` runs the Expo incremental build server on localhost:8080 - `daimo-web` runs the web app, including fallback deeplinks, on localhost:3001 - `daimo-api` runs the TRPC API on localhost:3000 You'll need to either use the hosted Daimo API or run one locally. To run the API locally, fill in `.env`. Message us if you need help. You can run Postgres in the background locally using the Mac Postgres app. Once you're running the API locally, you can run the full stack self-contained. ```sh # First tab cd packages/daimo-api && npm run dev # Second tab cd apps/daimo-mobile && npm run dev # Third tab cd apps/daimo-web && npm run dev ```
Dev quickstart: Maestro `daimo-mobile` runs end to end tests with [Maestro](https://maestro.mobile.dev). To write or run a test locally, first obtain a Expo build labelled with profile `maestro` [here](https://expo.dev/accounts/daimo/projects/daimo/builds). Then, with Maestro installed, you can simply run `maestro test ` to run the test. Example: `maestro test .maestro/onboardAndRemove.yaml`. In the cloud, these tests are run on the master branch using the `maestro-ci` workflow in [Maestro cloud](https://console.mobile.dev).

DB diagnostics Shovel caught up? ```sql SELECT * FROM shovel.latest; ``` Largest Postgres DB tables, disk usage: ```sql SELECT table_schema, table_name, pg_size_pretty(pg_total_relation_size(c.oid)) AS total_size FROM information_schema.tables t JOIN pg_class c ON c.relname = t.table_name WHERE table_type = 'BASE TABLE' ORDER BY pg_total_relation_size(c.oid) DESC LIMIT 20; ``` Largest tables, approximate row count: ```sql SELECT (SELECT nspname FROM pg_namespace WHERE oid=relnamespace) as r_schema, relname as r_name, reltuples as approx_num_rows, (relpages * 8) / 1024 as approx_disk_mb FROM pg_class WHERE reltuples > 0 ORDER BY reltuples DESC; ```