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

Charge for a contract deployment transaction #1883

Closed
ureeves opened this issue Jun 25, 2024 · 1 comment
Closed

Charge for a contract deployment transaction #1883

ureeves opened this issue Jun 25, 2024 · 1 comment
Assignees

Comments

@ureeves
Copy link
Member

ureeves commented Jun 25, 2024

Summary

An "extra" charge should be levied when deploying contract. Such a charge should likely be proportional to the amount of bytes of the contract's bytecode, and be charged to the transaction in gas points. A transaction that cannot pay for this amount should be considered invalid and fail.
Preverification should also be employed, yet the main mechanism should be on block acceptance - if a transaction can't possibly pay for itself, it should never be executed, and the block considered invalid.

Possible solution design or implementation

After implementing #1882, it should be possible to do this, charge amount calculation being based entirely on the contents of the new deployment transaction type.

Additional context

This is in the context of contract deployments #1071.

@miloszm
Copy link
Contributor

miloszm commented Jul 16, 2024

Proposed approach is based on the bytecode length - the charge is equal bytecode length in bytes times the GAS_PER_DEPLOY_BYTE constant (set to 100 at the time of writing) times the current price of gas.

@HDauven HDauven closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants