Hooks.wtf

Deployment

V001.s.sol

V001 deploys and wires the launchpad contracts. Its primary finding concerns the mainnet owner default and ownership recovery; shared findings cover recipient validation, trusted-router setup and fixed deployment assumptions.

Reviewed source: script/deployment/V001.s.sol at commit bcd45b2.

Findings

IDSeverityFinding
DICES-04LowThe deployment script leaves a single EOA as owner on mainnet by default

[LOW] DICES-04 · The deployment script leaves a single EOA as owner on mainnet by default

Affected modules: DicesHook.sol, TrustedRouters.sol, V001.s.sol.

Severity: Low. Type: configuration, access control.

Affected code: script/deployment/V001.s.sol:131, :306, :244-246, :323-325; src/core/TrustedRouters.sol:13.

Description

V001 refuses a mainnet run until the fee recipient, the buy-and-burn recipient and the bankroll are set. It does not do the same for the owner:

// script/deployment/V001.s.sol:306
protocolOwner = cfg.protocolOwner == address(0) ? deployer : cfg.protocolOwner;

BASE_MAINNET_PROTOCOL_OWNER is address(0) (:131), so as committed the deploying wallet stays owner and _requireWiring accepts that (:512).

Ownership is OpenZeppelin Ownable, reached through TrustedRouters. transferOwnership takes effect in one step, and renounceOwnership is callable.

Impact

All the powers in DICES-03 would sit on a hot deployer key. A one-step transfer to a mistyped address, or a renounce, removes administration permanently, including the ability to replace a faulty calculator (DICES-07) or set a missing recipient (DICES-01).

Evidence

The project's own test pins this behaviour: test_unsetOwnerKeepsTheDeployer (test/scripts/V001.t.sol:259-266) runs the script with a non-testnet configuration and a zero owner and asserts that hook.owner() is the deploying wallet. test_mainnetRequiresRecipients (:293-310) shows the other three constants are refused when unset. Both pass. So the default is deliberate; the finding is that it should not be available on mainnet.

Recommendation

  • Require a non-zero protocolOwner that is a contract when isTestnet is false.
  • Use Ownable2Step.
  • Override renounceOwnership to revert unless the client wants the option, and say so in the docs if they do.

Source finding: findings.md, DICES-04.

Shared findings

Previous
UniswapEvents.sol