From fdfa41f22b5d4e48c8e4122a49af15e8deb4d34e Mon Sep 17 00:00:00 2001 From: Antonio Pitasi Date: Tue, 11 Nov 2025 15:38:10 +0100 Subject: [PATCH] Add Warden Protocol chain --- .../blockchains/CoinAddressDerivationTests.kt | 2 +- docs/registry.md | 1 + include/TrustWalletCore/TWCoinType.h | 1 + .../core/test/CoinAddressDerivationTests.kt | 2 +- registry.json | 30 +++++++++++++++++++ .../tests/coin_address_derivation_test.rs | 1 + swift/Tests/CoinAddressDerivationTests.swift | 3 +- .../chains/WardenProtocol/TWCoinTypeTests.cpp | 29 ++++++++++++++++++ tests/common/CoinAddressDerivationTests.cpp | 1 + 9 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 tests/chains/WardenProtocol/TWCoinTypeTests.cpp diff --git a/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt b/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt index b1b407dfc87..63e7db4c057 100644 --- a/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt +++ b/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt @@ -47,7 +47,7 @@ class CoinAddressDerivationTests { FANTOM, CELO, CRONOSCHAIN, SMARTBITCOINCASH, KUCOINCOMMUNITYCHAIN, BOBA, METIS, AURORA, EVMOS, MOONRIVER, MOONBEAM, KAVAEVM, KAIA, METER, OKXCHAIN, POLYGONZKEVM, SCROLL, CONFLUXESPACE, ACALAEVM, OPBNB, NEON, BASE, LINEA, GREENFIELD, MANTLE, ZENEON, MANTAPACIFIC, - ZETAEVM, MERLIN, LIGHTLINK, BLAST, BOUNCEBIT, ZKLINKNOVA, SONIC, PLASMA, MONAD, + ZETAEVM, MERLIN, LIGHTLINK, BLAST, BOUNCEBIT, ZKLINKNOVA, SONIC, PLASMA, MONAD, WARDENPROTOCOL, -> assertEquals("0x8f348F300873Fd5DA36950B2aC75a26584584feE", address) RONIN -> assertEquals("ronin:8f348F300873Fd5DA36950B2aC75a26584584feE", address) diff --git a/docs/registry.md b/docs/registry.md index acb153ce4f6..33a795d5278 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -96,6 +96,7 @@ This list is generated from [./registry.json](../registry.json) | 6060 | GoChain | GO | | | | 7332 | Zen EON | ZEN | | | | 8453 | Base | ETH | | | +| 8765 | Warden Protocol | WARD | | | | 8964 | NULS | NULS | | | | 9745 | Plasma Mainnet | XPL | | | | 10143 | Monad | MON | | | diff --git a/include/TrustWalletCore/TWCoinType.h b/include/TrustWalletCore/TWCoinType.h index 3ee41d4b1a9..806760aa6d0 100644 --- a/include/TrustWalletCore/TWCoinType.h +++ b/include/TrustWalletCore/TWCoinType.h @@ -191,6 +191,7 @@ enum TWCoinType { TWCoinTypePolymesh = 595, TWCoinTypePlasma = 9745, TWCoinTypeMonad = 10143, + TWCoinTypeWardenProtocol = 10008765, // end_of_tw_coin_type_marker_do_not_modify }; diff --git a/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt b/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt index 8765207cf4b..bcf041a5e98 100644 --- a/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt +++ b/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt @@ -40,7 +40,7 @@ class CoinAddressDerivationTests { Fantom, Celo, CronosChain, SmartBitcoinCash, KuCoinCommunityChain, Boba, Metis, Aurora, Evmos, Moonriver, Moonbeam, KavaEvm, Kaia, Meter, OKXChain, PolygonzkEVM, Scroll, ConfluxeSpace, AcalaEVM, OpBNB, Neon, Base, Linea, Greenfield, Mantle, ZenEON, MantaPacific, - ZetaEVM, Merlin, Lightlink, Blast, BounceBit, ZkLinkNova, Sonic, Plasma, Monad, + ZetaEVM, Merlin, Lightlink, Blast, BounceBit, ZkLinkNova, Sonic, Plasma, Monad, WardenProtocol, -> "0x8f348F300873Fd5DA36950B2aC75a26584584feE" Ronin -> "ronin:8f348F300873Fd5DA36950B2aC75a26584584feE" diff --git a/registry.json b/registry.json index 26595cb9bc1..748f7603496 100644 --- a/registry.json +++ b/registry.json @@ -4940,5 +4940,35 @@ "rpc": "https://rpc.monad.xyz", "documentation": "https://docs.monad.xyz" } + }, + { + "id": "wardenprotocol", + "name": "Warden Protocol", + "displayName": "Warden Protocol", + "coinId": 10008765, + "symbol": "WARD", + "decimals": 18, + "blockchain": "Ethereum", + "derivation": [ + { + "path": "m/44'/60'/0'/0/0" + } + ], + "curve": "secp256k1", + "publicKeyType": "secp256k1Extended", + "chainId": "8765", + "addressHasher": "keccak256", + "explorer": { + "url": "https://explorer.wardenprotocol.org", + "txPath": "/tx/", + "accountPath": "/address/", + "sampleTx": "0x90aaaaf8379eecc479ac8679a1430e7fb53d2e64749c4bc9132371d4e1ea98f2", + "sampleAccount": "0xDc3D9d2f5fC5bEb330c7135b2c38f354c18656f0" + }, + "info": { + "url": "https://www.wardenprotocol.org", + "rpc": "https://evm.wardenprotocol.org", + "documentation": "https://docs.wardenprotocol.org" + } } ] diff --git a/rust/tw_tests/tests/coin_address_derivation_test.rs b/rust/tw_tests/tests/coin_address_derivation_test.rs index c2f386ef844..c6b0e202e16 100644 --- a/rust/tw_tests/tests/coin_address_derivation_test.rs +++ b/rust/tw_tests/tests/coin_address_derivation_test.rs @@ -94,6 +94,7 @@ fn test_coin_address_derivation() { | CoinType::Sonic | CoinType::Plasma | CoinType::Monad + | CoinType::WardenProtocol // end_of_evm_address_derivation_tests_marker_do_not_modify => "0xAc1ec44E4f0ca7D172B7803f6836De87Fb72b309", CoinType::Bitcoin => "bc1qten42eesehw0ktddcp0fws7d3ycsqez3f7d5yt", diff --git a/swift/Tests/CoinAddressDerivationTests.swift b/swift/Tests/CoinAddressDerivationTests.swift index 296264fdd45..d414f73836b 100644 --- a/swift/Tests/CoinAddressDerivationTests.swift +++ b/swift/Tests/CoinAddressDerivationTests.swift @@ -122,7 +122,8 @@ class CoinAddressDerivationTests: XCTestCase { .zkLinkNova, .sonic, .plasma, - .monad: + .monad, + .wardenProtocol: let expectedResult = "0x8f348F300873Fd5DA36950B2aC75a26584584feE" assertCoinDerivation(coin, expectedResult, derivedAddress, address) case .ronin: diff --git a/tests/chains/WardenProtocol/TWCoinTypeTests.cpp b/tests/chains/WardenProtocol/TWCoinTypeTests.cpp new file mode 100644 index 00000000000..5774e4349e4 --- /dev/null +++ b/tests/chains/WardenProtocol/TWCoinTypeTests.cpp @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright © 2017 Trust Wallet. + +#include "TestUtilities.h" +#include +#include + +TEST(TWWardenProtocolCoinType, TWCoinType) { + const auto coin = TWCoinTypeWardenProtocol; + const auto symbol = WRAPS(TWCoinTypeConfigurationGetSymbol(coin)); + const auto id = WRAPS(TWCoinTypeConfigurationGetID(coin)); + const auto name = WRAPS(TWCoinTypeConfigurationGetName(coin)); + const auto txId = WRAPS(TWStringCreateWithUTF8Bytes("0x90aaaaf8379eecc479ac8679a1430e7fb53d2e64749c4bc9132371d4e1ea98f2")); + const auto txUrl = WRAPS(TWCoinTypeConfigurationGetTransactionURL(coin, txId.get())); + const auto accId = WRAPS(TWStringCreateWithUTF8Bytes("0xDc3D9d2f5fC5bEb330c7135b2c38f354c18656f0")); + const auto accUrl = WRAPS(TWCoinTypeConfigurationGetAccountURL(coin, accId.get())); + + assertStringsEqual(id, "wardenprotocol"); + assertStringsEqual(name, "Warden Protocol"); + assertStringsEqual(symbol, "WARD"); + ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(coin), 18); + ASSERT_EQ(TWCoinTypeBlockchain(coin), TWBlockchainEthereum); + ASSERT_EQ(TWCoinTypeP2pkhPrefix(coin), 0); + ASSERT_EQ(TWCoinTypeP2shPrefix(coin), 0); + ASSERT_EQ(TWCoinTypeStaticPrefix(coin), 0); + assertStringsEqual(txUrl, "https://explorer.wardenprotocol.org/tx/0x90aaaaf8379eecc479ac8679a1430e7fb53d2e64749c4bc9132371d4e1ea98f2"); + assertStringsEqual(accUrl, "https://explorer.wardenprotocol.org/address/0xDc3D9d2f5fC5bEb330c7135b2c38f354c18656f0"); +} diff --git a/tests/common/CoinAddressDerivationTests.cpp b/tests/common/CoinAddressDerivationTests.cpp index 1dafcf3d775..a2b2c088f98 100644 --- a/tests/common/CoinAddressDerivationTests.cpp +++ b/tests/common/CoinAddressDerivationTests.cpp @@ -92,6 +92,7 @@ TEST(Coin, DeriveAddress) { case TWCoinTypeSonic: case TWCoinTypePlasma: case TWCoinTypeMonad: + case TWCoinTypeWardenProtocol: // end_of_evm_address_derivation_tests_marker_do_not_modify EXPECT_EQ(address, "0x9d8A62f656a8d1615C1294fd71e9CFb3E4855A4F"); break;