> For the complete documentation index, see [llms.txt](https://tunakings-organization.gitbook.io/tuna-rwa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tunakings-organization.gitbook.io/tuna-rwa-docs/core-architecture/smart-contracts.md).

# Smart Contracts

With the legal chassis in place, the next layer is code. Purpose-built smart contracts enforce the kg-per-token backing ratio, route revenues, and automate buy-backs—without manual intervention. Security audits and bug-bounties add a final defence-in-depth layer.

| Module             | Function                                                                                           | Risk Control                                                                                     |
| ------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **QuotaRegistry**  | Records the one-time mint and enforces the kg-per-token backing ratio.                             | Upgrade-locked after deployment; changes require a DAO super-majority.                           |
| **ESG Oracle**     | Ingests electronic logbook (e-log) and VMS data from AFMA; debits quota in real time.              | Pulls hashes from AFMA’s API; mismatch > 1 kg triggers auto-pause.                               |
| **DividendVault**  | Sweeps lease fees and fish-sale proceeds into the treasury; calculates Net Operating Income (NOI). | Multi-sig (3/5) with hardware keys; quarterly on-chain audit.                                    |
| **Buy-Back Bot**   | Converts ≥ 50 % of audited NOI into TUNA via DEX/CEX TWAP orders and burns them.                   | Rate limiter prevents > 2 % of 24 h volume per buy to avoid market impact.                       |
| **ComplianceList** | Stores whitelisted addresses and sanction lists.                                                   | Zero-knowledge proof integration planned to let users validate KYC status without revealing PII. |

All contracts undergo triple audit (Halborn + CertiK + Solana Foundation) and are covered by a US $250 k Immunefi bug-bounty programme.
