From aa3be5198093c5514d8ce237272e390f8be65d65 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Sat, 21 Apr 2018 15:57:45 -0700 Subject: Fix names and visibilities, use address type over contract type for function args and returns --- .../AssetProxyDispatcher/AssetProxyDispatcher.sol | 18 +++++++++--------- .../AssetProxyDispatcher/IAssetProxyDispatcher.sol | 14 +++++++------- .../current/protocol/Exchange/MixinSettlementProxy.sol | 4 ++-- .../current/utils/Authorizable/Authorizable.sol | 5 ++--- .../src/contracts/current/utils/LibBytes/LibBytes.sol | 2 +- 5 files changed, 21 insertions(+), 22 deletions(-) (limited to 'packages') diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/AssetProxyDispatcher.sol b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/AssetProxyDispatcher.sol index 2c689496f..43fd7596e 100644 --- a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/AssetProxyDispatcher.sol +++ b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/AssetProxyDispatcher.sol @@ -57,21 +57,21 @@ contract AssetProxyDispatcher is /// An id can only be assigned to a single proxy at a given time, /// however, an asset proxy may be registered to multiple ids. /// @param assetProxyId Id to register`newAssetProxy` under. - /// @param newAssetProxy asset proxy to register, or 0x0 to unset assetProxyId. - /// @param currentAssetProxy Existing asset proxy to overwrite, or 0x0 if assetProxyId is currently unused. + /// @param newAssetProxy Address of new asset proxy to register, or 0x0 to unset assetProxyId. + /// @param oldAssetProxy Existing asset proxy to overwrite, or 0x0 if assetProxyId is currently unused. function registerAssetProxy( uint8 assetProxyId, - IAssetProxy newAssetProxy, - IAssetProxy currentAssetProxy) + address newAssetProxy, + address oldAssetProxy) external onlyOwner { // Ensure the existing asset proxy is not unintentionally overwritten - require(currentAssetProxy == assetProxies[assetProxyId]); + require(oldAssetProxy == address(assetProxies[assetProxyId])); // Add asset proxy and log registration - assetProxies[assetProxyId] = newAssetProxy; - emit AssetProxySet(assetProxyId, newAssetProxy, currentAssetProxy); + assetProxies[assetProxyId] = IAssetProxy(newAssetProxy); + emit AssetProxySet(assetProxyId, newAssetProxy, oldAssetProxy); } /// @dev Gets an asset proxy. @@ -79,9 +79,9 @@ contract AssetProxyDispatcher is /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered. function getAssetProxy(uint8 assetProxyId) external view - returns (IAssetProxy) + returns (address) { IAssetProxy assetProxy = assetProxies[assetProxyId]; - return assetProxy; + return address(assetProxy); } } diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/IAssetProxyDispatcher.sol b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/IAssetProxyDispatcher.sol index 044983823..88bc0d353 100644 --- a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/IAssetProxyDispatcher.sol +++ b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/IAssetProxyDispatcher.sol @@ -31,20 +31,20 @@ contract IAssetProxyDispatcher is // Logs registration of new asset proxy event AssetProxySet( uint8 id, - IAssetProxy newAssetClassAddress, - IAssetProxy oldAssetClassAddress + address newAssetProxy, + address oldAssetProxy ); /// @dev Registers an asset proxy to an asset proxy id. /// An id can only be assigned to a single proxy at a given time, /// however, an asset proxy may be registered to multiple ids. /// @param assetProxyId Id to register`newAssetProxy` under. - /// @param newAssetProxy asset proxy to register, or 0x0 to unset assetProxyId. - /// @param currentAssetProxy Existing asset proxy to overwrite, or 0x0 if assetProxyId is currently unused. + /// @param newAssetProxy Address of new asset proxy to register, or 0x0 to unset assetProxyId. + /// @param oldAssetProxy Existing asset proxy to overwrite, or 0x0 if assetProxyId is currently unused. function registerAssetProxy( uint8 assetProxyId, - IAssetProxy newAssetProxy, - IAssetProxy currentAssetProxy) + address newAssetProxy, + address oldAssetProxy) external; /// @dev Gets an asset proxy. @@ -52,5 +52,5 @@ contract IAssetProxyDispatcher is /// @return The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered. function getAssetProxy(uint8 assetProxyId) external view - returns (IAssetProxy); + returns (address); } diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol index 0d1d13ede..718572d50 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol @@ -33,9 +33,9 @@ contract MixinSettlementProxy is function assetProxyDispatcher() public view - returns (IAssetProxy) + returns (address) { - return ASSET_PROXY_DISPATCHER; + return address(ASSET_PROXY_DISPATCHER); } function zrxProxyData() diff --git a/packages/contracts/src/contracts/current/utils/Authorizable/Authorizable.sol b/packages/contracts/src/contracts/current/utils/Authorizable/Authorizable.sol index 3e2e0782f..f6032f889 100644 --- a/packages/contracts/src/contracts/current/utils/Authorizable/Authorizable.sol +++ b/packages/contracts/src/contracts/current/utils/Authorizable/Authorizable.sol @@ -100,9 +100,8 @@ contract Authorizable is /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() - public - constant - returns (address[]) + public view + returns (address[] memory) { return authorities; } diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol index f78d9baec..ce107f306 100644 --- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol +++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol @@ -25,7 +25,7 @@ contract LibBytes { /// @param rhs Second byte array to compare. /// @return True if arrays are the same. False otherwise. function areBytesEqual(bytes memory lhs, bytes memory rhs) - public + public pure returns (bool equal) { assembly { -- cgit v1.2.3