0

I'm trying to do very basic things with Truffle 3.4.6 console. I've been able to successfully compile and migrate a contract and access its contents using both:

CoinCrowdsale.deployed()
CoinCrowdsale.at("0x327d1b04ea59035626438b84ea03a543d38662e0")

But then, there're things from the examples I cannot do. For example, assign a value to a variable:

var crowdsale = CoinCrowdsale.at("0x327d1b04ea59035626438b84ea03a543d38662e0")
Truffle v3.4.6 (core: 3.4.6)
Solidity v0.4.13 (solc-js)

The result of the assignation is the software version?? Of course, it's not been assigned at all:

crowdsale
Please specify the type of item to create. Example: truffle create contract MyContract

I've got more problems:

> truffle(development)> CoinCrowdsale.deployed().then(inst => {
> crowdsale = inst }); undefined

and then, again, inst is never assigned to crowdsale variable nor can access it in the console.

What am I doing wrong? Truffle docs are not helping so much...

Thanks in advance

0

It seems I maybe am affected by this bug:

https://github.com/trufflesuite/truffle-core/pull/29

I've been told the fix will be released by the next Monday. I'll try again then.

  • Definitely it was the issue pointed before. – predicador37 Aug 4 '17 at 11:17
0

it should be working like this, if you're in the truffle console:

CoinCrowdsaleInstance = CoinCrowdsale.deployed()
CoinCrowdsaleInstance.then(function(instance) {return JSON.stringify(instance.abi);})
CoinCrowdsaleInstance.then(function(instance) {return instance.yourFunction(); })
  • No, it doesn't work with my console version. It's a bug in the console to be fixed in a couple of days. – predicador37 Jul 29 '17 at 11:10

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.