tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
440 stars 277 forks source link

owner_address is required upon calling contract's decimals() #388

Closed yenkhoon closed 1 year ago

yenkhoon commented 1 year ago

tronWeb.contract(contractConfig.abi, contractConfig.contractAddress).decimals().call()

hit this error:

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "class java.security.InvalidParameterException : owner_address isn't set.".]

This is just a read operation why does the owner_address has to be set?

yanghang8612 commented 1 year ago

For historical reasons, the contract interaction interfaces are designed so that the owner_address is a required field, even though it doesn't play any substantial role for view-type methods.

You can pass 0x000000000000000000000000000000000000000000000000 or T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb to populate this field.

yenkhoon commented 1 year ago

oh i see thanks a lot.