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

Initial Impl of SBRV #13813

Merged
merged 148 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
61d7b10
Initial Impl of SBRV
Fletch153 Jul 10, 2024
2b3067c
Generate wrappers/ABI
samsondav Jul 11, 2024
7657ee3
Removed ZeroAddress check for feemanager & AC
Fletch153 Jul 11, 2024
208a601
Merge 7657ee362667fdbbdab325ecedb5d55099bd53f1 into fd9c7a3cff03c8353…
Fletch153 Jul 11, 2024
16d1c2c
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 11, 2024
1d540a6
Rename RewardManager=>DestinationRewardManager
samsondav Jul 11, 2024
e2fd278
Remove circular dependency between proxy and verifier
Fletch153 Jul 11, 2024
0e7d191
Fixes to init logic
Fletch153 Jul 11, 2024
7c7f9c1
Merge 0e7d191db9c8637a36f570609fe322f0026a5c02 into fd9c7a3cff03c8353…
Fletch153 Jul 11, 2024
de3288e
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 11, 2024
13cc269
llo-feeds: v0.4.0 reward manager tests
dav009 Jul 11, 2024
592bc7f
Add check to remove assumption that feeManager cannot be nil
Fletch153 Jul 12, 2024
0a86836
Generate
samsondav Jul 12, 2024
84879de
Merge pull request #13823 from smartcontractkit/feature/MERC-5889-tes…
Fletch153 Jul 15, 2024
5bbbb4b
Fixed poolIdMismatch not being thrown
Fletch153 Jul 12, 2024
64898d2
Fix logic error when looking up the activeDonConfig
Fletch153 Jul 15, 2024
4536b95
Merge 64898d2db905f39b4c4122c1c6d24bf8e283eb06 into 8a6202c52755cd1e4…
Fletch153 Jul 15, 2024
bd36382
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 15, 2024
8dc69ef
Update interface sanity checks when setting verifier
Fletch153 Jul 15, 2024
83c70dd
Add remaining interface functionality
Fletch153 Jul 15, 2024
fa5147c
Merge 83c70dd236b4c60877d8642ffca7118587dda6a4 into ced300beebbd1971e…
Fletch153 Jul 15, 2024
6f34066
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 15, 2024
b24f06e
llo-feeds: verifier SetConfig tests
dav009 Jul 14, 2024
e697dd5
llo-feeds: adding verifier contract get methods for easier testing
dav009 Jul 14, 2024
118cd6f
adding rewards wire up for testing
dav009 Jul 16, 2024
7e813b0
incomeplte fix for test_setConfigWithAddressesAndWeightsAreSetCorrectly
dav009 Jul 16, 2024
835cfde
llo-feeds: adjusting setConfig tests due to changes
dav009 Jul 16, 2024
c7c0ce2
llo-feeds: fee manager v0.4.0 tests: making v0.3.0 tests pass
dav009 Jul 12, 2024
672c2cf
llo-feeds: fee manager v0.4.0 tests: fee manager - adding test for Po…
dav009 Jul 12, 2024
24c6889
llo-feeds: fee manager v0.4.0 tests: nits
dav009 Jul 12, 2024
8e344b0
llo-feeds: feeManager bulk reverts when PoolId is 0
dav009 Jul 13, 2024
964c414
llo-feeds: feeManager tests revertOnSettingAnAddressZeroVerifier only…
dav009 Jul 13, 2024
3c455ea
llo-feeds: feeManager test poolIdsCannotBeZeroAddress
dav009 Jul 13, 2024
248824d
llo-feeds: rewardManager test_rewardsAreCorrectlySentToEachAssociated…
dav009 Jul 16, 2024
5982113
llo-feeds: verifier proxy tests
dav009 Jul 16, 2024
9746191
llo-feeds: fixing DestinationProxy error handling
dav009 Jul 16, 2024
40bd779
llo-feeds: fixing DestinationProxy test remove verifiercontract zero …
dav009 Jul 16, 2024
a3528fa
llo-feeds: remove interface checks for verifierProxy
dav009 Jul 16, 2024
e2b3bfb
Merge branch 'develop' into feature/MERC-5829/SBRV
ad0ll Jul 16, 2024
f77f014
llo-feeds: clean up setConfig tests from checking internal state
dav009 Jul 17, 2024
b976e71
fix issue when processing rewards
Fletch153 Jul 17, 2024
28d7921
Apply suggestions from code review
Fletch153 Jul 17, 2024
0c10af3
Update contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol
Fletch153 Jul 17, 2024
fab1034
Update contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifierProxy.sol
Fletch153 Jul 17, 2024
a2b9ebf
Merge pull request #13835 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 18, 2024
18241ed
Merge pull request #13844 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 18, 2024
031da10
llo-feeds: verifier proxy remove test test_setVerifierZeroVerifier
dav009 Jul 18, 2024
e6b5769
Merge pull request #13863 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 18, 2024
e2ccdd1
llo-feeds: tests for verify and verifyBulk
dav009 Jul 17, 2024
20f0d92
clean up
dav009 Jul 17, 2024
3fb9183
temporal fix for compile error
dav009 Jul 18, 2024
33eb244
llo: v0.4.0 removing V1 report tests
dav009 Jul 18, 2024
03b8f61
better comments
dav009 Jul 18, 2024
a601d4f
llo-feeds: verify test test_rollingOutConfiguration
dav009 Jul 18, 2024
93338c4
llo-feeds: verify test test_verifyFailsWhenReportIsOlderThanConfig
dav009 Jul 18, 2024
956b1cf
llo-feeds: verify test test_verifyFailsWhenReportIsOlderThanConfig
dav009 Jul 18, 2024
8954e2e
llo-feeds: tests for billing / billing bulk
dav009 Jul 17, 2024
957aac1
fixing tests
dav009 Jul 17, 2024
b0cba56
fixing tests names
dav009 Jul 18, 2024
d2767de
llo-feeds: fix proxy contract should send value in call to verify
dav009 Jul 18, 2024
fd5bfef
llo-feeds: fix billing tests
dav009 Jul 18, 2024
bd56e96
squash me
dav009 Jul 18, 2024
b20ab38
llo-feeds: billing bulk verify tests
dav009 Jul 18, 2024
ff9a8f7
llo-feeds: clean up
dav009 Jul 18, 2024
1817a08
llo-feeds: VerifierSetAccessControllerTest
dav009 Jul 18, 2024
90f7056
llo-feeds: clean up
dav009 Jul 18, 2024
e358dd3
llo-feeds: extra proxy tests
dav009 Jul 18, 2024
c034802
Update contracts/src/v0.8/llo-feeds/v0.4.0/DestinationFeeManager.sol
Fletch153 Jul 18, 2024
d81f8e3
Fix issue with oldest config verifying incorrectly
Fletch153 Jul 18, 2024
a8957dd
Fix issue with oldest config verifying incorrectly
Fletch153 Jul 18, 2024
4671ff8
Merge pull request #13884 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 19, 2024
30061be
Merge pull request #13871 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 19, 2024
13be51f
Merge pull request #13872 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 19, 2024
dc76688
Merge 13be51f6e387ff53a0e9f5ef4a07b9b66c810912 into 6f43b52e67d94a721…
Fletch153 Jul 19, 2024
c2ab92b
llo-feeds: fix underflow and test_verifyFailsWhenReportIsOlderThanConfig
dav009 Jul 19, 2024
606403e
Merge c2ab92be21e853b918416152ad10fe2e03893796 into 13be51f6e387ff53a…
dav009 Jul 19, 2024
0684243
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 19, 2024
a9862d5
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 19, 2024
6265d0e
llo-feeds: DestinationVerifier setFeeManager tests
dav009 Jul 19, 2024
89b0dd2
llo-feeds: Tests for Rewards and configs
dav009 Jul 19, 2024
780b622
llo-feeds: Tests for DestinationVerifier constructor
dav009 Jul 19, 2024
e42490a
llo-feeds: reverse looping efficiently
dav009 Jul 22, 2024
48c38e7
Merge branch 'develop' into feature/MERC-5829/SBRV
Fletch153 Jul 22, 2024
575a1f5
Update contracts/src/v0.8/llo-feeds/v0.4.0/DestinationVerifier.sol
Fletch153 Jul 22, 2024
dc6876e
Merge branch 'feature/MERC-5829/SBRV' into feature/MERC-5889-fix-veri…
dav009 Jul 23, 2024
c3ab853
Merge dc6876e600326119001a3de93bbe540f4bcec7cb into 48c38e7476c262bb0…
dav009 Jul 23, 2024
6f97c14
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 23, 2024
9c3f447
Merge pull request #13902 from smartcontractkit/feature/MERC-5889-fix…
dav009 Jul 23, 2024
3ace72a
Merge pull request #13903 from smartcontractkit/feature/MERC-5889-tes…
dav009 Jul 23, 2024
a0cf1f5
llo-feeds: fmt contract tests
dav009 Jul 23, 2024
89b1849
llo-feeds: npx prettify contract tests
dav009 Jul 23, 2024
44445c0
llo-feeds: npx prettify v0.4.0 contracts
dav009 Jul 23, 2024
12a5ef4
Merge pull request #13915 from smartcontractkit/feature/MERC-5829-pre…
dav009 Jul 23, 2024
87e2643
Merge branch 'develop' into feature/MERC-5829/SBRV
ad0ll Jul 23, 2024
bfd15b0
se --Add ability to amend config array
Fletch153 Jul 24, 2024
c08420a
Merge bfd15b05b2482612da0f054574d05686796f46c1 into c5224df52f9daf8ff…
Fletch153 Jul 24, 2024
df2473e
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 24, 2024
d8e2c82
Merge branch 'develop' into feature/MERC-5829/SBRV
ad0ll Jul 24, 2024
868d28a
Fix issue with future timestamps
Fletch153 Jul 24, 2024
fe89a8b
Merge 868d28a73ea4b42820acdb37a7ed8fb66574ee7d into d777fd8e7fda447c7…
Fletch153 Jul 24, 2024
e3660b8
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 24, 2024
0795424
Small fix
Fletch153 Jul 24, 2024
d7540c0
Fix broken tests
Fletch153 Jul 24, 2024
b3ee881
Merge d7540c03abb2d41235620a8f9790548960188509 into d777fd8e7fda447c7…
Fletch153 Jul 24, 2024
af72b7a
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 24, 2024
65d8922
llo-feeds: Tests setConfigWithActivationTime
dav009 Jul 25, 2024
294350a
llo-feeds: Tests setConfigWithActivationTime
dav009 Jul 25, 2024
de3893d
llo-feeds: Tests VerifierRemoveLatestConfigTest
dav009 Jul 25, 2024
1d1dc8d
llo-feeds: fixing linter errors (unused imports)
dav009 Jul 25, 2024
78b34ca
Merge pull request #13925 from smartcontractkit/feature/MERC-5829-tes…
dav009 Jul 25, 2024
490bd85
llo-feeds: tests better filenaming
dav009 Jul 25, 2024
47060ef
Merge pull request #13930 from smartcontractkit/feature/MERC-5829-cle…
dav009 Jul 26, 2024
3a6f5d0
Improve upgradability of contracts
Fletch153 Jul 28, 2024
0b975e9
Merge 3a6f5d0c058859f3eae133689632121775bf0479 into 683a12e85e91628f2…
Fletch153 Jul 28, 2024
6b6e7e7
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 28, 2024
16461bf
Small fix when setting rewardManager
Fletch153 Jul 29, 2024
4078b48
Merge 16461bff9e8278249c98005c8a2dfd8918b6baab into 683a12e85e91628f2…
Fletch153 Jul 29, 2024
47f6691
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 29, 2024
5186f4d
Fix var name to honour same interface
Fletch153 Jul 29, 2024
b953446
Merge 5186f4dbae9cbeefc3e8f1a5c8e982adc322f7d3 into 683a12e85e91628f2…
Fletch153 Jul 29, 2024
07f6ca5
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 29, 2024
5ce1e39
Improve getter consistency
Fletch153 Jul 29, 2024
41a25cf
Merge 5ce1e39876c01e02ff24bf2baff3f5081eae51fd into ca6e1c26a331af67a…
Fletch153 Jul 29, 2024
063a30d
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 29, 2024
b505515
Fix comments & conventions
Fletch153 Jul 29, 2024
31e4355
Update DON Config to camal case
Fletch153 Jul 29, 2024
d83055f
Merge 31e4355a41317888ec7d63560d764646153cb292 into d150bc6e11a85513a…
Fletch153 Jul 29, 2024
79425f6
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 29, 2024
a6d3cc3
solhint + gas snapshot
Fletch153 Jul 29, 2024
6aabfcf
prettier
Fletch153 Jul 29, 2024
582efa5
Solhint fixes
Fletch153 Jul 29, 2024
0154151
Merge 582efa55d9b21ebd9ac245e4a939cf27337b63f3 into 9f850e3fb951ce1ee…
Fletch153 Jul 29, 2024
7cb2776
Update gethwrappers
app-token-issuer-infra-releng[bot] Jul 29, 2024
7373552
gas snapshot
Fletch153 Jul 29, 2024
9c129a3
Merge branch 'develop' into feature/MERC-5829/SBRV
Fletch153 Jul 29, 2024
5319980
Fixed gas issue
Fletch153 Jul 29, 2024
d4ff613
Gas snapshot
Fletch153 Jul 29, 2024
f4c97a3
llo-feeds: testing multiple fee managers and verifiers
dav009 Jul 29, 2024
d98f9b4
llo: fixing tests
dav009 Jul 30, 2024
4c1c051
Update contracts/src/v0.8/llo-feeds/v0.4.0/test/verifier/DestinationV…
dav009 Jul 30, 2024
5ee02c1
llo: v0.4.0 interfaces test
dav009 Jul 30, 2024
fae21fc
Merge pull request #13958 from smartcontractkit/feature/MERC-5829-int…
Fletch153 Jul 30, 2024
6b63b89
Merge pull request #13936 from smartcontractkit/feature/MERC-5829-tes…
Fletch153 Jul 30, 2024
8e4a88c
Merge branch 'develop' into feature/MERC-5829/SBRV
Fletch153 Jul 30, 2024
e7e0ad5
Fixed gas snaposhot
Fletch153 Jul 30, 2024
1da9155
prettier
Fletch153 Jul 30, 2024
7c32442
Merge branch 'develop' into feature/MERC-5829/SBRV
Fletch153 Jul 31, 2024
0971985
Generate
samsondav Jul 31, 2024
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
241 changes: 241 additions & 0 deletions contracts/gas-snapshots/llo-feeds.gas-snapshot

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions contracts/scripts/native_solc_compile_all_llo-feeds
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ compileContract () {
"$ROOT"/contracts/src/v0.8/"$1"
}

