Function: createPool(bytes32 salt)
This function creates a pool with the given salt.
Inputs
salt
Control: Arbitrary.
Constraints: None.
Impact: Salt value for creating a pool contract.
Branches and code coverage
Intended branches
Negative behavior
Function call analysis
this.currentPredepositTotal() -> this.balancerOracleAdapter.getOraclePrice(token, PreDeposit.ETH)
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? If the price from the oracle can be controlled, it may result in incorrect valuation of tokens.
What happens if it reverts, reenters or does other unusual control flow? N/A.
this.currentPredepositTotal() -> IERC20_1(token).balanceOf(address(this))
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? If the amount of a deposited token can be controlled, it may result in incorrect valuation of deposits.
What happens if it reverts, reenters or does other unusual control flow? N/A.
IERC20_1(this.allowedTokens[i]).balanceOf(address(this))
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? If the amount of a deposited token can be controlled, it may result in incorrect approval, reverting the pool creation or not affecting the business logic.
What happens if it reverts, reenters or does other unusual control flow? N/A.
this.balancerOracleAdapter.getOraclePrice(address(tokens[i]), PreDeposit.ETH)
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? If the amount of a deposited token can be controlled, it may result in incorrect valuation of deposits.
What happens if it reverts, reenters or does other unusual control flow? N/A.
IERC20_1(address(tokens[i])).approve(address(this.balancerVault), amounts[i])
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? N/A.
this.balancerManagedPoolFactory.create(balancerPoolParams, balancerPoolSettingsParams, this.owner(), salt)
What is controllable? Weights can be partially controlled as the amount of the token. Salt can be fully controlled by an unprivileged caller.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? The pool-creation logic may fail. This contract is not expected to reenter.
IManagedPool(address(balancerPoolToken)).getPoolId()
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? The contract may join an incorrect pool.
What happens if it reverts, reenters or does other unusual control flow? N/A.
balancerPoolToken.balanceOf(address(this))
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? Amount of reserve tokens may be incorrectly calculated, leading to failure of pool creation or locking of reserve tokens in the PreDeposit contract.
What happens if it reverts, reenters or does other unusual control flow? N/A.
balancerPoolToken.approve(address(this.factory), reserveAmount)
What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? N/A.
this.factory.createPool(this.params, reserveAmount, this.bondAmount, this.leverageAmount, this.bondName, this.bondSymbol, this.leverageName, this.leverageSymbol, True)
What is controllable? Bond and leverage amount can be controlled by the owner.
If the return value is controllable, how is it used and how can it go wrong? None.
What happens if it reverts, reenters or does other unusual control flow? N/A.