Fix names and visibilities, use address type over contract type for function args and returns

This commit is contained in:
Amir Bandeali
2018-04-21 15:57:45 -07:00
parent fe6c77cafb
commit aa3be51980
5 changed files with 21 additions and 22 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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()

View File

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

View File

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