balancer / balancer-core

Balancer on the EVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parameters order of single assets functions are confusing

montyly opened this issue · comments

Severity: Code quality

Description

The parameters order of several similar functions is not the same:

  • joinswapExternAmountIn(address tokenIn, uint tokenAmountIn, uint minPoolAmountOut)
  • joinswapPoolAmountOut(uint poolAmountOut, address tokenIn, uint maxAmountIn)
  • exitswapPoolAmountIn(uint poolAmountIn, address tokenOut, uint minAmountOut)
  • exitswapExternAmountOut(address tokenOut, uint tokenAmountOut, uint maxPoolAmountIn)

For example, the address of the token is sometimes the first argument, and sometimes the second one. This inconsistency might create confusion for the users.

Recommendation

Short term, follow the same order of parameters for similar functions.

Long term, consider using Slither's printer capacity to review the contract's API.