Skip to content
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
06dee76
feat: migrate all non-major TribeRoles
thomas-waite Apr 10, 2022
9026265
feat: create new TribeRoles
thomas-waite Apr 10, 2022
739183b
feat: migrate contract admin roles
thomas-waite Apr 10, 2022
53032c3
feat: validate TribalCouncil granted roles
thomas-waite Apr 10, 2022
0ca7810
test: increase max proposals
thomas-waite Apr 10, 2022
bff1e8b
Merge branch 'gov-todos' into feat-role-transfer
thomas-waite Apr 11, 2022
5cd91a1
fix: PR feedback
thomas-waite Apr 11, 2022
12f01df
Merge branch 'gov-todos' into feat-role-transfer
thomas-waite Apr 11, 2022
2c0cc53
refactor: break out into seperate DAO vote
thomas-waite Apr 11, 2022
50cc766
feat: transfer all remaining non-major roles
thomas-waite Apr 12, 2022
658697f
this works
thomas-waite Apr 12, 2022
aa21b82
feat: track TOKEMAK_DEPOSIT_ADMIN_ROLE
thomas-waite Apr 13, 2022
8159d1b
feat: grant calling contracts new admins
thomas-waite Apr 13, 2022
ca16eea
feat: more permissions
thomas-waite Apr 13, 2022
8519720
fix: uncomment last actions
thomas-waite Apr 13, 2022
707ddd7
style: add natspec comments, uncomment tests
thomas-waite Apr 13, 2022
368a792
refactor: transfer MINOR_PARAM role admin
thomas-waite Apr 13, 2022
b1fed2f
fix: mint orca tokens in fip if testing
thomas-waite Apr 14, 2022
e0c5fd4
refactor: update contract dependencies
thomas-waite Apr 14, 2022
404ac72
refactor: update both fip scripts deps
thomas-waite Apr 14, 2022
bb418fa
Merge branch 'gov-todos' into feat-role-transfer
thomas-waite Apr 14, 2022
5dad385
feat: add additional ORACLE_ADMIN_ROLE to permissions
thomas-waite Apr 14, 2022
98fe9ae
test: update admin tests with delimiter
thomas-waite Apr 14, 2022
495a6f6
feat: add PSM_ADMIN_ROLE to permissions.ts
thomas-waite Apr 14, 2022
51fd583
Merge branch 'feat-governance-upgrade' into feat-role-transfer
thomas-waite Apr 27, 2022
bf7876f
Merge branch 'develop' into feat-role-transfer
thomas-waite Apr 29, 2022
1927e7b
Add proposal DEBUG tool
eswak Apr 29, 2022
20f515f
Merge pull request #763 from fei-protocol/tool/debug-proposal
eswak May 1, 2022
fce920a
build(deps-dev): bump mocha from 9.2.2 to 10.0.0
dependabot[bot] May 2, 2022
f3f5ab7
build(deps-dev): bump @types/node from 17.0.30 to 17.0.31
dependabot[bot] May 2, 2022
8afc7ba
build(deps-dev): bump tsconfig-paths from 3.14.1 to 4.0.0
dependabot[bot] May 3, 2022
6f3bc52
build(deps-dev): bump ethers from 5.6.4 to 5.6.5
dependabot[bot] May 3, 2022
4eb856a
Merge branch 'develop' into feat-role-transfer
thomas-waite May 3, 2022
003ce4e
feat: add PCV_MOVER role
thomas-waite May 3, 2022
f0843bc
feat: remove MINOR_ROLE_ADMIN
thomas-waite May 3, 2022
96cbdd8
refactor: remove unnecessary role granting
thomas-waite May 3, 2022
d5b09d9
test: update e2e test
thomas-waite May 3, 2022
e0384b6
feat: remove fip_82 config
thomas-waite May 3, 2022
0416b46
fix: update block number
thomas-waite May 3, 2022
c511b65
fix: reset fork to pinned block
thomas-waite May 3, 2022
f2ff7d2
Merge pull request #771 from fei-protocol/remove-fip82
thomas-waite May 3, 2022
35ef417
Merge branch 'develop' into feat-role-transfer
thomas-waite May 3, 2022
0f28634
refactor: rename MINTER_ADMIN to be clearer
thomas-waite May 3, 2022
9bd41cb
feat: add PCV_SAFE_MOVER role
thomas-waite May 3, 2022
fe7905e
Merge branch 'feat-role-transfer' into split-pcv-guard-role
thomas-waite May 3, 2022
bb7ec40
feat: grant PCV_SAFE_MOVER_ROLE
thomas-waite May 3, 2022
442a0a7
refactor: rename MINTER_ADMIN to be clearer
thomas-waite May 3, 2022
b9559b7
Merge branch 'feat-role-transfer' into split-pcv-guard-role
thomas-waite May 3, 2022
c4ece4e
feat: deploy new PCVGuardian with migrated state
thomas-waite May 3, 2022
b50e274
feat: remove PCV_GUARDIAN_ADMIN
thomas-waite May 3, 2022
5ab41f9
feat: revoke old pcv guardian
thomas-waite May 3, 2022
d88b64d
refactor: minor fixes
thomas-waite May 3, 2022
2f98c71
refactor: do not update deprecated contracts
thomas-waite May 3, 2022
518760c
Merge pull request #770 from fei-protocol/dependabot/npm_and_yarn/eth…
May 3, 2022
f0d654e
Merge branch 'feat-role-transfer' into split-pcv-guard-role
thomas-waite May 3, 2022
51a1af3
refactor: change proposal order so safe addresses up to date
thomas-waite May 3, 2022
0003526
refactor: use PCV_GUARDIAN_ADMIN_ROLE instead
thomas-waite May 4, 2022
da1a2e3
fix: correct role hash, remove redundant create
thomas-waite May 4, 2022
8da609d
Merge pull request #772 from fei-protocol/split-pcv-guard-role
thomas-waite May 4, 2022
dfa5339
refactor: PR feedback, remove roles
thomas-waite May 4, 2022
4c459ba
docs: update FIP description
thomas-waite May 4, 2022
30b5eb4
Merge branch 'feat-role-transfer' of https://github.com/fei-protocol/…
thomas-waite May 4, 2022
9ae6414
Revert "Merge branch 'feat-role-transfer' of https://github.com/fei-p…
thomas-waite May 4, 2022
30e9dd6
Merge branch 'feat-role-transfer' of https://github.com/fei-protocol/…
thomas-waite May 4, 2022
cbebe54
fix: correct broken merge
thomas-waite May 4, 2022
f6c79ee
feat: add PARAMETER_ADMIN to permissions
thomas-waite May 4, 2022
ee41371
refactor: change tokemak and index delegator admins
thomas-waite May 4, 2022
48acdf9
feat: take admin of two more roles
thomas-waite May 4, 2022
ed4d535
test: make dependency test pass
thomas-waite May 4, 2022
1163ccc
refactor: remove redundant role
thomas-waite May 4, 2022
0c9a37e
Merge pull request #678 from fei-protocol/feat-role-transfer
thomas-waite May 4, 2022
0a74ceb
feat: add new PCVGuardian deploy
thomas-waite May 4, 2022
1ff714b
build: remove fip_99
thomas-waite May 4, 2022
a78066b
refactor: update blockNumber to latest
thomas-waite May 5, 2022
616c207
circleci caching improvements
xklob May 5, 2022
95148fd
Updated config.yml
May 5, 2022
10d7eab
properly build
xklob May 5, 2022
e1dedfa
Updated config.yml
May 5, 2022
df1ddb4
add in the solidity files cache
xklob May 5, 2022
87af224
fix .gitignore
xklob May 5, 2022
edac38e
npm ci cache
xklob May 5, 2022
ecd4f94
comments
xklob May 5, 2022
257361a
trigger a cache rebuild
xklob May 5, 2022
338f76c
commit package-lock.json
xklob May 5, 2022
7fb10d6
use hardhat_mine instead of evm_mine
xklob May 5, 2022
7180460
fix bad package version
xklob May 5, 2022
c96e712
more cache stuff
xklob May 5, 2022
1510a35
sigmaproposalbuilder
xklob May 5, 2022
e177eca
fix hardhat_mine
xklob May 5, 2022
9450791
fix hre
xklob May 5, 2022
3429ba1
try hex string
xklob May 5, 2022
690c7e0
different bignumber
xklob May 5, 2022
0afe593
fix the other instance
xklob May 5, 2022
1950648
refactor: update affected contrat signoff
thomas-waite May 5, 2022
545b321
fix bugs
xklob May 5, 2022
d16338f
found a way to actually cache solidity source
xklob May 5, 2022
ef19737
try to placate the bn gods
xklob May 5, 2022
3870c7a
fix npm caching
xklob May 5, 2022
0739162
issue
xklob May 5, 2022
e832b52
disable unused test
xklob May 5, 2022
857e5f2
why not
xklob May 5, 2022
2077610
more parallel more better
xklob May 5, 2022
27e980e
too much parallel
xklob May 5, 2022
cf638b0
fix
xklob May 5, 2022
124ef37
test: fix broken Rai PSM tests
thomas-waite May 5, 2022
85ba525
Merge pull request #777 from fei-protocol/feat/ci-improvements
thomas-waite May 5, 2022
d718941
Merge branch 'develop' into deploy-new-pcvGuardian
thomas-waite May 5, 2022
e1cc16b
Merge pull request #774 from fei-protocol/deploy-new-pcvGuardian
thomas-waite May 5, 2022
01f4bb2
fix
xklob May 6, 2022
7fd23a9
Merge pull request #778 from fei-protocol/bug/dont-cache-solidity-fil…
May 6, 2022
bb7a78f
fix
xklob May 6, 2022
6a65f64
Updated config.yml
May 6, 2022
96fb04c
rename
xklob May 6, 2022
a460fb9
Merge branch 'feat/hardhat-network-fork-caching' of github.com:fei-pr…
xklob May 6, 2022
407e285
fix-sol-cache
xklob May 6, 2022
12955bf
we do want to cache the solcache
xklob May 6, 2022
efce372
fix glob
xklob May 6, 2022
e2b9da0
fix
xklob May 6, 2022
a28be35
fix paralle numbers
xklob May 6, 2022
322b2d2
restore the fork-cache in e2e
xklob May 6, 2022
6c050f8
remove extraenous resetfork
xklob May 6, 2022
217a52a
change beforeEach to before
xklob May 6, 2022
873e763
change params so hash is different
xklob May 6, 2022
8b64433
fix pod test
xklob May 6, 2022
b11c09d
fix
xklob May 6, 2022
141713d
must fix proposal id
xklob May 6, 2022
ad01a9c
some final speedupds
xklob May 6, 2022
212d18a
found another one
xklob May 6, 2022
fa7c6e7
try fix
xklob May 6, 2022
1141478
special case for zero
xklob May 6, 2022
e2981a9
SigmaProposal
xklob May 6, 2022
c69a57c
sigmaproposal
xklob May 6, 2022
5f43ac4
fix bug
xklob May 6, 2022
990648a
replace
xklob May 6, 2022
4b6b957
Merge pull request #767 from fei-protocol/dependabot/npm_and_yarn/typ…
May 6, 2022
bf038d6
Merge pull request #766 from fei-protocol/dependabot/npm_and_yarn/moc…
May 6, 2022
57c40ff
Merge pull request #769 from fei-protocol/dependabot/npm_and_yarn/tsc…
May 6, 2022
a41909c
feat: update proposalId
thomas-waite May 6, 2022
e252f07
Merge pull request #779 from fei-protocol/feat/hardhat-network-fork-c…
May 6, 2022
e5e54b3
deps: update block number
thomas-waite May 6, 2022
b285b17
Merge pull request #780 from fei-protocol/update-proposal-id
May 6, 2022
f1a4c5d
Merge branch 'master' into develop
May 6, 2022
a4596b3
Clear proposals config
Joeysantoro May 19, 2022
3861252
Block number update
Joeysantoro May 19, 2022
9e2209e
feat: update block num
thomas-waite May 20, 2022
88d9dd5
test: unpause DAI psm for e2e tests
thomas-waite May 20, 2022
a310f03
feat: update mainnet addresses
thomas-waite May 20, 2022
a9b43e2
style: fix lint error
thomas-waite May 20, 2022
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
125 changes: 74 additions & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,81 @@
version: 2.1
orbs:
discord: antonioned/[email protected]

