chore(StakeManager): change revert to use custom error

This commit is contained in:
Ricardo Guilherme Schmidt 2024-03-04 12:11:01 -03:00
parent 4f590049d4
commit c764142909
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ contract StakeManager is Ownable {
error StakeManager__AccountNotInitialized();
error StakeManager__InvalidMigration();
error StakeManager__AlreadyProcessedEpochs();
error StakeManager__InsufficientFunds();
struct Account {
address rewardAddress;
@ -158,7 +159,7 @@ contract StakeManager is Ownable {
function unstake(uint256 _amount) external onlyVault onlyInitialized(msg.sender) noMigration processEpoch {
Account storage account = accounts[msg.sender];
if (_amount > account.balance) {
revert("StakeManager: Amount exceeds balance");
revert StakeManager__InsufficientFunds();
}
if (account.lockUntil > block.timestamp) {
revert StakeManager__FundsLocked();