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
params
Control: Arbitrary.
Constraints: None.
Impact: Value of the pool parameters.
reserveAmount
Control: Arbitrary.
Constraints: Nonzero.
Impact: Amount of reserve tokens to seed the pool.
bondAmount
Control: Arbitrary.
Constraints: Nonzero.
Impact: Amount of bond tokens to mint.
leverageAmount
Control: Arbitrary.
Constraints: Nonzero.
Impact: Amount of leverage tokens to mint.
bondName
Control: None.
Constraints: None.
Impact: Name of the bond token.
bondSymbol
Control: None.
Constraints: None.
Impact: Symbol of the bond token.
leverageName
Control: None.
Constraints: None.
Impact: Name of the leverage token.
leverageSymbol
Control: 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_ROLE
of BondToken and LeverageToken to the pool.Grant
DISTRIBUTOR_ROLE
of 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.