jobs:
build:
working_directory: ~/repo
executors:
nodeimage:
docker:
- image: cimg/node:16.14
working_directory: ~/repo
resource_class: xlarge

jobs:
build:
executor: nodeimage
steps:
- checkout
- run:
name: 'Update NPM'
command: sudo npm install -g [email protected]
- run:
name: 'Set caching variables'
command: |
LAST_SUCCESSFUL_BUILD_URL="https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/master?filter=successful&limit=1"
LAST_SUCCESSFUL_COMMIT=`curl -Ss -u "$CIRCLE_TOKEN:" $LAST_SUCCESSFUL_BUILD_URL | jq -r '.[0]["vcs_revision"]'`
echo $LAST_SUCCESSFUL_COMMIT > /tmp/last-successful-commit
echo $CIRCLE_SHA1 > /tmp/current-commit
- restore_cache:
keys:
- build-cache-{{ .Branch }}-{{ checksum "/tmp/last-successful-commit" }}
- run:
- checkout
- restore_cache: # This one restores node_modules, and .npm if the package-lock.json checksum is the same
key: package-cache-{{ checksum "package-lock.json" }}
- run: # we use npm install and not npm ci because npm ci removes node-modules entirely
name: Install dependencies
command: npm install
- save_cache: # Save the node_modules and .npm directories into the cache by the checksum of package-lock.json
key: package-cache-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: # generate a checksum of all of the source solidity files to see if they have changed, which we use as the key for caching
name: Generate solidity source checksum
command: ./sol-checksum.sh /tmp/sol-checksum.txt
- restore_cache: # Restore the solidity files cache the same way we do node_modules (by the checksum of the .json file)
key: solcache-{{ checksum "/tmp/sol-checksum.txt" }}
- run:
name: Compile contracts
command: npm run compile:hardhat
- save_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
- run: # generate a checksum of all of the source solidity files to see if they have changed, which we use as the key for caching
name: Generate solidity source checksum (again)
command: ./sol-checksum.sh /tmp/sol-checksum.txt
- save_cache: # Save the solidity files cache, the compiled artifacts, and the generated types
key: solcache-{{ checksum "/tmp/sol-checksum.txt" }}
paths:
- artifacts
- types/contracts
- cache/solidity-files-cache.json
- restore_cache: # Restore the hardhat network fork cache if the hardhat-config hasn't changed
key: hardhat-config-{{ checksum "hardhat.config.ts" }}
- persist_to_workspace:
root: ~/repo
paths:
- ~/repo
- ./
lint:
working_directory: ~/repo
docker:
- image: cimg/node:16.14
executor: nodeimage
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- attach_workspace:
at: ./
- run:
name: Run linter
command: npm run lint
test:
working_directory: ~/repo
docker:
- image: cimg/node:16.14
executor: nodeimage
parallelism: 16
resource_class: large
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- attach_workspace:
at: ./
- run:
name: Run tests
command: |
circleci tests glob "test/unit/**/*.ts" | circleci tests split --split-by=filesize > /tmp/tests-to-run
npm run test:hardhat $(cat /tmp/tests-to-run)
- store_test_results:
path: test-results
path: test-results
- store_artifacts:
path: test-results
path: test-results

