Skip to content

Methodology

DISCLAIMER // NFA // DYOR

This analysis is based on observations of the contract behavior. We are not smart contract security experts. This document aims to explain what the contract appears to do based on the code. It should not be considered a comprehensive security audit or financial advice. Always verify critical information independently and consult with blockchain security professionals for important decisions.

⊙ generated by robots | curated by humans

METADATA
Contract Address 0xc4eD7EA2...F8cB0A (etherscan)
Network Ethereum Mainnet
Analysis Date 2026-11-27

Overview

The implementation was analysed from its verified source, with the DNZN clone 0xB611Ff19...4D5199 (etherscan) as the live instance. The implementation's own storage is empty, because init accepts only the factory and the factory calls it only on new clones, so every storage read and every behavioural check was made against the clone, which runs the implementation's code by Delegatecall.

As of block 26,508,644 (etherscan), the clone had no transactions, logs or token transfers of its own apart from its creation by the factory, so there was no history to decode. Behaviour was established instead by simulation: cast call for every revert path in the source, cast call --trace for the payout paths, and state overrides (--override-balance, --override-code, --override-state-diff) to put the clone into states it has not yet reached on chain, such as holding ETH, holding escrow, or having a matured queued action. No transaction was sent.

The source's comments were read for context, and where this analysis quotes them it says so. Conclusions about behaviour rest on the code and the simulations. The source's references to test files and design decisions point to files that are not part of the verified source and were not consulted.

Thought Process

mindmap
  root((Distribution implementation))
    Obtain
      Verified source shared with factory
      Runtime 9,277 bytes
      Init code from factory constructor
      Same code on Base
    Shape
      Implementation behind clones
      Immutables factory and self
      Storage slots 0-8 plus transient lock
      25 selectors in dispatcher
    Money paths
      distribute rounding and remainder
      100k gas ETH push
      Escrow release and claim
      ERC-20 return handling USDT USDC
      Reentrancy lock
    Configuration
      propose with nonce hash
      applyQueued window and GRACE
      cancel by owner or after expiry
      Two-step ownership and queue clearing
    Simulation
      Revert paths on the live clone
      State overrides for timelock and escrow
      Code overrides for hostile recipients
      2,300 gas stipend sender
    Risks
      Owner redirects after delay
      Stipend sends fail cold
      Nomination withdrawal delay
      Permanent escrow
      Falling token balances

Verification Guide

External Resources

RESOURCE WHAT IT PROVIDED
Etherscan — implementation source Verified source, Application Binary Interface (ABI), compiler settings
Etherscan API v2 (getsourcecode, getcontractcreation, getLogs, txlist, txlistinternal, tokentx) Creation data and the absence of activity on the implementation and clone
EIP-2929 Cold and warm access costs behind the stipend result
EIP-1153 Transient storage semantics for the lock
Foundry cast reference State-override and trace flags
Mastering Ethereum, 2nd Edition Background on gas, storage layout and delegatecall

Commandline Tools

Tip

Commands below use cast from the Foundry Toolkit. To run the commands below, you must set the RPC URL environment variable:

export ETH_RPC_URL=https://eth.llamarpc.com

Confirm the Code and Its Origin

The runtime is fetched and compared with Base. The creation record gives the factory as contractFactory, the factory's deployment transaction as txHash, and the EOA that sent it as contractCreator.

# FETCH RUNTIME AND COMPARE WITH BASE

cast code 0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A | md5sum
cast code --rpc-url https://mainnet.base.org 0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A | md5sum


# CREATION RECORD FOR THE IMPLEMENTATION AND THE DNZN CLONE

curl -s "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=getcontractcreation&contractaddresses=0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A,0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199&apikey=$ETHERSCAN_API_KEY"


# CHECK FOR OPCODES THAT WOULD MAKE THE IMPLEMENTATION DESTRUCTIBLE OR RE-DELEGATING (EXPECT 0)

