mattlockyer / composables-998

An implementation and documentation repo for developing the ERC-998 standard for Ethereum.
MIT License
103 stars 64 forks source link

1_initial_migration.js fails #41

Closed Oskii closed 2 years ago

Oskii commented 2 years ago

Trying to build this project so I can extend it, but it does not migrate...

Truffle config:

module.exports = {
  compilers: {
    solc: {
      version: "0.4.24",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
       settings: {          // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: false,
          runs: 200
        },
        evmVersion: "homestead"
       }
    }
  },
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      //gas: 8000000,
      network_id: "*" // Match any network id
    }
  }
};

The migrations file is unchanged, but will not deploy...

const Migrations = artifacts.require("./Migrations.sol");
const Composable = artifacts.require("./ComposableTopDown.sol");
const SampleNFT = artifacts.require("./SampleNFT.sol");
const SampleERC20 = artifacts.require("./SampleERC20.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations);
  //deployer.deploy(Composable, "ComposableTopDown", "COMPTD", {gas: 8000000});
  deployer.deploy(Composable, "ComposableTopDown", "COMPTD");
  deployer.deploy(SampleNFT, "SampleNFT", "SNFT");
  deployer.deploy(SampleERC20);
};

The error message I get is

1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > transaction hash:    0x157a6d4092b3290d2ac633726162844c5f9551b4cb5bb18b43dde72bc4798345
   > Blocks: 0            Seconds: 0
   > contract address:    0xb98c7CDE39CA5687e673BE940287A80DBFC98E6e
   > block number:        15
   > block timestamp:     1639655894
   > account:             0xA9981301919D090b015eDF55a84FE0072A25ba28
   > balance:             99.82268304
   > gas used:            238174 (0x3a25e)
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.00476348 ETH

   Deploying 'ComposableTopDown'
   -----------------------------

Error:  *** Deployment Failed ***

"ComposableTopDown" ran out of gas. Something in the constructor (ex: infinite loop) caused gas estimation to fail. Try:
   * Making your contract constructor more efficient
   * Setting the gas manually in your config or as a deployment parameter
   * Using the solc optimizer settings in 'truffle-config.js'
   * Setting a higher network block limit if you are on a
     private network or test client (like ganache).

    at C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Migration._deploy (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:70:1)
    at Migration._load (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:56:1)
    at Migration.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:217:1)
    at Object.runMigrations (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
    at Object.runFrom (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
    at Object.runAll (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
    at Object.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
    at runMigrations (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:258:1)
    at Object.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:223:1)
    at Command.run (C:\Users\O\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:183:1)
Truffle v5.4.11 (core: 5.4.11)
Node v14.17.5
mattlockyer commented 2 years ago

Sorry no longer maintaining this. If you figure it out and have a pull request please send it. Will add warning.