Skip to content

Commit

Permalink
chore(): move address map to different file
Browse files Browse the repository at this point in the history
  • Loading branch information
limitofzero committed Jan 17, 2024
1 parent f67546f commit bc7d79f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/limit-order-predicate.decoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { SeriesNonceManagerPredicateBuilder } from './series-nonce-manager-predi
import {mocksForV3Chain} from './test/helpers';
import {LimitOrderPredicateV3Builder} from "./limit-order-predicate-v3.builder";
import {
LIMIT_ORDER_PROTOCOL_V3_ABI,
limitOrderProtocolAddresses
LIMIT_ORDER_PROTOCOL_V3_ABI
} from "./limit-order-protocol.const";
import {SERIES_NONCE_MANAGER_ABI} from "./series-nonce-manager.const";
import {limitOrderProtocolAddresses} from "./limit-order-protocol-addresses.const";


// eslint-disable-next-line max-len
Expand Down
16 changes: 16 additions & 0 deletions src/limit-order-protocol-addresses.const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {ChainId} from "./model/limit-order-protocol.model";

export const limitOrderProtocolAddresses: { [key in ChainId]: string } = {
[ChainId.ethereumMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.binanceMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.polygonMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.optimismMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.arbitrumMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.auroraMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.gnosisMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.avalancheMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.fantomMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.klaytnMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.zkSyncEraMainnet]: '0x6e2b76966cbd9cf4cc2fa0d76d24d5241e0abc2f',
[ChainId.baseMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
} as const;
19 changes: 2 additions & 17 deletions src/limit-order-protocol.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {AbiItem} from './model/abi.model';
import LimitOrderProtocolABISource from './abi/LimitOrderProtocol.json';
import LimitOrderProtocolV3ABISource from './abi/LimitOrderProtocolV3.json';
import ERC20ABISource from './abi/ERC20ABI.json';
import { SignTypedDataVersion } from '@metamask/eth-sig-util';
import { ChainId } from './model/limit-order-protocol.model';
import {SignTypedDataVersion} from '@metamask/eth-sig-util';
import {limitOrderProtocolAddresses} from "./limit-order-protocol-addresses.const";

export const PROTOCOL_NAME = '1inch Aggregation Router';

Expand All @@ -30,21 +30,6 @@ export const EIP712_DOMAIN = [
{name: 'verifyingContract', type: 'address'},
];

export const limitOrderProtocolAddresses: {[key in ChainId]: string} = {
[ChainId.ethereumMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.binanceMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.polygonMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.optimismMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.arbitrumMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.auroraMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.gnosisMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.avalancheMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.fantomMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.klaytnMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
[ChainId.zkSyncEraMainnet]: '0x6e2b76966cbd9cf4cc2fa0d76d24d5241e0abc2f',
[ChainId.baseMainnet]: '0x1111111254eeb25477b68fb85ed929f73a960582',
} as const;

/**
* @deprecated Change to `limitOrderProtocolAddresses`
*/
Expand Down
2 changes: 1 addition & 1 deletion src/limit-order-v3.builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {LimitOrderDecoder} from './limit-order.decoder';
import {LimitOrderLegacy} from './model/limit-order-protocol.model';
import Web3 from 'web3';
import {PrivateKeyProviderConnector} from './connector/private-key-provider.connector';
import {limitOrderProtocolAddresses} from './limit-order-protocol.const';
import {largeInteractions, largeResult} from './test/mocks';
import {LimitOrderV3Builder} from "./limit-order-v3.builder";
import {limitOrderProtocolAddresses} from "./limit-order-protocol-addresses.const";

describe('LimitOrderV3Builder - for build new limit order', () => {
const chainId = 56;
Expand Down
4 changes: 1 addition & 3 deletions src/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import { Erc20Facade } from "../erc20.facade";
import { SeriesNonceManagerFacade } from "../series-nonce-manager.facade";
import { seriesNonceManagerContractAddresses } from "../series-nonce-manager.const";
import { SeriesNonceManagerPredicateBuilder } from "../series-nonce-manager-predicate.builder";
import {
limitOrderProtocolAddresses
} from "../limit-order-protocol.const";
import {LimitOrderPredicateV3Builder} from "../limit-order-predicate-v3.builder";
import {LimitOrderProtocolV3Facade} from "../limit-order-protocol-v3.facade";
import {LimitOrderV3Builder} from "../limit-order-v3.builder";
import {rpcUrls} from "../utils/rpc-url.const";
import {limitOrderProtocolAddresses} from "../limit-order-protocol-addresses.const";


export function mocksForV3Chain(
Expand Down

0 comments on commit bc7d79f

Please sign in to comment.