diff --git a/core/vm/contracts_with_ctx.go b/core/vm/contracts_with_ctx.go index 76493661a172..2bae3c133b7c 100644 --- a/core/vm/contracts_with_ctx.go +++ b/core/vm/contracts_with_ctx.go @@ -78,13 +78,14 @@ func (c *mint) RequiredGas(input []byte) uint64 { } // Predetermined create2 address of whitelist contract with exclusive mint/burn privileges. -const whitelistCreate2Addr = "0x000000" +// See: https://github.com/primevprotocol/contracts/blob/ecfd53d43770201da9c7a697be1fb03e5e554e4e/scripts/DeployScripts.s.sol +const whitelistCreate2Addr = "0xe57ee51bcb0914EC666703F923e0433d8c4d70b1" func (c *mint) Run(input []byte, ctx *precompileContext) ([]byte, error) { - // if ctx.caller != common.HexToAddress(whitelistCreate2Addr) { - // return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted") - // } + if ctx.caller != common.HexToAddress(whitelistCreate2Addr) { + return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted") + } mintTo := common.BytesToAddress(input[0:32]) @@ -110,9 +111,9 @@ func (c *burn) RequiredGas(input []byte) uint64 { func (c *burn) Run(input []byte, ctx *precompileContext) ([]byte, error) { - // if ctx.caller != common.HexToAddress(whitelistCreate2Addr) { - // return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted") - // } + if ctx.caller != common.HexToAddress(whitelistCreate2Addr) { + return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted") + } burnFrom := common.BytesToAddress(input[0:32])