Open hafizah65 opened 1 year ago
update: i change the code and i'm getting "Call to a member function signTransaction() on bool"
$eth = new Eth($web3->getProvider());
// Create the transaction object
$transaction = [
'from' => $senderAddress,
'to' => $contractAddress,
'data' => $contract->getData($functionName, 5678, $data_bc),
//'data' => '0x'. $contract->getData($functionName, 5678, $data_bc),
// Sign the transaction
$signedTransaction = $eth->accounts->signTransaction($transaction, $privateKey); //FIXME
];
// Send the transaction to the network
$transactionHash = $eth->sendRawTransaction($signedTransaction);
echo 'Transaction Hash: ' . Utils::toString($transactionHash) . PHP_EOL;
// Wait for the transaction to be mined
$receipt = $eth->getTransactionReceipt($transactionHash);
if ($receipt !== null) {
echo 'Transaction Mined' . PHP_EOL;
}
i'm trying to send the data but i got the following error. i managed to get an existing data from the blockchain, but sending gives out either "Please make sure you have put all function params and callback"
solidity function
php
i'm not exactly sure what i've done wrong. i've tried following #238 and i got "Wrong type of eth_sendTransaction method argument 0"