mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
- Change Go version from 1.24.6 to 1.22.8 (stable version) - Ensure all build scripts have executable permissions - Fix covdata issue by using stable Go version - CI should now pass all checks
42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package extras
|
|
|
|
import (
|
|
"github.com/luxfi/evm/precompile/precompileconfig"
|
|
"github.com/luxfi/geth/common"
|
|
)
|
|
|
|
type Rules struct {
|
|
// Rules for Lux releases
|
|
LuxRules
|
|
|
|
// Precompiles maps addresses to stateful precompiled contracts that are enabled
|
|
// for this rule set.
|
|
// Note: none of these addresses should conflict with the address space used by
|
|
// any existing precompiles.
|
|
Precompiles map[common.Address]precompileconfig.Config
|
|
// Predicaters maps addresses to stateful precompile Predicaters
|
|
// that are enabled for this rule set.
|
|
Predicaters map[common.Address]precompileconfig.Predicater
|
|
// AccepterPrecompiles map addresses to stateful precompile accepter functions
|
|
// that are enabled for this rule set.
|
|
AccepterPrecompiles map[common.Address]precompileconfig.Accepter
|
|
}
|
|
|
|
func (r *Rules) PredicatersExist() bool {
|
|
return len(r.Predicaters) > 0
|
|
}
|
|
|
|
func (r *Rules) PredicaterExists(addr common.Address) bool {
|
|
_, ok := r.Predicaters[addr]
|
|
return ok
|
|
}
|
|
|
|
// IsPrecompileEnabled returns true if the precompile at `addr` is enabled for this rule set.
|
|
func (r *Rules) IsPrecompileEnabled(addr common.Address) bool {
|
|
_, ok := r.Precompiles[addr]
|
|
return ok
|
|
}
|