Skip to main content
added 451 characters in body
Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.


Another problem seems to be in:

uint256 received = KNPI.swapEtherToToken.value(quantity)(ERC20(daiAddress), slippageRate);

Where the second input argument should probably be expectedRate rather than slippageRate.


Another potential problem is the fact that your contract must own at least quantity wei ether.

One way to ensure this is by passing that value when you call the function.

And by "passing that value", I don't mean as an input parameter to the function, but as a value to the transaction.

Note that for consistency, the Kyber contract might be requiring that you also pass it as an input parameter to the function.

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.


Another problem seems to be in:

uint256 received = KNPI.swapEtherToToken.value(quantity)(ERC20(daiAddress), slippageRate);

Where the second input argument should probably be expectedRate rather than slippageRate.

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.


Another problem seems to be in:

uint256 received = KNPI.swapEtherToToken.value(quantity)(ERC20(daiAddress), slippageRate);

Where the second input argument should probably be expectedRate rather than slippageRate.


Another potential problem is the fact that your contract must own at least quantity wei ether.

One way to ensure this is by passing that value when you call the function.

And by "passing that value", I don't mean as an input parameter to the function, but as a value to the transaction.

Note that for consistency, the Kyber contract might be requiring that you also pass it as an input parameter to the function.

added 242 characters in body
Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.


Another problem seems to be in:

uint256 received = KNPI.swapEtherToToken.value(quantity)(ERC20(daiAddress), slippageRate);

Where the second input argument should probably be expectedRate rather than slippageRate.

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.


Another problem seems to be in:

uint256 received = KNPI.swapEtherToToken.value(quantity)(ERC20(daiAddress), slippageRate);

Where the second input argument should probably be expectedRate rather than slippageRate.

Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

To begin with, given:

address public daiAddress = 0x6b175474e89094c44da98b954eedeac495271d0f;
address public kyberAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

You should probably change this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(daiAddress);

To this:

KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);

As it's not really clear why you are converting the ERC20 DAI token into a Kyber-Network proxy.