balancer / balancer-core

Balancer on the EVM
GNU General Public License v3.0
333 stars 168 forks source link

Parameters order of single assets functions are confusing #195

Closed montyly closed 4 years ago

montyly commented 4 years ago

Severity: Code quality

Description

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

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.

mikemcdonald commented 4 years ago

Fixed

https://github.com/balancer-labs/balancer-core/blob/6e12aef75749633165b96689eb34e96692eda872/contracts/BPool.sol#L582

https://github.com/balancer-labs/balancer-core/blob/6e12aef75749633165b96689eb34e96692eda872/contracts/BPool.sol#L616