dappuniversity / token_sale

Code Your Own Cryptocurrency & ICO on Ethereum | Tutorial
406 stars 387 forks source link

Error: Returned error: VM Exception while processing transaction: revert #49

Closed gauravjain14 closed 2 years ago

gauravjain14 commented 2 years ago
  Contract: DappToken
    ✓ initializes the contract with the correct values (338ms)
    ✓ sets the total supply upon deployment (259ms)
    1) transfers token ownership
    > No events were emitted

  2 passing (3s)
  1 failing

  1) Contract: DappToken
       transfers token ownership:
     Error: Returned error: VM Exception while processing transaction: revert

I have followed everything in the tutorial and in fact, even copied all the code over and yet I am getting this error. Don't have the slightest clue why this is happening. Any help would be appreciated.

Here is the link to my repo.

vatsalvatsyayan commented 2 years ago

Were u able to get a fix? Does the remaining part of this work as expected?

gauravjain14 commented 2 years ago

Yes, I was able to fix it. It was a mistake on my end.

The total amount I initiated the contract with was less than what I was trying to transfer from one account to other.

As for things working beyond that, I have completed 4 sessions, and they all work as shown (with some minor tweaks due to the Solidity API changing)