You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Severity: Informational Difficulty: High Type: Data Validation Target:ve-silo/contracts/guages/ethereum/LiquidityGaugeFactory.sol, ve-silo/contracts/guages/l2-common/ChildChainGaugeFactory.sol
Description
The incorrect parameter name in the create function of the LiquidityGaugeFactory contract can lead to the wrong configuration of the contract, which will require re-deployment of the contract to correct.
The SiloLiquidityGauge contract has been refactored to use an ERC20 token receiver hook instead of using an ERC20BalanceHandler to automate updates of the user checkpoints and liquidity along with the transfer of the Silo liquidity tokens. However, the factory contracts for the liquidity gauge contracts have not been updated to reflect this change. Specifically, the create function of the LiquidityGaugeFactory contract uses the parameter name erc20BalancesHandler for the hook_receiver parameter:
The wrong parameter name can cause confusion and result in the wrong initialization of the liquidity gauge contracts created with the factory contract. The wrong initialization can not be corrected without creating another gauge for the same pool.
The issue also affects the following contracts:
The create function of the ILiquidityGaugeFactory interface contract
The initialize function of the ISiloLiquidityGauge interface contract
The create function of the ChildChainGaugeFactory contract
The create function of the IChildChainGaugeFactory interface contract
The initialize function of the ISiloChildChainGauge interface contract
Recommendations
Short term, rename the erc20BalanceHandler parameter in all the functions to the hook_receiver parameter.
Long term, review the whole codebase during refactors to ensure correct refactoring of all the contracts interacting with each other.
The text was updated successfully, but these errors were encountered:
tuturu-tech
changed the title
Incorrect parameter name in the create function could lead to initialization mistakes
Incorrect parameter name in the create function could lead to initialization mistakes
Oct 18, 2023
Severity: Informational
Difficulty: High
Type: Data Validation
Target:
ve-silo/contracts/guages/ethereum/LiquidityGaugeFactory.sol
,ve-silo/contracts/guages/l2-common/ChildChainGaugeFactory.sol
Description
The incorrect parameter name in the
create
function of theLiquidityGaugeFactory
contract can lead to the wrong configuration of the contract, which will require re-deployment of the contract to correct.The
SiloLiquidityGauge
contract has been refactored to use an ERC20 token receiver hook instead of using anERC20BalanceHandler
to automate updates of the user checkpoints and liquidity along with the transfer of the Silo liquidity tokens. However, the factory contracts for the liquidity gauge contracts have not been updated to reflect this change. Specifically, thecreate
function of theLiquidityGaugeFactory
contract uses the parameter nameerc20BalancesHandler
for thehook_receiver
parameter:The wrong parameter name can cause confusion and result in the wrong initialization of the liquidity gauge contracts created with the factory contract. The wrong initialization can not be corrected without creating another gauge for the same pool.
The issue also affects the following contracts:
create
function of theILiquidityGaugeFactory
interface contractinitialize
function of theISiloLiquidityGauge
interface contractcreate
function of theChildChainGaugeFactory
contractcreate
function of theIChildChainGaugeFactory
interface contractinitialize
function of theISiloChildChainGauge
interface contractRecommendations
Short term, rename the
erc20BalanceHandler
parameter in all the functions to thehook_receiver
parameter.Long term, review the whole codebase during refactors to ensure correct refactoring of all the contracts interacting with each other.
The text was updated successfully, but these errors were encountered: