0

I'm currently trying to put in the function:

truffle console truffle (development) > const token = await Token.deployed()

And the result is coming up as undefined. I've started over my DAPP project twice and have reached the same point.

I deployed the contract in separate migration files. I received no error during migration. Related files are shared below:

1_initial_migration.js

const Migrations = artifacts.require("Migrations");

module.exports = function (deployer) {   deployer.deploy(Migrations);
};

2_deploy_contracts.js

const Token = artifacts.require("Token");

module.exports = function (deployer) {   deployer.deploy(Token); };

2
  • 1
    So apparantly "undefined" doesn't mean that it is undefined you just need to call the variable in the terminal to see the definition! If anyone gets scared when they see undefined it most likely doesn't mean an error :)
    – Stamyr
    Jul 21, 2021 at 16:26
  • Stamyr, did you resolve this issue? I am getting the same message for this command? How did you resolve it? Thanks...Raj
    – King
    Aug 20, 2021 at 7:03

1 Answer 1

1

Just type the variable you set your promise to assign to and it will output the value to the terminal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.