-
Notifications
You must be signed in to change notification settings - Fork 59
Exchange wrapper optimizations, minimize unnecessary transfers/approvals #218
Conversation
| uint256[] memory componentTokensAmounts = new uint256[](_tradeCount); | ||
|
|
||
| uint256 scannedBytes = 0; | ||
| // Prase and execute the trade at the current offset via the KyberNetworkProxy, each kyber trade is 160 bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parse
Pull Request Test Coverage Report for Build 1934
💛 - Coveralls |
8ba7af9 to
dd085d8
Compare
| _maker | ||
| // Transfer any unused or remainder maker token back to the issuance order user | ||
| uint remainderSourceToken = ERC20.balanceOf(_makerToken, this); | ||
| if (remainderSourceToken > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
componentTokensReceived during the trade was the makerToken, then an unintended amount would be returned to the _maker and the issuance order would fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding comment to request changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that a problem? why wouldn't we want it to revert? this seems like an optimization to make at the assertion level
| ); | ||
| } | ||
|
|
||
| // Ensure the maker token is allowed to be transferred by Set TransferProxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Destination token vs maker token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| { | ||
| address[] memory takerTokens = new address[](_orderCount); | ||
| uint256[] memory takerAmounts = new uint256[](_orderCount); | ||
| // Ensure the taker token is allowed to be transferred by ZeroEx Proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what you mean, but this is a slightly confusing comment given that the _makerToken is passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| _maker | ||
| // Transfer any unused or remainder maker token back to the issuance order user | ||
| uint remainderSourceToken = ERC20.balanceOf(_makerToken, this); | ||
| if (remainderSourceToken > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding comment to request changes
|
Compile issues 😢 |
| Buffer.concat(zeroExOrdersExchangeHeader), | ||
| Buffer.concat(zeroExOrderBuffer), | ||
| ])); | ||
| console.log(subjectExchangeOrdersData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console log!
c6b26de to
7452809
Compare
Passing in additional parameters into the wrappers. This will require a redeploy of contracts for it to work on TestNet since the wrappers and parameters that core pass are no longer sufficient.