Skip to content

Moat withdrawal hardening: hash160 ABI types, koinu granularity, upgrade-script verification #43

Description

@dghelm

From PR #41's review (out of that PR's scope). Fund-safety and ABI-ossification risks — decide before withdrawals are part of the launch surface.

  • withdrawToP2PKH(address) / withdrawToP2SH(address) (Moat.sol:243-262) take address for Dogecoin hash160 payloads: nothing stops swapping arguments or passing an EVM address, sending funds to an unspendable L1 output. Should take bytes20. Decide the fate of the repurposed withdrawToL1 — its old EVM-target semantics now reinterpret the argument as a P2PKH hash160 (fund-loss hazard if legacy callers exist); hard-fail or remove.
  • Koinu granularity unenforced: nothing requires amountAfterFee % 1e10 == 0, so up to ~1e10 wei per withdrawal is unrepresentable on 8-decimal L1 Dogecoin. Decide and enforce the rounding/refund rule before bridge semantics ossify.
  • submit-moat-proxy-upgrade.sh (~line 101): cast failures inside $(...) are swallowed under set -e, and the post-upgrade implementation address is never compared to the target. Capture-and-assert with non-zero exit.
  • Shell extract() helpers: head -n 1 the match and detect duplicate config keys.

Refs: PR #41 review thread.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions