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

DevUtils refactor into public libraries #2464

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
13 changes: 13 additions & 0 deletions contracts/dev-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
[
{
"version": "1.1.0",
"changes": [
{
"note": "Refactor mixins into public libraries.",
"pr": 2464
},
{
"note": "Remove `LibTransactionDecoder` export",
"pr": 2464
}
]
},
{
"timestamp": 1580988106,
"version": "1.0.6",
Expand Down
51 changes: 51 additions & 0 deletions contracts/dev-utils/contracts/src/Addresses.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*

Copyright 2019 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.16;
pragma experimental ABIEncoderV2;

import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetData.sol";
import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol";
import "@0x/contracts-utils/contracts/src/DeploymentConstants.sol";


// solhint-disable no-empty-blocks
contract Addresses is
DeploymentConstants
{
address public exchangeAddress;
address public erc20ProxyAddress;
address public erc721ProxyAddress;
address public erc1155ProxyAddress;
address public staticCallProxyAddress;
address public chaiBridgeAddress;

constructor (
address exchange_,
address chaiBridge_
)
public
{
exchangeAddress = exchange_;
chaiBridgeAddress = chaiBridge_;
erc20ProxyAddress = IExchange(exchange_).getAssetProxy(IAssetData(address(0)).ERC20Token.selector);
erc721ProxyAddress = IExchange(exchange_).getAssetProxy(IAssetData(address(0)).ERC721Token.selector);
erc1155ProxyAddress = IExchange(exchange_).getAssetProxy(IAssetData(address(0)).ERC1155Assets.selector);
staticCallProxyAddress = IExchange(exchange_).getAssetProxy(IAssetData(address(0)).StaticCall.selector);
}
}
374 changes: 374 additions & 0 deletions contracts/dev-utils/contracts/src/AssetBalance.sol

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions contracts/dev-utils/contracts/src/DevUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,37 @@

*/

pragma solidity ^0.5.5;
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import "@0x/contracts-exchange-libs/contracts/src/LibEIP712ExchangeDomain.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibZeroExTransaction.sol";
import "@0x/contracts-utils/contracts/src/LibEIP712.sol";
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "./Addresses.sol";
import "./OrderValidationUtils.sol";
import "./OrderTransferSimulationUtils.sol";
import "./EthBalanceChecker.sol";
import "./ExternalFunctions.sol";


// solhint-disable no-empty-blocks
contract DevUtils is
Addresses,
OrderValidationUtils,
LibEIP712ExchangeDomain,
EthBalanceChecker
EthBalanceChecker,
ExternalFunctions
{
constructor (
address _exchange,
address _chaiBridge
address exchange_,
address chaiBridge_
)
public
OrderValidationUtils(
_exchange,
_chaiBridge
Addresses(
exchange_,
chaiBridge_
)
OrderTransferSimulationUtils(_exchange)
LibEIP712ExchangeDomain(uint256(0), address(0)) // null args because because we only use constants
{}

Expand Down
2 changes: 1 addition & 1 deletion contracts/dev-utils/contracts/src/EthBalanceChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

*/

pragma solidity ^0.5.5;
pragma solidity ^0.5.16;


contract EthBalanceChecker {
Expand Down
Loading