0

I am testing a token vesting contract with truffle(from openzeppelin). To release tokens you call TokenVesting.release(ERC20Basic token).

const tokenAddress = await ico.token.call();
var token = ERC20Basic.at(tokenAddress);

const vestingAddress = await ico.vestingAddress.call();
var vestingContract = TokenVesting.at(vestingAddress);

await vestingContract.release(token);

This gives me the error "Error: Invalid number of arguments to Solidity function". Any ideas?

Edit: full release signature

/**
 * @notice Transfers vested tokens to beneficiary.
 * @param token ERC20 token which is being vested
 */
function release(ERC20Basic token) public {
  uint256 unreleased = releasableAmount(token);

    require(unreleased > 0);

    released[token] = released[token].add(unreleased);

    token.safeTransfer(beneficiary, unreleased);

    emit Released(unreleased);
 }
  • I already included the tokenvesting.release function, which signatures from these functions would I need to add? – drx Jul 22 '18 at 9:43
  • Yes, when commented out it does not yield an error. I updated the post to include full signature and even body! – drx Jul 22 '18 at 9:57
2

You have to pass the contract's address as the parameter, so just do this:

const tokenAddress = await ico.token.call();

const vestingAddress = await ico.vestingAddress.call();
var vestingContract = TokenVesting.at(vestingAddress);

await vestingContract.release(tokenAddress);

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.