Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit events on registrations #10

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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