trufflesuite / truffle-hdwallet-provider

HD Wallet-enabled Web3 provider
MIT License
400 stars 167 forks source link

Contract methods send causes promise rejection #59

Open CryptoKiddies opened 6 years ago

CryptoKiddies commented 6 years ago

I cannot utilize the contract methods send method from Web3 v1 with truffle-hd-wallet provider. When I try to send or estimate gas on the token transfer method, I get this error:

Unhandled promise rejection (rejection id: 1): Error: gas required exceeds allowance or always failing transaction

However, using my geth client wallet or ganache-cli, the token transfer send works fine.

Web3 v1-beta.34 hd-wallet v 0.0.3 & 0.0.6

// this works and has balance
    console.log(`estimate balance gas ${await testContract.methods.balanceOf(accounts[0]).estimateGas({ from: accounts[0], gas: '1000000' })}`)

//this fails
    console.log('test estimate',await testContract.methods.transfer(myAccount, tokenBalance).estimateGas({ from: accounts[0], gas: '1000000' }))