question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VM Exception when interfacing with Kyber contract

See original GitHub issue

Testing a contract that otherwise works against a ganache mainnet fork but when interfacing with the KyberProxy contract I get VM Exception while processing transaction: revert.

Kyber address: 0x818E6FECD516Ecc3849DAf6845e3EC868087B755

The code is as simple as this

function testFunc() public view returns(uint minConversionRate, uint  slippageRate){
uint value = 1000000000000000;
(minConversionRate, slippageRate) = kyberNetworkProxy.getExpectedRate(ERC20(ETH_ADDRESS), ERC20(snxAddress), value);
}

and the same code works on mainnet without issue. So we can safely rule out any issues related to contract code. Additionally, JS calls to the Kyber contract directly on ganache fork are working, so this bug is specific to interfacing with this contract from another contract on ganache.

Expected Behavior

Return two values from the getExpectedRate view function

Current Behavior

EVM Revert

Possible Solution

Not sure but I’ve tested with very high gasLimits and it wasn’t any help.

Steps to Reproduce (for bugs)

  1. run ganache-cli --fork https://mainnet.infura.io/v3/<infura-token>
  2. run testFunc()

Context

Your Environment

  • Version used: Ganache CLI v6.4.3 (ganache-core: 2.5.5)
  • Version of Truffle/Remix/Other tools used:Truffle v5.0.7 (core: 5.0.7)
  • Solidity - 0.5.0 (solc-js)
  • NodeJS Version: Node v13.3.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelcohen716commented, Oct 26, 2020

it’s been awhile so probably won’t be able to reproduce. good luck!

0reactions
seesemichaeljcommented, Nov 17, 2020

Thanks for the info @bertmiller! I’m going to defer to @davidmurdoch on this one going forward due to a shift of priorities on my end

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transaction "Revert" Error - solidity
To this: KyberNetworkProxyInterface KNPI = KyberNetworkProxyInterface(kyberAddress);. As it's not really clear why you are converting the ERC20 ...
Read more >
Error: VM Exception while processing transaction: revert.
Run the failing function. Changes to try in your code: change the code, re-deploy it in Remix, and then run the failing function...
Read more >
Error: call revert exception (Flashloan with dydx, Uniswap ...
I have therefore found all the Kovan addresses of the services used (dydx, kyber, the tokens to be exchanged etc.) and made a...
Read more >
ConsenSys/truffle - Gitter
Testing a contract that otherwise works against a ganache mainnet fork but when interfacing with Kyber I get VM Exception while processing transaction: ......
Read more >
Integrating the 0x API into your contracts - Solidity developer
How can you add 0x to your contracts to automatically convert between tokens? ... message a lot of times: Error: VM Exception while...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found