Skip to content

Commit

Permalink
Make DualAggregator a AccessController
Browse files Browse the repository at this point in the history
  • Loading branch information
Oozyx committed Nov 21, 2024
1 parent c8d4368 commit a231ae2
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 122 deletions.
240 changes: 120 additions & 120 deletions contracts/gas-snapshots/feeds.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
AcceptPayeeship:test_EmitsPayeeshipTransferred() (gas: 27068)
AcceptPayeeship:test_RevertIf_SenderIsNotProposed() (gas: 15287)
Constructor:test_constructor() (gas: 30784)
Description:test_ReturnsCorrectDescription() (gas: 12439)
GetAnswer:test_ReturnsPrimaryGetAnswer() (gas: 162522)
GetAnswer:test_ReturnsPrimaryGetAnswerAfterBlock() (gas: 163054)
GetAnswer:test_ReturnsPrimaryGetAnswerNotAllowed() (gas: 162630)
GetAnswer:test_ReturnsSecondaryGetAnswer() (gas: 165071)
GetAnswer:test_ReturnsSecondaryGetAnswerNotAllowed() (gas: 168103)
GetAnswer:test_ReturnsSecondaryGetAnswerSynced() (gas: 171758)
AcceptPayeeship:test_EmitsPayeeshipTransferred() (gas: 27024)
AcceptPayeeship:test_RevertIf_SenderIsNotProposed() (gas: 15243)
Constructor:test_constructor() (gas: 30723)
Description:test_ReturnsCorrectDescription() (gas: 12443)
GetAnswer:test_ReturnsPrimaryGetAnswer() (gas: 162543)
GetAnswer:test_ReturnsPrimaryGetAnswerAfterBlock() (gas: 163075)
GetAnswer:test_ReturnsPrimaryGetAnswerNotAllowed() (gas: 162651)
GetAnswer:test_ReturnsSecondaryGetAnswer() (gas: 165092)
GetAnswer:test_ReturnsSecondaryGetAnswerNotAllowed() (gas: 168146)
GetAnswer:test_ReturnsSecondaryGetAnswerSynced() (gas: 171801)
GetBilling:test_ReturnsBillingData() (gas: 16704)
GetBillingAccessController:test_ReturnsBillingAccessController() (gas: 11033)
GetLinkToken:test_ReturnsLinkToken() (gas: 13131)
GetRequesterAccessController:test_ReturnsRequesterAccessController() (gas: 18435)
GetRoundData:test_ReturnsPrimaryGetRoundData() (gas: 164690)
GetRoundData:test_ReturnsPrimaryGetRoundDataAfterBlock() (gas: 165261)
GetRoundData:test_ReturnsPrimaryGetRoundDataNotAllowed() (gas: 164699)
GetRoundData:test_ReturnsSecondaryGetRoundData() (gas: 167265)
GetRoundData:test_ReturnsSecondaryGetRoundDataNotAllowed() (gas: 170163)
GetRoundData:test_ReturnsSecondaryGetRoundDataSynced() (gas: 173952)
GetSyncPrimaryRound:test_returnSecondaryRoundId() (gas: 168614)
GetSyncPrimaryRound:test_returnSyncFourthRoundId() (gas: 167396)
GetSyncPrimaryRound:test_returnSyncLatestRoundId() (gas: 166129)
GetBillingAccessController:test_ReturnsBillingAccessController() (gas: 10968)
GetLinkToken:test_ReturnsLinkToken() (gas: 13087)
GetRequesterAccessController:test_ReturnsRequesterAccessController() (gas: 18479)
GetRoundData:test_ReturnsPrimaryGetRoundData() (gas: 164778)
GetRoundData:test_ReturnsPrimaryGetRoundDataAfterBlock() (gas: 165349)
GetRoundData:test_ReturnsPrimaryGetRoundDataNotAllowed() (gas: 164787)
GetRoundData:test_ReturnsSecondaryGetRoundData() (gas: 167353)
GetRoundData:test_ReturnsSecondaryGetRoundDataNotAllowed() (gas: 170273)
GetRoundData:test_ReturnsSecondaryGetRoundDataSynced() (gas: 174062)
GetSyncPrimaryRound:test_returnSecondaryRoundId() (gas: 168680)
GetSyncPrimaryRound:test_returnSyncFourthRoundId() (gas: 167462)
GetSyncPrimaryRound:test_returnSyncLatestRoundId() (gas: 166195)
GetSyncPrimaryRound:test_zeroTransmissions() (gas: 12853)
GetTimestamp:test_ReturnsPrimaryGetTimestamp() (gas: 162479)
GetTimestamp:test_ReturnsPrimaryGetTimestampAfterBlock() (gas: 162990)
GetTimestamp:test_ReturnsPrimaryGetTimestampNotAllowed() (gas: 162586)
GetTimestamp:test_ReturnsSecondaryGetTimestamp() (gas: 165015)
GetTimestamp:test_ReturnsSecondaryGetTimestampNotAllowed() (gas: 168057)
GetTimestamp:test_ReturnsSecondaryGetTimestampSynced() (gas: 171747)
GetTransmitters:test_ReturnsTransmittersList() (gas: 161033)
GetValidatorConfig:test_ReturnsValidatorConfig() (gas: 37659)
LatestAnswer:test_ReturnsLatestPrimaryAnswer() (gas: 165220)
LatestAnswer:test_ReturnsLatestPrimaryAnswerAfterBlock() (gas: 165783)
LatestAnswer:test_ReturnsLatestSecondaryAnswer() (gas: 165915)
LatestAnswer:test_ReturnsPreviousPrimaryAnswer() (gas: 165559)
LatestAnswer:test_ReturnsSyncedAnswer() (gas: 170874)
LatestConfigDetails:test_ReturnsConfigDetails() (gas: 16815)
LatestConfigDigestAndEpoch:test_ReturnsLatestConfigDigestAndEpoch() (gas: 186558)
LatestRound:test_ReturnsLatestPrimaryRoundId() (gas: 165006)
LatestRound:test_ReturnsLatestPrimaryRoundIdAfterBlock() (gas: 165570)
LatestRound:test_ReturnsLatestSecondaryRoundId() (gas: 165699)
LatestRound:test_ReturnsPreviousPrimaryRoundId() (gas: 165323)
LatestRound:test_ReturnsSyncedRoundId() (gas: 170616)
LatestRoundData:test_ReturnsLatestPrimaryRoundData() (gas: 167408)
LatestRoundData:test_ReturnsLatestPrimaryRoundDataAfterBlock() (gas: 167925)
LatestRoundData:test_ReturnsLatestSecondaryRoundData() (gas: 168121)
LatestRoundData:test_ReturnsPreviousPrimaryRoundData() (gas: 167747)
LatestRoundData:test_ReturnsSyncedRoundData() (gas: 173079)
LatestTimestamp:test_ReturnsLatestPrimaryTimestamp() (gas: 165187)
LatestTimestamp:test_ReturnsLatestPrimaryTimestampAfterBlock() (gas: 165728)
LatestTimestamp:test_ReturnsLatestSecondaryTimestamp() (gas: 165903)
LatestTimestamp:test_ReturnsPreviousPrimaryTimestamp() (gas: 165483)
LatestTimestamp:test_ReturnsSyncedTimestamp() (gas: 170861)
LatestTransmissionDetails:test_ReturnsLatestTransmissionDetails() (gas: 19740)
LatestTransmissionDetails:test_RevertIf_NotEOA() (gas: 8558)
LinkAvailableForPayment:test_ReturnsBalanceWhenNothingDue() (gas: 189995)
LinkAvailableForPayment:test_ReturnsRemainingBalanceWhenHasDues() (gas: 369810)
OracleObservationCount:test_ReturnsCorrectObservationCount() (gas: 223298)
OracleObservationCount:test_ReturnsZeroWhenNoObservations() (gas: 20050)
OwedPayment:test_ReturnOwedAmount() (gas: 157902)
OwedPayment:test_ReturnZeroIfTransmitterNotActive() (gas: 11291)
RequestNewRound:test_RevertIf_NotRequester() (gas: 15094)
RequestNewRound:test_ShouldRequestNewRound() (gas: 31986)
GetTimestamp:test_ReturnsPrimaryGetTimestamp() (gas: 162567)
GetTimestamp:test_ReturnsPrimaryGetTimestampAfterBlock() (gas: 163078)
GetTimestamp:test_ReturnsPrimaryGetTimestampNotAllowed() (gas: 162674)
GetTimestamp:test_ReturnsSecondaryGetTimestamp() (gas: 165103)
GetTimestamp:test_ReturnsSecondaryGetTimestampNotAllowed() (gas: 168167)
GetTimestamp:test_ReturnsSecondaryGetTimestampSynced() (gas: 171857)
GetTransmitters:test_ReturnsTransmittersList() (gas: 161037)
GetValidatorConfig:test_ReturnsValidatorConfig() (gas: 37703)
LatestAnswer:test_ReturnsLatestPrimaryAnswer() (gas: 165286)
LatestAnswer:test_ReturnsLatestPrimaryAnswerAfterBlock() (gas: 165849)
LatestAnswer:test_ReturnsLatestSecondaryAnswer() (gas: 165981)
LatestAnswer:test_ReturnsPreviousPrimaryAnswer() (gas: 165625)
LatestAnswer:test_ReturnsSyncedAnswer() (gas: 170962)
LatestConfigDetails:test_ReturnsConfigDetails() (gas: 16837)
LatestConfigDigestAndEpoch:test_ReturnsLatestConfigDigestAndEpoch() (gas: 186602)
LatestRound:test_ReturnsLatestPrimaryRoundId() (gas: 165072)
LatestRound:test_ReturnsLatestPrimaryRoundIdAfterBlock() (gas: 165636)
LatestRound:test_ReturnsLatestSecondaryRoundId() (gas: 165765)
LatestRound:test_ReturnsPreviousPrimaryRoundId() (gas: 165389)
LatestRound:test_ReturnsSyncedRoundId() (gas: 170704)
LatestRoundData:test_ReturnsLatestPrimaryRoundData() (gas: 167474)
LatestRoundData:test_ReturnsLatestPrimaryRoundDataAfterBlock() (gas: 167991)
LatestRoundData:test_ReturnsLatestSecondaryRoundData() (gas: 168187)
LatestRoundData:test_ReturnsPreviousPrimaryRoundData() (gas: 167813)
LatestRoundData:test_ReturnsSyncedRoundData() (gas: 173167)
LatestTimestamp:test_ReturnsLatestPrimaryTimestamp() (gas: 165253)
LatestTimestamp:test_ReturnsLatestPrimaryTimestampAfterBlock() (gas: 165794)
LatestTimestamp:test_ReturnsLatestSecondaryTimestamp() (gas: 165969)
LatestTimestamp:test_ReturnsPreviousPrimaryTimestamp() (gas: 165549)
LatestTimestamp:test_ReturnsSyncedTimestamp() (gas: 170949)
LatestTransmissionDetails:test_ReturnsLatestTransmissionDetails() (gas: 19784)
LatestTransmissionDetails:test_RevertIf_NotEOA() (gas: 8602)
LinkAvailableForPayment:test_ReturnsBalanceWhenNothingDue() (gas: 190017)
LinkAvailableForPayment:test_ReturnsRemainingBalanceWhenHasDues() (gas: 369852)
OracleObservationCount:test_ReturnsCorrectObservationCount() (gas: 223362)
OracleObservationCount:test_ReturnsZeroWhenNoObservations() (gas: 20094)
OwedPayment:test_ReturnOwedAmount() (gas: 157968)
OwedPayment:test_ReturnZeroIfTransmitterNotActive() (gas: 11313)
RequestNewRound:test_RevertIf_NotRequester() (gas: 15003)
RequestNewRound:test_ShouldRequestNewRound() (gas: 31939)
SetBilling:test_EmitsBillingSet() (gas: 54689)
SetBilling:test_RevertIf_NotOwner() (gas: 15236)
SetBillingAccessController:test_EmitsBillingAccessControllerSet() (gas: 22800)
SetConfig:test_RevertIf_OracleLengthMismatch() (gas: 27450)
SetConfig:test_RevertIf_RepeatedSigner() (gas: 120296)
SetConfig:test_RevertIf_RepeatedTransmitter() (gas: 143058)
SetConfig:test_RevertIf_SignersTooLong() (gas: 27874)
SetConfig:test_RevertIf_fNotPositive() (gas: 14430)
SetConfig:test_RevertIf_fTooHigh() (gas: 14265)
SetConfig:test_RevertIf_onchainConfigInvalid() (gas: 27927)
SetConfig:test_SetsTheConfigAndEmitsEvent() (gas: 3103066)
SetConfig:test_ShouldBeAbleToRemoveSigners() (gas: 3641924)
SetLinkToken:test_PayOutOraclesBeforeSettingNewLinkToken() (gas: 1413513)
SetLinkToken:test_RevertIf_TransferFundsFailed() (gas: 1465964)
SetLinkToken:test_SetLinkTokenToSameToken() (gas: 21037)
SetPayees:test_EmitsPayeeshipTransferred() (gas: 941401)
SetPayees:test_RevertIf_SetPayeesUsedToUpdateExistingPayees() (gas: 879112)
SetPayees:test_RevertIf_TransmittersSizeNotEqualPayeeSize() (gas: 84394)
SetRequesterAccessController:test_EmitsRequesterAccessControllerSet() (gas: 18362)
SetValidatorConfig:test_EmitsValidatorConfigSet() (gas: 37315)
TransferPayeeship:test_EmitsPayeeshipTransferredRequested() (gas: 46335)
TransferPayeeship:test_RevertIf_SenderIsProposed() (gas: 20000)
TransferPayeeship:test_RevertIf_SenderNotCurrentPayee() (gas: 10735)
Transmit:test_BothFeedsStalledIncomingPrimaryReportIsFromBeforeCutoffTime() (gas: 417317)
Transmit:test_BothFeedsStalledIncomingReportIsFromAfterCutoffTime() (gas: 416853)
Transmit:test_BothFeedsStalledIncomingSecondaryReportIsFromBeforeCutoffTime() (gas: 458087)
Transmit:test_IncomingSecondaryReportHasNotBeenRecordedOlderThanLatestReportNewerThanCutoffTime() (gas: 490805)
Transmit:test_IncomingSecondaryReportHasNotBeenRecordedOlderThanLatestReportOlderThanCutoffTime() (gas: 508126)
Transmit:test_IncomingSecondaryReportRevertsDueToMaxIterations() (gas: 791007)
Transmit:test_OutOfSyncFeedsPrimaryIsSourcedFromSecondaryWithLockDelay() (gas: 414208)
Transmit:test_OutOfSyncFeedsSecondaryFeedFallbackToStandardFeed() (gas: 785708)
Transmit:test_ReadExpectedInitialState() (gas: 146369)
Transmit:test_RevertIf_CalldataLengthMismatch() (gas: 23373)
Transmit:test_RevertIf_ConfigDigestMismatch() (gas: 20923)
Transmit:test_RevertIf_DuplicateSigner() (gas: 89805)
Transmit:test_RevertIf_MedianIsOutOfMinMaxRange() (gas: 155167)
Transmit:test_RevertIf_NumObservationsOutOfBounds() (gas: 95658)
Transmit:test_RevertIf_ReportLengthMismatch() (gas: 78027)
Transmit:test_RevertIf_SendTheSameReportAlternateFirstPrimaryFeed() (gas: 337151)
Transmit:test_RevertIf_SendTheSameReportAlternateFirstSecondaryFeed() (gas: 334583)
Transmit:test_RevertIf_SendTheSameReportTwiceToThePrimaryFeed() (gas: 265469)
Transmit:test_RevertIf_SendTheSameReportTwiceToTheSecondaryFeed() (gas: 266161)
Transmit:test_RevertIf_SignatureError() (gas: 86518)
Transmit:test_RevertIf_SignaturesOutOfRegistration() (gas: 25139)
Transmit:test_RevertIf_TooFewValuesToTrustMedian() (gas: 69820)
Transmit:test_RevertIf_UnauthorizedTransmitter() (gas: 14171)
Transmit:test_RevertIf_WrongNumberOfSignatures() (gas: 25000)
Transmit:test_SyncFeedsTransmitSecondaryFirstAlwaysSameBlock() (gas: 465389)
Transmit:test_SyncFeedsTransmitSecondaryFirstNeverSameBlock() (gas: 466357)
Transmit:test_SyncFeedsTransmitStandardFirstAlwaysSameBlock() (gas: 466840)
Transmit:test_SyncFeedsTransmitStandardFirstNeverSameBlock() (gas: 508677)
TypeAndVersion:test_IsCorrect() (gas: 10130)
ValidateAnswer:test_RevertIf_InsufficientGas() (gas: 329862)
ValidateAnswer:test_ValidateWithContractAddress() (gas: 374107)
ValidateAnswer:test_ValidateWithZeroAddressContract() (gas: 244519)
SetConfig:test_RevertIf_OracleLengthMismatch() (gas: 27427)
SetConfig:test_RevertIf_RepeatedSigner() (gas: 120273)
SetConfig:test_RevertIf_RepeatedTransmitter() (gas: 143035)
SetConfig:test_RevertIf_SignersTooLong() (gas: 27851)
SetConfig:test_RevertIf_fNotPositive() (gas: 14407)
SetConfig:test_RevertIf_fTooHigh() (gas: 14242)
SetConfig:test_RevertIf_onchainConfigInvalid() (gas: 27904)
SetConfig:test_SetsTheConfigAndEmitsEvent() (gas: 3103065)
SetConfig:test_ShouldBeAbleToRemoveSigners() (gas: 3641887)
SetLinkToken:test_PayOutOraclesBeforeSettingNewLinkToken() (gas: 1413579)
SetLinkToken:test_RevertIf_TransferFundsFailed() (gas: 1465986)
SetLinkToken:test_SetLinkTokenToSameToken() (gas: 20993)
SetPayees:test_EmitsPayeeshipTransferred() (gas: 941356)
SetPayees:test_RevertIf_SetPayeesUsedToUpdateExistingPayees() (gas: 879022)
SetPayees:test_RevertIf_TransmittersSizeNotEqualPayeeSize() (gas: 84349)
SetRequesterAccessController:test_EmitsRequesterAccessControllerSet() (gas: 18384)
SetValidatorConfig:test_EmitsValidatorConfigSet() (gas: 37337)
TransferPayeeship:test_EmitsPayeeshipTransferredRequested() (gas: 46357)
TransferPayeeship:test_RevertIf_SenderIsProposed() (gas: 20022)
TransferPayeeship:test_RevertIf_SenderNotCurrentPayee() (gas: 10757)
Transmit:test_BothFeedsStalledIncomingPrimaryReportIsFromBeforeCutoffTime() (gas: 417369)
Transmit:test_BothFeedsStalledIncomingReportIsFromAfterCutoffTime() (gas: 416905)
Transmit:test_BothFeedsStalledIncomingSecondaryReportIsFromBeforeCutoffTime() (gas: 458147)
Transmit:test_IncomingSecondaryReportHasNotBeenRecordedOlderThanLatestReportNewerThanCutoffTime() (gas: 490899)
Transmit:test_IncomingSecondaryReportHasNotBeenRecordedOlderThanLatestReportOlderThanCutoffTime() (gas: 508208)
Transmit:test_IncomingSecondaryReportRevertsDueToMaxIterations() (gas: 791159)
Transmit:test_OutOfSyncFeedsPrimaryIsSourcedFromSecondaryWithLockDelay() (gas: 414260)
Transmit:test_OutOfSyncFeedsSecondaryFeedFallbackToStandardFeed() (gas: 785848)
Transmit:test_ReadExpectedInitialState() (gas: 146373)
Transmit:test_RevertIf_CalldataLengthMismatch() (gas: 23395)
Transmit:test_RevertIf_ConfigDigestMismatch() (gas: 20945)
Transmit:test_RevertIf_DuplicateSigner() (gas: 89827)
Transmit:test_RevertIf_MedianIsOutOfMinMaxRange() (gas: 155211)
Transmit:test_RevertIf_NumObservationsOutOfBounds() (gas: 95680)
Transmit:test_RevertIf_ReportLengthMismatch() (gas: 78049)
Transmit:test_RevertIf_SendTheSameReportAlternateFirstPrimaryFeed() (gas: 337243)
Transmit:test_RevertIf_SendTheSameReportAlternateFirstSecondaryFeed() (gas: 334675)
Transmit:test_RevertIf_SendTheSameReportTwiceToThePrimaryFeed() (gas: 265515)
Transmit:test_RevertIf_SendTheSameReportTwiceToTheSecondaryFeed() (gas: 266207)
Transmit:test_RevertIf_SignatureError() (gas: 86540)
Transmit:test_RevertIf_SignaturesOutOfRegistration() (gas: 25161)
Transmit:test_RevertIf_TooFewValuesToTrustMedian() (gas: 69842)
Transmit:test_RevertIf_UnauthorizedTransmitter() (gas: 14193)
Transmit:test_RevertIf_WrongNumberOfSignatures() (gas: 25022)
Transmit:test_SyncFeedsTransmitSecondaryFirstAlwaysSameBlock() (gas: 465477)
Transmit:test_SyncFeedsTransmitSecondaryFirstNeverSameBlock() (gas: 466445)
Transmit:test_SyncFeedsTransmitStandardFirstAlwaysSameBlock() (gas: 466928)
Transmit:test_SyncFeedsTransmitStandardFirstNeverSameBlock() (gas: 508773)
TypeAndVersion:test_IsCorrect() (gas: 10156)
ValidateAnswer:test_RevertIf_InsufficientGas() (gas: 329910)
ValidateAnswer:test_ValidateWithContractAddress() (gas: 374149)
ValidateAnswer:test_ValidateWithZeroAddressContract() (gas: 244561)
Version:test_ReturnsTheCorrectVersion() (gas: 8703)
WithdrawFunds:test_RevertIf_InsufficientBalance() (gas: 337700)
WithdrawFunds:test_RevertIf_InsufficientFunds() (gas: 191296)
WithdrawFunds:test_RevertIf_NotOwner() (gas: 14903)
WithdrawPayment:test_PaysOracles() (gas: 234993)
WithdrawPayment:test_RevertIf_InsufficientFunds() (gas: 27406)
WithdrawPayment:test_RevertIf_NotPayee() (gas: 11361)
WithdrawFunds:test_RevertIf_InsufficientBalance() (gas: 337770)
WithdrawFunds:test_RevertIf_InsufficientFunds() (gas: 191318)
WithdrawFunds:test_RevertIf_NotOwner() (gas: 14925)
WithdrawPayment:test_PaysOracles() (gas: 235028)
WithdrawPayment:test_RevertIf_InsufficientFunds() (gas: 27428)
WithdrawPayment:test_RevertIf_NotPayee() (gas: 11383)
4 changes: 2 additions & 2 deletions contracts/src/v0.8/feeds/DualAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {AggregatorV2V3Interface} from "../shared/interfaces/AggregatorV2V3Interf
import {AggregatorValidatorInterface} from "../shared/interfaces/AggregatorValidatorInterface.sol";
import {LinkTokenInterface} from "../shared/interfaces/LinkTokenInterface.sol";

import {Ownable2StepMsgSender} from "../shared/access/Ownable2StepMsgSender.sol";
import {SimpleReadAccessController} from "../shared/access/SimpleReadAccessController.sol";
import {CallWithExactGas} from "../shared/call/CallWithExactGas.sol";
import {OCR2Abstract} from "../shared/ocr2/OCR2Abstract.sol";

// This contract is a port of OCR2Aggregator from `libocr` it is being used
// for a new feeds based project that is ongoing, there will be some modernization
// that happens to this contract as the project progresses.
// solhint-disable max-states-count
contract DualAggregator is OCR2Abstract, Ownable2StepMsgSender, AggregatorV2V3Interface {
contract DualAggregator is OCR2Abstract, AggregatorV2V3Interface, SimpleReadAccessController {
string public constant override typeAndVersion = "DualAggregator 1.0.0";

// This contract is divided into sections. Each section defines a set of
Expand Down

0 comments on commit a231ae2

Please sign in to comment.