tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
445 stars 276 forks source link

Invalid contract address provided #559

Closed daochild closed 3 days ago

daochild commented 2 months ago

I got errors on executing methods triggerConstantContract, estimateEnergy

 Error: the string "Invalid contract address provided" was thrown, throw an Error :)

Version: tronweb@5.3.2

Params:
contract address
0x743a1b8fe35eb3412b1Ca3D311D9a06101651256 

selector
0xac9650d8 

options
{ feeLimit: 1000000000, callValue: 0, shouldPollResponse: false } 

params
['0x252dba42000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000743a1b8fe35eb3412b1ca3d311d9a061016512560000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000442cbb15c00000000000000000000000000000000000000000000000000000000', '0x252dba4200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000'] 

sender
0x32dCf961bD024E44fDAa5A957B17486590088Bd2

Code example here: https://github.com/daochild/tron-multicall/blob/main/test/multicall.js#L56-L84

Satan-web3 commented 2 months ago

Tron address is different from Ethereum address. You need to use Tron address when using Contact class. For example, a Tron address should be:

`41${multicall.address.substring(2)}`