Merge branch 'development' of github.com:0xProject/0x-monorepo into refactor_rfq_comparison_price_integration

This commit is contained in:
Daniel Pyrathon 2020-10-19 13:04:25 -07:00
commit 4b508d255d
40 changed files with 113 additions and 34 deletions

View File

@ -62,7 +62,7 @@
"@0x/tslint-config": "^4.1.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -67,7 +67,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -67,7 +67,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -52,7 +52,7 @@
"@0x/tslint-config": "^4.1.0",
"@0x/types": "^3.2.0",
"@0x/utils": "^5.5.1",
"@types/node": "*",
"@types/node": "12.12.54",
"ethereum-types": "^3.2.0",
"ethers": "~4.0.4",
"npm-run-all": "^4.1.2",

View File

@ -63,7 +63,7 @@
"@0x/typescript-typings": "^5.1.1",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -65,7 +65,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -66,7 +66,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -73,7 +73,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -62,7 +62,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -69,7 +69,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -72,7 +72,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -72,7 +72,7 @@
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/seedrandom": "^2.4.28",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",

View File

@ -63,7 +63,7 @@
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -68,7 +68,7 @@
"@0x/types": "^3.2.0",
"@0x/web3-wrapper": "^7.2.0",
"@types/lodash": "4.14.104",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -60,7 +60,7 @@
"@types/js-combinatorics": "^0.5.29",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"bn.js": "^4.11.8",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",

View File

@ -62,7 +62,7 @@
"@types/bn.js": "^4.11.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -53,7 +53,6 @@
"@0x/tslint-config": "^4.1.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/sinon": "^2.2.2",
"awesome-typescript-loader": "^5.2.1",
"chai": "^4.0.1",
@ -88,6 +87,7 @@
"@0x/typescript-typings": "^5.1.1",
"@0x/utils": "^5.5.1",
"@0x/web3-wrapper": "^7.2.0",
"@types/node": "12.12.54",
"@types/web3-provider-engine": "^14.0.0",
"ethereum-types": "^3.2.0",
"ethers": "~4.0.4",

View File

@ -92,7 +92,7 @@
"@types/glob": "5.0.35",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/tmp": "^0.0.33",
"@types/yargs": "^11.0.0",
"chai": "^4.0.1",

View File

@ -103,7 +103,7 @@
"@0x/types": "^3.2.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",

View File

@ -41,7 +41,7 @@
"devDependencies": {
"@0x/tslint-config": "^4.1.0",
"@types/mkdirp": "^0.5.2",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/prettier": "^1.15.2",
"shx": "^0.2.2",
"tslint": "5.11.0",

View File

@ -41,7 +41,7 @@
"typescript": "3.0.1"
},
"dependencies": {
"@types/node": "*",
"@types/node": "12.12.54",
"bignumber.js": "~9.0.0"
},
"publishConfig": {

View File

@ -74,7 +74,7 @@
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/jest": "^23.3.5",
"@types/lodash": "4.14.104",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/react": "16.4.16",
"@types/react-dom": "16.0.6",
"@types/react-redux": "^6.0.9",

View File

@ -44,7 +44,7 @@
"homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md",
"dependencies": {
"@0x/typescript-typings": "^5.1.1",
"@types/node": "*",
"@types/node": "12.12.54",
"jsonschema": "^1.2.0",
"lodash.values": "^4.3.0"
},

View File

@ -35,7 +35,7 @@
"devDependencies": {
"@types/glob": "5.0.35",
"@types/mkdirp": "^0.5.2",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/rimraf": "^2.0.2",
"@types/semver": "5.5.0",
"@types/yargs": "^11.0.0",

View File

@ -52,7 +52,7 @@
"@types/bn.js": "^4.11.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/web3-provider-engine": "^14.0.0",
"chai": "^4.0.1",
"ethereum-types": "^3.2.0",

View File

@ -1,4 +1,13 @@
[
{
"version": "4.2.0",
"changes": [
{
"note": "Add solidity 0.7.x suppoert",
"pr": 2710
}
]
},
{
"timestamp": 1594788383,
"version": "4.1.1",

View File

@ -42,6 +42,7 @@ import { ContractContentsByPath, ImportPrefixRemappings, SolcWrapper } from './s
import { SolcWrapperV04 } from './solc_wrapper_v04';
import { SolcWrapperV05 } from './solc_wrapper_v05';
import { SolcWrapperV06 } from './solc_wrapper_v06';
import { SolcWrapperV07 } from './solc_wrapper_v07';
export type TYPE_ALL_FILES_IDENTIFIER = '*';
export const ALL_CONTRACTS_IDENTIFIER = '*';
@ -366,6 +367,9 @@ export class Compiler {
if (solcVersion.startsWith('0.6')) {
return new SolcWrapperV06(solcVersion, this._opts);
}
if (solcVersion.startsWith('0.7')) {
return new SolcWrapperV07(solcVersion, this._opts);
}
throw new Error(`Missing Solc wrapper implementation for version ${solcVersion}`);
}

View File

@ -0,0 +1,3 @@
import { SolcWrapperV06 } from './solc_wrapper_v06';
export const SolcWrapperV07 = SolcWrapperV06;

View File

@ -172,7 +172,7 @@ export async function compileDockerAsync(
'solc', '--standard-json',
];
return new Promise<solc.StandardOutput>((accept, reject) => {
const p = spawn('docker', dockerArgs, { shell: true, stdio: ['pipe', 'inherit', 'inherit'] });
const p = spawn('docker', dockerArgs, { shell: true, stdio: ['pipe', 'pipe', 'inherit'] });
p.stdin.write(standardInputStr);
p.stdin.end();
let fullOutput = '';

View File

@ -9,6 +9,7 @@ import { fsWrapper } from '../src/utils/fs_wrapper';
import { exchange_binary } from './fixtures/exchange_bin';
import { v6_contract_binary } from './fixtures/v6_contract_bin';
import { v7_contract_binary } from './fixtures/v7_contract_bin';
import { chaiSetup } from './util/chai_setup';
import { constants } from './util/constants';
@ -138,4 +139,27 @@ describe('#Compiler', function(): void {
const expectedBinaryWithoutMetadata = hexUtils.slice(v6_contract_binary, 0, -METADATA_SIZE);
expect(actualBinaryWithoutMetadata).to.eq(expectedBinaryWithoutMetadata);
});
it('should compile a V0.7 contract', async () => {
compilerOpts.contracts = ['V7Contract'];
const artifactPath = `${artifactsDir}/V7Contract.json`;
if (fsWrapper.doesPathExistSync(artifactPath)) {
await fsWrapper.removeFileAsync(artifactPath);
}
await new Compiler(compilerOpts).compileAsync();
const opts = {
encoding: 'utf8',
};
const exchangeArtifactString = await fsWrapper.readFileAsync(artifactPath, opts);
const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString);
const actualBinaryWithoutMetadata = hexUtils.slice(
exchangeArtifact.compilerOutput.evm.bytecode.object,
0,
-METADATA_SIZE,
);
const expectedBinaryWithoutMetadata = hexUtils.slice(v7_contract_binary, 0, -METADATA_SIZE);
expect(actualBinaryWithoutMetadata).to.eq(expectedBinaryWithoutMetadata);
});
});

View File

@ -0,0 +1,37 @@
/*
Copyright 2020 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity 0.7.0;
contract V7Contract {
uint256 private _privateNumber;
constructor(uint256 privateNumber) public {
_privateNumber = privateNumber;
}
fallback() external {
revert('nope');
}
receive() payable external {
// no-op
}
}

View File

@ -0,0 +1,2 @@
export const v7_contract_binary =
'0x6080604052348015600f57600080fd5b5060405161011238038061011283398181016040526020811015603157600080fd5b8101908080519060200190929190505050806000819055505060ba806100586000396000f3fe608060405236600a57005b348015601557600080fd5b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f6e6f70650000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fdfea2646970667358221220d498aaab2683da1af2092969c6d8a0c3d992a9a9a0a5d19b54b5e704ab8fd5e364736f6c63430007000033';

View File

@ -45,7 +45,7 @@
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.22",
"@0x/tslint-config": "^4.1.0",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/web3-provider-engine": "^14.0.0",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",

View File

@ -45,7 +45,7 @@
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.22",
"@0x/tslint-config": "^4.1.0",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/web3-provider-engine": "^14.0.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",

View File

@ -47,7 +47,7 @@
"@0x/ts-doc-gen": "^0.0.22",
"@0x/tslint-config": "^4.1.0",
"@types/loglevel": "^1.5.3",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/web3-provider-engine": "^14.0.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",

View File

@ -66,7 +66,7 @@
"@types/loglevel": "^1.5.3",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/rimraf": "^2.0.2",
"chai": "^4.0.1",
"copyfiles": "^2.0.0",

View File

@ -41,7 +41,7 @@
"devDependencies": {
"@0x/tslint-config": "^4.1.0",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"chai": "^4.0.1",
"chokidar-cli": "^1.2.0",
"copyfiles": "^2.0.0",

View File

@ -64,7 +64,7 @@
"@types/hdkey": "^0.7.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^5.2.7",
"@types/node": "*",
"@types/node": "12.12.54",
"@types/sinon": "^2.2.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",

View File

@ -30,7 +30,7 @@
"typescript": "3.0.1"
},
"dependencies": {
"@types/node": "*",
"@types/node": "12.12.54",
"bignumber.js": "~9.0.0",
"ethereum-types": "^3.2.0"
},

View File

@ -47,7 +47,7 @@
"dependencies": {
"@0x/types": "^3.2.0",
"@0x/typescript-typings": "^5.1.1",
"@types/node": "*",
"@types/node": "12.12.54",
"abortcontroller-polyfill": "^1.1.9",
"bignumber.js": "~9.0.0",
"chalk": "^2.3.0",