# Core contracts

The main Noderr contracts and their public functions. Addresses are in [Contract Addresses](./contract-addresses.md).

## Vaults

The user facing vaults are six per-tier vaults, built as EIP-2535 Diamonds that implement the ERC-7540 asynchronous tokenized vault standard.

- Deployed on Base Sepolia and holding seeded test funds.
- Denominated in tUSDC, the underlying asset, which is mintable through a public faucet.
- Two buckets per vault: a principal protected **Floor** bucket and a **Trading** bucket.
- No capital has been deployed to strategies yet.

### Fee model

Every vault charges a **0% management fee**. The only fee is a **performance fee**. It is assessed on the high-water mark (NAV per share above its prior peak). It is charged **only from the Trading bucket**, never from the principal protected Floor, and only on returns above a per-vault soft hurdle.

| Vault | Management fee | Performance fee | Soft hurdle |
|---|---|---|---|
| Conservative | 0% | 10% | 4% |
| Moderate | 0% | 10% | 6% |
| Aggressive | 0% | 15% | 8% |
| Hedged | 0% | 12% | 4% |
| Inverse | 0% | 15% | 8% |
| Configurable | 0% | 10% | 6% |
| Prediction Markets | 0% | 25% | 15% |

The Prediction Markets vault is planned and not yet deployed. Performance fees go to the protocol treasury wallet.

### Functions

Vaults follow the ERC-7540 asynchronous request → fulfill → claim lifecycle:

-   `requestDeposit(uint256 assets, address controller, address owner)`: Moves `assets` of tUSDC from `owner` into the vault as a pending deposit.
-   `claimDeposit(uint256 assets, address receiver, address controller)`: Mints shares to `receiver` once a keeper has fulfilled the deposit.
-   `requestRedeem(uint256 shares, address controller, address owner)`: Moves `shares` from `owner` into the vault as a pending redemption.
-   `claimRedeem(uint256 shares, address receiver, address controller)`: Sends tUSDC to `receiver` once a keeper has fulfilled the redemption.

The vaults have no `deposit`, `withdraw` or `claim()` function. See [Vault Contracts](./vault-contracts.md) for the full interface.

## StakingManager

-   `stake(uint256 amount)`: Stakes the specified amount of NODR tokens.
-   `unstake(uint256 amount)`: Initiates the unstaking of the specified amount of NODR tokens.
-   `claimRewards()`: Claims accumulated staking rewards.

## TrustFingerprint

-   `getScore(address user)`: Returns the TrustFingerprint score for the specified user.
-   `updateScore(address user, uint256 newScore)`: Updates the score for the specified user. Restricted to authorized scorer roles (e.g., `SCORER_ROLE`) held by Guardian/Oracle-tier operators.

## Governance

The onchain DAO contract handles node and oracle elections and protocol parameter votes. It is **not** the admin authority over the core contracts. Upgrade and admin authority sits with a 2-of-3 Gnosis Safe acting through a `MultiSigTimelock` with a 7-day delay. The timelock holds `DEFAULT_ADMIN` and `UPGRADER` over the core contracts. See [Governance](../governance/README.md).

-   `propose(...)`: Submits a new governance proposal.
-   `castVote(uint256 proposalId, bool support)`: Casts a vote on the specified proposal.
-   `execute(uint256 proposalId)`: Executes a passed proposal.

## NodeAdmissionController

`NodeAdmissionController` is a design for permissionless self registration. It is not deployed.

Today operators join by application. Once approved and paid for a tier, an operator receives an install token and runs the installer. See the [Node Setup Guide](../../node-operators/setup-guide.md). The deployed [Approved Applicant Registry](./approved-applicant-registry.md) records approved applicants.