compileContract llo-feeds/Verifier.sol
compileContract llo-feeds/VerifierProxy.sol
compileContract llo-feeds/FeeManager.sol
compileContract llo-feeds/RewardManager.sol
compileContract llo-feeds/v0.3.0/Verifier.sol
compileContract llo-feeds/v0.3.0/VerifierProxy.sol
compileContract llo-feeds/v0.3.0/FeeManager.sol
compileContract llo-feeds/v0.3.0/RewardManager.sol
compileContract llo-feeds/v0.4.0/DestinationVerifier.sol
compileContract llo-feeds/v0.4.0/DestinationVerifierProxy.sol
compileContract llo-feeds/v0.4.0/DestinationFeeManager.sol
compileContract llo-feeds/v0.4.0/DestinationRewardManager.sol


# Test | Mocks
compileContract llo-feeds/test/mocks/ErroredVerifier.sol
compileContract llo-feeds/test/mocks/ExposedVerifier.sol
compileContract llo-feeds/v0.3.0/test/mocks/ErroredVerifier.sol
compileContract llo-feeds/v0.3.0/test/mocks/ExposedVerifier.sol

# LLO
compileContract llo-feeds/dev/ChannelConfigStore.sol
Expand Down
46 changes: 46 additions & 0 deletions contracts/src/v0.8/llo-feeds/libraries/Common.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ library Common {
uint64 weight;
}

