Skip to content
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

rusk-wallet: Calculate contract deploy cost #2768

Open
HDauven opened this issue Oct 25, 2024 · 0 comments
Open

rusk-wallet: Calculate contract deploy cost #2768

HDauven opened this issue Oct 25, 2024 · 0 comments
Labels
module:rusk-wallet Issues related to rusk wallet type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)

Comments

@HDauven
Copy link
Member

HDauven commented Oct 25, 2024

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.

@HDauven HDauven added type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc) module:rusk-wallet Issues related to rusk wallet labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:rusk-wallet Issues related to rusk wallet type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)
Projects
None yet
Development

No branches or pull requests

1 participant