test-forge:
working_directory: ~/repo
docker:
- image: cimg/node:16.14
resource_class: xlarge
executor: nodeimage
steps:
- attach_workspace:
at: ./
- checkout
- restore_cache:
keys:
Expand All @@ -80,7 +86,7 @@ jobs:
- run:
name: Finish setting up env
command: echo "export PATH=$PATH:$(pwd)/.foundry/bin" >> /home/circleci/.bashrc
- run:
- run:
name: Install Foundry
command: curl -L https://foundry.paradigm.xyz | bash; source /home/circleci/.bashrc; $HOME/.foundry/bin/foundryup
- run:
Expand All @@ -91,37 +97,54 @@ jobs:

e2e-test:
working_directory: ~/repo
docker:
- image: cimg/node:16.14
parallelism: 5
resource_class: xlarge
executor: nodeimage
parallelism: 20
steps:
- attach_workspace:
at: ./
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
key: fork-cache-{{ checksum "hardhat.config.ts" }}
- run:
name: Run end-to-end tests
command: |
circleci tests glob "test/integration/**/*.ts" | circleci tests split --split-by=filesize > /tmp/tests-to-run
circleci tests glob "test/integration/tests/*.ts" | circleci tests split --split-by=filesize > /tmp/tests-to-run
npm run test:e2e $(cat /tmp/tests-to-run)
- store_test_results:
path: test-results
path: test-results
- store_artifacts:
path: test-results
path: test-results
- persist_to_workspace:
root: ~/repo
paths:
- ./cache/hardhat-network-fork

