Merge pull request #1682 from 0xProject/feat/contracts/solidity0.5.5

Upgrade contracts to Solidity 0.5.5
This commit is contained in:
Amir Bandeali 2019-03-11 17:06:28 -07:00 committed by GitHub
commit 2822e77716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
171 changed files with 527 additions and 417 deletions

View File

@ -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
}
]
},

View File

@ -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": {
"*": {
"*": [
@ -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",

View File

@ -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": {

View File

@ -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';
@ -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,

View File

@ -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';

View File

@ -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,
@ -18,12 +30,6 @@ import * as _ from 'lodash';
import {
artifacts,
DummyERC20TokenContract,
DummyERC20TokenTransferEventArgs,
DummyERC721ReceiverContract,
DummyERC721TokenContract,
DummyMultipleReturnERC20TokenContract,
DummyNoReturnERC20TokenContract,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
@ -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,
@ -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,
@ -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,
);
@ -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,
@ -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,

View File

@ -1,3 +1,4 @@
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';
@ -5,7 +6,7 @@ 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[];
@ -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,

View File

@ -1,3 +1,4 @@
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';
@ -5,7 +6,7 @@ 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[];
@ -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,

View File

@ -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",

View File

@ -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": {
"*": {
"*": [

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.5.3;
pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2";
import "./libs/LibConstants.sol";

View File

@ -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";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";
import "./libs/LibZeroExTransaction.sol";

View File

@ -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";

View File

@ -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";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental "ABIEncoderV2";
import "../libs/LibZeroExTransaction.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
contract ISignatureValidator {

View File

@ -15,7 +15,7 @@
limitations under the License.
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
contract ITransactions {

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "../interfaces/ITransactions.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "./LibEIP712Domain.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
contract LibEIP712Domain {

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "./LibEIP712Domain.sol";

View File

@ -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";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "../interfaces/ISignatureValidator.sol";

View File

@ -16,8 +16,7 @@
*/
pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity 0.5.5;
import "./MixinCoordinatorRegistryCore.sol";

View File

@ -16,8 +16,7 @@
*/
pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;
import "./interfaces/ICoordinatorRegistryCore.sol";

View File

@ -16,8 +16,7 @@
*/
pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.5;
// solhint-disable no-empty-blocks

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2";
import "../src/libs/LibCoordinatorApproval.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.5.3;
pragma solidity 0.5.5;
pragma experimental "ABIEncoderV2";
import "../src/MixinSignatureValidator.sol";

View File

@ -1,4 +1,5 @@
import { DummyERC20TokenContract, ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy';
import { ERC20ProxyContract, ERC20Wrapper } from '@0x/contracts-asset-proxy';
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
import {
artifacts as exchangeArtifacts,
ExchangeCancelEventArgs,

View File

@ -1,10 +1,14 @@
[
{
"version": "1.0.10",
"version": "2.0.0",
"changes": [
{
"note": "Set evmVersion to byzantium",
"pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
}
]
},

View File

@ -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": {
"*": {
"*": [
@ -28,7 +32,6 @@
"src/interfaces/IEtherToken.sol",
"test/DummyERC20Token.sol",
"test/DummyMultipleReturnERC20Token.sol",
"test/DummyNoReturnERC20Token.sol",
"test/ReentrantERC20Token.sol"
"test/DummyNoReturnERC20Token.sol"
]
}

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "./interfaces/IERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol";
import "./UnlimitedAllowanceERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "./ERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IERC20Token {

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "./IERC20Token.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "../src/MintableERC20Token.sol";
@ -32,8 +32,8 @@ contract DummyERC20Token is
uint256 public constant MAX_MINT_AMOUNT = 10000000000000000000000;
constructor (
string _name,
string _symbol,
string memory _name,
string memory _symbol,
uint256 _decimals,
uint256 _totalSupply
)

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "./DummyERC20Token.sol";
@ -26,8 +26,8 @@ contract DummyMultipleReturnERC20Token is
DummyERC20Token
{
constructor (
string _name,
string _symbol,
string memory _name,
string memory _symbol,
uint256 _decimals,
uint256 _totalSupply
)

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "./DummyERC20Token.sol";
@ -26,8 +26,8 @@ contract DummyNoReturnERC20Token is
DummyERC20Token
{
constructor (
string _name,
string _symbol,
string memory _name,
string memory _symbol,
uint256 _decimals,
uint256 _totalSupply
)

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|MintableERC20Token|ReentrantERC20Token|UnlimitedAllowanceERC20Token|WETH9|ZRXToken).json",
"abis": "./generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|MintableERC20Token|UnlimitedAllowanceERC20Token|WETH9|ZRXToken).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
@ -68,8 +68,8 @@
},
"dependencies": {
"@0x/base-contract": "^5.0.2",
"@0x/contracts-exchange-libs": "1.0.2",
"@0x/contracts-utils": "2.0.1",
"@0x/contracts-exchange-libs": "^1.1.3",
"@0x/contracts-utils": "^2.0.8",
"@0x/types": "^2.1.1",
"@0x/typescript-typings": "^4.1.0",
"@0x/utils": "^4.2.2",

View File

@ -12,7 +12,6 @@ import * as ERC20Token from '../generated-artifacts/ERC20Token.json';
import * as IERC20Token from '../generated-artifacts/IERC20Token.json';
import * as IEtherToken from '../generated-artifacts/IEtherToken.json';
import * as MintableERC20Token from '../generated-artifacts/MintableERC20Token.json';
import * as ReentrantERC20Token from '../generated-artifacts/ReentrantERC20Token.json';
import * as UnlimitedAllowanceERC20Token from '../generated-artifacts/UnlimitedAllowanceERC20Token.json';
import * as WETH9 from '../generated-artifacts/WETH9.json';
import * as ZRXToken from '../generated-artifacts/ZRXToken.json';
@ -27,5 +26,4 @@ export const artifacts = {
DummyERC20Token: DummyERC20Token as ContractArtifact,
DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact,
DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact,
ReentrantERC20Token: ReentrantERC20Token as ContractArtifact,
};

View File

@ -10,7 +10,6 @@ export * from '../generated-wrappers/erc20_token';
export * from '../generated-wrappers/i_erc20_token';
export * from '../generated-wrappers/i_ether_token';
export * from '../generated-wrappers/mintable_erc20_token';
export * from '../generated-wrappers/reentrant_erc20_token';
export * from '../generated-wrappers/unlimited_allowance_erc20_token';
export * from '../generated-wrappers/weth9';
export * from '../generated-wrappers/zrx_token';

View File

@ -10,7 +10,6 @@
"generated-artifacts/IERC20Token.json",
"generated-artifacts/IEtherToken.json",
"generated-artifacts/MintableERC20Token.json",
"generated-artifacts/ReentrantERC20Token.json",
"generated-artifacts/UnlimitedAllowanceERC20Token.json",
"generated-artifacts/WETH9.json",
"generated-artifacts/ZRXToken.json"

View File

@ -1,10 +1,14 @@
[
{
"version": "1.0.10",
"version": "2.0.0",
"changes": [
{
"note": "Set evmVersion to byzantium",
"pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
}
]
},

View File

@ -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": {
"*": {
"*": [

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "./interfaces/IERC721Token.sol";
import "./interfaces/IERC721Receiver.sol";
@ -59,7 +59,7 @@ contract ERC721Token is
address _from,
address _to,
uint256 _tokenId,
bytes _data
bytes calldata _data
)
external
{

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "./ERC721Token.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IERC721Receiver {
@ -37,7 +37,7 @@ contract IERC721Receiver {
address _operator,
address _from,
uint256 _tokenId,
bytes _data
bytes calldata _data
)
external
returns (bytes4);

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IERC721Token {
@ -66,7 +66,7 @@ contract IERC721Token {
address _from,
address _to,
uint256 _tokenId,
bytes _data
bytes calldata _data
)
external;

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "../src/interfaces/IERC721Receiver.sol";
@ -51,7 +51,7 @@ contract DummyERC721Receiver is
address _operator,
address _from,
uint256 _tokenId,
bytes _data
bytes calldata _data
)
external
returns (bytes4)

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "../src/MintableERC721Token.sol";
import "@0x/contracts-utils/contracts/src/Ownable.sol";
@ -31,8 +31,8 @@ contract DummyERC721Token is
string public symbol;
constructor (
string _name,
string _symbol
string memory _name,
string memory _symbol
)
public
{

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "../src/interfaces/IERC721Receiver.sol";
@ -50,7 +50,7 @@ contract InvalidERC721Receiver is
address _operator,
address _from,
uint256 _tokenId,
bytes _data
bytes calldata _data
)
external
returns (bytes4)

View File

@ -68,7 +68,7 @@
},
"dependencies": {
"@0x/base-contract": "^5.0.2",
"@0x/contracts-utils": "2.0.1",
"@0x/contracts-utils": "^2.0.8",
"@0x/types": "^2.1.1",
"@0x/typescript-typings": "^4.1.0",
"@0x/utils": "^4.2.2",

View File

@ -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
}
]
},

View File

@ -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": {
"*": {
"*": [
@ -18,11 +22,5 @@
}
}
},
"contracts": [
"@0x/contracts-erc20/contracts/src/WETH9.sol",
"@0x/contracts-erc20/contracts/test/DummyERC20Token.sol",
"@0x/contracts-erc721/contracts/test/DummyERC721Token.sol",
"@0x/contracts-exchange/contracts/src/Exchange.sol",
"src/Forwarder.sol"
]
"contracts": ["src/Forwarder.sol"]
}

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(DummyERC20Token|DummyERC721Token|Exchange|Forwarder|WETH9).json",
"abis": "./generated-artifacts/@(Forwarder).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
@ -70,8 +70,8 @@
"dependencies": {
"@0x/base-contract": "^5.0.2",
"@0x/contracts-asset-proxy": "^1.0.9",
"@0x/contracts-erc20": "^1.0.9",
"@0x/contracts-erc721": "^1.0.9",
"@0x/contracts-erc20": "1.0.8",
"@0x/contracts-erc721": "1.0.8",
"@0x/contracts-exchange": "1.0.2",
"@0x/contracts-exchange-libs": "1.0.2",
"@0x/contracts-utils": "2.0.1",

View File

@ -5,15 +5,5 @@
*/
import { ContractArtifact } from 'ethereum-types';
import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json';
import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json';
import * as Exchange from '../generated-artifacts/Exchange.json';
import * as Forwarder from '../generated-artifacts/Forwarder.json';
import * as WETH9 from '../generated-artifacts/WETH9.json';
export const artifacts = {
WETH9: WETH9 as ContractArtifact,
DummyERC20Token: DummyERC20Token as ContractArtifact,
DummyERC721Token: DummyERC721Token as ContractArtifact,
Exchange: Exchange as ContractArtifact,
Forwarder: Forwarder as ContractArtifact,
};
export const artifacts = { Forwarder: Forwarder as ContractArtifact };

View File

@ -3,8 +3,4 @@
* 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_token';
export * from '../generated-wrappers/exchange';
export * from '../generated-wrappers/forwarder';
export * from '../generated-wrappers/weth9';

View File

@ -1,10 +1,7 @@
import {
DummyERC20TokenContract,
DummyERC721TokenContract,
ERC20Wrapper,
ERC721Wrapper,
} from '@0x/contracts-asset-proxy';
import { ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange';
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange';
import {
chaiSetup,
constants,
@ -26,7 +23,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import { artifacts, ForwarderContract, ForwarderWrapper, WETH9Contract } from '../src';
import { artifacts, ForwarderContract, ForwarderWrapper } from '../src';
chaiSetup.configure();
const expect = chai.expect;
@ -91,14 +88,14 @@ describe(ContractName.Forwarder, () => {
const erc721Balances = await erc721Wrapper.getBalancesAsync();
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults);
weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider);
erc20Wrapper.addDummyTokenContract(weth);
wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address);
zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync(
artifacts.Exchange,
exchangeArtifacts.Exchange,
provider,
txDefaults,
zrxAssetData,
@ -169,7 +166,7 @@ describe(ContractName.Forwarder, () => {
describe('constructor', () => {
it('should revert if assetProxy is unregistered', async () => {
const exchangeInstance = await ExchangeContract.deployFrom0xArtifactAsync(
artifacts.Exchange,
exchangeArtifacts.Exchange,
provider,
txDefaults,
zrxAssetData,

View File

@ -1,3 +1,6 @@
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange';
import { constants, formatters, LogDecoder, MarketSellOrders, Web3ProviderEngine } from '@0x/contracts-test-utils';
import { SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils';
@ -58,7 +61,12 @@ export class ForwarderWrapper {
constructor(contractInstance: ForwarderContract, provider: Web3ProviderEngine) {
this._forwarderContract = contractInstance;
this._web3Wrapper = new Web3Wrapper(provider);
this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts);
this._logDecoder = new LogDecoder(this._web3Wrapper, {
...artifacts,
...exchangeArtifacts,
...erc20Artifacts,
...erc721Artifacts,
});
}
public async marketSellOrdersWithEthAsync(
orders: SignedOrder[],

View File

@ -2,12 +2,6 @@
"extends": "../../tsconfig",
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
"generated-artifacts/DummyERC20Token.json",
"generated-artifacts/DummyERC721Token.json",
"generated-artifacts/Exchange.json",
"generated-artifacts/Forwarder.json",
"generated-artifacts/WETH9.json"
],
"files": ["generated-artifacts/Forwarder.json"],
"exclude": ["./deploy/solc/solc_bin"]
}

View File

@ -1,10 +1,14 @@
[
{
"version": "1.1.4",
"version": "2.0.0",
"changes": [
{
"note": "Set evmVersion to byzantium",
"pr": 1678
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
}
]
},

View File

@ -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": {
"*": {
"*": [

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "./LibOrder.sol";

View File

@ -17,7 +17,7 @@
*/
// solhint-disable
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
/// @dev This contract documents the revert reasons used in the AssetProxy contracts.

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
// solhint-disable max-line-length

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
contract LibEIP712 {

View File

@ -17,7 +17,7 @@
*/
// solhint-disable
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
/// @dev This contract documents the revert reasons used in the Exchange contract.

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
contract LibExchangeSelectors {

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/SafeMath.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.5.3;
pragma solidity ^0.5.5;
import "./LibEIP712.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.5.3;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "../src/LibMath.sol";

View File

@ -1,10 +1,18 @@
[
{
"version": "1.0.10",
"version": "2.0.0",
"changes": [
{
"note": "Set evmVersion to byzantium",
"pr": 1678
},
{
"note": "Do not reexport external dependencies",
"pr": 1682
},
{
"note": "Upgrade contracts to Solidity 0.5.5",
"pr": 1682
}
]
},

View File

@ -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": {
"*": {
"*": [
@ -19,14 +23,6 @@
}
},
"contracts": [
"@0x/contracts-asset-proxy/contracts/src/ERC20Proxy.sol",
"@0x/contracts-asset-proxy/contracts/src/ERC721Proxy.sol",
"@0x/contracts-asset-proxy/contracts/src/MultiAssetProxy.sol",
"@0x/contracts-erc20/contracts/test/DummyERC20Token.sol",
"@0x/contracts-erc20/contracts/test/DummyNoReturnERC20Token.sol",
"@0x/contracts-erc20/contracts/test/ReentrantERC20Token.sol",
"@0x/contracts-erc721/contracts/test/DummyERC721Token.sol",
"@0x/contracts-exchange-libs/contracts/test/TestLibs.sol",
"examples/ExchangeWrapper.sol",
"examples/Validator.sol",
"examples/Wallet.sol",
@ -41,6 +37,7 @@
"src/interfaces/IValidator.sol",
"src/interfaces/IWallet.sol",
"src/interfaces/IWrapperFunctions.sol",
"test/ReentrantERC20Token.sol",
"test/TestAssetProxyDispatcher.sol",
"test/TestExchangeInternals.sol",
"test/TestSignatureValidator.sol",

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "../src/interfaces/IExchange.sol";
@ -43,7 +43,7 @@ contract ExchangeWrapper {
function cancelOrdersUpTo(
uint256 targetOrderEpoch,
uint256 salt,
bytes makerSignature
bytes calldata makerSignature
)
external
{

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "../src/interfaces/IValidator.sol";
@ -44,7 +44,7 @@ contract Validator is
function isValidSignature(
bytes32 hash,
address signerAddress,
bytes signature
bytes calldata signature
)
external
view

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
import "../src/interfaces/IWallet.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
@ -44,7 +44,7 @@ contract Wallet is
/// @return Validity of signature.
function isValidSignature(
bytes32 hash,
bytes eip712Signature
bytes calldata eip712Signature
)
external
view

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "../src/interfaces/IExchange.sol";
@ -69,7 +69,7 @@ contract Whitelist is
function isValidSignature(
bytes32 hash,
address signerAddress,
bytes signature
bytes calldata signature
)
external
view

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity 0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibConstants.sol";
@ -37,7 +37,7 @@ contract Exchange is
MixinAssetProxyDispatcher,
MixinWrapperFunctions
{
string constant public VERSION = "2.0.1-alpha";
string constant public VERSION = "3.0.0";
// Mixins are instantiated in the order they are inherited
constructor (bytes memory _zrxAssetData)

View File

@ -16,11 +16,11 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "./mixins/MAssetProxyDispatcher.sol";
import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetProxy.sol";
import "./interfaces/IAssetProxy.sol";
contract MixinAssetProxyDispatcher is
@ -28,7 +28,7 @@ contract MixinAssetProxyDispatcher is
MAssetProxyDispatcher
{
// Mapping from Asset Proxy Id's to their respective Asset Proxy
mapping (bytes4 => IAssetProxy) public assetProxies;
mapping (bytes4 => address) public assetProxies;
/// @dev Registers an asset proxy to its asset proxy id.
/// Once an asset proxy is registered, it cannot be unregistered.
@ -37,10 +37,8 @@ contract MixinAssetProxyDispatcher is
external
onlyOwner
{
IAssetProxy assetProxyContract = IAssetProxy(assetProxy);
// Ensure that no asset proxy exists with current id.
bytes4 assetProxyId = assetProxyContract.getProxyId();
bytes4 assetProxyId = IAssetProxy(assetProxy).getProxyId();
address currentAssetProxy = assetProxies[assetProxyId];
require(
currentAssetProxy == address(0),
@ -48,7 +46,7 @@ contract MixinAssetProxyDispatcher is
);
// Add asset proxy and log registration.
assetProxies[assetProxyId] = assetProxyContract;
assetProxies[assetProxyId] = assetProxy;
emit AssetProxyRegistered(
assetProxyId,
assetProxy

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -11,7 +11,7 @@
limitations under the License.
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";
@ -46,7 +46,7 @@ contract MixinSignatureValidator is
function preSign(
bytes32 hash,
address signerAddress,
bytes signature
bytes calldata signature
)
external
{
@ -233,7 +233,7 @@ contract MixinSignatureValidator is
function isValidWalletSignature(
bytes32 hash,
address walletAddress,
bytes signature
bytes memory signature
)
internal
view
@ -282,7 +282,7 @@ contract MixinSignatureValidator is
address validatorAddress,
bytes32 hash,
address signerAddress,
bytes signature
bytes memory signature
)
internal
view

View File

@ -15,7 +15,8 @@
limitations under the License.
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeErrors.sol";
import "./mixins/MSignatureValidator.sol";
@ -43,8 +44,8 @@ contract MixinTransactions is
function executeTransaction(
uint256 salt,
address signerAddress,
bytes data,
bytes signature
bytes calldata data,
bytes calldata signature
)
external
{
@ -84,8 +85,9 @@ contract MixinTransactions is
// Execute transaction
transactions[transactionHash] = true;
(bool success,) = address(this).delegatecall(data);
require(
address(this).delegatecall(data),
success,
"FAILED_EXECUTION"
);

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-utils/contracts/src/ReentrancyGuard.sol";

View File

@ -0,0 +1,43 @@
/*
Copyright 2018 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.5.5;
contract IAssetProxy {
/// @dev Transfers assets. Either succeeds or throws.
/// @param assetData Byte array encoded for the respective asset proxy.
/// @param from Address to transfer asset from.
/// @param to Address to transfer asset to.
/// @param amount Amount of asset to transfer.
function transferFrom(
bytes calldata assetData,
address from,
address to,
uint256 amount
)
external;
/// @dev Gets the proxy id associated with the proxy address.
/// @return Proxy id.
function getProxyId()
external
pure
returns (bytes4);
}

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IAssetProxyDispatcher {

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "./IExchangeCore.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -15,7 +15,8 @@
limitations under the License.
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract ISignatureValidator {
@ -28,7 +28,7 @@ contract ISignatureValidator {
function preSign(
bytes32 hash,
address signerAddress,
bytes signature
bytes calldata signature
)
external;

View File

@ -15,7 +15,8 @@
limitations under the License.
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract ITransactions {
@ -28,8 +29,8 @@ contract ITransactions {
function executeTransaction(
uint256 salt,
address signerAddress,
bytes data,
bytes signature
bytes calldata data,
bytes calldata signature
)
external;
}

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IValidator {
@ -29,7 +29,7 @@ contract IValidator {
function isValidSignature(
bytes32 hash,
address signerAddress,
bytes signature
bytes calldata signature
)
external
view

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
contract IWallet {
@ -27,7 +27,7 @@ contract IWallet {
/// @return Validity of order signature.
function isValidSignature(
bytes32 hash,
bytes signature
bytes calldata signature
)
external
view

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
import "../interfaces/IAssetProxyDispatcher.sol";

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -15,7 +15,8 @@
limitations under the License.
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

Some files were not shown because too many files have changed in this diff Show More