cast disassemble $(cast code 0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A) | grep -cE "SELFDESTRUCT|DELEGATECALL"

Confirm Selectors and Constants

# SELECTOR FOR EACH FUNCTION, E.G. DISTRIBUTE

cast sig "distribute(address)"


# CONSTANTS THROUGH THE CLONE

cast call 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 "GRACE()(uint256)"
cast call 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 "MAX_BENEFICIARIES()(uint256)"

Read the Clone's Storage

# PACKED OWNER | DELAY | NONCE, AND THE TABLE LENGTH

cast storage 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 0 -b 26508644
cast storage 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 3 -b 26508644


# FIRST BENEFICIARY ROW (ACCOUNT AND BPS PACKED)

cast storage 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 $(cast keccak $(cast to-uint256 3)) -b 26508644


# EVERYTHING AT ONCE

cast call 0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199 "snapshot()((address,uint32,uint32,string,(address,uint96,string,string)[],(bytes32,uint256,bytes)[]))"

Exercise the Revert Paths

Each call is expected to revert with the selector shown in functions. A few representative cases:

C=0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199
OPS=0x00c0e88778E3e3d17AcaaBC7550deC7Ab61F3790

# NOTHING TO DISTRIBUTE -> NothingToDo() 0x5c52a868

cast call $C "distribute(address)" 0x0000000000000000000000000000000000000000


# NON-OWNER PROPOSES -> NotOwner() 0x30cd7471

cast call --from 0x1111111111111111111111111111111111111111 $C "propose(bytes)" $(cast calldata "setDelay(uint32)" 0)


# OWNER CALLS A SETTER DIRECTLY -> Unauthorized() 0x82b42900

cast call --from $OPS $C "setDelay(uint32)" 0


# ETH TO THE IMPLEMENTATION -> Unauthorized(); ETH TO THE CLONE -> success

cast call --value 1 0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A
cast call --value 1 $C

Simulate the Timelock Window

A queued action is simulated by writing an eta into queued[hash] (mapping slot 6) for the action setDelay(0) at nonce 1.

C=0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199
ACT=$(cast calldata "setDelay(uint32)" 0)
H=$(cast keccak $(cast abi-encode "f(bytes,uint32)" $ACT 1))
Q=$(cast index bytes32 $H 6)
NOW=$(cast block 26508644 -f timestamp)

# MATURED ONE DAY AGO, APPLIED BY A RANDOM ADDRESS -> success

cast call -b 26508644 --from 0x1111111111111111111111111111111111111111 \
  --override-state-diff "$C:$Q:$(cast to-uint256 $((NOW - 86400)))" \
  $C "applyQueued(bytes,uint32)" $ACT 1


# MATURED 15 DAYS AGO -> Expired(eta) 0xf80dbaea

cast call -b 26508644 --override-state-diff "$C:$Q:$(cast to-uint256 $((NOW - 15*86400)))" \
  $C "applyQueued(bytes,uint32)" $ACT 1

Trace the Payout Paths

C=0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199
TRE=0x00b6E7D12EdE9Ca4A74fE69be758aAB1ee02cFb9
Z=0x0000000000000000000000000000000000000000

# 1 ETH SPLIT ACROSS THE TABLE

cast call -b 26508644 --trace --override-balance "$C:1000000000000000000" $C "distribute(address)" $Z


# 10,001 WEI: THE LAST ROW RECEIVES THE REMAINDER

cast call -b 26508644 --trace --override-balance "$C:10001" $C "distribute(address)" $Z


# TREASURY CODE REPLACED BY PUSH0 PUSH0 REVERT: ITS SHARE IS ESCROWED

cast call -b 26508644 --trace --override-balance "$C:1000000000000000000" \
  --override-code "$TRE:0x5f5ffd" $C "distribute(address)" $Z


# USDT, WHICH RETURNS NOTHING FROM transfer (BALANCES AT SLOT 2)

