Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
288d12b
audit fix -> H-01, H-02, M-02
pankajjagtapp Feb 18, 2026
c5cc902
audit fix: L-01 Incorrect Event Argument in RemainderHandled
pankajjagtapp Feb 18, 2026
3e61412
audit fix: L-02 => Non-Idempotent CREATE2 Deploy Can DoS Deployment S…
pankajjagtapp Feb 18, 2026
8d299e1
audit fix: I-01 => Rounding Loss in Treasury Split Calculation
pankajjagtapp Feb 18, 2026
c44e471
audit fix: I-03 =>Unused OwnableUpgradeable Inheritance
pankajjagtapp Feb 18, 2026
8d2111e
audit fix: I-04 => Inaccurate NatSpec in invalidateRequests
pankajjagtapp Feb 18, 2026
f11cdd6
audit fix: I-05. Batch Claim Bypasses User Balance Check
pankajjagtapp Feb 18, 2026
4afb260
audit fix: I-06. Potential Gas Griefing in claimWithdraw
pankajjagtapp Feb 18, 2026
cebb37a
audit fix: I-08. Deployment/Upgrade Scripts Print Inaccurate Logs
pankajjagtapp Feb 18, 2026
84ce16f
fix tests as per the new changes
pankajjagtapp Feb 18, 2026
bfb5dbd
audit fix: L-03. requestWithdrawWithPermit Can Be Griefed via Permit …
pankajjagtapp Feb 19, 2026
4e35487
audit fix: M-01. PriorityWithdrawalQueue Ignores Liquidity Pool Withd…
pankajjagtapp Feb 25, 2026
6a3448e
refactor: update error handling and minAmountOut logic in PriorityWit…
pankajjagtapp Feb 26, 2026
040eb3c
refactor: rename minAmountOut to amountWithFee in PriorityWithdrawalQ…
pankajjagtapp Feb 26, 2026
17a5375
fix: return 0 for claimable amount if request is not finalized or not…
pankajjagtapp Feb 26, 2026
3b6b81b
feat: enhance liquidity withdrawal logic to account for priority queu…
pankajjagtapp Feb 26, 2026
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
9 changes: 4 additions & 5 deletions script/upgrades/priority-queue/deployPriorityQueue.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract DeployPriorityQueue is Script, Utils {
console2.log("");

console2.log("To compute exact addresses, run with mainnet fork:");
console2.log(" forge script script/upgrades/priority-queue/deployPriorityQueue.s.sol:DeployPriorityQueue --sig 'dryRunWithFork()' --fork-url <RPC_URL>");
console2.log(" forge script script/upgrades/priority-queue/deployPriorityQueue.s.sol:DeployPriorityQueue --sig 'dryRun()' --fork-url <RPC_URL>");
}

