Skip to content

Security: autonet-code/governance

Security

docs/security.md

Security Model

Threats the suite is designed against, the mitigation for each, and where it lives in code. Each row was checked against the current source. API details are in technical-reference.md; Autonet trust assumptions are in autonet.md.

An internal audit and a test plan exist; both are kept private.

Threats and mitigations

Governance

Threat Mitigation Where
Vote buying RepToken is non-transferable: transfer/transferFrom always revert, and JurisdictionFactory makes no other token, so a direct factory call can't get around it RepToken.sol, JurisdictionFactory
Flash-loan voting Voting power is read at the proposal snapshot (getPastVotes, timestamp clock). Reward epochs use the snapshot one second before the epoch starts OZ Governor, RepToken.rewardOf
Malicious proposal Every action runs through TimelockController with a minimum delay; only the governor holds PROPOSER_ROLE JurisdictionFactory.finalize, Dao.sol
Factory keeps control finalize hands token admin and Registry owner to the timelock and revokes the factory's DEFAULT_ADMIN_ROLE on the timelock in the same transaction that attaches the modules. The Registry has no wrapper JurisdictionFactory.finalize
Deployment hijack (someone finalizes a half-deployed core with their own modules, keys or governor) deployCore records the pending core under its Registry, bound to msg.sender. finalize requires the caller to be that originator (NotOriginator) and all four core addresses to match (WrongCore); each module must be prepared for that core JurisdictionFactory.finalize; test/security.test.js "JurisdictionFactory deployment binding"
Clone initialization hijack (someone initializes a DAO's or a module's contract first, or initializes an implementation) Core and module contracts are EIP-1167 clones, each initialized in the transaction that creates it (JurisdictionFactory.deployCore, the setups' prepareInstallation, CloneMaker.cloneAndCall in scripts); initializer refuses a second call, and every implementation's constructor calls _disableInitializers(). Clones have no admin and no upgrade path test/core-clones.test.js
Malicious module Only setups published in ModuleCatalog attach (NotPublished); finalize executes a module's actions only against that DAO's own token and Registry (ForeignTarget); after origination every grant is listed in the attach proposal. The catalog curator and repo maintainers are the trust root ModuleProcessor.checkInstall, JurisdictionFactory.finalize; modules.md
Economy admin outlives setup onlyGovernance accepts admin only while timelockAddress == 0. setDaoAddresses can run once and requires a non-zero timelock; EconomySetup calls it in the same transaction that clones and initializes the Economy, so afterwards only the timelock can configure. transferAdmin is disabled once the timelock is set Economy.sol, EconomySetup; test/security.test.js "hands a prepared economy to the timelock in the same transaction"
Minting outside governance RepToken.mint requires admin (the timelock) or an explicit minters entry, which only the admin or timelock can grant. RepToken has no built-in Economy path: economy REP comes from the EconomyRepClaim minter granted when the module attaches RepToken.setMinter
Treasury drained by a captured vote Optional per-token rolling-window spend cap on transferETH, transferERC20 and disburseEarmarked (fixed window: worst case 2x the cap across a boundary) Registry._meterSpend; test/treasury-spend-guard.test.js
Reward budget overspent or reused Epoch budgets are earmarked in the Registry when the epoch starts; earmarks cannot exceed unreserved balance and ordinary transfers cannot touch reserved funds; each account claims once per epoch Registry.earmarkFunds, _requireUnreserved, RepToken.claimReward
Sybil delegation for rewards Not guarded on chain, by design: a member can delegate to their own second wallet and earn from both pools. Each jurisdiction handles it through its code of conduct and REP burns by constitutional proposal. Delegates are paid only for weight received from others, above the bar; an Autonet operator's owner delegating to it counts as the household's own RepToken.rewardOf

Trustless economy

Threat Mitigation Where
Contractor signs before the DAO can react Anyone (the indexer on ProposalCreated) registers a live veto proposal on the project with registerDaoProposal before cooling-off ends, checked against the Governor's hashProposal; signContract reverts until the proposal could last land (its deadline, a day to queue, the timelock delay, a day to execute), so a stalled DAO can't hold forever and no number of filings blocks another. Cooling-off is never below minCoolingOffPeriod, fixed before the hand-over DaoProposalHold, projects registerDaoProposal, signContract; Economy.setMinCoolingOffPeriod; test/dao-proposal-hold.test.js
Reputation minted before anyone can object The only payment a project makes outside the dispute window is the immediate portion at signing, and it earns nobody reputation (and pays no platform fee). All REP from projects therefore waits a dispute window, during which a veto proposal holds the payout. Funding, signing and giving the work up mints nothing ProjectBase.signContract, spentBy; test/security.test.js "Reputation farming"
Wash trading for free reputation Every reputation-accruing payout pays the platform fee to the treasury first, rounded up, so no payout is too small to pay it. setPlatformFee enforces a floor MIN_PLATFORM_FEE_BPS = 100 (1%) and a ceiling of 5000 (50%), so REP always has a price. EconomySetup goes through the same setter Economy.setPlatformFee, _payWithFees; test/security.test.js "Reputation farming"
Bad arbitration Ruling enters Appealable; the DAO overrules by proposal. An overrule registered inside the appeal window holds finalizeArbitration until it could last land and lands even after the window. Registration verifies the proposal with hashProposal and state, so caller-supplied data can't fake one; the project keeps only the latest end, so there is no list to fill or loop over. ToolBond holds a round the same way, for an overrule naming that round. Court verdicts can't hold, so the court's window is floored at a proposal lifecycle plus two days projects and ToolBond registerDaoProposal, daoOverrule; ProposalLifecycle.appealWindow (ContentCourt)
Outcome depending on who calls first Where the clock alone decides a step (the duration ending, the dispute window closing, the arbiter's time running out, a ruling passing its appeal period), anyone can take it, and withdrawals, the DAO's veto and its overrule first bring the project to where the clock put it. A veto or an overrule can't land on a project that had already run its course because nobody happened to call the close ProjectBase._advance; test/project-clock.test.js
Absent arbiter After arbitrationDeadline (the project's arbitrationTimeout, default 30 days, counted from the contest), anyone can close the project: the disputed shares and both sides' deposits go back, unless a DAO proposal registered before the deadline still holds it, so the close can't front-run an overrule; when the DAO rules in a silent arbiter's place the fee goes to the treasury arbitrationPeriodExpired, _finalizeDispute
Harmful project The timelock can daoVeto any non-closed project; backers get back what the project still holds for them (everything before the dispute window has closed, the disputed shares after it, and immediate funds if unsigned), less the platform fee, which goes to the treasury so frivolous projects cost something. A veto proposal registered while the work is ongoing or during the dispute window holds the payout until it could last land daoVeto, _contributionExit, registerDaoProposal
Escrow released by money the contractor controls There is no vote over the escrow. Each backer decides for their own share: one who disputes inside the dispute window keeps it out of the payout, and the contractor is paid only what nobody disputed, or what an arbiter awards. Funding a project from many addresses buys the contractor nothing but their own money back, less fees dispute, _settleReview; test/project-sequence.test.js "One backer's vote decides one backer's money"
Terms changed after money is committed A project copies the fees and periods when its parties are named and runs on that copy. A later vote can't raise the fee on a project and then veto it, shorten the arbiter's time to nothing, or close the appeal period on a dispute under way ProjectBase.terms, _fixTerms; test/project-sequence.test.js "Terms are fixed when the parties are named"
Contractor never delivers Every project has a maximum duration, set by its author when naming the parties. After it the contractor can no longer declare the work done and anyone closes the project: backers take their money back deadline, closeExpired
Disputing as a free option A backer who disputes deposits the arbiter fee for their share, and the contractor matches it to contest. The fee is divided the way the ruling divides the shares, so disputing work that was delivered costs the backer the deposit, and contesting a justified dispute costs the contractor theirs dispute, contest, _finalizeDispute
Fake ledger writes updateEarnings, updateSpendings, registerBacker, registerProjectRoles accept calls only from clones the Economy deployed (isProjectContract) Economy.sol
Reward claims cut short Jurisdiction earmarks (reward epochs) cannot be released with withdrawEarmarkedFunds; only reclaimEarmarkedFunds, after the epoch's grace period, fixed when it started and at least 30 days Registry.rewardEarmark
A treasury that can't be paid The treasury is paid like every other payee: if the transfer fails (a token that blocklists the Registry), the fee is credited to owed and anyone can send it later with payOwed, so the parties' payouts never wait on it. An Economy can't be handed to a DAO with no treasury ProjectBase._pay, payOwed; Economy.setDaoAddresses
Claim too large to make The REP claim reads spending project by project and can be made in ranges (claimRange), so a member who backed more projects than one transaction can read still claims; earnings are read per token EconomyRepClaim.claimRange, Economy.backedSpendings
Double withdrawal Contractor payout is zeroed before transfer; backers are marked contributorSettled; deposits come back once, inside those two paths (the contractor's is sent when the project closes) projects
Non-standard ERC20s (no return value) Registry, Economy, ERC20Project, ToolBond use SafeERC20 see caveats; test/tool-bond.test.js (NoReturnToken)
Reentrancy Registry (transferETH, transferERC20, disburseEarmarked) and every ToolBond function that moves tokens (bond, addBounty, withdraw, claim, payOut, payOutTo, payTreasury) are nonReentrant. Project clones have no guard and follow checks-effects-interactions

Autonet satellites

Threat Mitigation Where
A frozen or paused token blocking a verdict No ToolBond verdict calls a token: slashed stakes are owed to the treasury and paid by payTreasury. Review claims and withdraws pay with a transfer that may fail without reverting, keeping a failed amount owed for payOut or payTreasury (payOutTo sends an account's own owed amount to another address it names), so a token that freezes an account holds up only that payment ToolBond; test/tool-bond.test.js (PausableToken)
REP from a wrong or captured anchor A claim's REP value is computed by the Substrate from its token amounts, which are capped by the fees each pool collected, at the parities stored when the epoch was anchored; nothing in the anchored leaf sets it Substrate (autonet repo), AutonetRepClaim
Parity mispricing Parity is a Registry key editable only by a constitutional proposal. A tool bond keeps the value it was posted at, so a parity edit can't unbond existing tools; the cost is that a token that later loses its real value still backs its tools at the old value (the DAO's remedy is designate) Registry, ToolBond.bond
REP double count AutonetRepClaim mints only the delta over a per-agent watermark on monotonic Substrate ledgers; EconomyRepClaim likewise per user and token claimedEarnings (both), EconomyRepClaim.claimedSpendings
Malicious tool The framework rates tools, it doesn't contain them: each household decides from the ratings. Epoch reviews are committed hidden and weighed by REP at the epoch's start, so REP can't be gathered mid-review and nobody can copy a tally; withheld batches lose their REP penalty. Once the anchored close names a tool concluded, more than half the reviewing REP saying malware slashes that share of the author's bond to the treasury and burns that share of their REP at once; the DAO can clear any verdict by ordinary proposal (the burned REP goes back, the treasury repays the bond) or designate any bonded tool malware (its whole bond to the treasury); the bond can't be withdrawn while more than half the reviewing REP says malware before the tool concludes; slashes move bond tokens and REP and never create them ToolBond, RepToken.slash/reassign

Known caveats

  • Fee-on-transfer tokens are refused: projects check the amount received on funding and deposits, and ToolBond and the Substrate require the exact amount to arrive (ShortReceipt).
  • Standard DAOs created by factory builds that passed address(this) as the RepToken timelock (including standard DAOs created on Shadownet before the 2026-10-12 redeploy) cannot call startPassiveEpoch, startDelegateEpoch or setDelegateBar. JurisdictionFactory passes the real timelock for every DAO; economy DAOs were never affected. See technical-reference.md.
  • DAOs created by the old standard factories (the live Shadownet suite) have the factory as their Registry wrapper and so it keeps registry edit rights; the factory exposes no function that uses them after deployment. JurisdictionFactory sets no wrapper.
  • Timelock delay can be configured to zero (test networks do this), which removes the review window between a passed proposal and its execution.
  • Holds depend on someone registering the proposal inside its window. If the indexer is down and nobody calls registerDaoProposal, a contractor can sign once cooling-off ends, the undisputed shares can be paid once the dispute window closes, or a ruling can finalize once the window closes, before the vote does. The indexer registers on projects only; ToolBond overrules need someone to register them.
  • Once anyone registers a proposal, the hold lasts until it could last land even if it fails early, so any member able to propose can delay a signing, a payout or a finalization by one proposal lifecycle and two days. Accepted, since the alternative (a list) lets filings block a real appeal or cost unbounded gas.
  • The hold is fixed from the proposal and the timelock delay at registration. A later rise in the timelock delay before the proposal is queued can let finalization open before it lands.
  • Arming or lowering a spend cap is an ordinary vote, so a simple majority can set a token's cap to 1 and freeze its treasury transfers and reward claims, and only the supermajority can raise it again. Accepted: tightening must stay quick, and the freeze moves no funds.
  • A leaked agent key, while still live, can commit a large review batch and never reveal it, and the forfeit burns its household's REP. Accepted as the household's own risk (it revokes the key); the DAO can restore REP by proposal (burn and mint).
  • A detach proposal that passed but was never queued can still run after the same installation is detached and attached again: the modules.<name> marker carries no attachment count. Low impact (the DAO voted for that detach); a count in the marker would change the format werule and the indexer read.
  • A coordinated simple majority can raise itself to the supermajority. Its members create projects in which they are author, contractor and backer, are paid their own money back and claim REP for both the earning and the spending; no veto against them can pass, and they can vote the platform fees back out of the treasury. The supermajority threshold slows a majority and makes it visible, it doesn't stop one: every round is public and waits out the dispute window (the immediate portions earn no REP), and the constitutional proposal still takes its voting period and the timelock delay. What the path costs is set by three settings: jurisdiction.economy.rep_rate_bps (REP per unit of value, constitutional), the platform fee, and the treasury's spend caps (raising one is constitutional), which decide whether the fees can be voted back. With the defaults (full rate, no caps) it costs only gas. Accepted: a jurisdiction is ultimately ruled by its majority, and a minority that disagrees can leave and fork.
  • A share nobody disputes is paid. A contractor can declare the work done without having done it and collect the shares of every backer who doesn't dispute inside the dispute window. The window (a jurisdiction setting, fixed per project when the parties are named) is the backers' whole protection, so backers have to watch for WorkDeclared; the contractor is someone the backers accepted during the cooling-off, and loses that standing.
  • Any backer can dispute alone. A backer who hopes the arbiter will split the amount risks only their deposit, so the arbiter fee rate is what discourages disputing work that was delivered.
  • A contractor needs funds to contest: the arbiter fee rate times what is disputed. The rate is fixed when the parties are named, so the most it can be is known before signing, and the undisputed shares are paid before the contest deposit is due. One ruling covers every disputed share, so the contractor contests all the disputes or none.
  • A veto proposal that passed but was never executed can still be queued and executed later, with no new vote, and it lands on the project if it hasn't closed (the Governor keeps passed proposals with no expiry). Accepted: the passed veto is public before the contractor signs, anyone can execute it, and the majority that passed it could pass a new one at any time. werule shows a passed, unexecuted veto on the project.
  • Once an overrule proposal was registered on a project in Dispute or Appealable, any overrule can land after the appeal window while that proposal's hold lasts, even one that was never registered. Accepted: it takes a second passed proposal inside one hold, and when the hold ends the ruling is final by the clock.
  • The arbitration timeout and the appeal period can be set to nothing, which makes arbitration meaningless for the projects named afterwards: with no timeout the arbiter can never rule and every contested dispute goes back to the backers, and with no appeal period the DAO can rule in a silent arbiter's place at once. Accepted: the values are part of a project's terms, fixed when its parties are named and visible through the cooling-off, so a contractor or a backer who finds them unworkable doesn't take part.
  • When the arbiter doesn't rule in time, the backers who disputed get their shares and deposits back in full, so an arbiter who stays silent hands them the dispute at no cost, and the arbiter's fee on a small dispute may not be worth ruling for. The contractor's remedy is the DAO, which can rule in a silent arbiter's place once the appeal period has passed; a proposal registered before the arbiter's deadline holds the timeout. A jurisdiction that sets the arbitration timeout at or below the appeal period leaves the DAO no time to do that unless such a proposal was registered. Accepted: both are the jurisdiction's own settings, fixed in a project's terms.
  • Setting a parity for a token credits all the activity in it that members have not claimed yet, including activity from before the token was listed. Activity in a token costs the platform fee in that token, so listing a token a member can mint for free would mint them REP for nothing. Parities are set by constitutional proposal, and the voters decide which tokens are money. A parity key must be written with the token's address in lowercase: under any other spelling it is not read, and a member who claims meanwhile has that activity marked claimed with no REP.
  • Tokens whose balances change by themselves (rebasing tokens) are not supported: a project counts what it owes, not what it holds. A payee that can never receive the project's currency leaves its payment in the project for good.

There aren't any published security advisories