EatTheBlocks Forum

Dex Create migration file , seed token balance issue

Hi,

I am trying to run the migration file for Capstone project “Decentralized Exchange for ERC20 tokens”. It gives me the below error message. Does anyone encounter this issue as well? Can anyone help?

Error: Returned error: VM Exception while processing transaction: revert this token does not exist – Reason given: this token does not exist. at PromiEvent (/mnt/c/Users/green/AppData/Roaming/npm/node_modules/truffle/build/webpack:/packages/contract/lib/promievent.js:9:1)
at TruffleContract.deposit (/mnt/c/Users/green/AppData/Roaming/npm/node_modules/truffle/build/webpack:/packages/contract/lib/execute.js:169:1)
at seedTokenBalance (/mnt/c/Users/green/desktop/dex1/migrations/2_deploy_contracts.js:40:15)
at process._tickCallback (internal/process/next_tick.js:68:7)

Hi,

I have just found out the reason. In the migration code line 40:

const ticker = await token.name();

It retrieves the name of the token instead of its symbol that we are using in dex.sol. So it gives the error. So change to the below line will pass through.

const ticker = await token.symbol();