@rhinestone/shared-configs 2.15.1 → 2.16.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/dist/configs/contracts.dev.json +6 -2
- package/dist/scripts/__tests__/hoistUniform.test.js +16 -0
- package/dist/scripts/generate.js +2 -0
- package/dist/scripts/hoistUniform.d.ts +0 -28
- package/dist/scripts/hoistUniform.js +9 -1
- package/dist/src/generated/contracts.dev.js +6 -2
- package/dist/src/generated/packageVersion.d.ts +1 -1
- package/dist/src/generated/packageVersion.js +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"ecoPortal": "0xEC000064576f9C95a8623Bc0eff3db6d296ea6df",
|
|
16
16
|
"ecoHyperProver": "0xeC0008acc34d3D0CAa6758Ce788091e473812e28",
|
|
17
17
|
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9",
|
|
18
|
-
"oftProxy": "0x5B64E414f4dEA97062D6B552852FFbAcaf6d462b"
|
|
18
|
+
"oftProxy": "0x5B64E414f4dEA97062D6B552852FFbAcaf6d462b",
|
|
19
|
+
"swapAdapter": "0x58BC7d9279A38a1537c2f74426dBDbD804AD3A18",
|
|
20
|
+
"swapAdapterTokenSpender": "0xc5f6641b3ade357c5df77a1859d16528fe8b3e93"
|
|
19
21
|
},
|
|
20
22
|
"56": {
|
|
21
23
|
"ecoArbiter": "0x1BeBAfb3D05d84A5Bfd94800c88d1342f755d8AB",
|
|
@@ -79,7 +81,9 @@
|
|
|
79
81
|
"spokepool": "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64",
|
|
80
82
|
"ecoPortal": "0xEC000064576f9C95a8623Bc0eff3db6d296ea6df",
|
|
81
83
|
"ecoHyperProver": "0xeC0008acc34d3D0CAa6758Ce788091e473812e28",
|
|
82
|
-
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9"
|
|
84
|
+
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9",
|
|
85
|
+
"swapAdapter": "0x58BC7d9279A38a1537c2f74426dBDbD804AD3A18",
|
|
86
|
+
"swapAdapterTokenSpender": "0xc5f6641b3ade357c5df77a1859d16528fe8b3e93"
|
|
83
87
|
},
|
|
84
88
|
"9745": {
|
|
85
89
|
"ecoArbiter": "0x1BeBAfb3D05d84A5Bfd94800c88d1342f755d8AB",
|
|
@@ -38,6 +38,22 @@ const resolve = (contracts, chainId) => ({
|
|
|
38
38
|
(0, bun_test_1.expect)(out["1"].oftProxy).toBe("0x11");
|
|
39
39
|
(0, bun_test_1.expect)(out["*"].permit2).toBe("0xAA");
|
|
40
40
|
});
|
|
41
|
+
(0, bun_test_1.test)("keeps staged deployment addresses chain-scoped", () => {
|
|
42
|
+
const out = (0, hoistUniform_1.hoistUniformAddresses)({
|
|
43
|
+
"10": {
|
|
44
|
+
swapAdapter: "0xAA",
|
|
45
|
+
swapAdapterTokenSpender: "0xBB",
|
|
46
|
+
},
|
|
47
|
+
"8453": {
|
|
48
|
+
swapAdapter: "0xAA",
|
|
49
|
+
swapAdapterTokenSpender: "0xBB",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
(0, bun_test_1.expect)(out["*"]?.swapAdapter).toBeUndefined();
|
|
53
|
+
(0, bun_test_1.expect)(out["*"]?.swapAdapterTokenSpender).toBeUndefined();
|
|
54
|
+
(0, bun_test_1.expect)(out["10"].swapAdapter).toBe("0xAA");
|
|
55
|
+
(0, bun_test_1.expect)(out["8453"].swapAdapterTokenSpender).toBe("0xBB");
|
|
56
|
+
});
|
|
41
57
|
(0, bun_test_1.test)("resolution is unchanged for every chain that already had the key", () => {
|
|
42
58
|
const before = {
|
|
43
59
|
"*": { router: "0xRR" },
|
package/dist/scripts/generate.js
CHANGED
|
@@ -325,6 +325,8 @@ const mapChainDeployments = (deployments, external) => {
|
|
|
325
325
|
// external/derived address, so it's mapped here (RHI-4896).
|
|
326
326
|
swapper: deployments.swapper,
|
|
327
327
|
tokenTransferProxy: external?.tokenTransferProxy?.address,
|
|
328
|
+
swapAdapter: external?.swapAdapter?.address,
|
|
329
|
+
swapAdapterTokenSpender: external?.swapAdapterTokenSpender?.address,
|
|
328
330
|
});
|
|
329
331
|
};
|
|
330
332
|
function collectContracts(addrConfig) {
|
|
@@ -1,30 +1,2 @@
|
|
|
1
1
|
export type RawContracts = Record<string, Record<string, string>>;
|
|
2
|
-
/**
|
|
3
|
-
* Hoist every address that is identical on all chains carrying it into the `*`
|
|
4
|
-
* wildcard, leaving each chain with only what genuinely differs there.
|
|
5
|
-
*
|
|
6
|
-
* Consumers resolve a chain as `{ ...wildcard, ...chainSpecific }`, so this
|
|
7
|
-
* changes nothing for a chain that already had the key. What it changes is the
|
|
8
|
-
* chain the map has never heard of: chains now arrive at runtime in the facts
|
|
9
|
-
* artifact while this map is baked into the consumer's image, so a new chain
|
|
10
|
-
* falls back to the bare wildcard and every address missing from it resolves to
|
|
11
|
-
* `undefined`. That is not theoretical — it is why the first quote to Ink 500'd
|
|
12
|
-
* (RHI-5703): `permit2` was absent from the wildcard, so a `spender: undefined`
|
|
13
|
-
* reached viem, which threw inside a `catch` that then discarded the chain.
|
|
14
|
-
*
|
|
15
|
-
* Hoisted only with evidence: at least two chains carrying the key, and exactly
|
|
16
|
-
* one distinct address between them. One chain proves nothing about uniformity,
|
|
17
|
-
* and a key whose value varies is genuinely per-chain (`spokepool` has 16
|
|
18
|
-
* distinct addresses across 18 chains, `oftProxy` 7 across 7).
|
|
19
|
-
*
|
|
20
|
-
* Keys that split by *network* rather than by chain are deliberately left
|
|
21
|
-
* per-chain — the eco family is one mainnet address and one testnet address.
|
|
22
|
-
* A single wildcard value would hand a new testnet the mainnet portal, and a
|
|
23
|
-
* confidently wrong address is worse than a missing one.
|
|
24
|
-
*
|
|
25
|
-
* Note this widens resolution: a chain that never had `acrossHandler` now
|
|
26
|
-
* resolves one. Capability is gated by `settlementLayers` in the registry, not
|
|
27
|
-
* by the presence of a key here, so that is safe — but it does mean this file
|
|
28
|
-
* stops being a record of what is deployed where.
|
|
29
|
-
*/
|
|
30
2
|
export declare const hoistUniformAddresses: (contracts: RawContracts) => RawContracts;
|
|
@@ -29,6 +29,12 @@ exports.hoistUniformAddresses = void 0;
|
|
|
29
29
|
* by the presence of a key here, so that is safe — but it does mean this file
|
|
30
30
|
* stops being a record of what is deployed where.
|
|
31
31
|
*/
|
|
32
|
+
const CHAIN_SCOPED_KEYS = {
|
|
33
|
+
// Staged rollout: identical CREATE2 address does not prove deployment on an
|
|
34
|
+
// unknown chain. Keep these absent until that chain is explicitly enabled.
|
|
35
|
+
swapAdapter: true,
|
|
36
|
+
swapAdapterTokenSpender: true,
|
|
37
|
+
};
|
|
32
38
|
const hoistUniformAddresses = (contracts) => {
|
|
33
39
|
const perChain = Object.entries(contracts).filter(([id]) => id !== "*");
|
|
34
40
|
const addressesByKey = new Map();
|
|
@@ -41,7 +47,9 @@ const hoistUniformAddresses = (contracts) => {
|
|
|
41
47
|
}
|
|
42
48
|
const chainsCarrying = (key) => perChain.filter(([, entries]) => key in entries).length;
|
|
43
49
|
const uniform = [...addressesByKey.entries()]
|
|
44
|
-
.filter(([key, addresses]) =>
|
|
50
|
+
.filter(([key, addresses]) => !(key in CHAIN_SCOPED_KEYS) &&
|
|
51
|
+
addresses.size === 1 &&
|
|
52
|
+
chainsCarrying(key) > 1)
|
|
45
53
|
.map(([key]) => key);
|
|
46
54
|
if (uniform.length === 0) {
|
|
47
55
|
return contracts;
|
|
@@ -18,7 +18,9 @@ const contractAddresses = {
|
|
|
18
18
|
"ecoPortal": "0xEC000064576f9C95a8623Bc0eff3db6d296ea6df",
|
|
19
19
|
"ecoHyperProver": "0xeC0008acc34d3D0CAa6758Ce788091e473812e28",
|
|
20
20
|
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9",
|
|
21
|
-
"oftProxy": "0x5B64E414f4dEA97062D6B552852FFbAcaf6d462b"
|
|
21
|
+
"oftProxy": "0x5B64E414f4dEA97062D6B552852FFbAcaf6d462b",
|
|
22
|
+
"swapAdapter": "0x58BC7d9279A38a1537c2f74426dBDbD804AD3A18",
|
|
23
|
+
"swapAdapterTokenSpender": "0xc5f6641b3ade357c5df77a1859d16528fe8b3e93"
|
|
22
24
|
},
|
|
23
25
|
"56": {
|
|
24
26
|
"ecoArbiter": "0x1BeBAfb3D05d84A5Bfd94800c88d1342f755d8AB",
|
|
@@ -82,7 +84,9 @@ const contractAddresses = {
|
|
|
82
84
|
"spokepool": "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64",
|
|
83
85
|
"ecoPortal": "0xEC000064576f9C95a8623Bc0eff3db6d296ea6df",
|
|
84
86
|
"ecoHyperProver": "0xeC0008acc34d3D0CAa6758Ce788091e473812e28",
|
|
85
|
-
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9"
|
|
87
|
+
"ecoVaultAddress": "0x9f70b0c839fe2D7190A09Ae87ED658b6D1CbA4F9",
|
|
88
|
+
"swapAdapter": "0x58BC7d9279A38a1537c2f74426dBDbD804AD3A18",
|
|
89
|
+
"swapAdapterTokenSpender": "0xc5f6641b3ade357c5df77a1859d16528fe8b3e93"
|
|
86
90
|
},
|
|
87
91
|
"9745": {
|
|
88
92
|
"ecoArbiter": "0x1BeBAfb3D05d84A5Bfd94800c88d1342f755d8AB",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PACKAGE_VERSION = "2.
|
|
1
|
+
declare const PACKAGE_VERSION = "2.16.0";
|
|
2
2
|
export { PACKAGE_VERSION };
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PACKAGE_VERSION = void 0;
|
|
4
4
|
// Auto-generated by scripts/generate.ts. Do not edit manually.
|
|
5
|
-
const PACKAGE_VERSION = "2.
|
|
5
|
+
const PACKAGE_VERSION = "2.16.0";
|
|
6
6
|
exports.PACKAGE_VERSION = PACKAGE_VERSION;
|