Frequently Asked Questions for Smart Contract Auditors#
General Questions#
Q1: What is the primary purpose of the Lilith Platform?#
The Lilith Platform enables creators to:
- Tokenize access to their content using ERC-1155 access tokens
- Issue unique content licenses as ERC-721 NFTs
- Receive automated royalty distributions
- Build on-chain reputation through identity staking
Q2: What are the main entry points for external calls?#
User-facing functions:
AccessToken.purchaseTokens()- Purchase access tokensContentLicenseNFT.issueLicense()- Mint content licenseCreatorRoyalties.withdrawRoyalty()- Claim pending royaltiesIdentityReputation.registerIdentity()- Register new identityIdentityReputation.stake()/unstake()- Manage stakes
Admin functions:
*.pause()/unpause()- Emergency controls*.transferOwnership()- Ownership transfer (two-step)*Upgradeable.upgradeToAndCall()- Contract upgradesAccessToken.updateTreasury()- Change fee recipientAccessToken.setPlatformFeePercentage()- Change fees
Oracle functions:
IdentityReputation.updateReputation()- Update scoresIdentityReputation.slashStake()- Slash bad actorsIdentityReputation.resolveChallenge()- Resolve disputes
Q3: How is ETH handled in the system?#
Inflows:
- Token purchases (
purchaseTokens{value: X}()) - Identity staking (
stake{value: X}())
Outflows:
- Creator withdrawals (
withdrawRoyalty()- pull pattern) - Pending payment claims (
claimPendingPayment()) - Stake unstaking (
unstake()) - Admin treasury withdrawal (
withdrawToTreasury())
Safety measures:
- ReentrancyGuard on all external call paths
- CEI (Checks-Effects-Interactions) pattern
- Pull payment pattern instead of push
Q4: What external dependencies exist?#
| Dependency | Usage |
|---|---|
| OpenZeppelin Contracts 5.x | ERC standards, access control, security |
| OpenZeppelin Upgradeable 5.x | UUPS upgrade pattern |
| Solidity 0.8.20+ | Native overflow protection |
No price oracles are used. Token prices are set by creators.
Q5: How are upgrades handled?#
- Pattern: UUPS (Universal Upgradeable Proxy Standard)
- Authorization: Only owner can initiate
- Timelock: 72 hours delay via TimelockController
- Process:
- Owner schedules upgrade
- 72-hour waiting period
- Community can review
- Owner executes upgrade
- Cancel possible during delay
Storage safety:
- Storage gap patterns in all contracts
- Initializer functions for state setup
- Storage layout compatibility testing
Security Questions#
Q6: How is reentrancy prevented?#
- ReentrancyGuard: Applied to all functions with external calls
- CEI Pattern: State changes before external calls
- Pull Payments: Users claim funds, not pushed
- No callbacks: ERC-1155 safe transfers with reentrancy guard
Example pattern:
function withdraw() external nonReentrant {
uint256 amount = pendingBalance[msg.sender]; // Check
pendingBalance[msg.sender] = 0; // Effect
(bool success,) = msg.sender.call{value: amount}(""); // Interaction
require(success, "Transfer failed");
}
Q7: How are flash loan attacks prevented?#
The FlashLoanGuard library tracks the last action block for each user:
mapping(address => uint256) private _lastActionBlock;
modifier flashLoanProtected() {
require(block.number > _lastActionBlock[msg.sender], "SameBlock");
_lastActionBlock[msg.sender] = block.number;
_;
}
Applied to:
- Token purchases
- License minting
- Staking operations
- Royalty claims
Q8: What access control model is used?#
Ownable2Step: Two-step ownership transfer
- Owner proposes new owner
- New owner must accept
- Prevents accidental transfers
Role-based for specific functions:
- PAUSER_ROLE: Pause/unpause
- ORACLE_ROLE: Reputation updates
- VERIFIER_ROLE: Content verification
Q9: How are funds protected in case of compromise?#
- Multi-sig ownership: 3/5 Gnosis Safe
- Timelock: 72h delay on critical operations
- Pause capability: Emergency stop
- Pull payments: Users control withdrawals
- No infinite approvals: Standard transfer patterns
- Monitoring: On-chain alerts for sensitive events
Q10: What happens if the owner key is compromised?#
Immediate impact:
- Attacker can pause contracts
- Attacker can change fees (bounded)
- Attacker cannot immediately upgrade (72h delay)
- Attacker cannot directly access user funds
Response:
- Alert on ownership transfer detected
- Cancel any scheduled operations
- Rotate keys via multi-sig
- Deploy patched contracts if needed
Economic Questions#
Q11: What are the fee structures?#
| Fee Type | Default | Maximum | Recipient |
|---|---|---|---|
| Platform fee | 2.5% | 10% | Treasury |
| Royalties | Creator-defined | 25% | Creator |
Fee calculation:
uint256 platformFee = amount * platformFeePercentage / 10000;
uint256 creatorAmount = amount - platformFee;
Q12: How are royalties distributed?#
- Marketplace calls
distributeRoyalty(tokenId, amount) - Platform fee deducted
- Net amount added to creator's pending balance
- Creator calls
withdrawRoyalty()to claim
Only authorized marketplaces can trigger distributions.
Q13: What is the staking mechanism?#
Purpose: Reputation collateral
Operations:
stake{value: amount}()- Add stakeunstake(amount)- Remove stake (with checks)slashStake(user, amount, reason)- Penalty (oracle only)
Constraints:
- Minimum stake: 0.01 ETH
- Cannot unstake below minimum while registered
- Slashing requires oracle authorization
Technical Questions#
Q14: What Solidity version and why?#
Version: 0.8.20+
Reasons:
- Native overflow/underflow protection
- Custom errors for gas efficiency
- Latest security patches
- UUPS pattern compatibility
Q15: Are there any known gas optimization opportunities?#
Yes, some areas identified:
- Batch operations could use unchecked loops
- Some storage reads could be cached
- Events could be more gas-efficient
Note: Security was prioritized over gas optimization.
Q16: How is randomness handled?#
No on-chain randomness is used.
All operations are deterministic based on:
- User inputs
- Block properties (number, timestamp)
- Contract state
Q17: What are the batch operation limits?#
| Operation | Recommended Limit | Gas Limit |
|---|---|---|
| Batch license mint | 100 | ~15M gas |
| Batch transfer | 50 | ~10M gas |
Limits enforced in contract to prevent DoS.
Testing Questions#
Q18: What testing has been done?#
- Unit tests: 100% function coverage
- Integration tests: Cross-contract interactions
- Security tests:
- Reentrancy scenarios
- Access control bypass attempts
- Flash loan attack simulations
- CEI pattern verification
- DoS resistance
- Fuzzing: Foundry fuzz tests on critical paths
- Invariant tests: Economic invariants verified
Q19: What static analysis tools were used?#
- Slither (static analyzer)
- Mythril (symbolic execution)
- Solhint (linting)
- Hardhat coverage
Q20: Is there a deployed testnet version?#
Yes, contracts are deployed on:
- Sepolia testnet
- Goerli testnet (deprecated, migrating)
Testnet addresses available in deployment artifacts.
Contact Information#
For questions during the audit:
- Technical Lead: [Contact via secure channel]
- Response Time: < 4 hours during business hours
- Secure Document Sharing: [Encrypted channel]
- Code Repository: Private GitHub (access provided)
Document Versions#
| Document | Version | Last Updated |
|---|---|---|
| Architecture | 1.0 | 2024-Q4 |
| Threat Model | 1.0 | 2024-Q4 |
| Trust Assumptions | 1.0 | 2024-Q4 |
| This FAQ | 1.0 | 2024-Q4 |