Smart contracts for the Computing project by 10102, implemented in Solidity and managed with Hardhat. This repo includes source code, deployment scripts, and tests.
npm install
npx hardhat compile
npx hardhat testdev is the working branch. main is kept identical to dev — releases are cut by fast-forwarding dev onto main (no squash, no separate release(...) commit). A release is marked solely by an annotated CalVer tag (vYYYY.MM.DD, with .1, .2, … for additional same-day releases) on the release commit, plus a dated entry in CHANGELOG.md; push the tag and cut a GitHub Release from it.
This replaces the older squash-merge-with-release(...)-commit flow — main now matches dev 1:1, for simpler branch maintenance.
The Computing ecosystem is a modular suite of smart contracts organised around digital-asset legacy management. Users create "legacy" contracts that govern how their assets are distributed under configurable conditions (multisig, direct transfer, or timelock).
| Module | Purpose | Key Contracts |
|---|---|---|
| Common | Core factories and infrastructure | LegacyDeployer, LegacyFactory, EOALegacyFactory, Payment |
| Forwarding | Direct transfer legacies | TransferLegacyContractRouter, TransferLegacyEOAContractRouter |
| Inheritance | Multisig (Safe-based) legacies | MultisigLegacyContractRouter |
| Timelock | Delayed release of ERC-20/721/1155 assets | TimeLockRouter, TimeLockERC20, TimeLockERC721, TimeLockERC1155 |
| Premium | Subscription features and notifications | PremiumRegistry, PremiumSetting, PremiumReminderView |
| Term | EIP-712 Terms-of-Service verification | EIP712LegacyVerifier (VerifierTerm) |
| Whitelist | Token allowlisting for timelock swaps | TokenWhiteList |
- SafeGuard — Gnosis Safe Guard that tracks
lastTimestampTxsand enforces inactivity-trigger rules for Safe-based legacies. - LegacyDeployer — Create2 factory callable only by the three legacy routers; deploys per-user legacy contracts from deterministic salts.
- Payment — Central fee and withdrawal contract with WITHDRAWER/OPERATOR roles, claim-fee basis points, and ERC-20/ETH withdrawal.
- Banner — Configurable UI banner contract.
- Uniswap V2 — Token swaps within transfer legacy and timelock flows (router address per network in
config/external-addresses.ts). - Chainlink — Price feeds only (ETH/USD, USDT/USD, USDC/USD), consumed by
PremiumRegistryto price premium subscriptions. Chainlink Automation (keeper registry) and Functions were retired from the email-reminder path on 2026-06-02 (Phase B): email scheduling/delivery moved off-chain to a reminder-worker (Mailjet), driven byPremiumSettingemittingLegacyEmailNotifyRequestedwith timing read fromPremiumReminderView. The Automation/Mail proxies remain on mainnet but are inert. See CHANGELOG.md anddocs/plans/chainlink-email-retirement.md. - OpenZeppelin — Upgradeable contracts (UUPS proxies), access control, and standard token interfaces.
- Safe (Gnosis) — Smart-account wallets for multisig and transfer legacies.
npm installCreate a .env file in the root directory:
# Required for deployment
DEPLOYER_PRIVATE_KEY=your_private_key_here
# Required for contract verification
API_KEY_ETHERSCAN=your_etherscan_api_key_here
# Required for premium setup script
PK=your_private_key_here
RPC=your_rpc_url_hereConfigured in hardhat.config.ts:
| Network | Chain ID | Notes |
|---|---|---|
| hardhat | 31337 | Local dev network; supports mainnet fork via fork-block.json |
| localhost | 31337 | Local node (npx hardhat node) |
| sepolia | 11155111 | Public testnet |
| mainnet | 1 | Ethereum mainnet |
Solidity compiler: 0.8.20 (primary, via IR) and 0.8.22. Optimiser enabled with 200 runs.
npx hardhat compilenpx hardhat testActive test files:
EOALegacyClone.spec.ts— EIP-1167 EOA legacy clone flowsTransferEOARouterInitializers.spec.ts— EOA router initializationMultisigActivationTrigger.spec.ts— Multisig activation-trigger (uint128) pathPremiumRegistry.spec.ts— Premium registry (incl. SafeERC20 subscriptions)PremiumSettingNotify.spec.ts—LegacyEmailNotifyRequestedemit pathPremiumReminderView.spec.ts— Off-chain reminder due-window viewTimeLockRouter.test.ts— Timelock routerTimelockERC20.test.ts— Timelock ERC-20TokenWhiteList.test.ts— Token whitelistFormatUnits.spec.ts— Unit formatting library
Deployment uses hardhat-deploy with tag-based scripts and automatic dependency ordering. See docs/DEPLOY_DEPENDENCIES.md for the full dependency graph.
.envconfigured withDEPLOYER_PRIVATE_KEY- Deployer wallet funded with sufficient ETH for gas
- Network configuration verified in
hardhat.config.ts
# Deploy everything to a network (respects dependency order automatically)
npx hardhat deploy --network sepolia
# Deploy a specific contract by tag
npx hardhat deploy --network sepolia --tags PaymentIndependent (no dependencies)
Payment— Central fee contractEIP712LegacyVerifier— ToS signature verificationLegacyDeployer— Create2 legacy factoryBanner— UI bannerPremiumSetting— Premium configurationTimeLockRouter— Timelock routing
Note: The
PremiumMail*andPremiumAutomationManagerdeploy scripts (Chainlink Functions/Automation) were removed when the email path moved off-chain (Phase B, 2026-06-02).PremiumReminderViewis deployed standalone (no proxy) viascripts/deploy-premium-endstate.ts, not by a taggedhardhat-deployscript.
Dependent
TokenWhiteList— Depends on TestERC20PremiumRegistry— Depends on PremiumSetting, PaymentMultisigLegacyRouter— Depends on PremiumSetting, LegacyDeployer, EIP712LegacyVerifierTransferEOALegacyRouter— Depends on LegacyDeployer, PremiumSetting, EIP712LegacyVerifier, Payment
Note: The Safe-source
TransferLegacyRouterwas hard-sunset (v2026.05.18); its deploy script was removed. EOA and Multisig are the only live legacy creation paths. Wiring slots still passaddress(0)for the sunset router (seedeploy/init/0.set_up_legacy.ts).
TimelockERC20,TimelockERC721,TimelockERC1155— Depend on TimeLockRouterSetTimelockSwapRouter— Runs on any network with a Uniswap router configured (sepolia, mainnet); wires timelock contracts (setTimelock), sets token whitelist, configures Uniswap router, and adds USDC/USDT to the whitelist
npx hardhat verify --network <network-name> <contract-address> <constructor-args>Requires API_KEY_ETHERSCAN in .env. Sourcify verification is also enabled.
After deployment, generate contract addresses and ABIs for the UI app:
npm run sync-uiThis writes files to output/sync-ui/. Copy the contents into the UI repo so that configs/ and constants/ land under the UI's src/ directory.
After deploying all contracts, run setup scripts to wire contracts together:
npx hardhat run deploy/init/0.set_up_legacy.ts --network <network-name>
# Or: npm run set-up-legacy -- --network <network-name>Configures: EIP712LegacyVerifier, LegacyDeployer, MultisigLegacyRouter, TransferEOALegacyRouter, PremiumRegistry, and PremiumSetting (the sunset TransferLegacyRouter slot is wired to address(0)).
Premium wiring (PremiumSetting ↔ PremiumRegistry ↔ legacy routers) is handled by deploy/init/0.set_up_legacy.ts (PremiumSetting.setParams). The Chainlink-era deploy/init/2.set_up_reminder.ts reminder/automation/mail wiring script was removed when the email path moved off-chain (2026-06-02) — there is no longer a separate premium-reminder setup step on-chain, and the corresponding set-up-premium npm script has been removed. PremiumReminderView is deployed standalone via scripts/deploy-premium-endstate.ts.
Note: On sepolia and mainnet, timelock wiring (setTimelock, setTokenWhitelist, setUniswapRouter, and adding USDC/USDT to the whitelist) is handled automatically by the
SetTimelockSwapRouterdeploy script. It runs on any network with a Uniswap router configured inconfig/external-addresses.ts.
| Script | Description |
|---|---|
npm run compile |
Compile contracts |
npm test |
Run tests |
npm run node |
Start local Hardhat node (with mainnet fork) |
npm run node:fresh |
Start local Hardhat node (no fork) |
npm run deploy:local |
Deploy to localhost |
npm run deploy:sepolia |
Deploy to Sepolia |
npm run deploy:sepolia:fresh |
Deploy to Sepolia (reset all) |
npm run set-up-legacy |
Post-deploy legacy + premium wiring |
npm run sync-ui |
Generate UI config from deployments |
.
├── config/
│ └── external-addresses.ts # External contract addresses per network
├── contracts/
│ ├── SafeGuard.sol # Gnosis Safe Guard
│ ├── common/ # Deployer, Factory, Router base, Payment, Banner
│ ├── forwarding/ # Transfer legacy contracts and routers
│ ├── inheritance/ # Multisig legacy contracts and routers
│ ├── interfaces/ # All contract interfaces
│ ├── libraries/ # ArrayUtils, FormatUnits, NotifyLib, structs
│ ├── mock/ # Test mocks (ERC-20/721/1155, Uniswap, Chainlink)
│ ├── premium/ # Premium registry, settings, and reminder-due view
│ ├── term/ # EIP-712 ToS verifier
│ ├── timelock/ # Timelock router and token-type handlers
│ └── whitelist/ # Token whitelist for timelock swaps
├── deploy/
│ ├── init/ # Post-deployment setup scripts
│ ├── legacy/ # Legacy contract deploy scripts
│ ├── premium/ # Premium contract deploy scripts
│ └── timelock/ # Timelock contract deploy scripts
├── deployments/ # hardhat-deploy artefacts (per network)
├── docs/ # Architecture docs and deployment plans
├── output/sync-ui/ # Generated UI config (ABIs + addresses)
├── scripts/ # Utility and upgrade scripts
├── test/ # Hardhat test suite
├── contract-addresses.json # Deployed contract addresses (all networks)
├── hardhat.config.ts
├── slither.config.json # Slither static analysis config
└── compiler_config.json # Solidity compiler config
- CHANGELOG.md — Per-release narrative of what each deploy actually ships on-chain
- CONTRACTS_REFERENCE.md — Detailed reference for every deployed contract
- DEPLOY_DEPENDENCIES.md — Deploy script dependency graph and resume behaviour
- SECURITY.md — Vulnerability reporting policy
Releases on main are squash-merges of dev with a release: prefix.
The commit message on main is mechanical; the narrative lives in
CHANGELOG.md.
For every release:
- Draft the
CHANGELOG.mdentry first — headline the on-chain behavior or cost change that matters, not the file list. - Send the draft to the maintainer for sign-off before
squash-merging. The commit on
mainand theCHANGELOG.mdentry should land together in the same squash. - Mainnet deploys that ship from
devahead of a main-branch release (as with the EIP-1167 cutover) get their own[Unreleased on main — already live on mainnet]entry inCHANGELOG.mdso the on-chain story stays in sync with what users see. - Frontend-side changes get their entry in
computing/CHANGELOG.md, not here. Cross-reference when the contract and frontend stories are coupled.
- Keep private keys and
.envfiles out of version control. - Always test on testnets before deploying to mainnet.
- Treat contract upgrades and admin keys as production-critical.
- Report vulnerabilities to security@10102.io (see SECURITY.md).
IMPORTANT: The smart contracts in this repository are provided "as is", without warranty of any kind, express or implied.
Financial Risk: Interacting with smart contracts involves inherent risks, including but not limited to technical vulnerabilities, bugs, and permanent loss of funds. No Liability: In no event shall 10102 or the contributors be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
Copyright (c) 2026 10102.io - All rights reserved.
This software and associated documentation files are not licensed under any open-source licence. No part of this repository may be copied, modified, distributed, or used for commercial purposes without the express written permission of the copyright holder.