rusk-wallet: Calculate contract deploy cost #2768
Labels
module:rusk-wallet
Issues related to rusk wallet
type:enhancement
Issues concerning code or feature improvement (performance, refactoring, etc)
Summary
Since we know how the protocol prices smart contract deployments, we can precalculate the actual cost for the deploy action.
Possible solution design or implementation
Deployment costs are calculated by taking the minimum gas price x a fixed cost per byte. The exact constants can be found here. For the cost calculation see here.
One edge case to keep in mind is when the gas price goes above the constant. It should be seen as the minimum but the actual gas price of the network should also be taken into account if it's higher to prevent users from not being able to be included in the block. It's a rare situation, but could happen.
The text was updated successfully, but these errors were encountered: