Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Conversation

@asoong
Copy link
Contributor

@asoong asoong commented Sep 27, 2018

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.

  • Kyber wrapper does one approval for the source token
  • Kyber wrapper transfers source token 'change' to the issuance order maker once. This was actually a critical bug
  • ZeroEx wrapper does one approval for the issuance order taker token

@asoong asoong requested a review from a team September 27, 2018 19:09
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parse

@coveralls
Copy link

coveralls commented Sep 27, 2018

Pull Request Test Coverage Report for Build 1934

  • 31 of 31 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 100.0%

Totals Coverage Status
Change from base Build 1905: 0.1%
Covered Lines: 505
Relevant Lines: 505

💛 - Coveralls

@asoong asoong force-pushed the alex/exchange_wrapper_optimizations branch from 8ba7af9 to dd085d8 Compare September 28, 2018 04:08
_maker
// Transfer any unused or remainder maker token back to the issuance order user
uint remainderSourceToken = ERC20.balanceOf(_makerToken, this);
if (remainderSourceToken > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ If the componentTokensReceived during the trade was the makerToken, then an unintended amount would be returned to the _maker and the issuance order would fail.

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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

@felix2feng
Copy link
Contributor

Compile issues 😢

Buffer.concat(zeroExOrdersExchangeHeader),
Buffer.concat(zeroExOrderBuffer),
]));
console.log(subjectExchangeOrdersData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console log!

@asoong asoong force-pushed the alex/exchange_wrapper_optimizations branch from c6b26de to 7452809 Compare September 28, 2018 18:43
@asoong asoong merged commit 41df2f2 into master Sep 28, 2018
@asoong asoong deleted the alex/exchange_wrapper_optimizations branch September 28, 2018 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants