From b80933d53c73f96e6ed53b28efdae0d37274d8d7 Mon Sep 17 00:00:00 2001 From: cristovaoth Date: Thu, 12 Oct 2023 15:46:35 +0200 Subject: [PATCH] Moving the newly introducedd errors into ExecutionTracker --- contracts/core/GuardableModifier.sol | 2 +- contracts/core/Modifier.sol | 6 ------ contracts/signature/ExecutionTracker.sol | 3 +++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/contracts/core/GuardableModifier.sol b/contracts/core/GuardableModifier.sol index 3ba9dec5..6d8c0298 100644 --- a/contracts/core/GuardableModifier.sol +++ b/contracts/core/GuardableModifier.sol @@ -90,7 +90,7 @@ abstract contract GuardableModifier is Module, Guardable, Modifier { } } - function sentOrSignedBy() private returns (address) { + function sentOrSignedBy() private view returns (address) { if (modules[msg.sender] != address(0)) { return msg.sender; } diff --git a/contracts/core/Modifier.sol b/contracts/core/Modifier.sol index af96b549..3c8c5ae6 100644 --- a/contracts/core/Modifier.sol +++ b/contracts/core/Modifier.sol @@ -21,12 +21,6 @@ abstract contract Modifier is /// @param sender The address of the sender. error NotAuthorized(address sender); - /// @param hash already executed. - error HashAlreadyExecuted(bytes32 hash); - - /// @param hash already executed. - error HashInvalidated(bytes32 hash); - /// `module` is invalid. error InvalidModule(address module); diff --git a/contracts/signature/ExecutionTracker.sol b/contracts/signature/ExecutionTracker.sol index b9f21a0c..a8e6e07f 100644 --- a/contracts/signature/ExecutionTracker.sol +++ b/contracts/signature/ExecutionTracker.sol @@ -3,6 +3,9 @@ pragma solidity >=0.8.0 <0.9.0; /// @title ExecutionTracker - A contract that keeps track of executed and invalidated hashes contract ExecutionTracker { + error HashAlreadyExecuted(bytes32); + error HashInvalidated(bytes32); + mapping(address => mapping(bytes32 => bool)) public executed; mapping(address => mapping(bytes32 => bool)) public invalidated;