A decentralized finance wallet application with a Solidity smart contract backend and Rust API server.
- contract/ - Solidity smart contracts (Foundry project)
- backend/ - Rust API server (Axum)
- app/ - Frontend application
- migrations/ - Database migrations
In a terminal, start the Anvil local blockchain:
just run_rpcOr without just:
anvilAnvil will start on http://127.0.0.1:8545 with 10 pre-funded test accounts.
In a second terminal, deploy the Wallet contract to your local Anvil node:
just deployOr without just:
cd contract && forge script script/Wallet.s.sol:WalletScript \
--rpc-url http://127.0.0.1:8545 \
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--broadcastNote the deployed contract address from the output and update CONTRACT_ADDRESS in backend/.env if needed.
In a third terminal, start the Rust backend server:
just run_backendOr without just:
cd backend && cargo runThe backend will start on http://127.0.0.1:3000.
just build_contracts
# or: cd contract && forge buildRun contract tests:
just test_contracts
# or: cd contract && forge testRun backend tests:
just test_backend
# or: cd backend && cargo testThe main contract is Wallet.sol, which provides:
- Deposit ETH
- Withdraw ETH
- Transfer between accounts within the wallet
- Balance tracking per user
Backend configuration is in backend/.env:
RPC_ENDPOINT- Ethereum RPC endpoint (default: Anvil local node)CONTRACT_ADDRESS- Deployed Wallet contract addressSERVER_ADDRESS- Backend server addressDATABASE_URL- SQLite database path
See LICENSE file for details.