Skip to content

Conversation

@franzns
Copy link

@franzns franzns commented Mar 24, 2025

πŸ•“ Changelog

This PR adds support for the following additional chains:

  • Berachain (identifier: berachain, chain ID: 80094),
  • Ink (identifier: ink, chain ID: 57073),
  • Sonic (identifier: sonic, chain ID: 146),
  • Unichain (identifier: unichain, chain ID: 130).

All supported chains that use the Safe transaction service API can be retrieved via:

curl -s https://safe-config.safe.global/api/v1/chains/ | jq '.results[].chainName'

@pcaversaccio
Copy link
Owner

Sonic is not yet supported by Safe's Transaction Service: https://docs.safe.global/advanced/smart-account-supported-networks?service=Transaction+Service.

If you want to add Sonic to this script, this is a hard requirement. Otherwise, feel free to fork and adjust yourself.

@pcaversaccio pcaversaccio self-assigned this Mar 24, 2025
@pcaversaccio pcaversaccio added the feature πŸ’₯ New feature or request label Mar 24, 2025
@pcaversaccio pcaversaccio changed the title Add Sonic chain - 146 ✨ Add Support for Sonic Mar 24, 2025
@pcaversaccio
Copy link
Owner

Wait "https://safe-transaction-sonic.safe.global" indeed works!

@pcaversaccio pcaversaccio added the documentation πŸ“– Improvements or additions to documentation label Mar 24, 2025
@pcaversaccio
Copy link
Owner

pcaversaccio commented Mar 24, 2025

I just realised that the Safe docs are not up-to-date; for all supported chains we can do:

curl -s https://safe-config.safe.global/api/v1/chains/ | jq '.results[].chainName'

which prints:

"Ethereum"
"Gnosis Chain"
"Polygon"
"Polygon zkEVM"
"BNB Chain"
"Arbitrum"
"Optimism"
"Base"
"Berachain"
"Ink"
"Linea"
"Sonic"
"Unichain"
"zkSync Era"
"Scroll"
"X Layer"
"Celo"
"Avalanche"
"Blast"
"Mantle"
"World Chain"
"Aurora"
"Sepolia"
"Base Sepolia"
"Gnosis Chiado"

Let me add as part of this PR the other missing chains.

@pcaversaccio pcaversaccio changed the title ✨ Add Support for Sonic ✨ Add Support for Berachain, Ink, Sonic, and Unichain Mar 24, 2025
@pcaversaccio
Copy link
Owner

@franzns can you please enable this in the PR:

image

@pcaversaccio
Copy link
Owner

Superseded by #29.

pcaversaccio added a commit that referenced this pull request Mar 24, 2025
### πŸ•“ Changelog

This PR (supersedes
#28) adds
support for the following additional chains:
- Berachain (identifier: `berachain`, chain ID: `80094`),
- Ink (identifier: `ink`, chain ID: `57073`),
- Sonic (identifier: `sonic`, chain ID: `146`),
- Unichain (identifier: `unichain`, chain ID: `130`).

All supported chains that use the [Safe transaction service
API](https://docs.safe.global/core-api/transaction-service-overview) can
be retrieved via:

```console
curl -s https://safe-config.safe.global/api/v1/chains/ | jq '.results[].chainName'
```

### Test Example:

```console
./safe_hashes.sh --network sonic --address 0x9deDd0B4BDb5c55fB067C990a9D45BDEc465615e --nonce 3
```

returns:

```console
===================================
= Selected Network Configurations =
===================================

Network: sonic
Chain ID: 146

========================================
= Transaction Data and Computed Hashes =
========================================

Transaction Data
Multisig address: 0x9deDd0B4BDb5c55fB067C990a9D45BDEc465615e
To: 0x9deDd0B4BDb5c55fB067C990a9D45BDEc465615e
Value: 0
Data: 0x694e80c30000000000000000000000000000000000000000000000000000000000000003
Operation: Call
Safe Transaction Gas: 0
Base Gas: 0
Gas Price: 0
Gas Token: 0x0000000000000000000000000000000000000000
Refund Receiver: 0x0000000000000000000000000000000000000000
Nonce: 3
Encoded message: 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d80000000000000000000000009dedd0b4bdb5c55fb067c990a9d45bdec465615e0000000000000000000000000000000000000000000000000000000000000000f560b6cdc55440401411fc0e1bb3ecb6cdb48cc6b4bb13e0bf5ade906c02b9330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003
Method: changeThreshold
Parameters: [
  {
    "name": "_threshold",
    "type": "uint256",
    "value": "3"
  }
]

WARNING: The "changeThreshold" function modifies the owners or threshold of the Safe. Proceed with caution!

Hashes
Domain hash: 0xB9EA36B4E7E2C09243A9E3FF028E393972F441F8484C1C87AA34AFFA72D68593
Message hash: 0x28691163891E885EBC9F61F1CF5C8C879BF5C02C7BF7483CD49E8471A39FC82C
Safe transaction hash: 0x94aa3ee3649f35d14838e1b731fc6b4fb9c7ec9c5dd9028c4368b9964d76b6ae
```

Now compare with
https://app.safe.global/transactions/tx?safe=sonic:0x9deDd0B4BDb5c55fB067C990a9D45BDEc465615e&id=multisig_0x9deDd0B4BDb5c55fB067C990a9D45BDEc465615e_0x94aa3ee3649f35d14838e1b731fc6b4fb9c7ec9c5dd9028c4368b9964d76b6ae.

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
jcvernaleo pushed a commit to jcvernaleo/safe-tx-hashes-util that referenced this pull request May 16, 2025
* add thumbnail

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

Labels

documentation πŸ“– Improvements or additions to documentation feature πŸ’₯ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants