Skip to content

Commit

Permalink
Update EIP-7623: EIP-7623 - Move CREATE inside max
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
nerolation authored Feb 28, 2024
1 parent db044d3 commit e0a6fc8
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions EIPS/eip-7623.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,24 @@ The current formula for determining the gas used per transaction, typically desc
```python
tx.gasused = (
21000 \
+ isContractCreation * (32000 + InitCodeWordGas * words(calldata)) \
+ isCreate2Creation * Keccak256WordGas * words(calldata)
+
STANDARD_TOKEN_COST * tokens_in_calldata + evm_gas_used
+ isContractCreation * (32000 + InitCodeWordGas * words(calldata)) \
+ STANDARD_TOKEN_COST * tokens_in_calldata \
+ evm_gas_used
)
```

The formula for determining the gas used per transaction changes to:

```python
tx.gasused = (
tx.gasUsed = {
21000 \
+ isContractCreation * (32000 + InitCodeWordGas * words(calldata)) \
+ isCreate2Creation * Keccak256WordGas * words(calldata)
+
max(
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,
STANDARD_TOKEN_COST * tokens_in_calldata + evm_gas_used
max (
STANDARD_TOKEN_COST * tokens_in_calldata \
+ evm_gas_used \
+ isContractCreation * (32000 + InitCodeWordGas * words(calldata)),
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata
)
)
```

## Rationale
Expand Down

1 comment on commit e0a6fc8

@MhizC
Copy link

@MhizC MhizC commented on e0a6fc8 Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work mate

Please sign in to comment.