diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c17fae017..0510cefca6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ version: 2.1 parameters: - cache_version: - type: string - default: v3 + cache_version: + type: string + default: v4 jobs: build: @@ -11,15 +11,17 @@ jobs: docker: - image: node:16 environment: - NODE_OPTIONS: '--max-old-space-size=16384' - working_directory: ~/repo + NODE_OPTIONS: "--max-old-space-size=16384" steps: - checkout - run: git submodule update --init --recursive - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - lib-{{ .Environment.CIRCLE_BRANCH }} + - restore_cache: + keys: + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - run: name: install-yarn command: npm install --force --global yarn@1.22.0 @@ -29,10 +31,48 @@ jobs: - setup_remote_docker - run: yarn build:ci - save_cache: - key: repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + key: cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> paths: - - ~/repo + - ~/project/contracts/erc20/node_modules + - ~/project/contracts/test-utils/node_modules + - ~/project/contracts/treasury/node_modules + - ~/project/contracts/utils/node_modules + - ~/project/contracts/zero-ex/node_modules + - ~/project/node_modules + - ~/project/packages/asset-swapper/node_modules + - ~/project/packages/contract-addresses/node_modules + - ~/project/packages/contract-artifacts/node_modules + - ~/project/packages/contract-wrappers/node_modules + - ~/project/packages/protocol-utils/node_modules - ~/.cache/yarn + - save_cache: + key: lib-{{ .Environment.CIRCLE_BRANCH }} + paths: + - ~/project/contracts/erc20/generated-artifacts/ + - ~/project/contracts/erc20/generated-wrappers/ + - ~/project/contracts/erc20/lib/ + - ~/project/contracts/erc20/test/generated-artifacts/ + - ~/project/contracts/erc20/test/generated-wrappers/ + - ~/project/contracts/test-utils/lib/ + - ~/project/contracts/treasury/generated-artifacts/ + - ~/project/contracts/treasury/generated-wrappers/ + - ~/project/contracts/treasury/lib/ + - ~/project/contracts/treasury/test/generated-artifacts/ + - ~/project/contracts/treasury/test/generated-wrappers/ + - ~/project/contracts/utils/generated-artifacts/ + - ~/project/contracts/utils/generated-wrappers/ + - ~/project/contracts/utils/lib/ + - ~/project/contracts/utils/test/generated-artifacts/ + - ~/project/contracts/utils/test/generated-wrappers/ + - ~/project/contracts/zero-ex/generated-artifacts/ + - ~/project/contracts/zero-ex/generated-wrappers/ + - ~/project/contracts/zero-ex/lib/ + - ~/project/contracts/zero-ex/test/generated-artifacts/ + - ~/project/contracts/zero-ex/test/generated-wrappers/ + - ~/project/packages/contract-addresses/lib/ + - ~/project/packages/contract-artifacts/lib/ + - ~/project/packages/contract-wrappers/lib/ + - ~/project/packages/protocol-utils/lib/ - store_artifacts: path: ~/repo/packages/abi-gen/test-cli/output - store_artifacts: @@ -41,108 +81,124 @@ jobs: resource_class: xlarge docker: - image: node:16 - working_directory: ~/repo steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: yarn wsrun -p @0x/contracts-exchange -m --serial -c test:circleci test-integrations-ganache: resource_class: xlarge docker: - image: node:16 - working_directory: ~/repo steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: yarn wsrun -p @0x/contracts-integrations -m --serial -c test:circleci test-contracts-staking-ganache: resource_class: xlarge docker: - image: node:16 - working_directory: ~/repo steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: yarn wsrun -p @0x/contracts-staking -m --serial -c test:circleci test-contracts-extra-ganache: resource_class: xlarge docker: - image: node:16 - working_directory: ~/repo steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }} + - cache-{{ checksum "yarn.lock" }} + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: yarn wsrun -p @0x/contracts-exchange-forwarder -p @0x/contracts-coordinator -m --serial -c test:circleci test-contracts-rest-ganache: resource_class: xlarge docker: - image: node:16 - working_directory: ~/repo steps: - checkout - run: | - git diff --name-only development >> changed.txt - if ! grep -q \.sol changed.txt; then - circleci-agent step halt - fi + git diff --name-only development >> changed.txt + if ! grep -q \.sol changed.txt; then + circleci-agent step halt + fi - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: | - yarn wsrun \ - -p @0x/contracts-multisig \ - -p @0x/contracts-utils \ - -p @0x/contracts-exchange-libs \ - -p @0x/contracts-erc20 \ - -p @0x/contracts-erc721 \ - -p @0x/contracts-erc1155 \ - -p @0x/contracts-asset-proxy \ - -p @0x/contracts-broker \ - -p @0x/contracts-zero-ex \ - -m --serial -c test:circleci + yarn wsrun \ + -p @0x/contracts-multisig \ + -p @0x/contracts-utils \ + -p @0x/contracts-exchange-libs \ + -p @0x/contracts-erc20 \ + -p @0x/contracts-erc721 \ + -p @0x/contracts-erc1155 \ + -p @0x/contracts-asset-proxy \ + -p @0x/contracts-broker \ + -p @0x/contracts-zero-ex \ + -m --serial -c test:circleci test-foundry: resource_class: xlarge docker: - image: ghcr.io/foundry-rs/foundry:latest - working_directory: ~/repo/contracts/zero-ex steps: - checkout - run: | - git diff --name-only development >> changed.txt - if ! grep -q \.sol changed.txt; then - circleci-agent step halt - fi + git diff --name-only development >> changed.txt + cat changed.txt + if ! grep -q \.sol changed.txt; then + circleci-agent step halt + fi - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - # - run: forge install - - run: forge test + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} + - run: git submodule update --init --recursive + - run: + command: forge test + working_directory: ~/project/contracts/zero-ex test-publish: resource_class: large environment: - NODE_OPTIONS: '--max-old-space-size=6442' + NODE_OPTIONS: "--max-old-space-size=6442" docker: - image: node:16 - image: 0xorg/verdaccio - working_directory: ~/repo steps: - checkout - run: | - git diff --name-only development >> changed.txt - if ! grep -q packages/ changed.txt; then - circleci-agent step halt - fi + git diff --name-only development >> changed.txt + cat changed.txt + if ! grep -q packages/ changed.txt; then + circleci-agent step halt + fi - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: command: yarn test:publish:circleci no_output_timeout: 1800 @@ -151,26 +207,30 @@ jobs: test-doc-generation: docker: - image: node:16 - working_directory: ~/repo steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: command: yarn test:generate_docs:circleci no_output_timeout: 1200 test-rest: docker: - image: node:16 - working_directory: ~/repo environment: - RUST_ROUTER: 'true' + RUST_ROUTER: "true" steps: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: yarn wsrun -p @0x/contracts-test-utils -m --serial -c test:circleci - run: yarn wsrun -p @0x/contract-addresses -m --serial -c test:circleci - run: yarn wsrun -p @0x/contract-artifacts -m --serial -c test:circleci @@ -196,27 +256,26 @@ jobs: - checkout - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - lib-{{ .Environment.CIRCLE_BRANCH }} - run: - command: yarn lerna run lint - working_directory: ~/repo + command: yarn lerna run lint - run: - command: yarn prettier:ci - working_directory: ~/repo + command: yarn prettier:ci - run: - command: yarn deps_versions:ci - working_directory: ~/repo + command: yarn deps_versions:ci - run: - command: yarn diff_md_docs:ci - working_directory: ~/repo + command: yarn diff_md_docs:ci submit-coverage: docker: - image: node:16 - working_directory: ~/repo steps: - restore_cache: keys: - - repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> + - restore_cache: + keys: + - lib-{{ .Environment.CIRCLE_BRANCH }} - restore_cache: keys: - coverage-contract-wrappers-test-{{ checksum "yarn.lock" }} diff --git a/packages/asset-swapper/src/utils/market_operation_utils/constants.ts b/packages/asset-swapper/src/utils/market_operation_utils/constants.ts index 4c44cd1c92..55727d2b39 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/constants.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/constants.ts @@ -224,10 +224,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId( ERC20BridgeSource.Velodrome, ERC20BridgeSource.Synthetix, ]), - [ChainId.ArbitrumRinkeby]: new SourceFilters([ - ERC20BridgeSource.Native, - ERC20BridgeSource.UniswapV3, - ]), + [ChainId.ArbitrumRinkeby]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]), }, new SourceFilters([]), ); @@ -379,10 +376,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId( ERC20BridgeSource.Velodrome, ERC20BridgeSource.Synthetix, ]), - [ChainId.ArbitrumRinkeby]: new SourceFilters([ - ERC20BridgeSource.Native, - ERC20BridgeSource.UniswapV3, - ]), + [ChainId.ArbitrumRinkeby]: new SourceFilters([ERC20BridgeSource.Native, ERC20BridgeSource.UniswapV3]), }, new SourceFilters([]), ); diff --git a/packages/contract-addresses/addresses.json b/packages/contract-addresses/addresses.json index 3f613d9a3a..cc678a93e9 100644 --- a/packages/contract-addresses/addresses.json +++ b/packages/contract-addresses/addresses.json @@ -344,5 +344,4 @@ "positiveSlippageFeeTransformer": "0xd56b9c014b45ed95e2a048a0c28121db30265f13" } } - } diff --git a/packages/contract-addresses/src/index.ts b/packages/contract-addresses/src/index.ts index 4edefcb032..d381c605bc 100644 --- a/packages/contract-addresses/src/index.ts +++ b/packages/contract-addresses/src/index.ts @@ -39,7 +39,7 @@ export enum ChainId { Celo = 42220, Optimism = 10, Arbitrum = 42161, - ArbitrumRinkeby = 421611 + ArbitrumRinkeby = 421611, } /**