Skip to content

Commit

Permalink
Merge pull request #107 from morpho-labs/feat/events-struct
Browse files Browse the repository at this point in the history
Use struct in events
  • Loading branch information
Rubilmax authored Sep 25, 2023
2 parents 54123ca + 4e793f4 commit c423211
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -302,25 +302,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;
}
Expand Down
9 changes: 5 additions & 4 deletions src/libraries/EventsLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 SubmitTimelock(uint256 timelock);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit c423211

Please sign in to comment.