I am having a heck of a time getting transactions to post on mainnet. The issue is not my wallet balance or gas related. A balance lookup on the same contract works correctly.. However, i cannot get this offlinesignedtransaction (raw transaction equivalent,)
I have tried all manners of passing various parameters, i have set the defaultGas/Price via the transaction manager and used the SendTransactionAsync() method with the overloads that do no require them. I have sent the method with the contract parameters individually (not in an object array as below). I double checked the nonce - it appears as 0. I tried both this and the andwaitforreceipt variant.
var contract = web3.Eth.GetContract(contractAbi,contractAddress);
var function = contract.GetFunction("transfer");
hash = await function.SendTransactionAsync(@from: accountAddress, gas: new HexBigInteger(60000),
gasPrice: HexBigInteger(40), value: null, functionInput: new object[] { recipient, Web3.Convert.ToWei(value) });
The contract is a standard ERC20 Token. Any insight as to why the transaction returns no errors, however infura does not broadcast? I used this very same code many times with a regular private geth node.
Edit: Ive also been trying to get some of the other RPC JSON APIs. If anyone is familiar, would you confirm this is the correct way to do it by sending the data payload way? I get an "underpriced error" from the etherscan api
var contract = web3.Eth.GetContract(contractAbi, contractAddress);
var function = contract.GetFunction("transfer");
string fdata = function.GetData(new object[] { recipient, Web3.Convert.ToWei(value) });
var txCount = await web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(accountAddress);
var encoded = Web3.OfflineTransactionSigner.SignTransaction(privateKey: accountKey, to: contractAddress, amount: 0, nonce: txCount.Value, gasPrice: new BigInteger(70), gasLimit: new HexBigInteger(60000), data: fdata);
encoded = "0x" + encoded;