Skip to content

Commit

Permalink
Charge additional 32k gas in contract creation from EOA or EraVM cont…
Browse files Browse the repository at this point in the history
…ract (N-13)
  • Loading branch information
0xVolosnikov committed Jan 14, 2025
1 parent 200ec06 commit 513f094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions system-contracts/contracts/EvmEmulator.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,7 @@ object "EvmEmulator" {

if iszero(isCallerEVM) {
evmGasLeft := getEvmGasFromContext()
evmGasLeft := chargeGas(evmGasLeft, 32000)
}

let offset, len, gasToReturn := simulate(isCallerEVM, evmGasLeft, false)
Expand Down
2 changes: 2 additions & 0 deletions system-contracts/evm-emulator/EvmEmulator.template.yul
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ object "EvmEmulator" {

if iszero(isCallerEVM) {
evmGasLeft := getEvmGasFromContext()
// Charge additional creation cost
evmGasLeft := chargeGas(evmGasLeft, 32000)
}

let offset, len, gasToReturn := simulate(isCallerEVM, evmGasLeft, false)
Expand Down

0 comments on commit 513f094

Please sign in to comment.