Platform smart contracts for Subnet 112 (Minotaur) — the Bittensor subnet for distributed intent execution.
This repository hosts the generic platform contracts that every Minotaur App (DexAggregator, DCA, etc.) inherits from. App-specific contracts live in subnet112/minotaur-apps.
| Contract | Role |
|---|---|
AppIntentBase.sol |
Abstract base every App inherits. Validator quorum verification, EIP-712 user-signature checks, ephemeral CREATE2 proxy execution, replay protection, platform-fee plumbing. |
EphemeralProxy.sol |
Single-use proxy deployed per intent execution. Isolates token state between unrelated orders. |
EIP712Verifier.sol |
EIP-712 typed-data hashing for IntentOrder and PlanApproval structs. Library, not deployed. |
ValidatorRegistry.sol |
On-chain registry of validator hotkeys and quorum settings. Apps query it to validate signatures. |
ChampionRegistry.sol |
On-chain attestation of champion solvers. Used as a trustless gate by the solver-repo's auto-merge GitHub Action. |
interfaces/ |
Lightweight interface ABIs for off-chain consumers and inheriting contracts. |
Dependencies (OpenZeppelin, forge-std, Uniswap V3 core/periphery) are tracked as
git submodules under lib/. Clone with --recursive, or fetch them after a
plain clone:
git clone --recursive https://github.com/subnet112/minotaur_contracts.git
# or, if you already cloned without --recursive:
git submodule update --init --recursive
# Build
forge build
# Run tests
forge test -vStandard Foundry layout — foundry.toml declares src, out, lib, and the
OZ + Uniswap remappings.
Apps in subnet112/minotaur-apps consume this repo as a Foundry dependency:
forge install subnet112/minotaur_contractsThen in Solidity:
import "minotaur_contracts/src/AppIntentBase.sol";
contract YourApp is AppIntentBase {
bytes4 public constant YOUR_INTENT_SELECTOR = bytes4(keccak256("yourIntent(...)"));
constructor(/* ... */) AppIntentBase(/* ... */) {
registeredIntents[YOUR_INTENT_SELECTOR] = true;
}
function _handleIntent(IntentOrder calldata o, ExecutionPlan calldata p)
internal override returns (uint256 score, bool valid)
{
if (o.intentSelector == YOUR_INTENT_SELECTOR) {
return _yourIntent(o, p);
}
revert("Unknown intent");
}
}_handleIntent is the only function an app must implement. The base class does the rest — signature verification, quorum check, proxy deployment, plan execution, scoring threshold gate.
Apps are deployed permissionlessly through the validator API rather than directly via forge create — the relayer pays gas, the developer pays nothing on-chain. See the main subnet repo for the deployment flow.
For the platform contracts themselves (ValidatorRegistry, ChampionRegistry), the deploy scripts under script/ cover the canonical chain set. These are run manually by the subnet operator at chain bring-up.
MIT — see LICENSE.