@vultisig/core-chain 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#441](https://github.com/vultisig/vultisig-sdk/pull/441) [`e3dc2e8`](https://github.com/vultisig/vultisig-sdk/commit/e3dc2e828b3e4f95b293d4493bddbc176bbb3bb7) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - feat(chain/evm): static known-contract label registry for offline transaction-intent display
|
|
8
|
+
|
|
9
|
+
Adds `chains/evm/contract/knownContracts.ts` mapping well-known EVM contract addresses (Uniswap V2/V3 routers, 1inch V5/V6, Permit2, THORChain Router, Aave V3 Pool) to human-readable labels and categories. Complements `commonSelectors.ts`: that table labels what function is being called, this one labels who is being called (and lets UIs label spender-style address arguments). Lookup is offline, case-insensitive, and optionally chain-scoped.
|
|
10
|
+
|
|
3
11
|
## 1.6.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static registry of well-known EVM contract addresses with human-readable
|
|
3
|
+
* labels. Used by transaction-intent display to label both the recipient
|
|
4
|
+
* (`tx.to`) of a contract call and address-typed arguments such as the
|
|
5
|
+
* `spender` in `approve(address,uint256)`.
|
|
6
|
+
*
|
|
7
|
+
* Layering for transaction-intent display:
|
|
8
|
+
*
|
|
9
|
+
* 1. Blockaid simulation may already attribute well-known contracts in its
|
|
10
|
+
* `transaction_actions` / `address_validation` payloads — especially
|
|
11
|
+
* malicious or sanctioned addresses. Run that first when available.
|
|
12
|
+
*
|
|
13
|
+
* 2. This static table — offline fast-path for the long tail of well-known
|
|
14
|
+
* routers, aggregators, and protocol entry points the user is likely
|
|
15
|
+
* interacting with on a healthy chain. Resolves instantly with no
|
|
16
|
+
* network round-trip.
|
|
17
|
+
*
|
|
18
|
+
* Addresses are normalized to lowercase. Keys must be 0x-prefixed 40-hex-char
|
|
19
|
+
* strings (the canonical EIP-55 checksum form is lowercased here for stable
|
|
20
|
+
* lookup; callers may pass any casing).
|
|
21
|
+
*
|
|
22
|
+
* Chain scoping: many DEX/aggregator deployments use deterministic CREATE2
|
|
23
|
+
* addresses and live at the same address across every EVM chain. Such
|
|
24
|
+
* entries omit `chains`. Entries that are tied to a specific deployment
|
|
25
|
+
* include `chains` so the lookup helper can filter when the caller knows
|
|
26
|
+
* which chain the transaction is on.
|
|
27
|
+
*/
|
|
28
|
+
import type { EvmChain } from '../../../Chain.js';
|
|
29
|
+
export type KnownEvmContractCategory = 'DEX Router' | 'DEX Aggregator' | 'Token Approval Helper' | 'Cross-Chain Bridge' | 'Lending Protocol' | 'NFT Marketplace';
|
|
30
|
+
export type KnownEvmContract = {
|
|
31
|
+
label: string;
|
|
32
|
+
category: KnownEvmContractCategory;
|
|
33
|
+
/**
|
|
34
|
+
* If present, the entry is only valid on these chains. Omit for entries
|
|
35
|
+
* whose canonical deployment uses the same address on every EVM chain
|
|
36
|
+
* (deterministic CREATE2 deploys).
|
|
37
|
+
*/
|
|
38
|
+
chains?: ReadonlyArray<EvmChain>;
|
|
39
|
+
};
|
|
40
|
+
export declare const knownEvmContracts: Readonly<Record<string, KnownEvmContract>>;
|
|
41
|
+
export type LookupKnownEvmContractOptions = {
|
|
42
|
+
/**
|
|
43
|
+
* Chain the transaction is on. When omitted the lookup ignores any
|
|
44
|
+
* chain-scoping on entries (best-effort labeling). When supplied, entries
|
|
45
|
+
* with a `chains` filter only match if the chain is in that list.
|
|
46
|
+
*/
|
|
47
|
+
chain?: EvmChain;
|
|
48
|
+
};
|
|
49
|
+
export declare const lookupKnownEvmContract: (address: string, options?: LookupKnownEvmContractOptions) => KnownEvmContract | null;
|
|
50
|
+
//# sourceMappingURL=knownContracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownContracts.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/contract/knownContracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,wBAAwB,GAChC,YAAY,GACZ,gBAAgB,GAChB,uBAAuB,GACvB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,CAAA;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,wBAAwB,CAAA;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAoFxE,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,UAAU,6BAA6B,KACtC,gBAAgB,GAAG,IASrB,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static registry of well-known EVM contract addresses with human-readable
|
|
3
|
+
* labels. Used by transaction-intent display to label both the recipient
|
|
4
|
+
* (`tx.to`) of a contract call and address-typed arguments such as the
|
|
5
|
+
* `spender` in `approve(address,uint256)`.
|
|
6
|
+
*
|
|
7
|
+
* Layering for transaction-intent display:
|
|
8
|
+
*
|
|
9
|
+
* 1. Blockaid simulation may already attribute well-known contracts in its
|
|
10
|
+
* `transaction_actions` / `address_validation` payloads — especially
|
|
11
|
+
* malicious or sanctioned addresses. Run that first when available.
|
|
12
|
+
*
|
|
13
|
+
* 2. This static table — offline fast-path for the long tail of well-known
|
|
14
|
+
* routers, aggregators, and protocol entry points the user is likely
|
|
15
|
+
* interacting with on a healthy chain. Resolves instantly with no
|
|
16
|
+
* network round-trip.
|
|
17
|
+
*
|
|
18
|
+
* Addresses are normalized to lowercase. Keys must be 0x-prefixed 40-hex-char
|
|
19
|
+
* strings (the canonical EIP-55 checksum form is lowercased here for stable
|
|
20
|
+
* lookup; callers may pass any casing).
|
|
21
|
+
*
|
|
22
|
+
* Chain scoping: many DEX/aggregator deployments use deterministic CREATE2
|
|
23
|
+
* addresses and live at the same address across every EVM chain. Such
|
|
24
|
+
* entries omit `chains`. Entries that are tied to a specific deployment
|
|
25
|
+
* include `chains` so the lookup helper can filter when the caller knows
|
|
26
|
+
* which chain the transaction is on.
|
|
27
|
+
*/
|
|
28
|
+
export const knownEvmContracts = {
|
|
29
|
+
// Uniswap V2 Router (UniswapV2Router02). Ethereum mainnet only — the V2
|
|
30
|
+
// contract was never re-deployed by Uniswap to other chains.
|
|
31
|
+
'0x7a250d5630b4cf539739df2c5dacb4c659f2488d': {
|
|
32
|
+
label: 'Uniswap V2 Router',
|
|
33
|
+
category: 'DEX Router',
|
|
34
|
+
chains: ['Ethereum'],
|
|
35
|
+
},
|
|
36
|
+
// Uniswap V3 SwapRouter (legacy, "Router1"). Valid for the deployments
|
|
37
|
+
// listed below; do NOT assume the same address across every EVM chain —
|
|
38
|
+
// Uniswap's deployment docs explicitly warn router addresses can differ.
|
|
39
|
+
'0xe592427a0aece92de3edee1f18e0157c05861564': {
|
|
40
|
+
label: 'Uniswap V3 Router',
|
|
41
|
+
category: 'DEX Router',
|
|
42
|
+
chains: ['Ethereum', 'Arbitrum', 'Optimism', 'Polygon'],
|
|
43
|
+
},
|
|
44
|
+
// Uniswap V3 SwapRouter02. Valid for these deployments. Base uses a
|
|
45
|
+
// different SwapRouter02 address — see the entry below.
|
|
46
|
+
'0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45': {
|
|
47
|
+
label: 'Uniswap V3 SwapRouter02',
|
|
48
|
+
category: 'DEX Router',
|
|
49
|
+
chains: ['Ethereum', 'Arbitrum', 'Optimism', 'Polygon'],
|
|
50
|
+
},
|
|
51
|
+
// Uniswap V3 SwapRouter02 — Base deployment (per Uniswap's Base contracts
|
|
52
|
+
// page).
|
|
53
|
+
'0x2626664c2603336e57b271c5c0b26f421741e481': {
|
|
54
|
+
label: 'Uniswap V3 SwapRouter02',
|
|
55
|
+
category: 'DEX Router',
|
|
56
|
+
chains: ['Base'],
|
|
57
|
+
},
|
|
58
|
+
// Uniswap V3 SwapRouter02 — BSC deployment.
|
|
59
|
+
'0xb971ef87ede563556b2ed4b1c0b0019111dd85d2': {
|
|
60
|
+
label: 'Uniswap V3 SwapRouter02',
|
|
61
|
+
category: 'DEX Router',
|
|
62
|
+
chains: ['BSC'],
|
|
63
|
+
},
|
|
64
|
+
// Uniswap V3 SwapRouter02 — Avalanche deployment.
|
|
65
|
+
'0xbb00ff08d01d300023c629e8ffffcb65a5a578ce': {
|
|
66
|
+
label: 'Uniswap V3 SwapRouter02',
|
|
67
|
+
category: 'DEX Router',
|
|
68
|
+
chains: ['Avalanche'],
|
|
69
|
+
},
|
|
70
|
+
// 1inch Aggregation Router V5. Same address on most supported chains, but
|
|
71
|
+
// not zkSync Era (different V5 router) — left unscoped because we don't
|
|
72
|
+
// currently route on zkSync; tighten if that changes.
|
|
73
|
+
'0x1111111254eeb25477b68fb85ed929f73a960582': {
|
|
74
|
+
label: '1inch V5 Router',
|
|
75
|
+
category: 'DEX Aggregator',
|
|
76
|
+
},
|
|
77
|
+
// 1inch Aggregation Router V6.
|
|
78
|
+
'0x111111125421ca6dc452d289314280a0f8842a65': {
|
|
79
|
+
label: '1inch V6 Router',
|
|
80
|
+
category: 'DEX Aggregator',
|
|
81
|
+
},
|
|
82
|
+
// Uniswap Permit2 — universal token-approval helper used by Universal
|
|
83
|
+
// Router and many other integrators. Deployed at the same address on every
|
|
84
|
+
// EVM chain Uniswap currently lists; left unscoped on that basis.
|
|
85
|
+
'0x000000000022d473030f116ddee9f6b43ac78ba3': {
|
|
86
|
+
label: 'Permit2',
|
|
87
|
+
category: 'Token Approval Helper',
|
|
88
|
+
},
|
|
89
|
+
// THORChain Router on Ethereum mainnet (deposit entry point for
|
|
90
|
+
// cross-chain swaps).
|
|
91
|
+
'0xd37bbe5744d730a1d98d8dc97c42f0ca46ad7146': {
|
|
92
|
+
label: 'THORChain Router',
|
|
93
|
+
category: 'Cross-Chain Bridge',
|
|
94
|
+
chains: ['Ethereum'],
|
|
95
|
+
},
|
|
96
|
+
// Aave V3 Pool on Ethereum mainnet.
|
|
97
|
+
'0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2': {
|
|
98
|
+
label: 'Aave V3 Pool',
|
|
99
|
+
category: 'Lending Protocol',
|
|
100
|
+
chains: ['Ethereum'],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export const lookupKnownEvmContract = (address, options) => {
|
|
104
|
+
const entry = knownEvmContracts[address.toLowerCase()];
|
|
105
|
+
if (!entry) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
if (options?.chain && entry.chains && !entry.chains.includes(options.chain)) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return entry;
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=knownContracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownContracts.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/contract/knownContracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAuBH,MAAM,CAAC,MAAM,iBAAiB,GAA+C;IAC3E,wEAAwE;IACxE,6DAA6D;IAC7D,4CAA4C,EAAE;QAC5C,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,CAAC,UAAU,CAAC;KACrB;IAED,uEAAu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CAAC,UAAU,CAAC;KACrB;IAED,oCAAoC;IACpC,4CAA4C,EAAE;QAC5C,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,MAAM,EAAE,CAAC,UAAU,CAAC;KACrB;CACF,CAAA;AAWD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,OAAuC,EACd,EAAE;IAC3B,MAAM,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IACtD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,OAAO,EAAE,KAAK,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5E,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vultisig/core-chain",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Blockchain chain logic shared across Vultisig clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -474,6 +474,11 @@
|
|
|
474
474
|
"import": "./dist/chains/evm/contract/commonSelectors.js",
|
|
475
475
|
"default": "./dist/chains/evm/contract/commonSelectors.js"
|
|
476
476
|
},
|
|
477
|
+
"./chains/evm/contract/knownContracts": {
|
|
478
|
+
"types": "./dist/chains/evm/contract/knownContracts.d.ts",
|
|
479
|
+
"import": "./dist/chains/evm/contract/knownContracts.js",
|
|
480
|
+
"default": "./dist/chains/evm/contract/knownContracts.js"
|
|
481
|
+
},
|
|
477
482
|
"./chains/evm/contract/universalRouter/decode": {
|
|
478
483
|
"types": "./dist/chains/evm/contract/universalRouter/decode.d.ts",
|
|
479
484
|
"import": "./dist/chains/evm/contract/universalRouter/decode.js",
|