Errors when calling the initialize public method in `truffle console`
See original GitHub issueErrors when calling the initialize public method in truffle console
Steps to Reproduce
./scripts/test.sh
truffle migrate --network development --reset --compile-all
truffle console
...
ApeToken.deployed().then(inst => { apetoken = inst })
...
ApePreICO.deployed().then(inst => { preico = inst })
...
preico.initialized.call()
false
...
preico.initialize({ from: apetoken.address })
...
preico.initialize({ from: preico.owner() })
...
Expected Behavior
See the value preico.initialized.call()
automatically changed to true.
Actual Results
macOS Sierra Environment
truffle version
Truffle v4.0.1 (core: 4.0.1) Solidity v0.4.18 (solc-js)
node -v && npm -v
v8.9.1 5.5.1
References
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
Problem with Truffle Console: Cannot read property 'call' of ...
The contract is properly deployed and has a valid JSON document, I really don´t understand why I cannot access its members. The only...
Read more >Interact with your contracts - Truffle Suite
When you execute a contract function via a call you will receive the return value ... function sendCoin(address receiver, uint amount) public returns(bool ......
Read more >Problem as sometimes initialize() can't be called - SDK
I have a simple function initialize() public initializer { . ... await instance.initialize({from: accounts[0]}); or in the truffle console.
Read more >Calling function in truffle console error - Stack Overflow
Inside Truffle console ContractName.deployed().then(function(instance){app = instance}) app.adopt(23)//call method on contract class.
Read more >Testing with Web3.js & Truffle - Hardhat
If you want to use Truffle Migrations to initialize your tests and call deployed() on the contract abstractions, both @nomiclabs/hardhat- ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@chuacw Thanks for insisting on the tests.
I believe that now I really have a little better understanding of solidity.
https://github.com/josoroma/ape/blob/master/tests/ApePreICO.test.js#L131
Congratulations, @josoroma ! I believed you’ve learnt something here.