@tevm/voltaire / primitives/GasConstants
primitives/GasConstants
Namespaces
Type Aliases
CallDetails
CallDetails = object
Defined in: src/primitives/GasConstants/types.ts:44
Call operation details
Properties
gas
gas: bigint
Defined in: src/primitives/GasConstants/types.ts:48
hasValue
hasValue: boolean
Defined in: src/primitives/GasConstants/types.ts:46
isNewAccount
isNewAccount: boolean
Defined in: src/primitives/GasConstants/types.ts:47
isWarm
isWarm: boolean
Defined in: src/primitives/GasConstants/types.ts:45
Config
Config = object
Defined in: src/primitives/GasConstants/types.ts:18
Gas configuration for hardfork-specific calculations
Properties
hardfork
hardfork: Hardfork
Defined in: src/primitives/GasConstants/types.ts:19
CostResult
CostResult = object
Defined in: src/primitives/GasConstants/types.ts:25
Gas cost calculation result
Properties
base
base: bigint
Defined in: src/primitives/GasConstants/types.ts:26
dynamic
dynamic: bigint
Defined in: src/primitives/GasConstants/types.ts:27
total
total: bigint
Defined in: src/primitives/GasConstants/types.ts:28
Hardfork
Hardfork =Defined in: src/primitives/GasConstants/types.ts:4 Ethereum hardfork identifiers"homestead"|"byzantium"|"constantinople"|"istanbul"|"berlin"|"london"|"paris"|"shanghai"|"cancun"
MemoryExpansion
MemoryExpansion = object
Defined in: src/primitives/GasConstants/types.ts:34
Memory expansion details
Properties
expansionCost
expansionCost: bigint
Defined in: src/primitives/GasConstants/types.ts:37
newCost
newCost: bigint
Defined in: src/primitives/GasConstants/types.ts:36
oldCost
oldCost: bigint
Defined in: src/primitives/GasConstants/types.ts:35
words
words: bigint
Defined in: src/primitives/GasConstants/types.ts:38
Variables
BlobBaseFee
Defined in: src/primitives/GasConstants/constants.js:325 BLOBBASEFEE opcode cost (2 gas)constBlobBaseFee:2n=2n
BlobHash
Defined in: src/primitives/GasConstants/constants.js:319 BLOBHASH opcode cost (3 gas)constBlobHash:3n=3n
BrandedGasConstants
Defined in: src/primitives/GasConstants/index.ts:74constBrandedGasConstants:object
Type Declaration
calculateCallCost()
calculateCallCost: (Calculate CALL operation gas costisWarm,hasValue,isNewAccount,availableGas) =>object
Parameters
isWarm
boolean
Whether target account is warm
hasValue
boolean
Whether call transfers value
isNewAccount
boolean
Whether target account doesn’t exist
availableGas
bigint
Gas available for the call
Returns
object
Gas cost breakdown
base
base: bigint
dynamic
dynamic: bigint
forwarded
forwarded: bigint
stipend
stipend: bigint
total
total: bigint
Example
calculateCopyCost()
calculateCopyCost: (Calculate copy operation gas costsize) =>bigint
Parameters
size
bigint
Size of data to copy in bytes
Returns
bigint
Gas cost
calculateCreateCost()
calculateCreateCost: (Calculate contract creation gas costinitcodeSize,deployedSize) =>object
Parameters
initcodeSize
bigint
Size of initcode in bytes
deployedSize
bigint
Size of deployed bytecode in bytes
Returns
object
Gas cost breakdown
base
base: bigint
dynamic
dynamic: bigint
total
total: bigint
Throws
If initcode size exceeds maximumExample
calculateKeccak256Cost()
calculateKeccak256Cost: (Calculate KECCAK256 gas costdataSize) =>bigint
Parameters
dataSize
bigint
Size of data in bytes
Returns
bigint
Total gas cost
Example
calculateLogCost()
calculateLogCost: (Calculate LOG gas costtopicCount,dataSize) =>bigint
Parameters
topicCount
bigint
Number of topics (0-4)
dataSize
bigint
Size of log data in bytes
Returns
bigint
Total gas cost
Example
calculateMaxRefund()
calculateMaxRefund: (Calculate maximum gas refundgasUsed) =>bigint
Parameters
gasUsed
bigint
Total gas used in transaction
Returns
bigint
Maximum refundable gas
calculateMemoryExpansionCost()
calculateMemoryExpansionCost: (Calculate memory expansion costoldSize,newSize) =>object
Parameters
oldSize
bigint
Previous memory size in bytes
newSize
bigint
New memory size in bytes
Returns
object
Memory expansion cost
expansionCost
expansionCost: bigint
newCost
newCost: bigint
oldCost
oldCost: bigint
words
words: bigint
Example
calculateSstoreCost()
calculateSstoreCost: (Calculate SSTORE gas costisWarm,currentValue,newValue) =>object
Parameters
isWarm
boolean
Whether slot is warm (previously accessed)
currentValue
bigint
Current storage value (0n if empty)
newValue
bigint
New storage value
Returns
object
Gas cost and potential refund
cost
cost: bigint
refund
refund: bigint
Example
calculateTxIntrinsicGas()
calculateTxIntrinsicGas: (Calculate transaction intrinsic gas costdata,isCreate) =>bigint
Parameters
data
Uint8Array<ArrayBufferLike>
Transaction calldata
isCreate
boolean
Whether transaction creates a contract
Returns
bigint
Intrinsic gas cost
Example
callCost()
callCost: (Calculate CALL operation gas cost (convenience form with this:)this) =>object
Parameters
this
availableGas
bigint
hasValue
boolean
isNewAccount
boolean
isWarm
boolean
Returns
object
base
base: bigint
dynamic
dynamic: bigint
forwarded
forwarded: bigint
stipend
stipend: bigint
total
total: bigint
copyCost()
copyCost: (Calculate copy operation gas cost (convenience form with this:)this) =>bigint
Parameters
this
bigint
Returns
bigint
createCost()
createCost: (Calculate contract creation gas cost (convenience form with this:)this) =>object
Parameters
this
deployedSize
bigint
initcodeSize
bigint
Returns
object
base
base: bigint
dynamic
dynamic: bigint
total
total: bigint
getColdAccountAccessCost()
getColdAccountAccessCost: (Get cold account access cost for hardforkhardfork) =>bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas cost
getColdSloadCost()
getColdSloadCost: (Get cold storage cost for hardforkhardfork) =>bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas cost
getSelfdestructRefund()
getSelfdestructRefund: (Get selfdestruct refund for hardforkhardfork) =>bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas refund amount
getSstoreRefund()
getSstoreRefund: (Get storage refund for hardforkhardfork) =>bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas refund amount
hasEIP1153()
hasEIP1153: (Check if a hardfork includes EIP-1153 (transient storage)hardfork) =>boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-1153
hasEIP2929()
hasEIP2929: (Check if a hardfork includes EIP-2929 (cold/warm access costs)hardfork) =>boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-2929
hasEIP3529()
hasEIP3529: (Check if a hardfork includes EIP-3529 (reduced refunds)hardfork) =>boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-3529
hasEIP3860()
hasEIP3860: (Check if a hardfork includes EIP-3860 (initcode size limit)hardfork) =>boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-3860
hasEIP4844()
hasEIP4844: (Check if a hardfork includes EIP-4844 (blob transactions)hardfork) =>boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-4844
keccak256Cost()
keccak256Cost: (Calculate KECCAK256 gas cost (convenience form with this:)this) =>bigint
Parameters
this
bigint
Returns
bigint
Total gas cost
logCost()
logCost: (Calculate LOG gas cost (convenience form with this:)this) =>bigint
Parameters
this
dataSize
bigint
topicCount
bigint
Returns
bigint
maxRefund()
maxRefund: (Calculate maximum gas refund (convenience form with this:)this) =>bigint
Parameters
this
bigint
Returns
bigint
memoryExpansionCost()
memoryExpansionCost: (Calculate memory expansion cost (convenience form with this:)this) =>object
Parameters
this
newSize
bigint
oldSize
bigint
Returns
object
expansionCost
expansionCost: bigint
newCost
newCost: bigint
oldCost
oldCost: bigint
words
words: bigint
Precompile
Precompile: Precompile
ECRECOVER (address 0x01) - Fixed cost
sstoreCost()
sstoreCost: (Calculate SSTORE gas cost (convenience form with this:)this) =>object
Parameters
this
currentValue
bigint
isWarm
boolean
newValue
bigint
Returns
object
cost
cost: bigint
refund
refund: bigint
txIntrinsicGas()
txIntrinsicGas: (Calculate transaction intrinsic gas cost (convenience form with this:)this) =>bigint
Parameters
this
data
Uint8Array
isCreate
boolean
Returns
bigint
Call
Defined in: src/primitives/GasConstants/constants.js:177 Base CALL cost (40 gas)constCall:40n=40n
CallCode
Defined in: src/primitives/GasConstants/constants.js:201 CALLCODE cost (700 gas) - EIP-150constCallCode:700n=700n
CallGasRetentionDivisor
Defined in: src/primitives/GasConstants/constants.js:231 63/64 rule divisor for gas forwardingconstCallGasRetentionDivisor:64n=64n
CallNewAccount
Defined in: src/primitives/GasConstants/constants.js:195 Additional cost for new account creation (25000 gas)constCallNewAccount:25000n=25000n
CallStipend
Defined in: src/primitives/GasConstants/constants.js:183 Gas stipend for value transfer (2300 gas)constCallStipend:2300n=2300n
CallValueTransfer
Defined in: src/primitives/GasConstants/constants.js:189 Additional cost for value transfer (9000 gas)constCallValueTransfer:9000n=9000n
ColdAccountAccess
Defined in: src/primitives/GasConstants/constants.js:93 Cold account access (2600 gas) - EIP-2929 BALANCE, EXTCODESIZE, EXTCODECOPY, EXTCODEHASH, CALL familyconstColdAccountAccess:2600n=2600n
ColdSload
Defined in: src/primitives/GasConstants/constants.js:86 Cold SLOAD (2100 gas) - EIP-2929constColdSload:2100n=2100n
Copy
Defined in: src/primitives/GasConstants/constants.js:303 Per word for copy operations (3 gas)constCopy:3n=3n
Create
Defined in: src/primitives/GasConstants/constants.js:171 Base CREATE cost (32000 gas)constCreate:32000n=32000n
CreateData
Defined in: src/primitives/GasConstants/constants.js:257 Per-byte cost for deployed code (200 gas)constCreateData:200n=200n
DelegateCall
Defined in: src/primitives/GasConstants/constants.js:207 DELEGATECALL cost (700 gas) - EIP-150constDelegateCall:700n=700n
ExtStep
Defined in: src/primitives/GasConstants/constants.js:54 External account interaction (20 gas) BALANCE, EXTCODESIZE, BLOCKHASHconstExtStep:20n=20n
FastestStep
Defined in: src/primitives/GasConstants/constants.js:26 Simple arithmetic and logic (3 gas) ADD, SUB, NOT, LT, GT, SLT, SGT, EQ, ISZERO, AND, OR, XOR, CALLDATALOAD, MLOAD, MSTORE, MSTORE8, PUSH, DUP, SWAPconstFastestStep:3n=3n
FastStep
Defined in: src/primitives/GasConstants/constants.js:33 Multiplication and division (5 gas) MUL, DIV, SDIV, MOD, SMODconstFastStep:5n=5n
InitcodeWord
Defined in: src/primitives/GasConstants/constants.js:263 Per-word cost for initcode (2 gas) - EIP-3860constInitcodeWord:2n=2n
Jumpdest
Defined in: src/primitives/GasConstants/constants.js:139 JUMPDEST marker (1 gas)constJumpdest:1n=1n
Keccak256Base
Defined in: src/primitives/GasConstants/constants.js:64 Base cost for KECCAK256 (30 gas)constKeccak256Base:30n=30n
Keccak256Word
Defined in: src/primitives/GasConstants/constants.js:70 Per-word cost for KECCAK256 (6 gas per 32 bytes)constKeccak256Word:6n=6n
LogBase
Defined in: src/primitives/GasConstants/constants.js:149 Base cost for LOG operations (375 gas)constLogBase:375n=375n
LogData
Defined in: src/primitives/GasConstants/constants.js:155 Per-byte cost for LOG data (8 gas)constLogData:8n=8n
LogTopic
Defined in: src/primitives/GasConstants/constants.js:161 Per-topic cost for LOG (375 gas)constLogTopic:375n=375n
MaxInitcodeSize
Defined in: src/primitives/GasConstants/constants.js:269 Maximum initcode size (49152 bytes) - EIP-3860constMaxInitcodeSize:49152n=49152n
MaxRefundQuotient
Defined in: src/primitives/GasConstants/constants.js:309 Maximum refund quotient (1/5) - EIP-3529constMaxRefundQuotient:5n=5n
Memory
Defined in: src/primitives/GasConstants/constants.js:241 Linear coefficient for memory (3 gas)constMemory:3n=3n
MidStep
Defined in: src/primitives/GasConstants/constants.js:40 Advanced arithmetic (8 gas) ADDMOD, MULMOD, SIGNEXTENDconstMidStep:8n=8n
QuadCoeffDiv
Defined in: src/primitives/GasConstants/constants.js:247 Quadratic coefficient divisor (512)constQuadCoeffDiv:512n=512n
QuickStep
Defined in: src/primitives/GasConstants/constants.js:18 Very cheap operations (2 gas) ADDRESS, ORIGIN, CALLER, CALLVALUE, CALLDATASIZE, CODESIZE, GASPRICE, RETURNDATASIZE, PC, MSIZE, GAS, CHAINID, SELFBALANCEconstQuickStep:2n=2n
Selfdestruct
Defined in: src/primitives/GasConstants/constants.js:219 SELFDESTRUCT base cost (5000 gas) - EIP-150constSelfdestruct:5000n=5000n
SelfdestructRefund
Defined in: src/primitives/GasConstants/constants.js:225 SELFDESTRUCT refund (24000 gas) - Removed in EIP-3529constSelfdestructRefund:24000n=24000n
Sload
Defined in: src/primitives/GasConstants/constants.js:80 SLOAD on warm slot (100 gas)constSload:100n=100n
SlowStep
Defined in: src/primitives/GasConstants/constants.js:47 Moderate computation (10 gas) JUMPIconstSlowStep:10n=10n
SstoreClear
Defined in: src/primitives/GasConstants/constants.js:123 SSTORE clear to zero (5000 gas)constSstoreClear:5000n=5000n
SstoreRefund
Defined in: src/primitives/GasConstants/constants.js:129 Gas refund for clearing storage (4800 gas) - EIP-3529constSstoreRefund:4800n=4800n
SstoreReset
Defined in: src/primitives/GasConstants/constants.js:117 SSTORE modify existing non-zero (5000 gas)constSstoreReset:5000n=5000n
SstoreSentry
Defined in: src/primitives/GasConstants/constants.js:105 Minimum gas for SSTORE (2300 gas)constSstoreSentry:2300n=2300n
SstoreSet
Defined in: src/primitives/GasConstants/constants.js:111 SSTORE zero to non-zero (20000 gas)constSstoreSet:20000n=20000n
StaticCall
Defined in: src/primitives/GasConstants/constants.js:213 STATICCALL cost (700 gas) - EIP-214constStaticCall:700n=700n
TLoad
Defined in: src/primitives/GasConstants/constants.js:335 TLOAD cost (100 gas)constTLoad:100n=100n
TStore
Defined in: src/primitives/GasConstants/constants.js:341 TSTORE cost (100 gas)constTStore:100n=100n
Tx
Defined in: src/primitives/GasConstants/constants.js:279 Base transaction cost (21000 gas)constTx:21000n=21000n
TxContractCreation
Defined in: src/primitives/GasConstants/constants.js:285 Contract creation transaction base cost (53000 gas)constTxContractCreation:53000n=53000n
TxDataNonZero
Defined in: src/primitives/GasConstants/constants.js:297 Per non-zero byte in calldata (16 gas)constTxDataNonZero:16n=16n
TxDataZero
Defined in: src/primitives/GasConstants/constants.js:291 Per zero byte in calldata (4 gas)constTxDataZero:4n=4n
WarmStorageRead
Defined in: src/primitives/GasConstants/constants.js:99 Warm storage read (100 gas) - EIP-2929constWarmStorageRead:100n=100n
Functions
calculateCallCost()
calculateCallCost(Defined in: src/primitives/GasConstants/calculateCallCost.js:25 Calculate CALL operation gas costisWarm,hasValue,isNewAccount,availableGas):object
Parameters
isWarm
boolean
Whether target account is warm
hasValue
boolean
Whether call transfers value
isNewAccount
boolean
Whether target account doesn’t exist
availableGas
bigint
Gas available for the call
Returns
object
Gas cost breakdown
base
base: bigint
dynamic
dynamic: bigint
forwarded
forwarded: bigint
stipend
stipend: bigint
total
total: bigint
Example
calculateCopyCost()
calculateCopyCost(Defined in: src/primitives/GasConstants/calculateCopyCost.js:9 Calculate copy operation gas costsize):bigint
Parameters
size
bigint
Size of data to copy in bytes
Returns
bigint
Gas cost
calculateCreateCost()
calculateCreateCost(Defined in: src/primitives/GasConstants/calculateCreateCost.js:23 Calculate contract creation gas costinitcodeSize,deployedSize):object
Parameters
initcodeSize
bigint
Size of initcode in bytes
deployedSize
bigint
Size of deployed bytecode in bytes
Returns
object
Gas cost breakdown
base
base: bigint
dynamic
dynamic: bigint
total
total: bigint
Throws
If initcode size exceeds maximumExample
calculateKeccak256Cost()
calculateKeccak256Cost(Defined in: src/primitives/GasConstants/calculateKeccak256Cost.js:14 Calculate KECCAK256 gas costdataSize):bigint
Parameters
dataSize
bigint
Size of data in bytes
Returns
bigint
Total gas cost
Example
calculateLogCost()
calculateLogCost(Defined in: src/primitives/GasConstants/calculateLogCost.js:16 Calculate LOG gas costtopicCount,dataSize):bigint
Parameters
topicCount
bigint
Number of topics (0-4)
dataSize
bigint
Size of log data in bytes
Returns
bigint
Total gas cost
Example
calculateMaxRefund()
calculateMaxRefund(Defined in: src/primitives/GasConstants/calculateMaxRefund.js:9 Calculate maximum gas refundgasUsed):bigint
Parameters
gasUsed
bigint
Total gas used in transaction
Returns
bigint
Maximum refundable gas
calculateMemoryExpansionCost()
calculateMemoryExpansionCost(Defined in: src/primitives/GasConstants/calculateMemoryExpansionCost.js:16 Calculate memory expansion costoldSize,newSize):object
Parameters
oldSize
bigint
Previous memory size in bytes
newSize
bigint
New memory size in bytes
Returns
object
Memory expansion cost
expansionCost
expansionCost: bigint
newCost
newCost: bigint
oldCost
oldCost: bigint
words
words: bigint
Example
calculateSstoreCost()
calculateSstoreCost(Defined in: src/primitives/GasConstants/calculateSstoreCost.js:24 Calculate SSTORE gas costisWarm,currentValue,newValue):object
Parameters
isWarm
boolean
Whether slot is warm (previously accessed)
currentValue
bigint
Current storage value (0n if empty)
newValue
bigint
New storage value
Returns
object
Gas cost and potential refund
cost
cost: bigint
refund
refund: bigint
Example
calculateTxIntrinsicGas()
calculateTxIntrinsicGas(Defined in: src/primitives/GasConstants/calculateTxIntrinsicGas.js:22 Calculate transaction intrinsic gas costdata,isCreate):bigint
Parameters
data
Uint8Array<ArrayBufferLike>
Transaction calldata
isCreate
boolean
Whether transaction creates a contract
Returns
bigint
Intrinsic gas cost
Example
callCost()
callCost(Defined in: src/primitives/GasConstants/callCost.js:9 Calculate CALL operation gas cost (convenience form with this:)this):object
Parameters
this
availableGas
bigint
hasValue
boolean
isNewAccount
boolean
isWarm
boolean
Returns
object
base
base: bigint
dynamic
dynamic: bigint
forwarded
forwarded: bigint
stipend
stipend: bigint
total
total: bigint
copyCost()
copyCost(Defined in: src/primitives/GasConstants/copyCost.js:9 Calculate copy operation gas cost (convenience form with this:)this):bigint
Parameters
this
bigint
Returns
bigint
createCost()
createCost(Defined in: src/primitives/GasConstants/createCost.js:9 Calculate contract creation gas cost (convenience form with this:)this):object
Parameters
this
deployedSize
bigint
initcodeSize
bigint
Returns
object
base
base: bigint
dynamic
dynamic: bigint
total
total: bigint
getColdAccountAccessCost()
getColdAccountAccessCost(Defined in: src/primitives/GasConstants/getColdAccountAccessCost.js:10 Get cold account access cost for hardforkhardfork):bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas cost
getColdSloadCost()
getColdSloadCost(Defined in: src/primitives/GasConstants/getColdSloadCost.js:10 Get cold storage cost for hardforkhardfork):bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas cost
getSelfdestructRefund()
getSelfdestructRefund(Defined in: src/primitives/GasConstants/getSelfdestructRefund.js:10 Get selfdestruct refund for hardforkhardfork):bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas refund amount
getSstoreRefund()
getSstoreRefund(Defined in: src/primitives/GasConstants/getSstoreRefund.js:10 Get storage refund for hardforkhardfork):bigint
Parameters
hardfork
Hardfork
EVM hardfork
Returns
bigint
Gas refund amount
hasEIP1153()
hasEIP1153(Defined in: src/primitives/GasConstants/hasEIP1153.js:7 Check if a hardfork includes EIP-1153 (transient storage)hardfork):boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-1153
hasEIP2929()
hasEIP2929(Defined in: src/primitives/GasConstants/hasEIP2929.js:7 Check if a hardfork includes EIP-2929 (cold/warm access costs)hardfork):boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-2929
hasEIP3529()
hasEIP3529(Defined in: src/primitives/GasConstants/hasEIP3529.js:7 Check if a hardfork includes EIP-3529 (reduced refunds)hardfork):boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-3529
hasEIP3860()
hasEIP3860(Defined in: src/primitives/GasConstants/hasEIP3860.js:7 Check if a hardfork includes EIP-3860 (initcode size limit)hardfork):boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-3860
hasEIP4844()
hasEIP4844(Defined in: src/primitives/GasConstants/hasEIP4844.js:7 Check if a hardfork includes EIP-4844 (blob transactions)hardfork):boolean
Parameters
hardfork
Hardfork
EVM hardfork
Returns
boolean
Whether hardfork includes EIP-4844
keccak256Cost()
keccak256Cost(Defined in: src/primitives/GasConstants/keccak256Cost.js:9 Calculate KECCAK256 gas cost (convenience form with this:)this):bigint
Parameters
this
bigint
Returns
bigint
Total gas cost
logCost()
logCost(Defined in: src/primitives/GasConstants/logCost.js:9 Calculate LOG gas cost (convenience form with this:)this):bigint
Parameters
this
dataSize
bigint
topicCount
bigint
Returns
bigint
maxRefund()
maxRefund(Defined in: src/primitives/GasConstants/maxRefund.js:9 Calculate maximum gas refund (convenience form with this:)this):bigint
Parameters
this
bigint
Returns
bigint
memoryExpansionCost()
memoryExpansionCost(Defined in: src/primitives/GasConstants/memoryExpansionCost.js:9 Calculate memory expansion cost (convenience form with this:)this):object
Parameters
this
newSize
bigint
oldSize
bigint
Returns
object
expansionCost
expansionCost: bigint
newCost
newCost: bigint
oldCost
oldCost: bigint
words
words: bigint
sstoreCost()
sstoreCost(Defined in: src/primitives/GasConstants/sstoreCost.js:9 Calculate SSTORE gas cost (convenience form with this:)this):object
Parameters
this
currentValue
bigint
isWarm
boolean
newValue
bigint
Returns
object
cost
cost: bigint
refund
refund: bigint
txIntrinsicGas()
txIntrinsicGas(Defined in: src/primitives/GasConstants/txIntrinsicGas.js:9 Calculate transaction intrinsic gas cost (convenience form with this:)this):bigint
Parameters
this
data
Uint8Array
isCreate
boolean
Returns
bigint
