mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
26 lines
1.0 KiB
Go
26 lines
1.0 KiB
Go
// (c) 2020-2020, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package txallowlist
|
|
|
|
import (
|
|
"github.com/luxfi/evm/precompile/allowlist"
|
|
"github.com/luxfi/evm/precompile/contract"
|
|
"github.com/luxfi/geth/common"
|
|
)
|
|
|
|
// Singleton StatefulPrecompiledContract for W/R access to the tx allow list.
|
|
var TxAllowListPrecompile contract.StatefulPrecompiledContract = allowlist.CreateAllowListPrecompile(ContractAddress)
|
|
|
|
// GetTxAllowListStatus returns the role of [address] for the tx allow list.
|
|
func GetTxAllowListStatus(stateDB contract.StateReader, address common.Address) allowlist.Role {
|
|
return allowlist.GetAllowListStatus(stateDB, ContractAddress, address)
|
|
}
|
|
|
|
// SetTxAllowListStatus sets the permissions of [address] to [role] for the
|
|
// tx allow list.
|
|
// assumes [role] has already been verified as valid.
|
|
func SetTxAllowListStatus(stateDB contract.StateDB, address common.Address, role allowlist.Role) {
|
|
allowlist.SetAllowListRole(stateDB, ContractAddress, address, role)
|
|
}
|