Overview

Balancer DAO received ~3M ARB tokens during Arbitrum’s airdrop. Balancer sees itself as a potential top-tier DEX on Arbitrum and thus wants to allocate 1M ARB to a voting incentive matching program to enable growth.

This is a review of the AuraArbBalGrant smart contract that the Balancer Maxis have requested. This review will cover the contract's effectiveness, safety, and formatting/syntax.

Repo

aura-contracts/AuraArbBalGrant.sol at c9dfeb72ce5b5823845126fcf9a6f5704697e0d6 · aurafinance/aura-contracts

Contract Scope

Desired Features:

Contract Review

All functionality in AuraArbBalGrant matches the desired features and expectations listed above. While this is the case, we have discovered some areas of improvement ranging from 1 - least important to 3 - most important. Below is a breakdown of the findings:

Priority Count
1 - low 4
2 - medium 4
3 - high 0

Low Priority

Events

Per Tritium’s comment in the forum it would be helpful to add events for monitoring withdraws and the start and end times of the cooldown periods. These would be added within withdrawBalances and startCooldown.

Variable Naming

State variables for the various tokens are public but use the naming convention for constants. The inverse is also true. An example of how to improve this for public and constant variables is below.

// These occur in most state variables throughout the contract
IERC20 public immutable arbToken;

uint256 public constant COOLDOWN_PERIOD = 60 days;

Another finding related to variable naming is naming decisions for the various authorized multisigs. In order to improve readability it is suggested for balancer to be renamed to balancerMultisig or something similar. The same logic should be applied to project as it can be confusing to readers what that means exactly.

Variable Grouping

State variables are not grouped in an intuitive manner. It is recommended that variables be grouped next to other variables that are related to one another. An example of how this could be done in AuraArbBalGrant is below:

IERC20 public immutable ARB;
IERC20 public immutable BAL;
IERC20 public AURA;
IERC20 public BPT;

address public immutable project;
address public immutable balancer;

IBalancerVault public immutable BALANCER_VAULT;
bytes32 public POOL_ID;