/**
* @notice Checks if an array of AddressAndWeight has duplicate addresses
* @param recipients The array of AddressAndWeight to check
* @return bool True if there are duplicates, false otherwise
*/
function _hasDuplicateAddresses(address[] memory recipients) internal pure returns (bool) {
for (uint256 i = 0; i < recipients.length; ) {
for (uint256 j = i + 1; j < recipients.length; ) {
if (recipients[i] == recipients[j]) {
return true;
}
unchecked {
++j;
}
}
unchecked {
++i;
}
}
return false;
}

/**
* @notice Checks if an array of AddressAndWeight has duplicate addresses
* @param recipients The array of AddressAndWeight to check
Expand All @@ -40,4 +62,28 @@ library Common {
}
return false;
}

/**
* @notice sorts a list of addresses numerically
* @param arr The array of addresses to sort
* @param left the start index
* @param right the end index
*/
function _quickSort(address[] memory arr, int256 left, int256 right) internal pure {
int256 i = left;
int256 j = right;
if (i == j) return;
address pivot = arr[uint256(left + (right - left) / 2)];
while (i <= j) {
while (uint160(arr[uint256(i)]) < uint160(pivot)) i++;
while (uint160(pivot) < uint160(arr[uint256(j)])) j--;
if (i <= j) {
(arr[uint256(i)], arr[uint256(j)]) = (arr[uint256(j)], arr[uint256(i)]);
i++;
j--;
}
}
if (left < j) _quickSort(arr, left, j);
if (i < right) _quickSort(arr, i, right);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.19;

import {Test} from "forge-std/Test.sol";
import {ByteUtil} from "../libraries/ByteUtil.sol";
import {ByteUtil} from "../ByteUtil.sol";

contract ByteUtilTest is Test {
using ByteUtil for bytes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {IFeeManager} from "./interfaces/IFeeManager.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "./libraries/Common.sol";
import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol";
import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";
import {IRewardManager} from "./interfaces/IRewardManager.sol";
import {IWERC20} from "../shared/interfaces/IWERC20.sol";
import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol";
import {Math} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/Math.sol";
import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol";
import {IWERC20} from "../../shared/interfaces/IWERC20.sol";
import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol";
import {Math} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/math/Math.sol";
import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol";
import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {IRewardManager} from "./interfaces/IRewardManager.sol";
import {IERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {Common} from "./libraries/Common.sol";
import {SafeERC20} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC20.sol";
import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol";
import {Common} from "../libraries/Common.sol";
import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol";

/**
* @title RewardManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {IVerifier} from "./interfaces/IVerifier.sol";
import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "./libraries/Common.sol";
import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol";
import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";

// OCR2 standard
uint256 constant MAX_NUM_ORACLES = 31;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol";
import {IVerifier} from "./interfaces/IVerifier.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {AccessControllerInterface} from "../shared/interfaces/AccessControllerInterface.sol";
import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol";
import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol";
import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol";
import {Common} from "./libraries/Common.sol";
import {Common} from "../libraries/Common.sol";

/**
* The verifier proxy contract is the gateway for all report verification requests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";
import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../../libraries/Common.sol";
import {IVerifierFeeManager} from "./IVerifierFeeManager.sol";

interface IFeeManager is IERC165, IVerifierFeeManager {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";
import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../../libraries/Common.sol";

interface IRewardManager is IERC165 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";
import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../../libraries/Common.sol";

interface IVerifier is IERC165 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../libraries/Common.sol";
import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol";
import {Common} from "../../libraries/Common.sol";

interface IVerifierFeeManager is IERC165 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {Common} from "../libraries/Common.sol";
import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol";
import {Common} from "../../libraries/Common.sol";
import {AccessControllerInterface} from "../../../shared/interfaces/AccessControllerInterface.sol";
import {IVerifierFeeManager} from "./IVerifierFeeManager.sol";

interface IVerifierProxy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity 0.8.19;
import {Test} from "forge-std/Test.sol";
import {FeeManager} from "../../FeeManager.sol";
import {RewardManager} from "../../RewardManager.sol";
import {Common} from "../../libraries/Common.sol";
import {ERC20Mock} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol";
import {WERC20Mock} from "../../../shared/mocks/WERC20Mock.sol";
import {Common} from "../../../libraries/Common.sol";
import {ERC20Mock} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/mocks/ERC20Mock.sol";
import {WERC20Mock} from "../../../../shared/mocks/WERC20Mock.sol";
import {IRewardManager} from "../../interfaces/IRewardManager.sol";
import {FeeManagerProxy} from "../mocks/FeeManagerProxy.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.19;

import {Common} from "../../libraries/Common.sol";
import {Common} from "../../../libraries/Common.sol";
import "./BaseFeeManager.t.sol";

/**
Expand All @@ -10,15 +10,15 @@ import "./BaseFeeManager.t.sol";
* @notice This contract will test the functionality of the feeManager's getFeeAndReward
*/
contract FeeManagerProcessFeeTest is BaseFeeManagerTest {
function test_baseFeeIsAppliedForNative() public {
function test_baseFeeIsAppliedForNative() public view {
//get the fee required by the feeManager
Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER);

//fee should be the default
assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE);
}

function test_baseFeeIsAppliedForLink() public {
function test_baseFeeIsAppliedForLink() public view {
//get the fee required by the feeManager
Common.Asset memory fee = getFee(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER);

Expand Down Expand Up @@ -378,7 +378,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest {
assertEq(fee.amount, DEFAULT_REPORT_NATIVE_FEE - expectedDiscount);
}

function test_reportWithNoExpiryOrFeeReturnsZero() public {
function test_reportWithNoExpiryOrFeeReturnsZero() public view {
//get the fee required by the feeManager
Common.Asset memory fee = getFee(getV1Report(DEFAULT_FEED_1_V1), getNativeQuote(), USER);

Expand Down Expand Up @@ -462,7 +462,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest {
setNativeSurcharge(nativeSurcharge, ADMIN);
}

function test_getBaseRewardWithLinkQuote() public {
function test_getBaseRewardWithLinkQuote() public view {
//get the fee required by the feeManager
Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getLinkQuote(), USER);

Expand All @@ -481,7 +481,7 @@ contract FeeManagerProcessFeeTest is BaseFeeManagerTest {
assertEq(reward.amount, DEFAULT_REPORT_LINK_FEE / 2);
}

function test_getRewardWithNativeQuote() public {
function test_getRewardWithNativeQuote() public view {
//get the fee required by the feeManager
Common.Asset memory reward = getReward(getV3Report(DEFAULT_FEED_1_V3), getNativeQuote(), USER);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.19;

import {Common} from "../../libraries/Common.sol";
import {Common} from "../../../libraries/Common.sol";
import "./BaseFeeManager.t.sol";
import {IRewardManager} from "../../interfaces/IRewardManager.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity 0.8.19;

import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "../verifier/BaseVerifierTest.t.sol";
import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol";
import {Common} from "../../libraries/Common.sol";
import {SimpleWriteAccessController} from "../../../../shared/access/SimpleWriteAccessController.sol";
import {Common} from "../../../libraries/Common.sol";
import {IRewardManager} from "../../interfaces/IRewardManager.sol";

contract Verifier_setConfig is BaseTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@
pragma solidity 0.8.19;

import {IVerifier} from "../../interfaces/IVerifier.sol";
import {Common} from "../../libraries/Common.sol";
import {Common} from "../../../libraries/Common.sol";

contract ErroredVerifier is IVerifier {
function supportsInterface(bytes4 interfaceId) public pure override returns (bool) {
return interfaceId == this.verify.selector;
}

//define each of the errors thrown in the revert below

error FailedToVerify();
error FailedToSetConfig();
error FailedToActivateConfig();
error FailedToDeactivateConfig();
error FailedToActivateFeed();
error FailedToDeactivateFeed();
error FailedToGetLatestConfigDigestAndEpoch();
error FailedToGetLatestConfigDetails();

function verify(
bytes memory,
/**
Expand All @@ -26,7 +37,7 @@ contract ErroredVerifier is IVerifier {
bytes memory
)
{
revert("Failed to verify");
revert FailedToVerify();
}

function setConfig(
Expand All @@ -39,7 +50,7 @@ contract ErroredVerifier is IVerifier {
bytes memory,
Common.AddressAndWeight[] memory
) external pure override {
revert("Failed to set config");
revert FailedToSetConfig();
}

function setConfigFromSource(
Expand All @@ -55,30 +66,30 @@ contract ErroredVerifier is IVerifier {
bytes memory,
Common.AddressAndWeight[] memory
) external pure override {
revert("Failed to set config");
revert FailedToSetConfig();
}

function activateConfig(bytes32, bytes32) external pure {
revert("Failed to activate config");
revert FailedToActivateConfig();
}

function deactivateConfig(bytes32, bytes32) external pure {
revert("Failed to deactivate config");
revert FailedToDeactivateConfig();
}

function activateFeed(bytes32) external pure {
revert("Failed to activate feed");
revert FailedToActivateFeed();
}

function deactivateFeed(bytes32) external pure {
revert("Failed to deactivate feed");
revert FailedToDeactivateFeed();
}

function latestConfigDigestAndEpoch(bytes32) external pure override returns (bool, bytes32, uint32) {
revert("Failed to get latest config digest and epoch");
revert FailedToGetLatestConfigDigestAndEpoch();
}

function latestConfigDetails(bytes32) external pure override returns (uint32, uint32, bytes32) {
revert("Failed to get latest config details");
revert FailedToGetLatestConfigDetails();
}
}
Loading
Loading