@rhinestone/shared-configs 2.15.0 → 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.
@@ -2874,7 +2874,6 @@
2874
2874
  },
2875
2875
  {
2876
2876
  "address": "0x768F42455A2D082E23ceeF7d51e5787C82d67a39",
2877
- "appFee": true,
2878
2877
  "approvalSlot": 1,
2879
2878
  "authorization": {
2880
2879
  "domain": {
@@ -2896,6 +2895,30 @@
2896
2895
  "priceSymbol": "USDC",
2897
2896
  "symbol": "ensUSDC",
2898
2897
  "unpriced": true
2898
+ },
2899
+ {
2900
+ "address": "0xcBFD80F74375c54E545AF34788Ff465F96F66F05",
2901
+ "approvalSlot": 1,
2902
+ "authorization": {
2903
+ "domain": {
2904
+ "chainId": 11155111,
2905
+ "name": "USDC",
2906
+ "verifyingContract": "0xcBFD80F74375c54E545AF34788Ff465F96F66F05",
2907
+ "version": "1"
2908
+ },
2909
+ "domainSeparator": "0x9ca6558c61a10bb82489cb06bbc485dfec461002acea9ee2e44a31fa9e4a3578",
2910
+ "eoaOnly": true,
2911
+ "standards": [
2912
+ "erc2612"
2913
+ ]
2914
+ },
2915
+ "balanceSlot": 0,
2916
+ "decimals": 6,
2917
+ "gasRefund": true,
2918
+ "pegGroup": "USD",
2919
+ "priceSymbol": "USDC",
2920
+ "symbol": "ensUSDC2",
2921
+ "unpriced": true
2899
2922
  }
2900
2923
  ],
2901
2924
  "vmType": "evm",
@@ -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" },
@@ -94,6 +94,7 @@ function errorsFor(chain) {
94
94
  ["747474:0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62", permitOnly],
95
95
  ["11155111:0x1c7d4b196cb0c7b01d743fbc6116a902379c7238", both],
96
96
  ["11155111:0x768f42455a2d082e23ceef7d51e5787c82d67a39", permitOnly],
97
+ ["11155111:0xcbfd80f74375c54e545af34788ff465f96f66f05", permitOnly],
97
98
  ["11155420:0x5fd84259d66cd46123540766be93dfe6d43130d7", both],
98
99
  ]);
99
100
  const configured = new Map(Object.entries(index_1.chainRegistry).flatMap(([chainId, entry]) => entry.tokens.flatMap((token) => {
@@ -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]) => addresses.size === 1 && chainsCarrying(key) > 1)
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;
@@ -4,11 +4,17 @@ const bun_test_1 = require("bun:test");
4
4
  const index_1 = require("../index");
5
5
  const entries = Object.entries(index_1.chainRegistry);
6
6
  /**
7
- * `<chainId>:<symbol>` for a catalog token we have DECIDED not to accept as
8
- * payment. Empty today every real EVM catalog token is accepted. An entry
9
- * here records a decision; it is not a backlog.
7
+ * `<chainId>:<symbol>` for a catalog token we have DECIDED not to accept for
8
+ * every payment purpose. An entry here records a decision; it is not a backlog.
9
+ *
10
+ * The Sepolia ENS mocks carry `gasRefund` but deliberately not `appFee`: an
11
+ * app-fee carve credits a ledger that withdrawal pays out against in real
12
+ * stablecoin, and a freely-mintable mock must not be able to inflate it.
10
13
  */
11
- const NOT_ACCEPTED_AS_PAYMENT = new Set();
14
+ const NOT_ACCEPTED_AS_PAYMENT = new Set([
15
+ "11155111:ensUSDC",
16
+ "11155111:ensUSDC2",
17
+ ]);
12
18
  (0, bun_test_1.describe)("payment-token eligibility", () => {
13
19
  (0, bun_test_1.it)("is only ever present as `true`", () => {
14
20
  // `false` and absent mean the same thing, so writing `false` would imply a
@@ -2968,7 +2968,6 @@ const chains = {
2968
2968
  },
2969
2969
  {
2970
2970
  "address": "0x768F42455A2D082E23ceeF7d51e5787C82d67a39",
2971
- "appFee": true,
2972
2971
  "approvalSlot": 1,
2973
2972
  "authorization": {
2974
2973
  "domain": {
@@ -2990,6 +2989,30 @@ const chains = {
2990
2989
  "priceSymbol": "USDC",
2991
2990
  "symbol": "ensUSDC",
2992
2991
  "unpriced": true
2992
+ },
2993
+ {
2994
+ "address": "0xcBFD80F74375c54E545AF34788Ff465F96F66F05",
2995
+ "approvalSlot": 1,
2996
+ "authorization": {
2997
+ "domain": {
2998
+ "chainId": 11155111,
2999
+ "name": "USDC",
3000
+ "verifyingContract": "0xcBFD80F74375c54E545AF34788Ff465F96F66F05",
3001
+ "version": "1"
3002
+ },
3003
+ "domainSeparator": "0x9ca6558c61a10bb82489cb06bbc485dfec461002acea9ee2e44a31fa9e4a3578",
3004
+ "eoaOnly": true,
3005
+ "standards": [
3006
+ "erc2612"
3007
+ ]
3008
+ },
3009
+ "balanceSlot": 0,
3010
+ "decimals": 6,
3011
+ "gasRefund": true,
3012
+ "pegGroup": "USD",
3013
+ "priceSymbol": "USDC",
3014
+ "symbol": "ensUSDC2",
3015
+ "unpriced": true
2993
3016
  }
2994
3017
  ],
2995
3018
  "vmType": "evm",
@@ -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.15.0";
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.15.0";
5
+ const PACKAGE_VERSION = "2.16.0";
6
6
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/shared-configs",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "Reusable configuration files for Rhinestone services",
5
5
  "author": {
6
6
  "name": "Rhinestone",