1

I'm completely new to Ethereum Smart Contracts. I'm following the course on LinkedIn [Ethereum: Building Blockchain Decentralized Apps (DApps)].

I've been able to compile the smart contract as per tutorial but I am unable to Miigrate it to my test server.

I get the following error:

PS C:\Users\xxxx\desktop\contracts> truffle migrate development

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.


Starting migrations...
======================
> Network name:    'development'
> Network id:      5777
> Block gas limit: 0x6691b7


2_deploy_contracts.js
=====================
Error: SyntaxError: Unexpected token {
    at Object.run (C:\Users\xxxx\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:92:1)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
Truffle v5.0.21 (core: 5.0.21)
Node v12.4.0

I'm running on Windows 10

As instructed on LinkedIn. Truffle config is:

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 9545,
      network_id: "*"
    }
  }
}

And script for deploying the contract is:

var ApprovalContract = artifacts.require("ApprovalContract");

module.exports = funtion(deployer) {
  deployer.deploy(ApprovalContract);
}

Thanks

1

You have a spelling mistake in function keyword in the migration script.

  • Thanks a lot Sanjay! It looks like typos are killing me today: "Error: Could not find artifacts for AprovalContract from any sources" another error I managed to solve because the name of the artifact was different from the contract file name (I was using the contract file name which was spelt differently from the artifact name!) – Shaye Jun 12 at 12:40

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.