Versions in this module Expand all Collapse all v0 v0.5.6 Jul 16, 2024 v0.0.1 Jun 28, 2024 Changes in this version + const ModifyAllowListGasCost + const ReadAllowListFuncKey + const ReadAllowListGasCost + const SetAdminFuncKey + const SetEnabledFuncKey + const SetManagerFuncKey + const SetNoneFuncKey + var AdminRole = Role(common.BigToHash(common.Big2)) + var AllowListFuncKeys = []string + var EnabledRole = Role(common.BigToHash(common.Big1)) + var ErrCannotAddManagersBeforeDUpgrade = fmt.Errorf("cannot add managers before DUpgrade") + var ErrCannotModifyAllowList = errors.New("cannot modify allow list") + var ManagerRole = Role(common.BigToHash(common.Big3)) + var NoRole = Role(common.BigToHash(common.Big0)) + var TestAdminAddr = common.HexToAddress("0x0000000000000000000000000000000000000011") + var TestEnabledAddr = common.HexToAddress("0x0000000000000000000000000000000000000022") + var TestManagerAddr = common.HexToAddress("0x0000000000000000000000000000000000000044") + var TestNoRoleAddr = common.HexToAddress("0x0000000000000000000000000000000000000033") + func AllowListConfigEqualTests(t testing.TB, module modules.Module) map[string]testutils.ConfigEqualTest + func AllowListConfigVerifyTests(t testing.TB, module modules.Module) map[string]testutils.ConfigVerifyTest + func AllowListTests(t testing.TB, module modules.Module) map[string]testutils.PrecompileTest + func BenchPrecompileWithAllowList(b *testing.B, module modules.Module, ...) + func CreateAllowListFunctions(precompileAddr common.Address) []*contract.StatefulPrecompileFunction + func CreateAllowListPrecompile(precompileAddr common.Address) contract.StatefulPrecompiledContract + func EqualPrecompileWithAllowListTests(t *testing.T, module modules.Module, ...) + func PackModifyAllowList(address common.Address, role Role) ([]byte, error) + func PackReadAllowList(address common.Address) []byte + func RunPrecompileWithAllowListTests(t *testing.T, module modules.Module, ...) + func SetAllowListRole(stateDB contract.StateDB, precompileAddr, address common.Address, role Role) + func SetDefaultRoles(contractAddress common.Address) func(t testing.TB, state contract.StateDB) + func VerifyPrecompileWithAllowListTests(t *testing.T, module modules.Module, ...) + type AllowListConfig struct + AdminAddresses []common.Address + EnabledAddresses []common.Address + ManagerAddresses []common.Address + func (c *AllowListConfig) Configure(chainConfig precompileconfig.ChainConfig, precompileAddr common.Address, ...) error + func (c *AllowListConfig) Equal(other *AllowListConfig) bool + func (c *AllowListConfig) Verify(chainConfig precompileconfig.ChainConfig, upgrade precompileconfig.Upgrade) error + type Role common.Hash + func GetAllowListStatus(state contract.StateDB, precompileAddr common.Address, address common.Address) Role + func (r Role) CanModify(from, target Role) bool + func (r Role) IsAdmin() bool + func (r Role) IsEnabled() bool + func (r Role) IsNoRole() bool + func (r Role) String() string