Platform: Code4rena
Start Date: 26/09/2022
Pot Size: $50,000 USDC
Total HM: 13
Participants: 113
Period: 5 days
Judge: 0xean
Total Solo HM: 6
Id: 166
League: ETH
Rank: 12/113
Findings: 1
Award: $593.27
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: berndartmueller
Also found by: 0xbepresent, 8olidity, tonisives
https://github.com/code-423n4/2022-09-quickswap/blob/main/src/core/contracts/AlgebraFactory.sol#L91
Improper vaultAddress Settings can cause financial damage
// src/core/contracts/AlgebraFactory.sol function setVaultAddress(address _vaultAddress) external override onlyOwner { require(vaultAddress != _vaultAddress); emit VaultAddress(_vaultAddress); vaultAddress = _vaultAddress; }
In the pool, _payCommunityFee() is called to transfer the processing fee to the Vault address.
if (communityFee > 0) { _payCommunityFee(zeroToOne ? token0 : token1, communityFee); }
If Vault is 0 address, then communityFee will be lost
If vault is the address of token0 or token1, then balanceToken0(),balanceToken1() in the pool will be affected.
function _payCommunityFee(address token, uint256 amount) private { address vault = IAlgebraFactory(factory).vaultAddress(); TransferHelper.safeTransfer(token, vault, amount); }
vscode
check vault address
#0 - IliaAzhel
2022-10-04T13:41:29Z
duplicate of #210