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 26, 2018

Things to do separately:

  • Writeup for Kyber wrapper rates
  • Integration tests with Issuance Orders

@asoong asoong requested a review from a team September 26, 2018 01:31
@coveralls
Copy link

coveralls commented Sep 26, 2018

Pull Request Test Coverage Report for Build 1859

  • 22 of 22 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 99.851%

Totals Coverage Status
Change from base Build 1839: 0.006%
Covered Lines: 484
Relevant Lines: 484

💛 - Coveralls

Copy link
Contributor

@felix2feng felix2feng left a comment

Choose a reason for hiding this comment

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

This is really good! This is just my initial perusal, but I only have surface-level comments. I'll take another peek in a bit

);

// Update current bytes
scannedBytes = scannedBytes.add(160);
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 trade data size is fixed, can we make this a variable defined on the top of the file vs. a magic number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normally, yes. In solidity, no since it’s another reference which adds gas

// Transfer any unused issuance order maker token back to user
uint remainderSourceToken = ERC20.balanceOf(_trade.sourceToken, this);
if (remainderSourceToken > 0) {
ERC20.transfer(
Copy link
Contributor

Choose a reason for hiding this comment

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

OPTIMIZATION: Performing a transfer each time seems costly. Is there a way we can accumulate the remainderSourceToken and send it once after all Kyber trades have been executed?

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

import { BigNumber } from 'bignumber.js';
import { Address, Bytes, KyberTrade } from 'set-protocol-utils';

import ChaiSetup from '../../../utils/chaiSetup';
Copy link
Contributor

Choose a reason for hiding this comment

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

Use path aliases! @utils

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

*
* TODO: Currently passes change back to the issuance order maker
*
* @param _maker Unused address of issuance order signer to conform to IExchangeWrapper
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is a little misleading because the address is used for transferring leftover tokens

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

Copy link
Contributor

@felix2feng felix2feng left a comment

Choose a reason for hiding this comment

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

This is a great. Looking forward to the following integration tests.

Approve modulo getting the small knits in. The optimization piece can be added later as long as we add a card for it.

*
* | Data | Location |
* |----------------------------|-------------------------------|
* | sourceToken | 0 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems useful to add the data type as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just needs to show which parameter is at which index, the types are revealed in the struct at the top of this file

);
}

// 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.

Knit: Space between Transfer and Proxy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving it in, meant to refer to the contract name

@asoong asoong force-pushed the alex/kyber_network_proxy_wrapper branch from a6cfec7 to 4c7334d Compare September 26, 2018 18:27
@asoong asoong force-pushed the alex/kyber_network_proxy_wrapper branch from 4c7334d to 36b3e27 Compare September 26, 2018 18:46
@asoong asoong merged commit 9f22669 into master Sep 26, 2018
@asoong asoong deleted the alex/kyber_network_proxy_wrapper branch September 26, 2018 19:07
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