question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embark failing when deploying contracts

See original GitHub issue

I tried Embark with these contracts https://github.com/bitpopulous/Populous-smart-contracts/tree/master/contracts

However I got this error:

C:\projects\embark_demo>embark run
RangeError: Invalid count value
    at String.repeat (native)
    at C:\Users\simon\AppData\Roaming\npm\node_modules\embark\lib\contracts\deploy.js:112:45
    at C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\web3\lib\web3\property.js:119:13
    at C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\web3\lib\web3\requestmanager.js:89:9
    at XMLHttpRequest.request.onreadystatechange (C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\web3\lib\web3\httpprovider.js:118:13)
    at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\xhr2\lib\xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\xhr2\lib\xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\xhr2\lib\xhr2.js:509:12)
    at IncomingMessage.<anonymous> (C:\Users\simon\AppData\Roaming\npm\node_modules\embark\node_modules\xhr2\lib\xhr2.js:469:24)
    at emitNone (events.js:110:20)

$ embark --version 2.6.0

OS: Win 8.1 64bit

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
iurimatiascommented, Dec 19, 2017

@Simoneth The issue you were facing has now been fixed in version 2.6.3, below is the config I used for those contracts.

Note that in 2.6.x you need to interfaces deploy to false, some contracts might need manual adjustment on their gas values, This wouldn’t’ be necessary in the next version. (current develop branch)

embark.json (note: contracts at app/contracts, required in 2.6.x

{
  "contracts": ["app/contracts/**"],
  "app": {
  },
  "buildDir": "dist/",
  "config": "config/",
  "plugins": {
  }
}

This is the contracts config I used, after this you might need to set the contract arguments and dependencies (as described here)

config/contracts.json

{
  "default": {
    "versions": {
      "web3.js": "1.0.0-beta",
      "solc": "0.4.17"
    },
    "deployment": {
      "host": "localhost",
      "port": 8545,
      "type": "rpc"
    },
    "dappConnection": [
      "$WEB3",
      "http://localhost:8545"
    ],
    "gas": "auto",
    "contracts": {
      "CurrencyToken": {
        "gas": 1100000
      },
      "Crowdsale": {
        "gas": 2600000
      },
      "PopulousToken": {
        "gas": 800000
      },
      "ContractReceiver": {
        "deploy": false
      },
      "iCrowdsale": {
        "deploy": false
      },
      "iCrowdsaleManager": {
        "deploy": false
      },
      "iDepositContractsManager": {
        "deploy": false
      },
      "iERC20Token": {
        "deploy": false
      }
    }
  }
}

If you need further help please don’t hesitate to reach me on gitter or by opening new issues, thanks for reporting this bug!

1reaction
iurimatiascommented, Dec 18, 2017

@Simoneth hi, there is a bug in embark 2.6.0 with the contracts config on embark.json : they have to be inside “app/contracts/” (not “contracts/”);

this has been fixed in develop already and wouldn’t be an issue in the next version. In the meanwhile for 2.6.0 as a workaround, put the contracts inside app/contracts and make sure embark.json reflects this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embark failing when deploying contracts · Issue #320 - GitHub
@Simoneth hi, there is a bug in embark 2.6.0 with the contracts config on embark.json : they have to be inside "app/contracts/" (not...
Read more >
What's wrong with embark gas limit? - Stack Overflow
I have a problem using Embark to deploy a contract. I have successfully use it before with smaller contracts. Here is the problem...
Read more >
embark-framework/Lobby - Gitter
This is default one // when not specified // - explicit will only attempt to deploy the contracts that are explicitly specified inside...
Read more >
Executing Scripts - Embark Framework
It's important to note that afterDeploy hooks are executed every time all Smart Contracts have been deployed. Often there are cases where ...
Read more >
Getting "Error while loading the content of <contract>.sol"
I've found the issue. The 'import' in solidity contract was referring to a file that wasn't available in the folder.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found