Skip to content

Commit

Permalink
fix allow list comments (#469)
Browse files Browse the repository at this point in the history
* fix allow list comments

* cleaner sentences

* use preallocated big nums

* infer allow list role type
  • Loading branch information
ceyonur authored Jan 31, 2023
1 parent 954fe72 commit 01a16a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions precompile/allow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package precompile
import (
"errors"
"fmt"
"math/big"

"github.com/ava-labs/subnet-evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -23,9 +22,12 @@ const (
)

var (
AllowListNoRole AllowListRole = AllowListRole(common.BigToHash(big.NewInt(0))) // No role assigned - this is equivalent to common.Hash{} and deletes the key from the DB when set
AllowListEnabled AllowListRole = AllowListRole(common.BigToHash(big.NewInt(1))) // Deployers are allowed to create new contracts
AllowListAdmin AllowListRole = AllowListRole(common.BigToHash(big.NewInt(2))) // Admin - allowed to modify both the admin and deployer list as well as deploy contracts
// No role assigned - this is equivalent to common.Hash{} and deletes the key from the DB when set
AllowListNoRole = AllowListRole(common.BigToHash(common.Big0))
// Enabled - allowed to use state-changing precompile functions without modifying status of other admins or enableds
AllowListEnabled = AllowListRole(common.BigToHash(common.Big1))
// Admin - allowed to modify both the admin and enabled list, as well as to use state-changing precompile functions
AllowListAdmin = AllowListRole(common.BigToHash(common.Big2))

// AllowList function signatures
setAdminSignature = CalculateFunctionSelector("setAdmin(address)")
Expand Down

0 comments on commit 01a16a0

Please sign in to comment.