diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-04-22 06:57:45 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-22 08:31:11 +0800 |
commit | aa3be5198093c5514d8ce237272e390f8be65d65 (patch) | |
tree | abfd2e2517f89ade404835bad2c8f90b3eb60ab2 | |
parent | fe6c77cafb3bc1b5e19e9a9b5eb9f995244d625c (diff) | |
download | dexon-0x-contracts-aa3be5198093c5514d8ce237272e390f8be65d65.tar.gz dexon-0x-contracts-aa3be5198093c5514d8ce237272e390f8be65d65.tar.zst dexon-0x-contracts-aa3be5198093c5514d8ce237272e390f8be65d65.zip |
Fix names and visibilities, use address type over contract type for function args and returns
5 files changed, 21 insertions, 22 deletions
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 { |