harmony-one/sdk

Help with contract.wallet.addByPrivateKey

billtlee opened this issue · 4 comments

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...

Did you manage to figure it out?

no, are you running into the same problem?

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

okok, thx!