I have been playing around with parity's "eth_estimateGas" call to determine different tokens gas requirements. Generally using this code:
let transfer_data = contract.transfer.getData("<destinaton ETH address>", 1);
let gas_limit = await rpcCall("eth_estimateGas",[{
to: contractData.contractAddress,
from: "<source ETH address>",
data:transfer_data
}]);
I'm getting different results based on the from address. If that address has done thousands of transactions (like exchange's) the amount of gas used is significantly higher then an address thats only done 10's of transactions. Nothing else modified beside the from address.
My only theory is if the nonce is quite high, the contract or evm has to do more verification that it does in fact have the correct balance to complete the send.
What am I missing?
EDIT: Here's an example data. Token: FunFair
From address has high nonce Contract Address: 0x419d0d8bdd9af5e606ae2232ed285aff190e711b From Address: 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98 To Adress: 0x6d8401b8ed8755bb4d01a89072860c98c236dc78 https://etherscan.io/tx/0xc407d8320f44745f88244400c3750875e1858e0ee6a1106bafbde424c289a6ef Gas Used: 58999
From address has low nonce Contract Address: 0x419d0d8bdd9af5e606ae2232ed285aff190e711b From Address: 0x8c301c986e6d23117f17394722272fcd16d43efd To Adress: 0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be https://etherscan.io/tx/0x708fb93a22f4ddd3d410f7280fb3800c8ff96deed5d4fafa12244d0f74e48045 Gas Used: 29127
Plugging those values into the parity call, the estimate results have roughly the same variance.
from
addresses you're comparing. The number of transactions previously made by the account have no direct impact.