ποΈ System Architecture
Overview
SEAL360 is built on a multi-layer architecture designed for security, scalability, and decentralization.
Technology Stack
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PRESENTATION LAYER β
β π Frontend: Next.js 14 + React 18 + TailwindCSS β
β π± Mobile: React Native (roadmap 2027) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APPLICATION LAYER (dApp) β
β π Web3: ethers.js v6 + wagmi + RainbowKit β
β π Auth: Supabase Auth + wallet connection β
β π State: Zustand + React Query β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND / API LAYER β
β β‘ API Routes: Next.js API + Edge Functions β
β ποΈ Database: Supabase (PostgreSQL 15) β
β π Webhooks: Alchemy Notify + Custom indexer β
β π§ Email: Resend (transactional emails) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BLOCKCHAIN LAYER (Avalanche C-Chain) β
β π Smart Contracts: Solidity 0.8.28 β
β ποΈ Framework: Hardhat + Foundry β
β π Testing: 753 Hardhat + 181 Foundry + 12 Echidna + 4 Manticore = 950 tests β
β π‘οΈ Security: Slither + Manual Review β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INFRASTRUCTURE LAYER β
β βοΈ Hosting: Vercel (frontend) + AWS (nodes) β
β π RPC: Alchemy (primary) + Infura (backup) β
β π¦ Storage: IPFS (metadata) + Arweave (audit reports) β
β π Analytics: Dune Analytics + Custom dashboard β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββSmart Contract Ecosystem
15 Production Contracts
SEAL360 Smart Contract Ecosystem
β
ββββ π¦ CORE (3 contracts)
β ββ SEAL360Token.sol β ERC-20 + Flash Loans + Voting
β ββ S360StakingRewards.sol β Staking with dynamic APY
β ββ S360FeeDistribution.sol β 3-way fee splitter (33/33/34%)
β
ββββ ποΈ GOVERNANCE (5 contracts)
β ββ S360Governor.sol β OpenZeppelin Governor
β ββ S360TimelockController.sol β 48h timelock
β ββ S360MultiSigTimelock.sol β multisig β₯60% (ej.: 3/5 o 4/7) para emergencias
β ββ S360Treasury.sol β DAO-controlled treasury
β ββ OwnershipMigrationHelper.sol β Safe ownership transfer
β
ββββ πΉ PERIPHERY (4 contracts)
β ββ S360BondingCurve.sol β Bancor price discovery
β ββ S360BondingCurveDynamic.sol β Dynamic pricing v2
β ββ S360Vesting.sol β Linear vesting with cliff
β ββ S360TimeVaultRND.sol β 5-year R&D lockup
β
ββββ ποΈ BADGES (1 contract)
β ββ S360AchievementBadges.sol β NFT certification badges
β
ββββ π° GROWTH (2 contracts)
ββ S360GrowthFund.sol β Marketing & expansion fund
ββ S360Launchpad.sol β IDO platform (roadmap)Total Statistics:
- 15 production contracts
- 6 mock contracts (testing only)
- 5,009 lines of Solidity code
- 950 automated tests
- Coverage: 61.22% overall / 84.41% core contracts
Contract Dependencies
Key Relationships
-
SEAL360Token β All Contracts
The token is the center - all contracts reference it -
FeeDistribution β 3 Destinations
Splits fees to: Treasury (33.33%), Stakers (33.33%), Growth (33.34%) -
Governor β Timelock β Treasury
Chain of command for governance decisions -
BondingCurve β FeeDistribution
Trading fees flow into the distribution system
Security Architecture
Defense in Depth (7 Layers)
LAYER 7: Post-Launch Monitoring
ββ Alchemy Notify + Dune Analytics
β
LAYER 6: Access Control
ββ Ownable2Step + Role-Based Access
β
LAYER 5: Circuit Breakers
ββ Pausable + Emergency Multisig
β
LAYER 4: Rate Limiting
ββ Flash Loan Limits + Per-TX Caps
β
LAYER 3: Reentrancy Protection
ββ ReentrancyGuard on 22 functions
β
LAYER 2: Input Validation
ββ require() + custom errors
β
LAYER 1: Audits + Tests
ββ Slither + 950 tests passingProtection Mechanisms
| Layer | Mechanism | Coverage |
|---|---|---|
| Reentrancy | ReentrancyGuard | 22 functions |
| Access Control | Ownable2Step | 13 contracts |
| Emergency Stop | Pausable | 6 contracts |
| Rate Limiting | Per-TX caps | All trading |
| Flash Loans | 0.09% fee + 1.08M limit | SEAL360Token |
| Governance | 48h timelock | All proposals |
| Multisig | β₯60% signers (ej.: 3/5 o 4/7) | Solo emergencias |
Data Flow
Transaction Lifecycle
USER β WALLET β RPC β BLOCKCHAIN β INDEXER β DATABASE β FRONTEND
β β β β β β β
[Sign] [MetaMask] [Alchemy] [Avalanche] [Webhook] [Supabase] [UI]Step by Step:
- User initiates (e.g., stake 10,000 S360)
- Wallet signs transaction
- RPC broadcasts to Avalanche
- Smart contract executes logic
- Event emitted on-chain
- Indexer captures via webhook
- Database updates user stats
- Frontend refreshes (real-time)
Total Time: < 3 seconds
Gas Cost: ~$0.02 AVAX
Fee Distribution Flow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FEE COLLECTION SOURCES β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. Bonding Curve (2% per trade) β
β 2. Flash Loans (0.09% per loan) β
β 3. Launchpad (5% commission) β
β 4. Audit Services (50% in S360) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β S360FeeDistribution.sol β
β (Automated 3-Way Splitter) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββ
β β β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β TREASURY β β STAKERS β β GROWTH FUND β
β 33.33% β β 33.33% β β 33.34% β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β β
Governance Passive Income Marketing
Operations for Holders + ExpansionMathematical Precision
No token loss due to rounding:
// Example: 100.000000000000000007 S360
uint256 toTreasury = (amount * 3333) / 10000; // 33.330...002
uint256 toStakers = (amount * 3333) / 10000; // 33.330...002
uint256 toGrowth = amount - toTreasury - toStakers; // Remainder
// Total = 100.000000000000000007 β
(exact match, 0 loss)Tested in: SecurityCritical.v3.3.2.test.cjs β TEST 6 (v2.4.0)
Network Configuration
Avalanche C-Chain (Mainnet)
{
chainId: 43114,
name: "Avalanche C-Chain",
rpcUrl: "https://api.avax.network/ext/bc/C/rpc",
explorer: "https://snowtrace.io",
nativeCurrency: {
name: "Avalanche",
symbol: "AVAX",
decimals: 18
}
}Fuji Testnet
{
chainId: 43113,
name: "Avalanche Fuji Testnet",
rpcUrl: "https://api.avax-test.network/ext/bc/C/rpc",
explorer: "https://testnet.snowtrace.io",
faucet: "https://faucet.avax.network"
}Why Avalanche?
| Feature | Avalanche | Ethereum | BNB Chain |
|---|---|---|---|
| Finality | < 1 second | 12-15 seconds | 3 seconds |
| Gas Cost | ~$0.01 | $5-50 | $0.10-1 |
| TPS | 4,500+ | 15-30 | 300+ |
| EVM Compatible | β Yes | β Native | β Yes |
| Subnet Capability | β Yes | β No | β No |
Decision: Avalanche provides 10x faster transactions and 100x lower costs than Ethereum, while maintaining full EVM compatibility.