Update contracts.go

This commit is contained in:
Felix Lange 2025-06-05 09:49:46 +02:00 committed by GitHub
parent 0ceb286d14
commit 9caab0d8de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -469,18 +469,15 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 {
if gas.BitLen() > 64 {
return math.MaxUint64
}
return max(minPrice, gas.Uint64())
}
if gas.Uint64() < minPrice {
return minPrice
}
return gas.Uint64()
}
// Pre-osaka logic.
gas = modexpMultComplexity(gas)
if adjExpLen.Cmp(big1) > 0 {
gas.Mul(gas, adjExpLen)
}
gas.Div(gas, big20)
if gas.BitLen() > 64 {
return math.MaxUint64
}