USDT=0xdAC17F958D2ee523a2206206994597C13D831ec7
cast call -b 26508644 --trace \
  --override-state-diff "$USDT:$(cast index address $C 2):$(cast to-uint256 10001)" \
  $C "distribute(address)" $USDT

Test a 2,300-Gas Stipend Sender

A 35-byte test contract is placed at a spare address. It sends 1 wei to the clone with a gas argument of zero, so the callee receives only the 2,300-gas Gas Stipend, as with Solidity's transfer, and returns the call's success flag. The second variant first runs EXTCODESIZE on the implementation to warm it.

C=0xB611Ff193DA8Fa9391C0A3DAa29C3c9a0F4D5199
I=0xc4eD7EA21B8CC334F08945B4D0c182e0afF8cB0A
T=0x1111111111111111111111111111111111111111
STIP="5f5f5f5f600173${C:2}5ff15f5260205ff3"

# IMPLEMENTATION COLD -> 0 (FAILED)

cast call -b 26508644 --override-code "$T:0x$STIP" --override-balance "$T:1000" $T


# IMPLEMENTATION WARMED FIRST -> 1 (SUCCEEDED)

cast call -b 26508644 --override-code "$T:0x73${I:2}3b50$STIP" --override-balance "$T:1000" $T

Reentrancy From a Beneficiary

The treasury's code is replaced with a contract that copies calldata for applyQueued (or distribute) out of its own code, calls the clone with it, and reverts with whatever comes back. With a matured action in queued, the trace shows the inner call reverting Locked() and the treasury's share being escrowed. The shape is CODECOPY the calldata, CALL the clone with all gas, RETURNDATACOPY, REVERT. The bytecode is built by reentry.sh in the repository's artifacts/c4eD7EA2...F8cB0A/ directory, next to sim.sh and trace.sh, which run every simulation on this page; their output is reproduced in the artifacts.


Document Verification

The drafted documents were re-checked before publication in five independent passes, each with a narrow scope and each reading from primary sources rather than from the draft. Running them separately matters: a claim can be correctly formatted, non-redundant, neutral in tone, free of filler, and still be factually wrong, and a single reviewer holding all five concerns at once reliably drops the last one.

DIMENSION WHAT IT CHECKS CHECKED AGAINST
Facts Addresses, block heights, dates, compiler settings, selector values, storage values, simulated results, every quantitative claim Live chain state via cast, Etherscan API v2, the verified Distribution source, and re-runs of the simulations above
Standards Address display format, explorer links on every on-chain reference, table casing, section separators, icon semantics, glossary term wrapping, nav registration AGENTS.md, docs/glossary.md, mkdocs.yml
Redundancy Duplicated tables and paragraphs across the six documents and the factory analysis, and the same claim stated with different values in two places The document set itself
Voice Superlatives asserted without a verification clause, opinion adjectives, speculation about intent or users AGENTS.md writing standards
Filler Rhetorical padding — meta-narration, telegraphed structure, formulaic emphasis AGENTS.md anti-patterns

Every disagreement the fact pass raised was re-derived from chain or source before any edit was made, on the assumption that the checker is as capable of being wrong as the draft. A claim was only changed where the contradicting value could be reproduced from a command in the Verification Guide above.


Token Cost Breakdown

PHASE DESCRIPTION TOKENS
Phase 0 Obtain the Contract 20 tok
Phase 1 Discovery & Understanding 20 tok
Phase 2 Deep Dive Analysis 60 tok
Phase 3 Risk & Trust Analysis 15 tok
Phase 4 Documentation Generation 85 tok
Phase 5 Document Verification 800 tok
TOTAL Complete Contract Analysis 1 mtok

Phase 5 dominates because the fact pass re-ran the simulations and storage reads from scratch rather than trusting the draft.

Note: Token costs are estimates based on typical conversation lengths and complexity. Actual consumption may vary by ±10-15% depending on API responses, iterative refinement, and verification steps.