Closed reza-khalafi closed 1 year ago
I need to calculate energy_used so use tron.trigger_constant_contract like this:
tron.trigger_constant_contract
result = tron.trigger_constant_contract( owner_address="TQYbVpBqboaQu4rc4bLuD9VUqNAAAAAAA", contract_address="TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", function_selector="transfer (address, uint256)", parameter="" # ? ) print(result)
And for calculate parameter i used this:
with open("abi/trc20_abi.json") as f: info_json = json.load(f) # from tronscan bytecode = '60806040526000...' # from tronscan cntr = Contract(name="TetherToken", bytecode=bytecode, abi=info_json) parameter = cntr.constructor.encode_parameter("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", 18) # like tronpy document print(parameter)
So get this error: TypeError: wrong number of arguments, require 4 got 2
TypeError: wrong number of arguments, require 4 got 2
What is 18 in this method? What is the problem? Is there better way?
See an example here: https://github.com/bitcart/bitcart/blob/c1715ed9c302b5d2c92003d172a94467b4523284/daemons/trx.py#L388-L399
I need to calculate energy_used so use
tron.trigger_constant_contract
like this:And for calculate parameter i used this:
So get this error:
TypeError: wrong number of arguments, require 4 got 2
What is 18 in this method? What is the problem? Is there better way?