0

I'm trying to call the exchange proxy 2 in truffle console with web3.js and i get a VM Exception while processing transaction: revert. My truffle console is pointing to a ganache-cli mainnet fork based off of infura. The balancer method returns a struct. Could that be the reason it fails? What else could I be doing wrong? Seems like a fairly straight forward thing but I can't for the life of me understand what I'm doing wrong. Passing those exact same arguments to the etherscan read contract page doesnt throw the error...

// abi retrieved from etherscan for this address
contract = new web3.eth.Contract(abi, "0x3e66b66fd1d0b02fda6c811da9e0547970db2f21");
contract.methods.viewSplitExactIn(
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 
    "0x6B175474E89094C44Da98b954EedeAC495271d0F", 
    1000000, 4).call()
4
  • Could be that your input is wrong. – goodvibration Sep 18 '20 at 11:09
  • Passing those exact same arguments to the etherscan read contract page doesnt throw the error - but it doesn't show the output either, so most likely etherscan runs into the same problem. – goodvibration Sep 18 '20 at 11:10
  • @goodvibration but doesn't etherscan usually show VM Exception while processing transaction: revert when an error like that happens? – Terence Chow Sep 18 '20 at 14:15
  • Well, maybe, but it also shows an actual result when an error doesn't happen. – goodvibration Sep 18 '20 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.