Conversation
Contributor
Gas usage comparisonBase commit: Summary
Largest method changes
Deployment changes
All method measurements
All deployments
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DAuthOracleRegistry contract to maintain an owner-managed subset of current Controller oracles intended to run dAuth services, along with deployment scripting, documentation updates, and a dedicated test suite.
Changes:
- Introduces
contracts/DAuthOracleRegistry.solwith add/remove + filtered read APIs based on currentControlleroracle membership. - Adds a numbered deploy script for Base/Base Sepolia and updates docs to include the new contract and deploy order.
- Adds a full test suite covering constructor validation, ownership gating, add/remove behavior, and filtering when
Controlleroracle membership changes.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| contracts/DAuthOracleRegistry.sol | New Ownable registry contract that tracks selected dAuth oracles and filters reads against Controller.getOracles() membership. |
| test/DAuthOracleRegistry.test.ts | New unit tests covering constructor checks, access control, add/remove flows, and stale-oracle filtering. |
| scripts/deploys/12.DAuthOracleRegistry.ts | New deployment script to deploy DAuthOracleRegistry using CONTROLLER_ADDR and SAFE_ADDR. |
| README.md | Documents the new contract and adds its Base deployment address + deploy command. |
| DEPLOYMENT.md | Updates deployment procedure to include the new registry and notes about managing dAuth membership separately. |
| .openzeppelin/base-sepolia.json | Updates the Base Sepolia OpenZeppelin manifest (likely due to local deploy/upgrade tooling state changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+40
| function getDAuthOracles() public view returns (address[] memory) { | ||
| uint256 activeDAuthOraclesCount = 0; | ||
| for (uint i = 0; i < _dAuthOracles.length; i++) { | ||
| if (_isControllerOracle(_dAuthOracles[i])) { | ||
| activeDAuthOraclesCount++; | ||
| } | ||
| } | ||
|
|
||
| address[] memory activeDAuthOracles = new address[]( | ||
| activeDAuthOraclesCount | ||
| ); | ||
| uint256 activeDAuthOracleIndex = 0; | ||
| for (uint i = 0; i < _dAuthOracles.length; i++) { | ||
| if (_isControllerOracle(_dAuthOracles[i])) { | ||
| activeDAuthOracles[activeDAuthOracleIndex] = _dAuthOracles[i]; | ||
| activeDAuthOracleIndex++; | ||
| } |
Comment on lines
+24
to
+44
| function getDAuthOracles() public view returns (address[] memory) { | ||
| uint256 activeDAuthOraclesCount = 0; | ||
| for (uint i = 0; i < _dAuthOracles.length; i++) { | ||
| if (_isControllerOracle(_dAuthOracles[i])) { | ||
| activeDAuthOraclesCount++; | ||
| } | ||
| } | ||
|
|
||
| address[] memory activeDAuthOracles = new address[]( | ||
| activeDAuthOraclesCount | ||
| ); | ||
| uint256 activeDAuthOracleIndex = 0; | ||
| for (uint i = 0; i < _dAuthOracles.length; i++) { | ||
| if (_isControllerOracle(_dAuthOracles[i])) { | ||
| activeDAuthOracles[activeDAuthOracleIndex] = _dAuthOracles[i]; | ||
| activeDAuthOracleIndex++; | ||
| } | ||
| } | ||
|
|
||
| return activeDAuthOracles; | ||
| } |
Comment on lines
+46
to
+50
| function isDAuthOracle(address oracleAddress) public view returns (bool) { | ||
| return | ||
| _isDAuthOracle[oracleAddress] && | ||
| _isControllerOracle(oracleAddress); | ||
| } |
Comment on lines
+52
to
+66
| function addDAuthOracle(address newDAuthOracle) public onlyOwner { | ||
| require(newDAuthOracle != address(0), "Invalid dAuth oracle address"); | ||
| require( | ||
| !_isDAuthOracle[newDAuthOracle], | ||
| "dAuth oracle already exists" | ||
| ); | ||
| require( | ||
| _isControllerOracle(newDAuthOracle), | ||
| "Address is not Controller oracle" | ||
| ); | ||
|
|
||
| _isDAuthOracle[newDAuthOracle] = true; | ||
| _dAuthOracles.push(newDAuthOracle); | ||
| emit DAuthOracleAdded(newDAuthOracle); | ||
| } |
Comment on lines
+85
to
+95
| function _isControllerOracle( | ||
| address oracleAddress | ||
| ) private view returns (bool) { | ||
| address[] memory controllerOracles = controller.getOracles(); | ||
| for (uint i = 0; i < controllerOracles.length; i++) { | ||
| if (controllerOracles[i] == oracleAddress) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.