save-network-fork-cache:
working_directory: ~/repo
executor: nodeimage
steps:
- attach_workspace:
at: ./
- save_cache: # Save the solidity files cache, the compiled artifacts, and the generated types
key: fork-cache-{{ checksum "hardhat.config.ts" }}
paths:
- cache/hardhat-network-fork

workflows:
main:
jobs:
- build
- lint:
- lint:
requires:
- build
- test-forge:
requires:
- build
- build
- test:
requires:
- build
- e2e-test:
requires:
- build
- save-network-fork-cache:
requires:
- e2e-test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ cache
types/contracts
.eslintcache
.xml
out
out
35 changes: 19 additions & 16 deletions contracts/core/TribeRoles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ library TribeRoles {
/// @notice capable of granting and revoking other TribeRoles from having veto power over a pod
bytes32 internal constant POD_VETO_ADMIN = keccak256("POD_VETO_ADMIN");

/// @notice can manage the majority of Tribe protocol parameters. Sets boundaries for MINOR_PARAM_ROLE.
/// @notice can manage the majority of Tribe protocol parameters
bytes32 internal constant PARAMETER_ADMIN = keccak256("PARAMETER_ADMIN");

/// @notice manages the Collateralization Oracle as well as other protocol oracles.
Expand All @@ -48,23 +48,23 @@ library TribeRoles {
/// @notice manages TribalChief incentives and related functionality.
bytes32 internal constant TRIBAL_CHIEF_ADMIN = keccak256("TRIBAL_CHIEF_ADMIN_ROLE");

/// @notice admin of the Tokemak PCV deposits
bytes32 internal constant TOKEMAK_DEPOSIT_ADMIN_ROLE = keccak256("TOKEMAK_DEPOSIT_ADMIN_ROLE");

/// @notice admin of PCVGuardian
bytes32 internal constant PCV_GUARDIAN_ADMIN = keccak256("PCV_GUARDIAN_ADMIN_ROLE");

/// @notice admin of all Minor Roles
bytes32 internal constant MINOR_ROLE_ADMIN = keccak256("MINOR_ROLE_ADMIN");

/// @notice admin of the Fuse protocol
bytes32 internal constant FUSE_ADMIN = keccak256("FUSE_ADMIN");

/// @notice capable of vetoing DAO votes or optimistic timelocks
bytes32 internal constant VETO_ADMIN = keccak256("VETO_ADMIN");
/// @notice admin of minting Fei for specific scoped contracts
bytes32 internal constant FEI_MINT_ADMIN = keccak256("FEI_MINT_ADMIN");

/// @notice capable of setting FEI Minters within global rate limits and caps
bytes32 internal constant MINTER_ADMIN = keccak256("MINTER_ADMIN");
/// @notice capable of admin functionality on PCVDeposits
bytes32 internal constant PCV_MINOR_PARAM_ROLE = keccak256("PCV_MINOR_PARAM_ROLE");

/// @notice manages the constituents of Optimistic Timelocks, including Proposers and Executors
bytes32 internal constant OPTIMISTIC_ADMIN = keccak256("OPTIMISTIC_ADMIN");
/// @notice capable of setting FEI Minters within global rate limits and caps
bytes32 internal constant RATE_LIMITED_MINTER_ADMIN = keccak256("RATE_LIMITED_MINTER_ADMIN");

/// @notice manages meta-governance actions, like voting & delegating.
/// Also used to vote for gauge weights & similar liquid governance things.
Expand All @@ -78,23 +78,26 @@ library TribeRoles {
/// @notice manages whitelisting of gauges where the protocol's tokens can be staked
bytes32 internal constant METAGOVERNANCE_GAUGE_ADMIN = keccak256("METAGOVERNANCE_GAUGE_ADMIN");

/// @notice capable of performing swaps on Balancer LBP Swapper
bytes32 internal constant SWAP_ADMIN_ROLE = keccak256("SWAP_ADMIN_ROLE");

/// @notice capable of setting properties on Balancer BasePool utility wrapper
bytes32 internal constant BALANCER_MANAGER_ADMIN_ROLE = keccak256("BALANCER_MANAGER_ADMIN_ROLE");

/*///////////////////////////////////////////////////////////////
Minor Roles
//////////////////////////////////////////////////////////////*/
bytes32 internal constant POD_METADATA_REGISTER_ROLE = keccak256("POD_METADATA_REGISTER_ROLE");

/// @notice capable of poking existing LBP auctions to exchange tokens.
bytes32 internal constant LBP_SWAP_ROLE = keccak256("SWAP_ADMIN_ROLE");

/// @notice capable of engaging with Votium for voting incentives.
bytes32 internal constant VOTIUM_ROLE = keccak256("VOTIUM_ADMIN_ROLE");

/// @notice capable of adding an address to multi rate limited
bytes32 internal constant ADD_MINTER_ROLE = keccak256("ADD_MINTER_ROLE");

/// @notice capable of changing parameters within non-critical ranges
bytes32 internal constant MINOR_PARAM_ROLE = keccak256("MINOR_PARAM_ROLE");

/// @notice capable of changing PCV Deposit and Global Rate Limited Minter in the PSM
bytes32 internal constant PSM_ADMIN_ROLE = keccak256("PSM_ADMIN_ROLE");

/// @notice capable of moving PCV between safe addresses on the PCVGuardian
bytes32 internal constant PCV_SAFE_MOVER_ROLE = keccak256("PCV_SAFE_MOVER_ROLE");
}
37 changes: 26 additions & 11 deletions contracts/pcv/PCVGuardian.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "../refs/CoreRef.sol";
import "./IPCVGuardian.sol";
import "./IPCVDeposit.sol";
import "../libs/CoreRefPauseableLib.sol";
import {TribeRoles} from "../core/TribeRoles.sol";

contract PCVGuardian is IPCVGuardian, CoreRef {
using CoreRefPauseableLib for address;
Expand All @@ -15,8 +16,6 @@ contract PCVGuardian is IPCVGuardian, CoreRef {
EnumerableSet.AddressSet private safeAddresses;

constructor(address _core, address[] memory _safeAddresses) CoreRef(_core) {
_setContractAdminRole(keccak256("PCV_GUARDIAN_ADMIN_ROLE"));

for (uint256 i = 0; i < _safeAddresses.length; i++) {
_setSafeAddress(_safeAddresses[i]);
}
Expand All @@ -35,34 +34,50 @@ contract PCVGuardian is IPCVGuardian, CoreRef {
return safeAddresses.values();
}

// ---------- Governor-or-Admin-Only State-Changing API ----------
// ---------- GOVERNOR-or-PCV_GUARDIAN_ADMIN-Only State-Changing API ----------

/// @notice governor-only method to set an address as "safe" to withdraw funds to
/// @param pcvDeposit the address to set as safe
function setSafeAddress(address pcvDeposit) external override onlyGovernorOrAdmin {
function setSafeAddress(address pcvDeposit)
external
override
hasAnyOfTwoRoles(TribeRoles.GOVERNOR, TribeRoles.PCV_GUARDIAN_ADMIN)
{
_setSafeAddress(pcvDeposit);
}

/// @notice batch version of setSafeAddress
/// @param _safeAddresses the addresses to set as safe, as calldata
function setSafeAddresses(address[] calldata _safeAddresses) external override onlyGovernorOrAdmin {
function setSafeAddresses(address[] calldata _safeAddresses)
external
override
hasAnyOfTwoRoles(TribeRoles.GOVERNOR, TribeRoles.PCV_GUARDIAN_ADMIN)
{
require(_safeAddresses.length != 0, "empty");
for (uint256 i = 0; i < _safeAddresses.length; i++) {
_setSafeAddress(_safeAddresses[i]);
}
}

// ---------- Governor-or-Admin-Or-Guardian-Only State-Changing API ----------
// ---------- GOVERNOR-or-PCV_GUARDIAN_ADMIN-Or-GUARDIAN-Only State-Changing API ----------

/// @notice governor-or-guardian-only method to un-set an address as "safe" to withdraw funds to
/// @param pcvDeposit the address to un-set as safe
function unsetSafeAddress(address pcvDeposit) external override isGovernorOrGuardianOrAdmin {
function unsetSafeAddress(address pcvDeposit)
external
override
hasAnyOfThreeRoles(TribeRoles.GOVERNOR, TribeRoles.GUARDIAN, TribeRoles.PCV_GUARDIAN_ADMIN)
{
_unsetSafeAddress(pcvDeposit);
}

/// @notice batch version of unsetSafeAddresses
/// @param _safeAddresses the addresses to un-set as safe
function unsetSafeAddresses(address[] calldata _safeAddresses) external override isGovernorOrGuardianOrAdmin {
function unsetSafeAddresses(address[] calldata _safeAddresses)
external
override
hasAnyOfThreeRoles(TribeRoles.GOVERNOR, TribeRoles.GUARDIAN, TribeRoles.PCV_GUARDIAN_ADMIN)
{
require(_safeAddresses.length != 0, "empty");
for (uint256 i = 0; i < _safeAddresses.length; i++) {
_unsetSafeAddress(_safeAddresses[i]);
Expand All @@ -81,7 +96,7 @@ contract PCVGuardian is IPCVGuardian, CoreRef {
uint256 amount,
bool pauseAfter,
bool depositAfter
) external override isGovernorOrGuardianOrAdmin {
) external override hasAnyOfThreeRoles(TribeRoles.GOVERNOR, TribeRoles.PCV_SAFE_MOVER_ROLE, TribeRoles.GUARDIAN) {
require(isSafeAddress(safeAddress), "Provided address is not a safe address!");

pcvDeposit._ensureUnpaused();
Expand Down Expand Up @@ -111,7 +126,7 @@ contract PCVGuardian is IPCVGuardian, CoreRef {
uint256 amount,
bool pauseAfter,
bool depositAfter
) external override isGovernorOrGuardianOrAdmin {
) external override hasAnyOfThreeRoles(TribeRoles.GOVERNOR, TribeRoles.PCV_SAFE_MOVER_ROLE, TribeRoles.GUARDIAN) {
require(isSafeAddress(safeAddress), "Provided address is not a safe address!");

pcvDeposit._ensureUnpaused();
Expand Down Expand Up @@ -142,7 +157,7 @@ contract PCVGuardian is IPCVGuardian, CoreRef {
uint256 amount,
bool pauseAfter,
bool depositAfter
) external override isGovernorOrGuardianOrAdmin {
) external override hasAnyOfThreeRoles(TribeRoles.GOVERNOR, TribeRoles.PCV_SAFE_MOVER_ROLE, TribeRoles.GUARDIAN) {
require(isSafeAddress(safeAddress), "Provided address is not a safe address!");

pcvDeposit._ensureUnpaused();
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
forking: enableMainnetForking
? {
url: `https://eth-mainnet.alchemyapi.io/v2/${mainnetAlchemyApiKey}`,
blockNumber: 14723389 // Friday, May 6th
blockNumber: 14807700 // Thursday, May 19th
}
: undefined
},
Expand Down
Loading