1

There is two transfer function in my contract, And i m trying to call transfer function of erc223 for transfer token to contract address using this function.

 Token.deployed()
 .then(function(i) {
   i.transfer.call('0x5f71b35ed4bdd29d0183b5a11d0b3dfd025d7556','12','test_data')
   .then(function(j){
     console.log(j)
   })
 })

but it throw an error as below:

(node:12048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Invalid number of arguments to Solidity function

0

The transfer function is not constant so you should call it from a transaction not a call

Token.deployed()
.then(function(i) {
    i.transfer.sendTransaction('0x5f71b35ed4bdd29d0183b5a11d0b3dfd025d7556', '12', 'test_data')
    .then(function(j) {
         console.log(j)
    })
})

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.