Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Error: VM Exception while processing transaction: revert #82

Closed
mesqueeb opened this issue Feb 22, 2018 · 9 comments
Closed

Error: VM Exception while processing transaction: revert #82

mesqueeb opened this issue Feb 22, 2018 · 9 comments

Comments

@mesqueeb
Copy link

I'm trying out a very simple script through truffle to create a multisig wallet on a local testrpc net. However it always fails.

module.exports = async function (callback) {
let wallet = await MultiSigWalletWithDailyLimit.new([
    "0x8a20a13b75d0aefb995c0626f22df0d98031a4b6", "0x0f78e5aa80909501a0e393ec4e7e253d18f2c035"
    ], 2, 3000)

  console.log('MultisigWallet: ', wallet)
  console.log(`MultisigWallet address: ${wallet.address}`)
}

This is the error I always get:

(node:44792) UnhandledPromiseRejectionWarning: Error: VM Exception while processing transaction: revert
    at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:41484:16)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:329530:36
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:325200:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:328229:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176415:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176705:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176860:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176820:24)
    at IncomingMessage.emit (events.js:164:20)
    at endReadableNT (_stream_readable.js:1062:12)
(node:44792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

However, the Multisig tests run without problem...
I'm not sure what I'm doing wrong...

@denisgranha
Copy link
Contributor

@mesqueeb can you try MultiSigWalletWithDailyLimit.contract.new instead of MultiSigWalletWithDailyLimit.new if my memory doesn't fail

@mesqueeb
Copy link
Author

mesqueeb commented Feb 23, 2018

Dear @denisgranha Thank you very very much.
This indeed solved my problem!

I wonder why, because your tests are written without .contract in between!
Do you know the reason?

From your MultisigWallet test:

const deployMultisig = (owners, confirmations, limit) => {
    return MultiSigWalletWithDailyLimit.new(owners, confirmations, limit)
}

@mesqueeb
Copy link
Author

I'm running this custom testrpc node:

#!/bin/bash

ganache-cli -p 9545 -l 4700000 --account="0x8445abbbcf2911a2db42fced93efe0d7b3172295c99b01a9e02197ff52f30a53,20000000000000000000000000" --account="0x580324cb2abc8029d6eb5a14650a8bd77f48be478c7ece07afd777755070128c,20000000000000000000000000" --account="0x3e478e4fed09cdc68388286b94aeb1404df47b1f1df0de715e582d6aebc6e1c9,20000000000000000000000000" --account="0xa0d45d6a3911221c4e1b7edcd256741c6bcb9a247fda017a8946ff5f5c38021a,200000000000000000000" --account="0x1386ff12f7d49e6e4e835952493d034570e134bfb0fc6f9d17b49dbdf88d03b3,200000000000000000000" --account="0xf84d5b9d64e427d43645e3c12906d322410a87b277374a0335a4ca0da9316d23,200000000000000000000" 

@mesqueeb
Copy link
Author

mesqueeb commented May 8, 2018

@denisgranha Just curious for my own understanding & learning point of view:

What's the difference between MultiSigWalletWithDailyLimit.contract.new instead of MultiSigWalletWithDailyLimit.new. Is this a web3 related thing?
Do you have any recommendation for me to read up on related to this particular behaviour?

@mesqueeb
Copy link
Author

mesqueeb commented Jun 6, 2018

@denisgranha
A new related bug seems to have appeared.
When trying my setup again today I get: TypeError: Cannot read property 'new' of undefined

So MultiSigWalletWithDailyLimit.contract.new() doesn't exist anymore...

The only difference is that because of Node I had to write these lines in my deploy script inside a try block:

try {
    wallet = await MultiSigWalletWithDailyLimit.contract.new([multisigWalletAddress1, multisigWalletAddress2], 2, multisigWalletDailyLimit)
    console.log(`MultisigWallet: ${wallet.address}`)

Other libraries like truffle shouldn't be changed as I use fixed versions:

npm install -g truffle@4.0.1
npm install -g ganache-cli@6.0.3
npm install truffle-hdwallet-provider@0.0.3

@mesqueeb mesqueeb reopened this Jun 6, 2018
@mesqueeb mesqueeb changed the title UnhandledPromiseRejectionWarning: Error Error: VM Exception while processing transaction: revert Jun 6, 2018
@mesqueeb mesqueeb closed this as completed Jun 6, 2018
@denisgranha
Copy link
Contributor

what was the issue @mesqueeb ? :)

@mesqueeb
Copy link
Author

mesqueeb commented Jun 6, 2018

Solved by deleting the contract keyword again.
This time I didn't get the bug I had initially when calling without the contract keyword.

I'm still not sure what the contract keyword does... I'd love some hint on what contract does! : D

@denisgranha
Copy link
Contributor

ah ok ^^
So, maybe you should use https://github.com/trufflesuite/truffle-contract in order to load the source code

@denisgranha
Copy link
Contributor

http://truffleframework.com/docs/getting_started/scripts it's more oriented for set ups, test settings... I would say

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants