Skip to content

Commit

Permalink
feat: emit SequencerOracleUpdated on contract creation
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurka-o committed May 8, 2024
1 parent 94fa241 commit d030fab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions contracts/OverlayV1Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ contract OverlayV1Factory is IOverlayV1Factory {
deployer = new OverlayV1Deployer(_ov);

// set the sequencer oracle
sequencerOracle = AggregatorV3Interface(_sequencerOracle);
_setSequencerOracle(_sequencerOracle);
_setGracePeriod(_gracePeriod);
}

Expand Down Expand Up @@ -253,8 +253,7 @@ contract OverlayV1Factory is IOverlayV1Factory {
}

function setSequencerOracle(address newSequencerOracle) public onlyGovernor {
sequencerOracle = AggregatorV3Interface(newSequencerOracle);
emit SequencerOracleUpdated(newSequencerOracle);
_setSequencerOracle(newSequencerOracle);
}

function setGracePeriod(uint256 newGracePeriod) public onlyGovernor {
Expand All @@ -265,4 +264,10 @@ contract OverlayV1Factory is IOverlayV1Factory {
gracePeriod = newGracePeriod;
emit GracePeriodUpdated(newGracePeriod);
}

function _setSequencerOracle(address newSequencerOracle) internal {
require(newSequencerOracle != address(0), "OVV1: sequencerOracle should not be zero address");
sequencerOracle = AggregatorV3Interface(newSequencerOracle);
emit SequencerOracleUpdated(newSequencerOracle);
}
}

0 comments on commit d030fab

Please sign in to comment.