@1trillionsecurity/institutional-smart-account
v1.0.15
Published
ERC-4337 compatible multi-level sequential approval system for institutional blockchain accounts
Downloads
1,705
Maintainers
Readme
Multi-Level Sequential Approval System
ERC-4337 compatible multi-level sequential approval system for institutional blockchain accounts with amount-based routing, dynamic quorum, time-locked progression, and veto capability.
Features
- ERC-4337 Compatibility: Standard transaction format via EntryPoint
- Amount-Based Routing: Different approval paths based on transaction amount
- Dynamic Quorum: Per-level quorum requirements based on amount
- Time-Locked Progression: Configurable timelocks between approval levels
- Veto Capability: Any signer can deny a transaction at any level
- Privacy-Preserving: Signers only see their level, not other levels
- TypeScript SDK: Full-featured SDK for easy integration
- Comprehensive Tests: Unit, integration, security, and ERC-4337 tests
Project Structure
implementation/
├── contracts/ # Smart contracts
│ ├── core/ # Main contracts
│ ├── interfaces/ # Contract interfaces
│ └── libraries/ # Utility libraries
├── test/ # Test suite
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── 4337/ # ERC-4337 tests
│ ├── security/ # Security tests
│ └── helpers/ # Test utilities
├── sdk/ # TypeScript SDK
└── scripts/ # Deployment scriptsPrerequisites
- Node.js 18.x or higher
- npm
Installation
npm installUsage
Compile Contracts
npm run compileRun Tests
# Run all tests
npm test
# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:4337
npm run test:securityGenerate Coverage Report
npm run coverageThis generates a comprehensive coverage report for all Solidity contracts. The report includes:
- Line coverage
- Branch coverage
- Function coverage
- Statement coverage
Reports are generated in the coverage/ directory. Open coverage/index.html in a browser to view the detailed report.
Coverage Targets:
- Line Coverage: 95%+
- Branch Coverage: 90%+
- Function Coverage: 100%
- Critical Paths: 100%
Deploy Contracts
# Deploy to local network
npm run deploy:local
# Deploy to Sepolia testnet
npm run deploy:sepoliaDevelopment
This project uses:
- Hardhat for development environment
- TypeScript for type safety
- Ethers.js v6 for blockchain interaction
- OpenZeppelin Contracts v5 for security
- @account-abstraction/contracts for ERC-4337 support
SDK
A TypeScript SDK is included in the sdk/ directory. See SDK README for details.
Testing
# Run all tests
npm test
# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:4337
npm run test:security
# Generate coverage report
npm run coverageDeployment
# Deploy to local network
npm run deploy:local
# Deploy to Sepolia testnet
npm run deploy:sepoliaDocumentation
Contracts
- Contracts README - Contract overview and features
- Contract Architecture - System architecture and design
- Contract API Reference - Complete API documentation
SDK
- SDK README - SDK overview and quick start
- SDK Architecture - SDK design and patterns
- SDK API Documentation - SDK API reference
- SDK Integration Guide - Complete integration guide
- SDK Examples - Usage examples
Testing
- Testing Overview - Test suite structure and overview
- Testing Guide - Complete testing guide
- Test Helpers - Test utilities documentation
Other
- Implementation Plan - Complete technical specification
License
MIT
