aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-04-11 12:36:19 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:17 +0800
commit219d6c294d1bea000d3b763059162811f51568ee (patch)
tree76b87379c71957df128bf59489f06bb0c2779aa1 /packages/contracts
parent78d81f193f3b9358ab86819f83c76b8bcd52a9c9 (diff)
downloaddexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar.gz
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar.bz2
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar.lz
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar.xz
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.tar.zst
dexon-sol-tools-219d6c294d1bea000d3b763059162811f51568ee.zip
Changed order of write parameters in LibBytes. Now ordered by most generalized to most specific
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy.sol2
-rw-r--r--packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy_v1.sol2
-rw-r--r--packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC721TransferProxy.sol4
-rw-r--r--packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol12
4 files changed, 10 insertions, 10 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy.sol b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy.sol
index 61fcd9d00..535bfba24 100644
--- a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy.sol
+++ b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy.sol
@@ -63,7 +63,7 @@ contract ERC20TransferProxy is
// Encode fields into a byte array
assetMetadata = new bytes(21);
assetMetadata[0] = byte(assetProxyId);
- writeAddress(tokenAddress, assetMetadata, 1);
+ writeAddress(assetMetadata, 1, tokenAddress);
return assetMetadata;
}
diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy_v1.sol b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy_v1.sol
index 6b19f1a52..dceb2c1a6 100644
--- a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy_v1.sol
+++ b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC20TransferProxy_v1.sol
@@ -72,7 +72,7 @@ contract ERC20TransferProxy_v1 is
// Encode fields into a byte array
assetMetadata = new bytes(21);
assetMetadata[0] = byte(assetProxyId);
- writeAddress(tokenAddress, assetMetadata, 1);
+ writeAddress(assetMetadata, 1, tokenAddress);
return assetMetadata;
}
diff --git a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC721TransferProxy.sol b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC721TransferProxy.sol
index 51f027a56..8b7a131cb 100644
--- a/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC721TransferProxy.sol
+++ b/packages/contracts/src/contracts/current/protocol/AssetProxyDispatcher/proxies/ERC721TransferProxy.sol
@@ -73,8 +73,8 @@ contract ERC721TransferProxy is
// Encode fields into a byte array
assetMetadata = new bytes(53);
assetMetadata[0] = byte(assetProxyId);
- writeAddress(tokenAddress, assetMetadata, 1);
- writeUint256(tokenId, assetMetadata, 21);
+ writeAddress(assetMetadata, 1, tokenAddress);
+ writeUint256(assetMetadata, 21, tokenId);
return assetMetadata;
}
diff --git a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
index 32a51d8ab..59017d159 100644
--- a/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
+++ b/packages/contracts/src/contracts/current/utils/LibBytes/LibBytes.sol
@@ -48,13 +48,13 @@ contract LibBytes {
}
/// @dev Writes an address into a specific position in a byte array.
- /// @param input Address to put into byte array.
/// @param b Byte array to insert address into.
/// @param index Index in byte array of address.
+ /// @param input Address to put into byte array.
function writeAddress(
- address input,
bytes b,
- uint256 index)
+ uint256 index,
+ address input)
public pure
{
require(b.length >= index + 20); // 20 is length of address
@@ -104,13 +104,13 @@ contract LibBytes {
}
/// @dev Writes a uint256 into a specific position in a byte array.
- /// @param input uint256 to put into byte array.
/// @param b Byte array to insert <input> into.
/// @param index Index in byte array of <input>.
+ /// @param input uint256 to put into byte array.
function writeUint256(
- uint256 input,
bytes b,
- uint256 index)
+ uint256 index,
+ uint256 input)
public pure
{
require(b.length >= index + 32);