Compare commits

...

3 Commits

Author SHA1 Message Date
Marcin Wolny
382f1f8cdc WIP 2022-08-31 14:49:20 +02:00
Marcin Wolny
e2c35893b4 Test 2022-08-31 14:32:03 +02:00
Kyu
2fd8f1c6dd format error 2022-08-31 20:07:29 +09:00
3 changed files with 110 additions and 67 deletions

View File

@@ -1,9 +1,9 @@
version: 2.1 version: 2.1
parameters: parameters:
cache_version: cache_version:
type: string type: string
default: v3 default: v4
jobs: jobs:
build: build:
@@ -11,15 +11,17 @@ jobs:
docker: docker:
- image: node:16 - image: node:16
environment: environment:
NODE_OPTIONS: '--max-old-space-size=16384' NODE_OPTIONS: "--max-old-space-size=16384"
working_directory: ~/repo
steps: steps:
- checkout - checkout
- run: git submodule update --init --recursive - run: git submodule update --init --recursive
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- restore_cache: - restore_cache:
keys: 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: - run:
name: install-yarn name: install-yarn
command: npm install --force --global yarn@1.22.0 command: npm install --force --global yarn@1.22.0
@@ -29,10 +31,32 @@ jobs:
- setup_remote_docker - setup_remote_docker
- run: yarn build:ci - run: yarn build:ci
- save_cache: - save_cache:
key: repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> key: cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
paths: 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 - ~/.cache/yarn
- save_cache:
key: lib-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/project/contracts/erc20/lib/
- ~/project/contracts/test-utils/lib/
- ~/project/contracts/treasury/lib/
- ~/project/contracts/utils/lib/
- ~/project/contracts/zero-ex/lib/
- ~/project/packages/contract-addresses/lib/
- ~/project/packages/contract-artifacts/lib/
- ~/project/packages/contract-wrappers/lib/
- ~/project/packages/protocol-utils/lib/
- store_artifacts: - store_artifacts:
path: ~/repo/packages/abi-gen/test-cli/output path: ~/repo/packages/abi-gen/test-cli/output
- store_artifacts: - store_artifacts:
@@ -41,108 +65,123 @@ jobs:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun -p @0x/contracts-exchange -m --serial -c test:circleci - run: yarn wsrun -p @0x/contracts-exchange -m --serial -c test:circleci
test-integrations-ganache: test-integrations-ganache:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun -p @0x/contracts-integrations -m --serial -c test:circleci - run: yarn wsrun -p @0x/contracts-integrations -m --serial -c test:circleci
test-contracts-staking-ganache: test-contracts-staking-ganache:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun -p @0x/contracts-staking -m --serial -c test:circleci - run: yarn wsrun -p @0x/contracts-staking -m --serial -c test:circleci
test-contracts-extra-ganache: test-contracts-extra-ganache:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }} - cache-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun -p @0x/contracts-exchange-forwarder -p @0x/contracts-coordinator -m --serial -c test:circleci - run: yarn wsrun -p @0x/contracts-exchange-forwarder -p @0x/contracts-coordinator -m --serial -c test:circleci
test-contracts-rest-ganache: test-contracts-rest-ganache:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- run: | - run: |
git diff --name-only development >> changed.txt git diff --name-only development >> changed.txt
if ! grep -q \.sol changed.txt; then if ! grep -q \.sol changed.txt; then
circleci-agent step halt circleci-agent step halt
fi fi
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: | - run: |
yarn wsrun \ yarn wsrun \
-p @0x/contracts-multisig \ -p @0x/contracts-multisig \
-p @0x/contracts-utils \ -p @0x/contracts-utils \
-p @0x/contracts-exchange-libs \ -p @0x/contracts-exchange-libs \
-p @0x/contracts-erc20 \ -p @0x/contracts-erc20 \
-p @0x/contracts-erc721 \ -p @0x/contracts-erc721 \
-p @0x/contracts-erc1155 \ -p @0x/contracts-erc1155 \
-p @0x/contracts-asset-proxy \ -p @0x/contracts-asset-proxy \
-p @0x/contracts-broker \ -p @0x/contracts-broker \
-p @0x/contracts-zero-ex \ -p @0x/contracts-zero-ex \
-m --serial -c test:circleci -m --serial -c test:circleci
test-foundry: test-foundry:
resource_class: xlarge resource_class: xlarge
docker: docker:
- image: ghcr.io/foundry-rs/foundry:latest - image: ghcr.io/foundry-rs/foundry:latest
working_directory: ~/repo/contracts/zero-ex
steps: steps:
- checkout - checkout
- run: | - run: |
git diff --name-only development >> changed.txt git diff --name-only development >> changed.txt
if ! grep -q \.sol changed.txt; then cat changed.txt
circleci-agent step halt if ! grep -q \.sol changed.txt; then
fi circleci-agent step halt
fi
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
# - run: forge install - restore_cache:
- run: forge test keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run:
command: forge test
working_directory: ~/project/contracts/zero-ex
test-publish: test-publish:
resource_class: large resource_class: large
environment: environment:
NODE_OPTIONS: '--max-old-space-size=6442' NODE_OPTIONS: "--max-old-space-size=6442"
docker: docker:
- image: node:16 - image: node:16
- image: 0xorg/verdaccio - image: 0xorg/verdaccio
working_directory: ~/repo
steps: steps:
- checkout - checkout
- run: | - run: |
git diff --name-only development >> changed.txt git diff --name-only development >> changed.txt
if ! grep -q packages/ changed.txt; then cat changed.txt
circleci-agent step halt if ! grep -q packages/ changed.txt; then
fi circleci-agent step halt
fi
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: - run:
command: yarn test:publish:circleci command: yarn test:publish:circleci
no_output_timeout: 1800 no_output_timeout: 1800
@@ -151,26 +190,30 @@ jobs:
test-doc-generation: test-doc-generation:
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: - run:
command: yarn test:generate_docs:circleci command: yarn test:generate_docs:circleci
no_output_timeout: 1200 no_output_timeout: 1200
test-rest: test-rest:
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
environment: environment:
RUST_ROUTER: 'true' RUST_ROUTER: "true"
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun -p @0x/contracts-test-utils -m --serial -c test:circleci - 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-addresses -m --serial -c test:circleci
- run: yarn wsrun -p @0x/contract-artifacts -m --serial -c test:circleci - run: yarn wsrun -p @0x/contract-artifacts -m --serial -c test:circleci
@@ -196,27 +239,26 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- lib-{{ .Environment.CIRCLE_SHA1 }}
- run: - run:
command: yarn lerna run lint command: yarn lerna run lint
working_directory: ~/repo
- run: - run:
command: yarn prettier:ci command: yarn prettier:ci
working_directory: ~/repo
- run: - run:
command: yarn deps_versions:ci command: yarn deps_versions:ci
working_directory: ~/repo
- run: - run:
command: yarn diff_md_docs:ci command: yarn diff_md_docs:ci
working_directory: ~/repo
submit-coverage: submit-coverage:
docker: docker:
- image: node:16 - image: node:16
working_directory: ~/repo
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >> - cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
- restore_cache:
keys:
- lib-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: - restore_cache:
keys: keys:
- coverage-contract-wrappers-test-{{ checksum "yarn.lock" }} - coverage-contract-wrappers-test-{{ checksum "yarn.lock" }}

View File

@@ -20,6 +20,8 @@
pragma solidity ^0.6.5; pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./features/interfaces/IOwnableFeature.sol"; import "./features/interfaces/IOwnableFeature.sol";
import "./features/interfaces/ISimpleFunctionRegistryFeature.sol"; import "./features/interfaces/ISimpleFunctionRegistryFeature.sol";
import "./features/interfaces/ITokenSpenderFeature.sol"; import "./features/interfaces/ITokenSpenderFeature.sol";

View File

@@ -1,9 +1,8 @@
import { ContractAddresses } from '@0x/contract-addresses'; import { ContractAddresses } from '@0x/contract-addresses';
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
export enum ForwarderError { // not formatted
CompleteFillFailed = 'COMPLETE_FILL_FAILED', export enum ForwarderError { CompleteFillFailed = 'COMPLETE_FILL_FAILED', }
}
export enum ContractError { export enum ContractError {
ContractNotDeployedOnChain = 'CONTRACT_NOT_DEPLOYED_ON_CHAIN', ContractNotDeployedOnChain = 'CONTRACT_NOT_DEPLOYED_ON_CHAIN',