Skip to main content
added 39 characters in body
Source Link
thefett
  • 3.9k
  • 5
  • 26
  • 49

I'm trying to run an external script in truffle. Basically I deploy the contracts with 'migrate' then want to run this script to set the variables. I just can't seem to get it to call correctly with:

truffle develop
compile
migrate
exec file.js

and my code:

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

module.exports = async function(callback) {
    var factory = await Factory.deployed();
    console.log(factory.address);
    await factory.setVariables(1000000000000000,1000000000000000,7,1);
}

The console logs the correct address, but then it just hangs on the last part. Any help is much appreciated!

I'm trying to run an external script in truffle. Basically I deploy the contracts with 'migrate' then want to run this script to set the variables. I just can't seem to get it to call correctly with:

truffle exec file.js

and my code:

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

module.exports = async function(callback) {
    var factory = await Factory.deployed();
    console.log(factory.address);
    await factory.setVariables(1000000000000000,1000000000000000,7,1);
}

The console logs the correct address, but then it just hangs on the last part. Any help is much appreciated!

I'm trying to run an external script in truffle. Basically I deploy the contracts with 'migrate' then want to run this script to set the variables. I just can't seem to get it to call correctly with:

truffle develop
compile
migrate
exec file.js

and my code:

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

module.exports = async function(callback) {
    var factory = await Factory.deployed();
    console.log(factory.address);
    await factory.setVariables(1000000000000000,1000000000000000,7,1);
}

The console logs the correct address, but then it just hangs on the last part. Any help is much appreciated!

Source Link
thefett
  • 3.9k
  • 5
  • 26
  • 49

Truffle exec failure

I'm trying to run an external script in truffle. Basically I deploy the contracts with 'migrate' then want to run this script to set the variables. I just can't seem to get it to call correctly with:

truffle exec file.js

and my code:

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

module.exports = async function(callback) {
    var factory = await Factory.deployed();
    console.log(factory.address);
    await factory.setVariables(1000000000000000,1000000000000000,7,1);
}

The console logs the correct address, but then it just hangs on the last part. Any help is much appreciated!