-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discrepancy Between Estimated and Actual Fees for Storing Data in Smart Contract #53
Comments
You seem to be using some plugin from Polkagate. I have no idea how this is calculating the fee. But @pgherveou should have a look. He is back next week. |
We are the PolkaGate team, currently working on adding Polkadot contract support to the existing PolkaGate Snap.
These values are retrieved from the call dry run. |
You should not multiply the Instead you should create a new extrinsic using the returned However, you need to be aware that this is just an estimation and not binding. Only the |
Got it, thank you! Now, I’m using:
to get the fee based on the weight. Then, to find the estimated fee, I should: Is that correct? |
This doesn't account for all the extrinc's fees. For example, the byte fee. You need to use:
Yes
Do you mean Weight refund? If yes: No. Or do you mean storage deposit refunds? Then yes. |
The screenshots show the actual fee displayed on Subscan for storing data in a smart contract, which matches the exact amount deducted from the balance, as confirmed in Remix. However, as shown in the insights displayed in MetaMask, the estimated fee differs significantly from the actual fee.
We calculate the fee using the formula:
(gasConsumed.refTime + gasConsumed.proofSize) * gasPrice + storageDepositCharge
The text was updated successfully, but these errors were encountered: