Frequently asked questions about the SmartBrain platform.
- General
- Installation & Setup
- Smart Functions
- Orval DB
- Documentation Engine
- Bots & Subscriptions
- Multi-Chain Support
- CI/CD & Workflows
- Security
SmartBrain is an AI/ML engine and automation platform for smart contract development. It combines model training, inference, automated auditing, multi-chain deployment, and an AI brain memory system (Orval DB) into one cohesive platform.
SmartBrain supports: Ethereum (Mainnet, Sepolia, Goerli), Polygon (PoS, zkEVM), Solana (Mainnet-beta, Devnet, Testnet), Binance Smart Chain, Avalanche (C-Chain), Arbitrum, Optimism, Base, and Cosmos SDK chains (Beta).
Yes. SmartBrain is licensed under the Apache License 2.0.
Node.js v16 or higher is required. Node.js v20 is recommended for best compatibility.
git clone https://github.com/SolanaRemix/SmartBrain.git
cd SmartBrain
npm install
cp .env.example .env
# Edit .env with your configuration
./scripts/bootstrap.shThe minimum required variables are:
STRIPE_SECRET_KEY— Stripe secret API keySTRIPE_WEBHOOK_SECRET— Stripe webhook signing secret
Optional but recommended:
GITHUB_TOKEN— For GitHub API accessINFURA_KEYorALCHEMY_KEY— For Ethereum deploymentsSOLANA_RPC_URL— For Solana deployments
See .env.example for the full list.
chmod +x scripts/bootstrap.sh
./scripts/bootstrap.shSmart Functions are AI helper modules (src/smart-functions/) that provide:
- AutoAnalyzer — Analyzes smart contracts for patterns and complexity
- AutoFixer — Suggests and applies automated fixes
- AutoTestGenerator — Generates test scaffolding from ABIs
- AutoSync — Syncs configs and documentation across the ecosystem
- SmartSuggest — AI-powered contextual code recommendations
npm run smart:analyzeOr use it programmatically:
const { AutoAnalyzer } = require('./src/smart-functions');
const analyzer = new AutoAnalyzer();
const result = analyzer.analyze(contractSourceCode, 'MyContract');
console.log(result);const { AutoTestGenerator } = require('./src/smart-functions');
const generator = new AutoTestGenerator({ framework: 'jest' });
const result = generator.generateTests(abi, 'MyContract');
console.log(result.data.testCode);Orval DB is a virtual in-memory database system (src/orval-db/) that powers SmartBrain's AI memory. It stores learned patterns from contract analysis, maintains a knowledge graph, tracks audit history, and supports snapshot/restore persistence.
npm run brain:statusBy default, Orval DB is in-memory only. Use the Persistence class to save and load state:
const { createOrvalDb } = require('./src/orval-db');
const { brain, persistence } = createOrvalDb({
persistence: { filePath: './orval-db.json', autoSaveIntervalMs: 60000 }
});
// Load on startup
const loaded = persistence.load();
if (loaded.data) brain.restore(loaded.data);
// Save on shutdown
persistence.save(brain.snapshot());Memory decay is an optional TTL (time-to-live) setting that automatically expires old memories. Set memoryDecayMs when creating a VirtualBrain:
const brain = new VirtualBrain({ memoryDecayMs: 86400000 }); // 24 hoursThe docs engine (src/docs-engine/auto-updater.js) automatically scans the codebase for JSDoc comments and documentation files, then reports freshness scores to help keep documentation up to date.
npm run docs:scanCreate a docs-engine.config.json at the project root:
{
"includeDirs": ["src", "bots", "docs"],
"docExtensions": [".md"],
"codeExtensions": [".js"],
"stalenessThresholdDays": 30
}See SELF_UPDATING_DOCS.md for full configuration options.
- @SmartContractDeploy ($9/month) — Multi-chain smart contract deployment
- @SmartContractAudit ($4/month) — Automated security auditing
- Set up your Stripe account and create subscription products
- Configure
.envwith your Stripe keys and Price IDs - Start the bots with
npm startornpm run deploy-bot/npm run audit-bot - Use the bot's subscription endpoint to create customer subscriptions
Yes, subscriptions can be cancelled at any time through the Stripe customer portal. Access is revoked at the end of the billing period.
Yes — configure a 14-day free trial in your Stripe Dashboard when setting up the subscription products.
# Set the RPC URL
SOLANA_RPC_URL=https://api.devnet.solana.com
# Deploy using the deploy bot or sync script
./sync_deploy.sh deploy-bot "@SmartContractDeploy" "deploy"Set the ETHERSCAN_API_KEY environment variable and use the deploy bot's verification feature. The bot will automatically submit source code for verification after deployment.
- CI (
ci.yml) — Runs tests on Node.js 16, 18, and 20 - Lint (
lint.yml) — Runs ESLint and Prettier checks - CodeQL (
codeql.yml) — Security analysis - Model Validate (
model-validate.yml) — Validates model metadata - Release (
release.yml) — Semantic release automation
Run npm run lint locally to see the errors, then fix them manually or with npm run lint:fix. See TROUBLESHOOTING.md for details.
Go to GitHub Repository → Settings → Secrets and variables → Actions and add:
CODECOV_TOKEN— For coverage reporting (optional)STRIPE_SECRET_KEY— If running integration tests- Any other secrets referenced in workflows
Email security@smartbrain.dev directly. Do not open a public GitHub issue for security vulnerabilities. See SECURITY.md for our full security policy.
Yes. API keys are stored only in environment variables and never committed to source control. Use .env locally and GitHub Secrets for CI/CD.
Yes. The @SmartBrain automation bot includes a private key leak scanner that flags accidental exposure of wallet credentials in code.
See also: Troubleshooting Guide | Complete Documentation