Function: createPool(PoolParams params, uint256 reserveAmount, uint256 bondAmount, uint256 leverageAmount, string bondName, string bondSymbol, string leverageName, string leverageSymbol)
This function creates a new pool with the given parameters.
Inputs
paramsControl: Arbitrary.
Constraints: None.
Impact: Value of the pool parameters.
reserveAmountControl: Arbitrary.
Constraints: Nonzero.
Impact: Amount of reserve tokens to seed the pool.
bondAmountControl: Arbitrary.
Constraints: Nonzero.
Impact: Amount of bond tokens to mint.
leverageAmountControl: Arbitrary.
Constraints: Nonzero.
Impact: Amount of leverage tokens to mint.
bondNameControl: None.
Constraints: None.
Impact: Name of the bond token.
bondSymbolControl: None.
Constraints: None.
Impact: Symbol of the bond token.
leverageNameControl: None.
Constraints: None.
Impact: Name of the leverage token.
leverageSymbolControl: None.
Constraints: None.
Impact: Symbol of the leverage token.
Branches and code coverage
Intended branches
Deploy BondToken and LeverageToken.
Deploy the pool contract as a BeaconProxy.
Register the pool with distributor.
Grant
MINTER_ROLEof BondToken and LeverageToken to the pool.Grant
DISTRIBUTOR_ROLEof BondToken to the pool.Set token governance.
Revoke governance from factory.
Send seed reserves to the pool.
Mint seed amounts.
Negative behavior
Revert if the caller does not have the
GOV_ROLE.Revert if the reserve amount is zero.
Revert if the bond amount is zero.
Revert if the leverage amount is zero.
Revert if the contract is paused.