From c764142909362ee2d6773c980f2a51dbe970b59e Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Mon, 4 Mar 2024 12:11:01 -0300 Subject: [PATCH] chore(StakeManager): change revert to use custom error --- contracts/StakeManager.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/StakeManager.sol b/contracts/StakeManager.sol index 486194e..ff16e7f 100644 --- a/contracts/StakeManager.sol +++ b/contracts/StakeManager.sol @@ -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();