function run() public {
Expand Down Expand Up @@ -125,9 +125,8 @@ contract DeployPriorityQueue is Script, Utils {
console2.log("EtherFiRedemptionManager Implementation:", etherFiRedemptionManagerImpl);
console2.log("");
console2.log("NEXT STEPS:");
console2.log("1. Initialize PriorityWithdrawalQueue proxy");
console2.log("2. Upgrade LiquidityPool proxy to new implementation");
console2.log("3. Upgrade EtherFiRedemptionManager proxy to new implementation");
console2.log("4. Grant necessary roles in RoleRegistry");
console2.log("1. Upgrade LiquidityPool proxy to new implementation");
console2.log("2. Upgrade EtherFiRedemptionManager proxy to new implementation");
console2.log("3. Grant necessary roles in RoleRegistry");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ contract PriorityQueueTransactions is Script, Utils {
console2.log("Transaction Details:");
console2.log("--------------------");
console2.log("1. Upgrade LiquidityPool to:", liquidityPoolImpl);
console2.log("2. Grant PRIORITY_WITHDRAWAL_QUEUE_ADMIN_ROLE to:", ETHERFI_OPERATING_ADMIN);
console2.log("3. Grant PRIORITY_WITHDRAWAL_QUEUE_WHITELIST_MANAGER_ROLE to:", ETHERFI_OPERATING_ADMIN);
console2.log("4. Grant PRIORITY_WITHDRAWAL_QUEUE_REQUEST_MANAGER_ROLE to:", ADMIN_EOA);
console2.log("2. Upgrade EtherFiRedemptionManager to:", etherFiRedemptionManagerImpl);
console2.log("3. Grant PRIORITY_WITHDRAWAL_QUEUE_ADMIN_ROLE to:", ETHERFI_OPERATING_ADMIN);
console2.log("4. Grant PRIORITY_WITHDRAWAL_QUEUE_WHITELIST_MANAGER_ROLE to:", ETHERFI_OPERATING_ADMIN);
console2.log("5. Grant PRIORITY_WITHDRAWAL_QUEUE_REQUEST_MANAGER_ROLE to:", ADMIN_EOA);
console2.log("================================================");
console2.log("");

Expand Down
18 changes: 15 additions & 3 deletions script/utils/utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,24 @@ contract Utils is Script, Deployed {
uint256 constant MIN_DELAY_TIMELOCK = 259200; // 72 hours

function deploy(string memory contractName, bytes memory constructorArgs, bytes memory bytecode, bytes32 salt, bool logging, ICreate2Factory factory) internal returns (address) {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address predictedAddress = factory.computeAddress(salt, bytecode);
address deployedAddress = factory.deploy(bytecode, salt);
require(deployedAddress == predictedAddress, "Deployment address mismatch");
bool alreadyDeployed = predictedAddress.code.length > 0;
address deployedAddress = predictedAddress;

if (alreadyDeployed) {
// Idempotent path: script reruns should reuse the existing deployment.
require(factory.verify(predictedAddress, salt, bytecode), "Existing code at predicted address does not match");
} else {
deployedAddress = factory.deploy(bytecode, salt);
require(deployedAddress == predictedAddress, "Deployment address mismatch");
}

if (logging) {
if (alreadyDeployed) {
console.log("\n=== Deployment Skipped (Already Deployed) ===");
console.log("Contract:", contractName);
console.log("Address:", predictedAddress);
}

// 5. Create JSON deployment log (exact same format)
string memory deployLog = string.concat(
Expand Down
13 changes: 11 additions & 2 deletions src/LiquidityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "./interfaces/ILiquifier.sol";
import "./interfaces/IEtherFiNode.sol";
import "./interfaces/IEtherFiNodesManager.sol";
import "./interfaces/IRoleRegistry.sol";
import "./interfaces/IPriorityWithdrawalQueue.sol";

contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, ILiquidityPool {
using SafeERC20 for IERC20;
Expand Down Expand Up @@ -218,14 +219,22 @@ contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, IL
msg.sender == priorityWithdrawalQueue,
"Incorrect Caller"
);
if (totalValueInLp < _amount || (msg.sender == address(withdrawRequestNFT) && ethAmountLockedForWithdrawal < _amount) || eETH.balanceOf(msg.sender) < _amount) revert InsufficientLiquidity();
if (totalValueInLp < _amount || eETH.balanceOf(msg.sender) < _amount) revert InsufficientLiquidity();
if (_amount > type(uint128).max || _amount == 0 || share == 0) revert InvalidAmount();

totalValueInLp -= uint128(_amount);
if (msg.sender == priorityWithdrawalQueue && (totalValueInLp - ethAmountLockedForWithdrawal < _amount)) revert InsufficientLiquidity();
Comment thread
pankajjagtapp marked this conversation as resolved.

if (msg.sender == address(withdrawRequestNFT)) {
if (ethAmountLockedForWithdrawal < _amount) revert InsufficientLiquidity();
if (priorityWithdrawalQueue != address(0)) {
uint128 priorityLocked = uint128(IPriorityWithdrawalQueue(priorityWithdrawalQueue).ethAmountLockedForPriorityWithdrawal());
if (totalValueInLp - priorityLocked < _amount) revert InsufficientLiquidity();
Comment thread
pankajjagtapp marked this conversation as resolved.
}
ethAmountLockedForWithdrawal -= uint128(_amount);
}

totalValueInLp -= uint128(_amount);

eETH.burnShares(msg.sender, share);

_sendFund(_recipient, _amount);
Expand Down
Loading