0

I am trying to send an ERC token (USDC) on the Ethereum Mainnet fork made with ganache-cli --fork. The transfer is made from the unlocked account that has both ETH and USDC balances available to the test account generated by the Ganache. The code looks as follows:

const erc20_abi = require("./erc20_abi.js");
const usdc_addr = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48";
const usdc_holder_account = "0x....";
const usdc = new web3.eth.Contract(erc20_abi, usdc_addr);
usdc.methods.transfer('0x...', new BN('100000000'))
    .send({from: usdc_holder_account})
    .then(function(result){
      console.log(result);
    });

However, I get the 'revert' error from the forked EVM:

{ '0x3...': { error: 'revert', program_counter: 1704, return: '0x' },
 stack: 'c: VM Exception while processing transaction: revert\n ....}

I first thought that the USDC account was not actually unlocked but I managed to successfully send ETH from it to my test account. So, I am confused what the problem might be and cannot find a 'revert' reason.

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.