Skip to content

feat: log Safe EIP-712 tx hashes on cheat broadcast - #180

Merged
huyhuynh3103 merged 4 commits into
mainnetfrom
feat/log-safe-tx-hashes
Jun 18, 2026
Merged

huyhuynh3103 merged 4 commits into
mainnetfrom
feat/log-safe-tx-hashes

Conversation

@huyhuynh3103

Copy link
Copy Markdown
Contributor

When the broadcast sender is a Safe wallet, cheatBroadcast only logs and pranks instead of sending. Add Domain Hash, Message Hash, and Safe Tx Hash to that log so signers can independently verify before signing.

Nonce resolution priority: overwrite (env SAFE_NONCE) > Safe Transaction Service API (queue-aware) > on-chain Safe.nonce(). The API base URL maps chainId 2020 to the Ronin service and is overridable via SAFE_TX_SERVICE_URL.

Hash math is extracted to a pure computeSafeTxHashes() and verified against independently cast-derived reference values in test/SafeTxHashes.t.sol.

Description

Checklist

  • I have clearly commented on all the main functions following the NatSpec Format
  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works

huyhuynh3103 and others added 4 commits June 18, 2026 13:27
When the broadcast sender is a Safe wallet, cheatBroadcast only logs and
pranks instead of sending. Add Domain Hash, Message Hash, and Safe Tx Hash
to that log so signers can independently verify before signing.

Nonce resolution priority: overwrite (env SAFE_NONCE) > Safe Transaction
Service API (queue-aware) > on-chain Safe.nonce(). The API base URL maps
chainId 2020 to the Ronin service and is overridable via SAFE_TX_SERVICE_URL.

Hash math is extracted to a pure computeSafeTxHashes() and verified against
independently cast-derived reference values in test/SafeTxHashes.t.sol.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the broadcast sender is a Safe wallet, cheatBroadcast only logs and
pranks instead of sending. Add Domain Hash, Message Hash, and Safe Tx Hash
to that log so signers can independently verify before signing.

Safe detection trusts the Safe Transaction Service (HTTP 200), falling back
to an on-chain singleton check (proxy slot 0 vs known Safe singletons) when
the service is unavailable (testnet/localhost, unmapped chain, or offline).

Nonce resolution priority: overwrite (env SAFE_NONCE) > Safe Transaction
Service API (queue-aware) > on-chain Safe.nonce(). The API base URL maps
chainId 2020 to the Ronin service and is overridable via SAFE_TX_SERVICE_URL.

Hash math is extracted to a pure computeSafeTxHashes() and verified against
independently cast-derived reference values in test/SafeTxHashes.t.sol.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Removed duplicate logSafeTxHashes call before executing the transaction.
@huyhuynh3103
huyhuynh3103 merged commit b8ddbf4 into mainnet Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant