Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Upgrade contracts to Solidity 0.5.5 #1682

Merged
merged 5 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contracts/asset-proxy/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[
{
"version": "1.0.10",
"version": "2.0.0",
"changes": [
{
"note": "Set evmVersion to byzantium",
"pr": 1678
},
{
"note": "Do not reexport external dependencies",
"pr": 1682
}
]
},
Expand Down
11 changes: 5 additions & 6 deletions contracts/asset-proxy/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"isOfflineMode": false,
"compilerSettings": {
"evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 },
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
Expand All @@ -19,11 +23,6 @@
}
},
"contracts": [
"@0x/contracts-erc20/contracts/test/DummyERC20Token.sol",
"@0x/contracts-erc20/contracts/test/DummyMultipleReturnERC20Token.sol",
"@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol",
"@0x/contracts-erc721/contracts/test/DummyERC721Receiver.sol",
"@0x/contracts-erc721/contracts/test/DummyERC721Token.sol",
"src/ERC20Proxy.sol",
"src/ERC721Proxy.sol",
"src/MixinAuthorizable.sol",
Expand Down
2 changes: 1 addition & 1 deletion contracts/asset-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Receiver|DummyERC721Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json",
"abis": "./generated-artifacts/@(ERC20Proxy|ERC721Proxy|IAssetData|IAssetProxy|IAuthorizable|MixinAuthorizable|MultiAssetProxy).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
Expand Down
10 changes: 0 additions & 10 deletions contracts/asset-proxy/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
*/
import { ContractArtifact } from 'ethereum-types';

import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json';
import * as DummyERC721Receiver from '../generated-artifacts/DummyERC721Receiver.json';
import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json';
import * as DummyMultipleReturnERC20Token from '../generated-artifacts/DummyMultipleReturnERC20Token.json';
import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json';
import * as ERC20Proxy from '../generated-artifacts/ERC20Proxy.json';
import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json';
import * as IAssetData from '../generated-artifacts/IAssetData.json';
Expand All @@ -18,11 +13,6 @@ import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json';
import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json';
export const artifacts = {
DummyERC20Token: DummyERC20Token as ContractArtifact,
DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact,
DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
DummyERC721Receiver: DummyERC721Receiver as ContractArtifact,
DummyERC721Token: DummyERC721Token as ContractArtifact,
ERC20Proxy: ERC20Proxy as ContractArtifact,
ERC721Proxy: ERC721Proxy as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact,
Expand Down
5 changes: 0 additions & 5 deletions contracts/asset-proxy/src/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
export * from '../generated-wrappers/dummy_erc20_token';
export * from '../generated-wrappers/dummy_erc721_receiver';
export * from '../generated-wrappers/dummy_erc721_token';
export * from '../generated-wrappers/dummy_multiple_return_erc20_token';
export * from '../generated-wrappers/dummy_no_return_erc20_token';
export * from '../generated-wrappers/erc20_proxy';
export * from '../generated-wrappers/erc721_proxy';
export * from '../generated-wrappers/i_asset_data';
Expand Down
28 changes: 17 additions & 11 deletions contracts/asset-proxy/test/proxies.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import {
artifacts as erc20Artifacts,
DummyERC20TokenContract,
DummyERC20TokenTransferEventArgs,
DummyMultipleReturnERC20TokenContract,
DummyNoReturnERC20TokenContract,
} from '@0x/contracts-erc20';
import {
artifacts as erc721Artifacts,
DummyERC721ReceiverContract,
DummyERC721TokenContract,
} from '@0x/contracts-erc721';
import {
chaiSetup,
constants,
Expand All @@ -18,12 +30,6 @@ import * as _ from 'lodash';

import {
artifacts,
DummyERC20TokenContract,
DummyERC20TokenTransferEventArgs,
DummyERC721ReceiverContract,
DummyERC721TokenContract,
DummyMultipleReturnERC20TokenContract,
DummyNoReturnERC20TokenContract,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
Expand Down Expand Up @@ -148,7 +154,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_DECIMALS,
);
noReturnErc20Token = await DummyNoReturnERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyNoReturnERC20Token,
erc20Artifacts.DummyNoReturnERC20Token,
provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
Expand All @@ -157,7 +163,7 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_TOTAL_SUPPLY,
);
multipleReturnErc20Token = await DummyMultipleReturnERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyMultipleReturnERC20Token,
erc20Artifacts.DummyMultipleReturnERC20Token,
provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
Expand Down Expand Up @@ -198,7 +204,7 @@ describe('Asset Transfer Proxies', () => {
// Deploy and configure ERC721 tokens and receiver
[erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync();
erc721Receiver = await DummyERC721ReceiverContract.deployFrom0xArtifactAsync(
artifacts.DummyERC721Receiver,
erc721Artifacts.DummyERC721Receiver,
provider,
txDefaults,
);
Expand Down Expand Up @@ -562,7 +568,7 @@ describe('Asset Transfer Proxies', () => {
erc721Receiver.address,
amount,
);
const logDecoder = new LogDecoder(web3Wrapper, artifacts);
const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc721Artifacts });
const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({
to: erc721Proxy.address,
Expand Down Expand Up @@ -754,7 +760,7 @@ describe('Asset Transfer Proxies', () => {
inputAmount,
);
const erc20Balances = await erc20Wrapper.getBalancesAsync();
const logDecoder = new LogDecoder(web3Wrapper, artifacts);
const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts });
const tx = await logDecoder.getTxWithDecodedLogsAsync(
await web3Wrapper.sendTransactionAsync({
to: multiAssetProxy.address,
Expand Down
5 changes: 3 additions & 2 deletions contracts/asset-proxy/test/utils/erc20_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20';
import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils';
import { assetDataUtils } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash';

import { artifacts, DummyERC20TokenContract, ERC20ProxyContract } from '../../src';
import { artifacts, ERC20ProxyContract } from '../../src';

export class ERC20Wrapper {
private readonly _tokenOwnerAddresses: string[];
Expand Down Expand Up @@ -36,7 +37,7 @@ export class ERC20Wrapper {
for (let i = 0; i < numberToDeploy; i++) {
this._dummyTokenContracts.push(
await DummyERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyERC20Token,
erc20Artifacts.DummyERC20Token,
this._provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
Expand Down
5 changes: 3 additions & 2 deletions contracts/asset-proxy/test/utils/erc721_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils';
import { generatePseudoRandomSalt } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash';

import { artifacts, DummyERC721TokenContract, ERC721ProxyContract } from '../../src';
import { artifacts, ERC721ProxyContract } from '../../src';

export class ERC721Wrapper {
private readonly _tokenOwnerAddresses: string[];
Expand All @@ -28,7 +29,7 @@ export class ERC721Wrapper {
for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) {
this._dummyTokenContracts.push(
await DummyERC721TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyERC721Token,
erc721Artifacts.DummyERC721Token,
this._provider,
txDefaults,
constants.DUMMY_TOKEN_NAME,
Expand Down
5 changes: 0 additions & 5 deletions contracts/asset-proxy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
"generated-artifacts/DummyERC20Token.json",
"generated-artifacts/DummyERC721Receiver.json",
"generated-artifacts/DummyERC721Token.json",
"generated-artifacts/DummyMultipleReturnERC20Token.json",
"generated-artifacts/DummyNoReturnERC20Token.json",
"generated-artifacts/ERC20Proxy.json",
"generated-artifacts/ERC721Proxy.json",
"generated-artifacts/IAssetData.json",
Expand Down
6 changes: 5 additions & 1 deletion contracts/coordinator/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"useDockerisedSolc": true,
"compilerSettings": {
"evmVersion": "byzantium",
"optimizer": { "enabled": true, "runs": 1000000 },
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/coordinator/contracts/src/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity 0.5.3;
pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2";

import "./libs/LibConstants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";

import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";

import "./libs/LibZeroExTransaction.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;

import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "./mixins/MSignatureValidator.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";

import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";

import "../libs/LibZeroExTransaction.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;


contract ISignatureValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
limitations under the License.

*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;


contract ITransactions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;

import "../interfaces/ITransactions.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;

import "./LibEIP712Domain.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;


contract LibEIP712Domain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;

import "./LibEIP712Domain.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";

import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity ^0.5.5;

import "../interfaces/ISignatureValidator.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity 0.5.5;

import "./MixinCoordinatorRegistryCore.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;

import "./interfaces/ICoordinatorRegistryCore.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

*/

pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;


// solhint-disable no-empty-blocks
Expand Down
2 changes: 1 addition & 1 deletion contracts/coordinator/contracts/test/TestLibs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.3;
pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2";

import "../src/libs/LibCoordinatorApproval.sol";
Expand Down
Loading