Skip to content

Commit

Permalink
emit event on registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x authored and dcposch committed Feb 7, 2024
1 parent e5bd318 commit b0a4b80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BundleBulker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ contract BundleBulker {
mapping(uint32 => IInflator) public idToInflator;
mapping(IInflator => uint32) public inflatorToID;

event InflatorRegistered(uint32 id, IInflator inflator);

function registerInflator(uint32 inflatorId, IInflator inflator) public {
require(inflatorId != 0, "Inflator ID cannot be 0");
require(
Expand All @@ -26,6 +28,8 @@ contract BundleBulker {

idToInflator[inflatorId] = inflator;
inflatorToID[inflator] = inflatorId;

emit InflatorRegistered(inflatorId, inflator);
}

function inflate(bytes calldata compressed) public view returns (UserOperation[] memory ops, address payable beneficiary) {
Expand Down
4 changes: 4 additions & 0 deletions src/PerOpInflator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ contract PerOpInflator is IInflator, Ownable {
mapping(uint32 => IOpInflator) public idToInflator;
mapping(IOpInflator => uint32) public inflatorToID;

event OpInflatorRegistered(uint32 id, IOpInflator inflator);

function registerOpInflator(uint32 inflatorId, IOpInflator inflator) public {
require(inflatorId != 0, "Inflator ID cannot be 0");
require(address(inflator) != address(0), "Inflator address cannot be 0");
Expand All @@ -21,6 +23,8 @@ contract PerOpInflator is IInflator, Ownable {

idToInflator[inflatorId] = inflator;
inflatorToID[inflator] = inflatorId;

emit OpInflatorRegistered(inflatorId, inflator);
}

constructor(address _owner) {
Expand Down

0 comments on commit b0a4b80

Please sign in to comment.