1

I need the pending balance of my contract. As far as I understand I could do it with web3:

web3.eth.call(callObject [, defaultBlock] [, callback])

Can I pass defaultBlock to truffle-contract abstraction as well or I need to call web3 directly?

I.e. When I'm trying to pass a defaultBlock to a truffle-contract call:

import { default as Contract } from "truffle-contract";
let contractDef = Contract(artifacts);
contractDef.setProvider(provider);
let instance = await contractDef.deployed();
let balance = await myContract.instance.balanceOf(
         address,
         "pending"
     );

I get:

Error: Invalid number of arguments to Solidity function
0

There were issues with this before, please downgrade to truffle 3.x , delete the build/contracts/ folder (back it up just in case), rebuild the artifacts with truffle migrate --compile-all and try again.

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.