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

Remove PSM and ERC20allocator, Consolidate GRLM and GSERL #197

Draft
wants to merge 82 commits into
base: feat/core-coreref-cleanup
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7bff2ee
PCV Oracle Accounting Comment
ElliotFriedman Jan 9, 2023
d941e15
update time to 2024 for oracle start price
ElliotFriedman Jan 9, 2023
8948fe9
Liquid PCV Deposit role count and member checks
ElliotFriedman Jan 9, 2023
b5cadfe
TODO in deployment file around start time and price
ElliotFriedman Jan 9, 2023
0b6e393
Remove LIQUID_PCV_DEPOSIT role from psm
ElliotFriedman Jan 9, 2023
c097365
PCV Deposit V2
ElliotFriedman Jan 10, 2023
5726f39
PCVDeposit V2 and Morpho PCV Deposit refactor
ElliotFriedman Jan 18, 2023
02bcd53
resolve merge conflicts
ElliotFriedman Jan 18, 2023
0edc79a
Update deployment script with new Morpho PCV Deposit
ElliotFriedman Jan 18, 2023
230221e
remove system v2
ElliotFriedman Jan 18, 2023
55f86f1
add _withdrawAndTransfer function
ElliotFriedman Jan 18, 2023
b4277d3
Merge branch 'feat/core-coreref-cleanup' of github.com:volt-protocol/…
ElliotFriedman Jan 18, 2023
11e281a
fix imports
ElliotFriedman Jan 18, 2023
f76c81f
Merge branch 'feat/core-coreref-cleanup' of github.com:volt-protocol/…
ElliotFriedman Jan 18, 2023
f2cb3a3
PCVDepositV2 _withdrawAndTransfer function
ElliotFriedman Jan 19, 2023
4927402
Market governance
ElliotFriedman Jan 19, 2023
77f7223
Market Governance compatability and decimal normalization for PCV Oracle
ElliotFriedman Jan 19, 2023
09a1137
resolve merge conflicts
ElliotFriedman Jan 19, 2023
53f9520
fix merge conflicts
ElliotFriedman Jan 19, 2023
b8ffb03
remove contracts folder
ElliotFriedman Jan 19, 2023
bd6faf7
Euler PCV Deposit
ElliotFriedman Jan 20, 2023
0561407
Morpho AAVE PCV Deposit
ElliotFriedman Jan 20, 2023
7c70721
move balanceReportedIn to PCV Deposit V2
ElliotFriedman Jan 20, 2023
2fc0868
Morpho Aave and Euler PCV Deposit Tests
ElliotFriedman Jan 20, 2023
dab899f
Add AAVE Morpho updateIndex function
ElliotFriedman Jan 20, 2023
0ce23ba
Deploy Euler and Morpho-Aave PCV Deposits
ElliotFriedman Jan 20, 2023
98b43cf
remove compound pcv deposit
ElliotFriedman Jan 20, 2023
645f59b
import clean up
ElliotFriedman Jan 20, 2023
dd1bd79
change unit test morpho address label
ElliotFriedman Jan 20, 2023
00e7844
Rename MorphoPCVDeposit to MorphoCompoundPCVDeposit
ElliotFriedman Jan 20, 2023
d0726c0
Market Governance
ElliotFriedman Jan 24, 2023
c571e27
market gov tests
ElliotFriedman Jan 24, 2023
6732e39
Simplify interface
ElliotFriedman Jan 25, 2023
e37a907
remove PCVMover, roll back PCVRouter
ElliotFriedman Jan 26, 2023
4bb9d8b
PCV Router Architecture
ElliotFriedman Jan 26, 2023
659d6a8
delete mock pcv router
ElliotFriedman Jan 26, 2023
06b5f8b
Rollback PCVRouter tests, accomodate new movePCV arch
ElliotFriedman Jan 26, 2023
f07f7de
Update Market Governance tests
ElliotFriedman Jan 26, 2023
3f6c402
add events, update tests
ElliotFriedman Jan 26, 2023
bc21de7
events
ElliotFriedman Jan 26, 2023
de7bc3f
event in _harvestRewards
ElliotFriedman Jan 26, 2023
b5e2536
Add events to stake() and unstake()
ElliotFriedman Jan 26, 2023
ae73461
Merge branch 'feat/core-coreref-cleanup' of github.com:volt-protocol/…
ElliotFriedman Jan 26, 2023
7b8320c
update internal function names, add natspec
ElliotFriedman Jan 26, 2023
395f8c7
add additional test cases
ElliotFriedman Jan 26, 2023
e894138
Harvest event update
ElliotFriedman Jan 27, 2023
405729e
add venueUserVconStartingSharePrice to Market Governance
ElliotFriedman Jan 27, 2023
dd54646
remove console.log
ElliotFriedman Jan 27, 2023
f0cd71f
add realizeGainsAndLosses tests
ElliotFriedman Jan 27, 2023
6920af7
natspec
ElliotFriedman Jan 27, 2023
f9f61c9
system arch refactor to use share prices for each venue
ElliotFriedman Jan 27, 2023
047adbb
add additional unit tests
ElliotFriedman Jan 31, 2023
32192fa
add last recorded profit to ERC20 Holding PCV Deposit
ElliotFriedman Jan 31, 2023
4d4cec0
Market Governance share price refactor, add holding deposit logic
ElliotFriedman Jan 31, 2023
9d1d6a6
Add more unit and fuzz tests
ElliotFriedman Feb 2, 2023
c9ed0a6
interface and contract clean up
ElliotFriedman Feb 2, 2023
095b3c9
feedback
ElliotFriedman Feb 2, 2023
319371c
PCV Oracle Refactor (#195)
ElliotFriedman Feb 10, 2023
bbf4036
fix merge conflicts, merge pcv deposit v2
ElliotFriedman Feb 17, 2023
d51db0e
address Erwan PCV Deposit comments
ElliotFriedman Feb 17, 2023
7a0181d
rate limit mid points, remove psm and allocator
ElliotFriedman Feb 18, 2023
7239980
lint
ElliotFriedman Feb 18, 2023
6ce2d1a
RateLimitedV2 and NC PSM checkpoint
ElliotFriedman Feb 23, 2023
0825f62
Tests passing, cleanup comments
ElliotFriedman Feb 26, 2023
311baff
fix unit test
ElliotFriedman Feb 27, 2023
0f5cf38
Fix imports, remove comments
ElliotFriedman Feb 28, 2023
3b85ae2
remove all v1 migrator contracts
ElliotFriedman Feb 28, 2023
9ad1c00
fix integration tests and vip16, remove deployment of deprecated cont…
ElliotFriedman Feb 28, 2023
8e17104
update circleci config
ElliotFriedman Feb 28, 2023
fb0a0ca
foundryup master branch for circleci
ElliotFriedman Feb 28, 2023
bdd1d0c
isolate foundry setup actions
ElliotFriedman Feb 28, 2023
86ae88f
hardcode path to foundryup
ElliotFriedman Feb 28, 2023
0e52ef1
revert ci
ElliotFriedman Feb 28, 2023
072e4e6
remove cache
ElliotFriedman Feb 28, 2023
1724385
revert ci config
ElliotFriedman Mar 1, 2023
3dfb258
Merge branch 'feat/core-coreref-cleanup' of github.com:volt-protocol/…
ElliotFriedman Mar 1, 2023
ae7083a
remove market governance code
ElliotFriedman Mar 1, 2023
91d3c05
remove morpho deposits
ElliotFriedman Mar 1, 2023
d2138e9
remove Euler PCV Deposit
ElliotFriedman Mar 1, 2023
7dd04fd
todo comments
ElliotFriedman Mar 1, 2023
58a3918
test TODO comments
ElliotFriedman Mar 1, 2023
b8cb408
remove PCV Deposit V2
ElliotFriedman Mar 1, 2023
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: Finish setting up env
command: echo "export PATH=$PATH:$(pwd)/.foundry/bin" >> /home/circleci/.bashrc
- run:
name: Install Foundry
name: Download Foundry
command: curl -L https://foundry.paradigm.xyz | bash; source /home/circleci/.bashrc; $HOME/.foundry/bin/foundryup
- run:
name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ script = 'script'
libs = ['node_modules', 'script', 'src/external', 'src/v1']

[fuzz]
runs = 5000
runs = 50
max_test_rejects = 100000

[invariant]
Expand Down
2 changes: 1 addition & 1 deletion slither/slither-10-21-v2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Parameter PermissionsV2.isGovernor(address)._address (contracts/core/Permissions
Parameter PermissionsV2.isGuardian(address)._address (contracts/core/PermissionsV2.sol#247) is not in mixedCase
Parameter PermissionsV2.isLocker(address)._address (contracts/core/PermissionsV2.sol#255) is not in mixedCase
Parameter PermissionsV2.isPCVGuard(address)._address (contracts/core/PermissionsV2.sol#262) is not in mixedCase
Parameter PermissionsV2.isRateLimitedMinter(address)._address (contracts/core/PermissionsV2.sol#270) is not in mixedCase
Parameter PermissionsV2.isPsmMinter(address)._address (contracts/core/PermissionsV2.sol#270) is not in mixedCase
Parameter PermissionsV2.isRateLimitedRedeemer(address)._address (contracts/core/PermissionsV2.sol#279) is not in mixedCase
Function IRateLimitedV2.MAX_RATE_LIMIT_PER_SECOND() (contracts/utils/IRateLimitedV2.sol#11) is not in mixedCase
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions
Expand Down
3 changes: 3 additions & 0 deletions src/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ library Constants {
/// @notice Wei per ETH, i.e. 10**18
uint256 public constant ETH_GRANULARITY = 1e18;

/// @notice Wei per ETH, i.e. 10**18
int256 public constant ETH_GRANULARITY_INT = 1e18;

/// @notice number of decimals in ETH, 18
uint256 public constant ETH_DECIMALS = 18;
}
18 changes: 0 additions & 18 deletions src/core/CoreV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {ICoreV2} from "@voltprotocol/core/ICoreV2.sol";
import {IPCVOracle} from "@voltprotocol/oracle/IPCVOracle.sol";
import {PermissionsV2} from "@voltprotocol/core/PermissionsV2.sol";
import {IGlobalRateLimitedMinter} from "@voltprotocol/rate-limits/IGlobalRateLimitedMinter.sol";
import {IGlobalSystemExitRateLimiter} from "@voltprotocol/rate-limits/IGlobalSystemExitRateLimiter.sol";
import {IGlobalReentrancyLock, GlobalReentrancyLock} from "@voltprotocol/core/GlobalReentrancyLock.sol";

/// @title Source of truth for VOLT Protocol
Expand All @@ -24,9 +23,6 @@ contract CoreV2 is ICoreV2, PermissionsV2 {
/// @notice address of the global rate limited minter
IGlobalRateLimitedMinter public globalRateLimitedMinter;

/// @notice address of the global system exit rate limiter
IGlobalSystemExitRateLimiter public globalSystemExitRateLimiter;

/// @notice address of the pcv oracle
IPCVOracle public pcvOracle;

Expand Down Expand Up @@ -83,20 +79,6 @@ contract CoreV2 is ICoreV2, PermissionsV2 {
emit PCVOracleUpdate(oldPCVOracle, address(newPCVOracle));
}

/// @notice governor only function to set the Global Rate Limited Minter
/// @param newGlobalSystemExitRateLimiter new volt global rate limited minter
function setGlobalSystemExitRateLimiter(
IGlobalSystemExitRateLimiter newGlobalSystemExitRateLimiter
) external onlyGovernor {
address oldGserl = address(globalSystemExitRateLimiter);
globalSystemExitRateLimiter = newGlobalSystemExitRateLimiter;

emit GlobalSystemExitRateLimiterUpdate(
oldGserl,
address(newGlobalSystemExitRateLimiter)
);
}

/// @notice governor only function to set the Global Reentrancy Lock
/// @param newGlobalReentrancyLock new global reentrancy lock
function setGlobalReentrancyLock(
Expand Down
13 changes: 0 additions & 13 deletions src/core/ICoreV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {IVolt, IERC20} from "@voltprotocol/volt/IVolt.sol";
import {IPermissionsV2} from "@voltprotocol/core/IPermissionsV2.sol";
import {IGlobalReentrancyLock} from "@voltprotocol/core/IGlobalReentrancyLock.sol";
import {IGlobalRateLimitedMinter} from "@voltprotocol/rate-limits/IGlobalRateLimitedMinter.sol";
import {IGlobalSystemExitRateLimiter} from "@voltprotocol/rate-limits/IGlobalSystemExitRateLimiter.sol";

/// @title Core Interface
/// @author Volt Protocol
Expand All @@ -31,12 +30,6 @@ interface ICoreV2 is IPermissionsV2 {
address indexed newPcvOracle
);

/// @notice emitted when reference to global system exit rate limiter is updated
event GlobalSystemExitRateLimiterUpdate(
address indexed oldGserl,
address indexed newGserl
);

/// @notice emitted when reference to global reentrancy lock is updated
event GlobalReentrancyLockUpdate(
address indexed oldGrl,
Expand Down Expand Up @@ -80,12 +73,6 @@ interface ICoreV2 is IPermissionsV2 {
IGlobalRateLimitedMinter newGlobalRateLimitedMinter
) external;

/// @notice governor only function to set the Global Rate Limited Minter
/// @param newGlobalSystemExitRateLimiter new volt global rate limited minter
function setGlobalSystemExitRateLimiter(
IGlobalSystemExitRateLimiter newGlobalSystemExitRateLimiter
) external;

/// @notice governor only function to set the PCV Oracle
/// @param newPCVOracle new volt pcv oracle
function setPCVOracle(IPCVOracle newPCVOracle) external;
Expand Down
50 changes: 4 additions & 46 deletions src/core/IPermissionsV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@ interface IPermissionsV2 is IAccessControl {

function grantPCVGuard(address pcvGuard) external;

function grantRateLimitedMinter(address rateLimitedMinter) external;

function grantRateLimitedRedeemer(address rateLimitedRedeemer) external;

function grantSystemExitRateLimitDepleter(
address rateLimitedDepleter
) external;

function grantSystemExitRateLimitReplenisher(
address rateLimitedReplenisher
) external;
function grantPsmMinter(address rateLimitedMinter) external;

function revokeMinter(address minter) external;

Expand All @@ -46,17 +36,7 @@ interface IPermissionsV2 is IAccessControl {

function revokePCVGuard(address pcvGuard) external;

function revokeRateLimitedMinter(address rateLimitedMinter) external;

function revokeRateLimitedRedeemer(address rateLimitedRedeemer) external;

function revokeSystemExitRateLimitDepleter(
address rateLimitedDepleter
) external;

function revokeSystemExitRateLimitReplenisher(
address rateLimitedReplenisher
) external;
function revokePsmMinter(address rateLimitedMinter) external;

// ----------- Revoker only state changing api -----------

Expand All @@ -76,19 +56,7 @@ interface IPermissionsV2 is IAccessControl {

function isPCVGuard(address _address) external view returns (bool);

function isRateLimitedMinter(address _address) external view returns (bool);

function isRateLimitedRedeemer(
address _address
) external view returns (bool);

function isSystemExitRateLimitReplenisher(
address _address
) external view returns (bool);

function isSystemExitRateLimitDepleter(
address _address
) external view returns (bool);
function isPsmMinter(address _address) external view returns (bool);

// ----------- Predefined Roles -----------

Expand All @@ -115,15 +83,5 @@ interface IPermissionsV2 is IAccessControl {

/// @notice granted to peg stability modules that will call in to deplete buffer
/// and mint Volt
function RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE()
external
view
returns (bytes32);

/// @notice granted to peg stability modules that will call in to replenish the
/// buffer Volt is minted from
function RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE()
external
view
returns (bytes32);
function PSM_MINTER() external view returns (bytes32);
}
122 changes: 10 additions & 112 deletions src/core/PermissionsV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,9 @@ contract PermissionsV2 is IPermissionsV2, AccessControlEnumerable {
/// @notice granted to EOA's to enable movement of funds to safety in an emergency
bytes32 public constant PCV_GUARD_ROLE = keccak256("PCV_GUARD_ROLE");

/// @notice granted to peg stability modules that will call in to deplete buffer
/// and mint Volt
bytes32 public constant RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE =
keccak256("RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE");

/// @notice granted to peg stability modules that will call in to replenish the
/// buffer Volt is minted from
bytes32 public constant RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE =
keccak256("RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE");

/// @notice can replenish buffer through GlobalSystemExitRateLimiter
bytes32 public constant RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE =
keccak256("RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE");

/// @notice can delpete buffer through the GlobalSystemExitRateLimiter buffer
bytes32 public constant RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE =
keccak256("RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE");
/// @notice can replenish and deplete buffer through the GlobalRateLimiter.
/// replenishing burns Volt, depleting mints Volt
bytes32 public constant PSM_MINTER = keccak256("PSM_MINTER_ROLE");

/// @notice granted to system smart contracts to enable the setting
/// of reentrancy locks within the GlobalReentrancyLock contract
Expand All @@ -58,10 +44,7 @@ contract PermissionsV2 is IPermissionsV2, AccessControlEnumerable {
_setRoleAdmin(GUARDIAN_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(LOCKER_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(PCV_GUARD_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE, GOVERNOR_ROLE);
_setRoleAdmin(PSM_MINTER, GOVERNOR_ROLE);
}

/// @notice callable only by governor
Expand Down Expand Up @@ -135,39 +118,10 @@ contract PermissionsV2 is IPermissionsV2, AccessControlEnumerable {

/// @notice grants ability to mint Volt through the global rate limited minter
/// @param rateLimitedMinter address to add as a minter in global rate limited minter
function grantRateLimitedMinter(
function grantPsmMinter(
address rateLimitedMinter
) external override onlyGovernor {
_grantRole(RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE, rateLimitedMinter);
}

/// @notice grants ability to replenish buffer for minting Volt through the global rate limited minter
/// @param rateLimitedRedeemer address to add as a redeemer in global rate limited minter
function grantRateLimitedRedeemer(
address rateLimitedRedeemer
) external override onlyGovernor {
_grantRole(RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE, rateLimitedRedeemer);
}

/// @notice grants ability to replenish buffer for funds exiting system through
/// the global system exit rate limiter
/// @param rateLimitedReplenisher address to add as a replenisher in global system exit rate limiter
function grantSystemExitRateLimitReplenisher(
address rateLimitedReplenisher
) external override onlyGovernor {
_grantRole(
RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE,
rateLimitedReplenisher
);
}

/// @notice grants ability to deplete buffer for funds exiting system through
/// the global system exit rate limiter
/// @param rateLimitedDepleter address to add as a depleter in global system exit rate limiter
function grantSystemExitRateLimitDepleter(
address rateLimitedDepleter
) external override onlyGovernor {
_grantRole(RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE, rateLimitedDepleter);
_grantRole(PSM_MINTER, rateLimitedMinter);
}

/// @notice revokes minter role from address
Expand Down Expand Up @@ -212,39 +166,10 @@ contract PermissionsV2 is IPermissionsV2, AccessControlEnumerable {

/// @notice revokes ability to mint Volt through the global rate limited minter
/// @param rateLimitedMinter ex minter in global rate limited minter
function revokeRateLimitedMinter(
function revokePsmMinter(
address rateLimitedMinter
) external override onlyGovernor {
_revokeRole(RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE, rateLimitedMinter);
}

/// @notice revokes ability to replenish buffer for minting Volt through the global rate limited minter
/// @param rateLimitedRedeemer ex redeemer in global rate limited minter
function revokeRateLimitedRedeemer(
address rateLimitedRedeemer
) external override onlyGovernor {
_revokeRole(
RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE,
rateLimitedRedeemer
);
}

/// @notice revokes ability to replenish buffer for funds exiting system through
/// the global system exit rate limiter
/// @param rateLimitedRedeemer ex replenisher in global system exit rate limiter
function revokeSystemExitRateLimitReplenisher(
address rateLimitedRedeemer
) external override onlyGovernor {
_revokeRole(RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE, rateLimitedRedeemer);
}

/// @notice revokes ability to deplete buffer for funds exiting system through
/// the global system exit rate limiter
/// @param rateLimitedRedeemer ex depleter in global system exit rate limiter
function revokeSystemExitRateLimitDepleter(
address rateLimitedRedeemer
) external override onlyGovernor {
_revokeRole(RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE, rateLimitedRedeemer);
_revokeRole(PSM_MINTER, rateLimitedMinter);
}

/// @notice revokes a role from address
Expand Down Expand Up @@ -322,36 +247,9 @@ contract PermissionsV2 is IPermissionsV2, AccessControlEnumerable {
/// @notice checks if address has Volt Minter Role
/// @param _address address to check
/// @return true if _address has Volt Minter Role
function isRateLimitedMinter(
address _address
) external view override returns (bool) {
return hasRole(RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE, _address);
}

/// @notice checks if address has Volt Redeemer Role
/// @param _address address to check
/// @return true if _address has Volt Redeemer Role
function isRateLimitedRedeemer(
address _address
) external view override returns (bool) {
return hasRole(RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE, _address);
}

/// @notice checks if address has Volt Rate Limited Replenisher Role
/// @param _address address to check
/// @return true if _address has Volt Rate Limited Replenisher Role
function isSystemExitRateLimitReplenisher(
address _address
) external view override returns (bool) {
return hasRole(RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE, _address);
}

/// @notice checks if address has Volt Rate Limited Depleter Role
/// @param _address address to check
/// @return true if _address has Volt Rate Limited Depleter Role
function isSystemExitRateLimitDepleter(
function isPsmMinter(
address _address
) external view override returns (bool) {
return hasRole(RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE, _address);
return hasRole(PSM_MINTER, _address);
}
}
19 changes: 3 additions & 16 deletions src/core/VoltRoles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,9 @@ library VoltRoles {

/// ----------- Rate limiters for Global System Entry / Exit ---------------

/// @notice can mint VOLT through GlobalRateLimitedMinter on a rate limit
bytes32 internal constant RATE_LIMIT_SYSTEM_ENTRY_DEPLETE =
keccak256("RATE_LIMIT_SYSTEM_ENTRY_DEPLETE_ROLE");

/// @notice can redeem VOLT and replenish the GlobalRateLimitedMinter buffer
/// @notice non custodial PSM role.
bytes32 internal constant RATE_LIMIT_SYSTEM_ENTRY_REPLENISH =
keccak256("RATE_LIMIT_SYSTEM_ENTRY_REPLENISH_ROLE");

/// @notice can delpete buffer through the GlobalSystemExitRateLimiter buffer
bytes32 internal constant RATE_LIMIT_SYSTEM_EXIT_DEPLETE =
keccak256("RATE_LIMIT_SYSTEM_EXIT_DEPLETE_ROLE");

/// @notice can replenish buffer through GlobalSystemExitRateLimiter
bytes32 internal constant RATE_LIMIT_SYSTEM_EXIT_REPLENISH =
keccak256("RATE_LIMIT_SYSTEM_EXIT_REPLENISH_ROLE");
/// @notice can replenish and deplete buffer through the GlobalRateLimiter.
/// replenishing burns Volt, depleting mints Volt
bytes32 internal constant PSM_MINTER = keccak256("PSM_MINTER_ROLE");

/*///////////////////////////////////////////////////////////////
Minor Roles
Expand Down
Loading