aboutsummaryrefslogtreecommitdiffstats
path: root/contracts/extensions
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-12-13 08:44:28 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-12-21 01:13:36 +0800
commit0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd (patch)
treecc4c7d17a46d62a0e8e5a31e27f37ff11be412d7 /contracts/extensions
parentb6f4c5c7da7d0afe65c0e3dba97aa64e11934595 (diff)
downloaddexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar.gz
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar.bz2
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar.lz
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar.xz
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.tar.zst
dexon-sol-tools-0a5ecec3e222ae0c5e70e0d3092e57df5dfb75cd.zip
update comments
Diffstat (limited to 'contracts/extensions')
-rw-r--r--contracts/extensions/contracts/OrderMatcher/MixinAssets.sol7
-rw-r--r--contracts/extensions/contracts/OrderMatcher/MixinMatchOrders.sol5
-rw-r--r--contracts/extensions/contracts/OrderMatcher/interfaces/IMatchOrders.sol2
-rw-r--r--contracts/extensions/contracts/OrderMatcher/interfaces/IOrderMatcher.sol2
-rw-r--r--contracts/extensions/contracts/OrderMatcher/libs/LibConstants.sol2
5 files changed, 11 insertions, 7 deletions
diff --git a/contracts/extensions/contracts/OrderMatcher/MixinAssets.sol b/contracts/extensions/contracts/OrderMatcher/MixinAssets.sol
index 43e19c19e..323998705 100644
--- a/contracts/extensions/contracts/OrderMatcher/MixinAssets.sol
+++ b/contracts/extensions/contracts/OrderMatcher/MixinAssets.sol
@@ -20,8 +20,8 @@ pragma solidity 0.4.24;
import "@0x/contracts-utils/contracts/utils/LibBytes/LibBytes.sol";
import "@0x/contracts-utils/contracts/utils/Ownable/Ownable.sol";
-import "../../tokens/ERC20Token/IERC20Token.sol";
-import "../../tokens/ERC721Token/IERC721Token.sol";
+import "@0x/contracts-tokens/contracts/tokens/ERC20Token/IERC20Token.sol";
+import "@0x/contracts-tokens/contracts/tokens/ERC721Token/IERC721Token.sol";
import "./mixins/MAssets.sol";
import "./libs/LibConstants.sol";
@@ -98,6 +98,7 @@ contract MixinAssets is
)
internal
{
+ // 4 byte id + 12 0 bytes before ABI encoded token address.
address token = assetData.readAddress(16);
// Transfer tokens.
@@ -149,7 +150,9 @@ contract MixinAssets is
"INVALID_AMOUNT"
);
// Decode asset data.
+ // 4 byte id + 12 0 bytes before ABI encoded token address.
address token = assetData.readAddress(16);
+ // 4 byte id + 32 byte ABI encoded token address before token id.
uint256 tokenId = assetData.readUint256(36);
// Perform transfer.
diff --git a/contracts/extensions/contracts/OrderMatcher/MixinMatchOrders.sol b/contracts/extensions/contracts/OrderMatcher/MixinMatchOrders.sol
index ffe037ee7..866523190 100644
--- a/contracts/extensions/contracts/OrderMatcher/MixinMatchOrders.sol
+++ b/contracts/extensions/contracts/OrderMatcher/MixinMatchOrders.sol
@@ -230,7 +230,7 @@ contract MixinMatchOrders is
// | 932 | a | rightMakerAssetData Contents |
// | 932 + a | 32 | rightTakerAssetData Length |
// | 964 | b | rightTakerAssetData Contents |
- // | 964 + b | 32 | rightSigature Length (always 0) |
+ // | 964 + b | 32 | rightSignature Length (always 0) |
// We assume that `leftOrder.makerAssetData == rightOrder.takerAssetData` and `leftOrder.takerAssetData == rightOrder.makerAssetData`
// `EXCHANGE.matchOrders` already makes this assumption, so it is likely
@@ -280,6 +280,7 @@ contract MixinMatchOrders is
)
mstore(rightSignatureStart, 0)
+ // function selector (4 bytes) + 3 params (3 * 32 bytes) must be stored before `rightOrderStart`
let cdStart := sub(rightOrderStart, 100)
// `fillOrder` selector = 0xb4be83d5
@@ -288,7 +289,7 @@ contract MixinMatchOrders is
// Write offset to `rightOrder`
mstore(add(cdStart, 4), 96)
- // Write `takerAssetFillAmount`
+ // Write `takerAssetFillAmount`, which will be the `leftMakerAssetSpreadAmount` received from the `matchOrders` call
mstore(add(cdStart, 36), mload(256))
// Write offset to `rightSignature`
diff --git a/contracts/extensions/contracts/OrderMatcher/interfaces/IMatchOrders.sol b/contracts/extensions/contracts/OrderMatcher/interfaces/IMatchOrders.sol
index 455259238..19bcbb326 100644
--- a/contracts/extensions/contracts/OrderMatcher/interfaces/IMatchOrders.sol
+++ b/contracts/extensions/contracts/OrderMatcher/interfaces/IMatchOrders.sol
@@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
-import "../../../protocol/Exchange/libs/LibOrder.sol";
+import "@0x/contracts-libs/contracts/libs/LibOrder.sol";
contract IMatchOrders {
diff --git a/contracts/extensions/contracts/OrderMatcher/interfaces/IOrderMatcher.sol b/contracts/extensions/contracts/OrderMatcher/interfaces/IOrderMatcher.sol
index ed4aee925..9b6ea26d8 100644
--- a/contracts/extensions/contracts/OrderMatcher/interfaces/IOrderMatcher.sol
+++ b/contracts/extensions/contracts/OrderMatcher/interfaces/IOrderMatcher.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../../../utils/Ownable/IOwnable.sol";
+import "@0x/contract-utils/contracts/utils/Ownable/IOwnable.sol";
import "./IMatchOrders.sol";
import "./IAssets.sol";
diff --git a/contracts/extensions/contracts/OrderMatcher/libs/LibConstants.sol b/contracts/extensions/contracts/OrderMatcher/libs/LibConstants.sol
index a7c170b42..43bbdeec2 100644
--- a/contracts/extensions/contracts/OrderMatcher/libs/LibConstants.sol
+++ b/contracts/extensions/contracts/OrderMatcher/libs/LibConstants.sol
@@ -18,7 +18,7 @@
pragma solidity 0.4.24;
-import "../../../protocol/Exchange/interfaces/IExchange.sol";
+import "@0x/contracts-interfaces/contracts/protocol/Exchange/IExchange.sol";
contract LibConstants {