1

so I'm deploying a basic smart contract with web3js and I'm compiling it with solc. It compiles fine but for whatever reason, it doesn't deploy...

Here's my backend...

pragma solidity ^0.5.0;

contract Token {
    string public name = "My Name";
}

Here's my frontend...

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

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

And this is what my terminal returned...

const token = await Token.depolyed()
Thrown:
TypeError: Token.depolyed is not a function
    at evalmachine.<anonymous>:1:15

I'm pretty new to Dapp development so please be patient with me.

Thank you!

2
  • +1 for the effort to format the post. Using indentation for code blocks makes it easy to format. Jun 9 at 18:32
  • also, note that it should be deployed instead of depolyed --> here: const token = await Token.depolyed()
    – bguiz
    Jun 10 at 6:23
1

you can't run const token twice. clear the truffle console, start again and this time run token as the next line

1
  • +1 for adding the answer. You can accept your answer, and mark it as the correct one if it solved your problem Jun 9 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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