Chameleon Mining
How it hidesStart mining

Pool contract

ChamPool: 0x1B188BC8909b84f7BE9AE5B01C5C5d98197a4b22

One contract holds the USDG (0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168, 6 decimals) and pays the epochs. No proxy. The owner can withdraw only what is not committed to a posted epoch; committed USDG can only leave through claims or, after the claim deadline, back to the free balance.

fund(uint256 amount)                         // anyone, USDG transferFrom
payJob(bytes32 jobId, uint256 amount)        // a buyer pays for a job; the USDG joins the pool
postEpoch(uint32 day, bytes32 root, uint256 total, uint64 deadline)   // publisher
claim(uint32 day, address account, uint256 amount, bytes32[] proof)   // anyone, pays account
claimMany(...) / reclaim(uint32 day) / withdraw(address to, uint256 amount)  // owner, free balance only
available() / committed() / getEpoch(day) / isClaimed(day, account) / canClaim(...)

Merkle format

leaf = keccak256(bytes.concat(keccak256(abi.encode(account, amount))))
node = keccak256(min(a, b) | max(a, b)); pairs in order, an odd last node goes up unchanged

Tested

  • The balance always equals free plus committed, and committed equals what open epochs still owe (invariant suite).
  • Claims with real proofs on trees of 1 to 16 leaves, double claims refused, relayed claims pay the account.
  • The owner cannot withdraw committed USDG.
  • A full epoch against the real USDG contract on a fork of chain 4663.

The contract is deployed through the standard CREATE2 deployer, at an address the network mines itself: today's job is a salt for it (init code hash 0xf60967bf02955549...).