Smart Contracts
Doga is composed of eight contracts on Base mainnet. Seven sit
behind ERC1967 proxies and are upgradeable; one (Roles) is the root
of trust and is intentionally non-upgradeable.
| Contract | Address | What it does |
|---|---|---|
| LendingCore | 0x0610a09af09c4f6feb2b145cea3d5da1feb3636b | The composer. Holds collateral, tracks debt, runs deposit/borrow/repay/liquidate/capital-deployment. Every user action enters here. |
| CollateralRegistry | 0x0cdc1459479fff3758106ac1fde9ccbb2a74b504 | Whitelist + risk parameters per collateral token (LTV, liquidation threshold, penalty, oracle staleness). |
| FiatCurrencyRegistry | 0xb5e62acb608784ae3f21ab1c8e62ea7b15de4816 | Per-currency APR, LTV cap, debt ceiling, and the cumulative interest index. |
| BorrowerAllowlist | 0xe25fce794e37c00017bdc3771e0296d6b8a7dca9 | Per-currency KYC list + per-user country code. |
| CryptoPriceOracle | 0xe1971fe423d6d58e4948094ca6e6f7a0d28c1b69 | Chainlink wrapper, normalises every feed to 8-decimal USD. |
| FxOracle | 0x400a21abf720de5a28bc9a57d45b374d3b59eeac | EIP-712 signed-push oracle for KES/NGN/GHS. ≥ 2 of 3 signers per update. |
| Treasury | 0x5695924fac66b0620fa94585fa4c169eb61c5dff | USDC repayments, liquidation penalties, withdrawal fees, bad-debt accounting. |
| Roles | 0x8e1164b25766b0442b74bb5e02aa9fa97df4e815 | OpenZeppelin AccessControl with 9 named roles. The single source of truth for permissions. |
USDC on Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) is the
universal settlement asset.
Calling contracts
You can integrate against Doga at three layers:
- Direct contract calls (this section). Send transactions to
LendingCoreetc. with your own viem/ethers/Foundry setup. Maximum control, you handle ABI encoding. - REST API (next section). The API encodes calldata for you and exposes every read. Same on-chain semantics, less typing.
- MCP server (last section). For AI agents.
Reading the per-contract pages
Every contract page in this section follows the same shape:
- Address + responsibility at the top.
- Storage shape so you know what state is live.
- Per-function reference with: signature, semantics, computation pseudo-code, reverts table, events emitted, runnable example.
- Worked example at the end of each function group.
Standard reverts
All Doga contracts use custom errors rather than revert strings. You'll see these signatures in failed transaction traces:
| Selector | Error | Means |
|---|---|---|
0x82b42900 | Unauthorized(address caller, bytes32 role) | Caller doesn't hold the required role. |
0x1f2a2005 | ZeroAmount() | An amount argument was 0 where the contract requires > 0. |
0xd92e233d | ZeroAddress() | An address argument was the zero address. |
| (per contract) | Paused() | The relevant pause flag is set. |
| (per contract) | NotFound(...) / AlreadyExists(...) | Registry lookup failure. |
Decode them with cast 4byte 0x82b42900 or by referencing the per-contract pages.