Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

VM Exception when calling join() (Dai Savings Rate) #279

Open
CristianNe opened this issue Jul 8, 2021 · 1 comment
Open

VM Exception when calling join() (Dai Savings Rate) #279

CristianNe opened this issue Jul 8, 2021 · 1 comment

Comments

@CristianNe
Copy link

Hello everyone,
I'm testing my code on a local fork (http://localhost:2000) of the Ethereum mainnet using infura.
I simply want to deposit an amount of Dai to the Dai Savings Rate contract.
Here's my code:

const privateKey = process.env.LOCAL_GANACHE_PRIVATE_KEY;
web3.eth.accounts.wallet.add('0x'` + privateKey);
const testAddress = web3.eth.accounts.wallet[0].address;

const maker = await Maker.create('http', {
        plugins: [McdPlugin],
        url: 'http://127.0.0.1:2000',
        privateKey: '0x' + privateKey,
        web3: {
            transactionSettings:{
                gasLimit: 6721975,
                gasPrice: 20000000000
            }
        },
        log: true
    });
const dsrService = maker.service('mcd:savings');
const proxyAddress = maker.service('proxy').getProxyAddress(testAddress);
await dsrService.join(DAI(amount));

This is the error that i get:

 Error: VM Exception while processing transaction: revert
{
  "0xe45980fa1349afedc5912a519854bb5095071d4044ea61d7545758a27bc869b3": {
    "error": "revert",
    "program_counter": 948,
    "return": "0x"
  }

I made sure that maker is using the right address and I minted some Dai to the address before calling the join().
Any help would be appreciated.

@b-pmcg
Copy link
Contributor

b-pmcg commented Oct 4, 2021

hi @CristianNe sorry for the late response. Did you set the approval for your proxy address? See here: https://github.com/makerdao/dai.js/blob/dev/packages/dai-plugin-mcd/test/SavingsService.spec.js#L50

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