From 93c76a2334be4bab32991444ae476d9ec6fe83d6 Mon Sep 17 00:00:00 2001 From: "L0GYKAL.eth" <32228897+L0GYKAL@users.noreply.github.com> Date: Sat, 9 Nov 2024 13:33:01 +0100 Subject: [PATCH] feat: AbstractBlocklockReceiver.sol (#4) --- contracts/src/AbstractBlocklockReceiver.sol | 15 +++++++++++++++ contracts/src/AbstractDecryptionReceiver.sol | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 contracts/src/AbstractBlocklockReceiver.sol diff --git a/contracts/src/AbstractBlocklockReceiver.sol b/contracts/src/AbstractBlocklockReceiver.sol new file mode 100644 index 0000000..914c40a --- /dev/null +++ b/contracts/src/AbstractBlocklockReceiver.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import {IBlocklockReceiver} from "./IBlocklockReceiver.sol"; + +abstract contract AbstractBlocklockReceiver is IBlocklockReceiver { + address public immutable DECRYPTION_PROVIDER = 0x11045878Ed62Ec3aCC91cE36A46F4EF61d4616e1; + + error NotAuthorizedDecryptionProvider(); + + modifier onlyDecryptionProvider(){ + if (msg.sender != DECRYPTION_PROVIDER) revert NotAuthorizedDecryptionProvider(); + _; + } +} diff --git a/contracts/src/AbstractDecryptionReceiver.sol b/contracts/src/AbstractDecryptionReceiver.sol index ceba1cc..2b39b60 100644 --- a/contracts/src/AbstractDecryptionReceiver.sol +++ b/contracts/src/AbstractDecryptionReceiver.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {IDecryptionReceiver} from "./IDecryptionReceiver.sol"; -abstract contract AbstractDecryptionReceiver { +abstract contract AbstractDecryptionReceiver is IDecryptionReceiver { address public immutable DECRYPTION_PROVIDER = 0x11045878Ed62Ec3aCC91cE36A46F4EF61d4616e1; error NotAuthorizedDecryptionProvider();