CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

Early meeting of E-Gold founders may hold clue to Satoshi Nakamoto’s identity — Peter Thiel

Did Satoshi Nakamoto work on E-Gold? If so, Peter Thiel thinks he has a way to narrow down the identity of Bitcoin’s creator.

web3.php – How to call a contract function that mutates states?

I’m creating web3 instance $web3 = new Web3( new HttpProvider( new HttpRequestManager( config(‘infura.endpoint’), // url 5.0 // timeout ) ) ) ; Then instance of my contract $contract = new Contract($web3->provider, $abi); I must call this function { “constant”: false, “inputs”: [ { “internalType”: “uint256”, “name”: “_index”, “type”: “uint256” }, { “internalType”: “string”, “name”: “_data_to_store”,::Listen

I’m creating web3 instance

            $web3 = new Web3(                         new HttpProvider(                             new HttpRequestManager(                                 config('infura.endpoint'),       // url                                 5.0                              // timeout                             )                         )                     )             ; 

Then instance of my contract

$contract = new Contract($web3->provider, $abi); 

I must call this function

    {         "constant": false,         "inputs": [             {                 "internalType": "uint256",                 "name": "_index",                 "type": "uint256"             },             {                 "internalType": "string",                 "name": "_data_to_store",                 "type": "string"             }         ],         "name": "set",         "outputs": [],         "payable": false,         "stateMutability": "nonpayable",         "type": "function"     }, 

I am trying

$contract->at(config('infura.contract_address'))     ->send('set', 22, 'hello world', function($error, $result) {             // this is Laravel dump to screen and die command             dd("error", $error, "result", $result);         }     ) ; 

The problem is that send throws an Exception. The Exception’s message is

“Wrong type of eth_sendTransaction method argument 0.”

Could you please explain me how to use the send method?

EDIT 1:

I tried a different syntax

$contract->at(config('infura.contract_address'))     ->send('set', 22, 'hello world', [ 'from' => config('infura.wallet_address') ], function($error, $result) {             dd("error", $error, "result", $result);         }     ) ; 

But I got a more fun differenct exception

The method eth_sendTransaction does not exist/is not available at web3.phpsrcRequestManagersHttpRequestManager.php

Early meeting of E-Gold founders may hold clue to Satoshi Nakamoto’s identity — Peter Thiel

Shopping cart
There are no products in the cart!
Continue shopping
0