diff options
Diffstat (limited to 'packages/contracts/src')
3 files changed, 6 insertions, 8 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC20Proxy.sol b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC20Proxy.sol index c8e8f4587..50632400e 100644 --- a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC20Proxy.sol +++ b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC20Proxy.sol @@ -20,7 +20,6 @@ pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "../../utils/LibBytes/LibBytes.sol"; -import "../../tokens/ERC20Token/IERC20Token.sol"; import "./MixinAssetProxy.sol"; import "./MixinAuthorizable.sol"; import "../../tokens/ERC20Token/IERC20Token.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol index 7de7968cc..21e5518c6 100644 --- a/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol +++ b/packages/contracts/src/contracts/current/protocol/AssetProxy/ERC721Proxy.sol @@ -33,8 +33,6 @@ contract ERC721Proxy is // Id of this proxy. uint8 constant PROXY_ID = 2; - string constant PROXY_ID_MISMATCH = "Proxy id in metadata does not match this proxy id."; - /// @dev Internal version of `transferFrom`. /// @param assetData Encoded byte array. /// @param from Address to transfer asset from. @@ -60,7 +58,7 @@ contract ERC721Proxy is // Data must be intended for this proxy. require( proxyId == PROXY_ID, - PROXY_ID_MISMATCH + ASSET_PROXY_ID_MISMATCH ); // There exists only 1 of each token. diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol index 5610c47b3..8f6647d20 100644 --- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol +++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol @@ -332,7 +332,8 @@ contract LibBytes is internal pure { - // Read length of nested bytes + // Assert length of <b> is valid, given + // length of input require( b.length >= index + 32 /* 32 bytes to store length */ + input.length, GTE_32_LENGTH_REQUIRED @@ -340,9 +341,9 @@ contract LibBytes is // Copy <input> into <b> memcpy( - getMemAddress(b) + index + 32, // +32 to skip length of <b> - getMemAddress(input), // include length of byte array - input.length + 32 // +32 bytes to store length + getMemAddress(b) + 32 + index, // +32 to skip length of <b> + getMemAddress(input), // includes length of <input> + input.length + 32 // +32 bytes to store <input> length ); } } |