harmony-one / sdk

Javascript SDK of Harmony protocol.
MIT License
92 stars 43 forks source link

Help with contract.wallet.addByPrivateKey #80

Closed billtlee closed 2 years ago

billtlee commented 3 years ago

so, i deployed an Ownable contract using my ONE wallet account, I then tried to call an onlyOwner function in the contract by using the send api, did contract.wallet.addByPrivateKey('private key of my ONE wallet account') to add the signing account to the wallet. But I am getting the "Ownable: caller is not the owner was thrown". Does anyone know why this might be happening? When I call the owner function from the contract, I am getting the correct wallet address...

nipund commented 2 years ago

Did you manage to figure it out?

billtlee commented 2 years ago

no, are you running into the same problem?

nipund commented 2 years ago

Yeah. It works if you don't call estimateGas() and just use a predefined gas limit, as long as it's high enough.

billtlee commented 2 years ago

okok, thx!