From 4e793f42f7674a8630532e4a36985740c4b243ec Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Mon, 25 Sep 2023 10:53:12 +0200 Subject: [PATCH] feat: use struct in events --- src/MetaMorpho.sol | 8 ++++---- src/libraries/EventsLib.sol | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/MetaMorpho.sol b/src/MetaMorpho.sol index 711a9da9..a0ff6f91 100644 --- a/src/MetaMorpho.sol +++ b/src/MetaMorpho.sol @@ -288,25 +288,25 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph /* ONLY GUARDIAN FUNCTIONS */ function revokeTimelock() external onlyGuardian { - emit EventsLib.RevokeTimelock(msg.sender, pendingTimelock.value, pendingTimelock.submittedAt); + emit EventsLib.RevokeTimelock(msg.sender, pendingTimelock); delete pendingTimelock; } function revokeFee() external onlyGuardian { - emit EventsLib.RevokeFee(msg.sender, pendingFee.value, pendingFee.submittedAt); + emit EventsLib.RevokeFee(msg.sender, pendingFee); delete pendingFee; } function revokeCap(Id id) external onlyGuardian { - emit EventsLib.RevokeCap(msg.sender, id, pendingCap[id].value, pendingCap[id].submittedAt); + emit EventsLib.RevokeCap(msg.sender, id, pendingCap[id]); delete pendingCap[id]; } function revokeGuardian() external onlyGuardian { - emit EventsLib.RevokeGuardian(msg.sender, pendingGuardian.value, pendingGuardian.submittedAt); + emit EventsLib.RevokeGuardian(msg.sender, pendingGuardian); delete pendingGuardian; } diff --git a/src/libraries/EventsLib.sol b/src/libraries/EventsLib.sol index 05b3b830..217985df 100644 --- a/src/libraries/EventsLib.sol +++ b/src/libraries/EventsLib.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import {Id} from "@morpho-blue/interfaces/IMorpho.sol"; +import {PendingUint192, PendingAddress} from "../interfaces/IMetaMorpho.sol"; library EventsLib { event SetRole(address indexed target, uint256 role); @@ -38,13 +39,13 @@ library EventsLib { event SetIsAllocator(address indexed allocator, bool isAllocator); - event RevokeTimelock(address indexed guardian, uint256 pendingTimelock, uint256 submittedAt); + event RevokeTimelock(address indexed guardian, PendingUint192 pendingTimelock); - event RevokeFee(address indexed guardian, uint256 pendingFee, uint256 submittedAt); + event RevokeFee(address indexed guardian, PendingUint192 pendingFee); - event RevokeCap(address indexed guardian, Id indexed id, uint256 pendingCap, uint256 submittedAt); + event RevokeCap(address indexed guardian, Id indexed id, PendingUint192 pendingCap); - event RevokeGuardian(address indexed guardian, address pendingGuardian, uint256 submittedAt); + event RevokeGuardian(address indexed guardian, PendingAddress pendingGuardian); event SetSupplyQueue(address indexed allocator, Id[] id);