Skip to content

Develop - #80

Open
aledefra wants to merge 4 commits into
mainfrom
develop
Open

Develop#80
aledefra wants to merge 4 commits into
mainfrom
develop

Conversation

@aledefra

@aledefra aledefra commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 15:01
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Gas usage comparison

Base commit: e161377
PR commit: 9cf9837

Summary

  • Method gas total: 776,847,970 → 781,718,822 (+4,870,852, +0.63%)
  • Deployment gas total: 5,762,992,655 → 5,823,507,759 (+60,515,104, +1.05%)
  • Largest deployment bytecode (PR): PoAIManager (23,678 bytes, 96.35%)

Largest method changes

Contract Method Calls (base→PR) Base Avg Gas PR Avg Gas Δ Gas Δ %
DAuthOracleRegistry addDAuthOracle 0→11 100,355 +100,355
MNDContract approve 32→0 46,395 -46,395
DAuthOracleRegistry removeDAuthOracle 0→6 34,785 +34,785

Deployment changes

Contract Base Avg Gas PR Avg Gas Δ Gas Δ % Δ Size (bytes) Base Limit Usage PR Limit Usage Δ Limit Usage
DAuthOracleRegistry 656,067 +656,067 +2,547 10.36%
All method measurements
Contract Method Calls (base→PR) Base Avg Gas PR Avg Gas Δ Gas Δ %
AdoptionOracle initializeLicenseSales 15 145,145 145,145 0 0.00%
AdoptionOracle initializePoaiVolumes 7 171,655 171,655 0 0.00%
AdoptionOracle recordLicenseSales 12 101,348 101,348 0 0.00%
AdoptionOracle recordPoaiVolume 10 109,732 109,732 0 0.00%
AdoptionOracle setNdFullReleaseThreshold 3 34,768 34,768 0 0.00%
AdoptionOracle setPoaiVolumeFullReleaseThreshold 3 34,826 34,826 0 0.00%
AttestationRegistry submitRedmeshJobStartAttestation 5 151,080 151,080 0 0.00%
AttestationRegistry submitRedmeshTestAttestation 10 125,148 125,148 0 0.00%
BurnContract burn 2 41,462 41,462 0 0.00%
Controller addOracle 203→235 108,647 108,515 -132 -0.12%
Controller removeOracle 2→5 33,704 36,008 +2,304 +6.84%
Controller setContracts 111 68,755 68,754 -1 -0.00%
Controller setMinimumRequiredSignatures 7 27,646 27,646 0 0.00%
CspEscrow createJobs 78 686,666 686,666 0 0.00%
CspEscrow extendJobDuration 2 77,646 77,646 0 0.00%
CspEscrow extendJobNodes 4 78,822 78,822 0 0.00%
CspEscrow extendJobsDurationBatch 3 99,230 99,230 0 0.00%
CspEscrow extendJobsNodesBatch 3 99,617 99,617 0 0.00%
CspEscrow redeemUnusedJob 4 131,711 131,711 0 0.00%
CspEscrow removeDelegate 1 53,570 53,570 0 0.00%
CspEscrow setDelegatePermissions 15 129,993 129,993 0 0.00%
DAuthOracleRegistry addDAuthOracle 0→11 100,355 +100,355
DAuthOracleRegistry removeDAuthOracle 0→6 34,785 +34,785
ERC20Mock approve 102 46,187 46,187 0 0.00%
ERC20Mock mint 246→214 63,101 61,836 -1,265 -2.00%
GratitudeBurn burn 89 289,806 289,806 0 0.00%
GratitudeBurn registerApp 63 129,370 129,370 0 0.00%
MNDContract addLicense 686 249,178 249,178 0 0.00%
MNDContract approve 32→0 46,395 -46,395
MNDContract burn 3 91,573 91,573 0 0.00%
MNDContract claimRewards 29 1,340,781 1,340,781 0 0.00%
MNDContract initiateBurn 3 51,394 51,394 0 0.00%
MNDContract initiateTransfer 2 51,728 51,728 0 0.00%
MNDContract linkMultiNode 1 286,516 286,516 0 0.00%
MNDContract linkNode 49 181,108 181,108 0 0.00%
MNDContract pause 4 51,996 51,996 0 0.00%
MNDContract setAdoptionOracle 13 35,438 35,438 0 0.00%
MNDContract setBaseURI 2 52,048 52,048 0 0.00%
MNDContract setCompanyWallets 2 140,636 140,636 0 0.00%
MNDContract setMaxCarryoverReleaseFactor 5 36,201 36,201 0 0.00%
MNDContract setNDContract 110 51,355 51,355 0 0.00%
MNDContract transferFrom 2 110,991 110,991 0 0.00%
MNDContract unlinkNode 7 49,314 49,314 0 0.00%
MNDContract unpause 1 30,250 30,250 0 0.00%
NDContract banLicense 4 51,155 51,155 0 0.00%
NDContract burn 3 56,436 56,436 0 0.00%
NDContract buyLicense 183 764,537 764,537 0 0.00%
NDContract claimRewards 9 281,785 281,785 0 0.00%
NDContract linkMultiNode 1 273,948 273,948 0 0.00%
NDContract linkNode 161 182,580 182,580 0 0.00%
NDContract pause 6 52,019 52,019 0 0.00%
NDContract setAdoptionOracle 110 51,289 51,289 0 0.00%
NDContract setBaseURI 2 52,027 52,027 0 0.00%
NDContract setCompanyWallets 110 96,440 96,440 0 0.00%
NDContract setDirectAddLpPercentage 110 50,860 50,860 0 0.00%
NDContract setMaxAllowedPriceDifference 4 50,889 50,889 0 0.00%
NDContract setMNDContract 110 51,136 51,136 0 0.00%
NDContract setPoAIManager 110 51,158 51,158 0 0.00%
NDContract setUniswapParams 110 96,336 96,337 +1 +0.00%
NDContract transferFrom 2 100,083 100,083 0 0.00%
NDContract unbanLicense 1 29,217 29,217 0 0.00%
NDContract unlinkNode 4 50,809 50,809 0 0.00%
NDContract unpause 1 30,206 30,206 0 0.00%
PoAIManager allocateRewardsAcrossAllEscrows 26 730,775 730,775 0 0.00%
PoAIManager deployCspEscrow 113 553,403 553,403 0 0.00%
PoAIManager increaseJobBalance 3 76,455 76,455 0 0.00%
PoAIManager initiateCspEscrowOwnerTransfer 4 62,947 62,947 0 0.00%
PoAIManager reconcileAllJobsAcrossEscrows 4 105,479 105,479 0 0.00%
PoAIManager reconcileAllJobsBalance 2 101,614 101,614 0 0.00%
PoAIManager setAdoptionOracle 110 51,134 51,134 0 0.00%
PoAIManager setBurnContract 1 57,382 57,394 +12 +0.02%
PoAIManager setCspTier 9 53,047 53,047 0 0.00%
PoAIManager submitNodeUpdate 174 316,738 316,738 0 0.00%
PoAIManager transferCspEscrowOwnership 5 80,101 80,101 0 0.00%
R1 addBurner 120 46,360 46,360 0 0.00%
R1 approve 172→204 44,524 44,817 +293 +0.66%
R1 burn 1 36,577 36,577 0 0.00%
R1 mint 198→230 64,891 65,819 +928 +1.43%
R1 removeBurner 2 24,411 24,411 0 0.00%
R1 renounceOwnership 1 23,423 23,423 0 0.00%
R1 setMndContract 113 46,394 46,394 0 0.00%
R1 setNdContract 121 46,350 46,350 0 0.00%
Reader initialize 1 158,365 158,365 0 0.00%
TestnetFaucet changeSettings 1 36,509 36,509 0 0.00%
TestnetFaucet claim 3 79,755 79,755 0 0.00%
TestnetFaucet withdraw 1 53,359 53,359 0 0.00%
All deployments
Contract Base Avg Gas PR Avg Gas Δ Gas Δ % Δ Size (bytes) Base Limit Usage PR Limit Usage Δ Limit Usage
AdoptionOracle 1,648,877 1,648,877 0 0.00% 0 30.06% 30.06% 0.00pp
AttestationRegistry 1,988,798 1,988,798 0 0.00% 0 35.96% 35.96% 0.00pp
BurnContract 133,270 133,270 0 0.00% 0 1.45% 1.45% 0.00pp
Controller 1,235,030 1,235,030 0 0.00% 0 20.47% 20.47% 0.00pp
CspEscrow 4,529,629 4,529,629 0 0.00% 0 84.31% 84.31% 0.00pp
DAuthOracleRegistry 656,067 +656,067 +2,547 10.36%
ERC20Mock 610,970 610,970 0 0.00% 0 9.44% 9.44% 0.00pp
GratitudeBurn 1,238,966 1,238,966 0 0.00% 0 22.33% 22.33% 0.00pp
MNDContract 4,986,371 4,986,371 0 0.00% 0 92.99% 92.99% 0.00pp
NDContract 4,785,637 4,785,637 0 0.00% 0 89.14% 89.14% 0.00pp
PoAIManager 5,153,322 5,153,322 0 0.00% 0 96.35% 96.35% 0.00pp
R1 919,887 919,887 0 0.00% 0 14.80% 14.80% 0.00pp
Reader 3,696,193 3,696,193 0 0.00% 0 68.62% 68.62% 0.00pp
TestnetFaucet 470,305 470,305 0 0.00% 0 6.06% 6.06% 0.00pp
UniswapMockPair 254,904 254,904 0 0.00% 0 2.41% 2.41% 0.00pp
UniswapMockRouter 507,895 507,895 0 0.00% 0 8.08% 8.08% 0.00pp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sol with add/remove + filtered read APIs based on current Controller oracle 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 Controller oracle 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++;
}
Copilot AI review requested due to automatic review settings July 7, 2026 15:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants