You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in C:\xampp7\htdocs\tron\vendor\iexbase\tron-api\src\TransactionBuilder.php:424 Stack trace: #0 C:\xampp7\htdocs\tron\index.php(58): IEXBase\TronAPI\TransactionBuilder->triggerSmartContract() #1 {main} thrown in C:\xampp7\htdocs\tron\vendor\iexbase\tron-api\src\TransactionBuilder.php on line 424
I cannot understand how it should be. It seems like I'm doing everything right, but it doesn't work.
I tried to redo it from an object into an array and various other ways, in the end it does not work. Maybe there is some exactly correct option and someone will share?
The text was updated successfully, but these errors were encountered:
Hi.
Set ABI contract
$json= ' [ { "inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_wtrx","type":"address"}], "payable":false, "stateMutability":"nonpayable", "type":"constructor" }, {"payable":true,"stateMutability":"payable","type":"fallback"}, {"constant":false,"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}, ]'; $abi = json_decode($json);
ERROR:
PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in C:\xampp7\htdocs\tron\vendor\iexbase\tron-api\src\TransactionBuilder.php:424 Stack trace: #0 C:\xampp7\htdocs\tron\index.php(58): IEXBase\TronAPI\TransactionBuilder->triggerSmartContract() #1 {main} thrown in C:\xampp7\htdocs\tron\vendor\iexbase\tron-api\src\TransactionBuilder.php on line 424
USE:
$tron->getTransactionBuilder()->triggerSmartContract($abi, $data['contract_address'], $data['function_selector'], ['uint256', 'address', 'address', 'bool'], $data['fee_limit'], $data['contract_address']);
I cannot understand how it should be. It seems like I'm doing everything right, but it doesn't work.
I tried to redo it from an object into an array and various other ways, in the end it does not work. Maybe there is some exactly correct option and someone will share?
The text was updated successfully, but these errors were encountered: