BabController
Interface: IBabController.sol​

Functions

The following functions can be called by any user or public roles.

CreateGarden

Public: Anyone can call this function.
This function creates a new garden and adds it to the Babylon controller.
1
function createGarden(
2
address _reserveAsset,
3
string memory _name,
4
string memory _symbol,
5
string memory _tokenURI,
6
uint256 _seed,
7
uint256[] calldata _gardenParams,
8
uint256 _initialContribution,
9
bool[] memory _publicGardenStrategistsStewards,
10
uint256[] memory _profitSharing
11
) external payable returns (address);
Copied!
Creator must have called ERC-20 approve with the reserve asset and initial contribution on the controller address.
Parameter
Description
address _reserveAsset
Address of the reserve asset. WETH, DAI, AAVE, USDC & WBTC are supported.
string memory _name
Name of the Garden
string memory _symbol
ERC-20 symbol of the Garden token
string memory _tokenURI
Token URI of the membership NFT
uint256 _seed
Seed to retrieve the garden NFT
uint256[] calldata _gardenParams
Array of 12 garden parameters. See below.
uint256 _initialContribution
Amount of reserve asset to be deposited by the creator
bool[] memory _publicGardenStrategistsStewards
Three booleans. First one specifies whether the garden is public or private. Second one specifies whether or not anyone can create strategies. Third one specifies whether or not anyone can vote to approve strategies.
uint256[] memory _profitSharing
Three numbers, 18 decimals each. 1e18 means 100%. The three numbers must add up to 95%. They represent the strategist share of profits, steward share of profits and lp share of profits. You can pass three 0s to use the defaults.
Definition of the garden parameters:
1
​
2
* @param _maxDepositLimit Max deposit limit in reserve asset units
3
* @param _minLiquidityAsset Number that represents min amount of liquidity denominated in reserve asset
4
* @param _depositHardlock Number that represents the time deposits are locked for
5
* an user after the deposit. In seconds.
6
* @param _minContribution Min contribution to the garden in reserve asset units
7
* @param _strategyCooldownPeriod How long after the strategy has been activated, will it be ready
8
* to be executed. In seconds.
9
* @param _minVotesQuorum Percentage of votes needed to activate an strategy (0.01% = 1e14, 1% = 1e16)
10
* @param _minStrategyDuration Min duration of an strategy. In seconds.
11
* @param _maxStrategyDuration Max duration of an strategy. In seconds.
12
* @param _minVoters The minimum amount of voters needed for quorum.
13
* @param _pricePerShareDecayRate Decay rate of price per share. 1e18= 100%
14
* @param _pricePerShareDelta Base slippage for price per share. 1e18= 100%
15
* @param _canMintNftAfter Can mint NFT after being a member for X secs.
16
Copied!

RemoveGarden

Only Owner: Only the garden owner can call this function.
This function removes a garden from the controller. The Garden won't be able to execute any more strategies. Garden can only be removed if there are no active strategies.
1
function removeGarden(address _garden) external;
Copied!
Parameter
Description
address _garden
Address of the garden to remove

ClaimRewards

Public: Anyone can call this function
This function adds a referral amount earned by a depositor and referrer.
1
function claimRewards() external;
Copied!

Privileged Functions

AddReserveAsset

Only Governance or team multisig can call this function
This function adds a new reserve asset to the controller
1
function addReserveAsset(address _reserveAsset) external;
Copied!
Parameter
Description
address _reserveAsset
Address of the reserve asset to add

RemoveReserveAsset

Only Governance or team multisig can call this function
This function removes a reserve asset from the controller
1
function removeReserveAsset(address _reserveAsset) external;
Copied!
Parameter
Description
address _reserveAsset
Address of the reserve asset to remove

UpdateProtocolWantedAsset

Only Governance or team multisig can call this function
This function indicates the heart to purchase an asset to keep it under PCV.
1
function updateProtocolWantedAsset(address _wantedAsset, bool _wanted) external;
Copied!
Parameter
Description
address _wantedAsset
Address of the asset to purchase
bool _wanted
Boolean indicating whether the asset should be purchased by the heart

UpdateGardenAffiliateRate

Only Governance or team multisig can call this function
This function sets a referral program for a specific garden
1
function updateGardenAffiliateRate(address _garden, uint256 _affiliateRate) external;
Copied!
Parameter
Description
address _garden
Address of the garden
uint256 _affiliateRate
Amount of BABL to award for the referral for unit of the reserve asset

AddAffiliateReward

Only Garden contracts can call this function
This function adds a referral amount earned by a depositor and referrer.
1
function addAffiliateReward(
2
address _depositor,
3
address _referrer,
4
uint256 _reserveAmount
5
) external;
Copied!
Parameter
Description
address _depositor
Address of the depositor
address _referrer
Address of the referrer
uint256 _reserveAmount
Amount of the reserve asset that was deposited

EditPriceOracle

Only governance or team multisig can call this function.
This function edits the price oracle of the protocol.
1
function editPriceOracle(address _priceOracle) external;
Copied!
Parameter
Description
address _priceOracle
Address of the new price oracle

EditMardukGate

Only governance can call this function.
This function edits the marduk gate (whitelist checker).
1
function editMardukGate(address _mardukGate) external;
Copied!
Parameter
Description
address _mardukGate
Address of the new marduk gate

EditGardenValuer

Only governance or team multisig can call this function.
This function edits the contract that calculates the price of a garden token.
1
function editGardenValuer(address _gardenValuer) external;
Copied!
Parameter
Description
address _gardenValuer
Address of the new garden valuer

EditTreasury

Only governance can call this function.
This function edits the address of the treasury.
1
function editTreasury(address _newTreasury) external;
Copied!
Parameter
Description
address _newTreasury
Address of the new treasury

EditHeart

Only governance or team multisig can call this function.
This function edits the address of the heart.
1
function editHeart(address _newHeart) external;
Copied!
Parameter
Description
address _newHeart
Address of the new heart

EditRewardsDistributor

Only governance can call this function.
This function edits the address of the reward distributor.
1
function editRewardsDistributor(address _rewardsDistributor) external;
Copied!
Parameter
Description
address _rewardsDistributor
Address of the new reward distributor

EditGardenFactory

Only governance or multisig can call this function.
This function edits the address of the garden factory contract.
1
function editGardenFactory(address _newGardenFactory) external;
Copied!
Parameter
Description
address _newGardenFactory
Address of the new garden factory

EditGardenNFT

Only governance or multisig can call this function.
This function edits the address of the garden NFT template contract.
1
function editGardenNFT(address _newGardenNFT) external;
Copied!
Parameter
Description
address _newGardenNFT
Address of the new garden NFT template contract

EditStrategyNFT

Only governance or multisig can call this function.
This function edits the address of the strategy NFT template contract.
1
function editStrategyNFT(address _newStrategyNFT) external;
Copied!
Parameter
Description
address _newStrategyNFT
Address of the new strategy NFT template contract

EditStrategyFactory

Only governance or multisig can call this function.
This function edits the address of the strategy factory template contract.
1
function editStrategyFactory(address _newStrategyFactory) external;
Copied!
Parameter
Description
address _newStrategyFactory
Address of the new strategy NFT template contract

SetOperation

Only governance or multi-sig can call this function.
This function edits an existing operation in the registry.
1
function setOperation(uint8 _kind, address _operation) external;
Copied!
Parameter
Description
uint8 _kind
Operation kind.
address _operation
Address of the operation contract to set.

SetMasterSwapper

Only governance or multi-sig can call this function.
This function allows governance to edit the protocol default trade integration
1
function setMasterSwapper(address _newMasterSwapper) external;
Copied!

AddKeeper

Only governance or multi-sig can call this function.
This function adds a new valid keeper to the list.
1
function addKeeper(address _keeper) external;
Copied!

AddKeepers

Only governance or multi-sig can call this function.
This function adds an array of new valid keepers to the list.
1
function addKeepers(address[] memory _keepers) external;
Copied!

RemoveKeeper

Only governance or multi-sig can call this function.
This function remove a keeper from the keeper's list.
1
function removeKeeper(address _keeper) external;
Copied!

EnableGardenTokensTransfers

Only governance can call this function.
This function allows transfers of ERC20 gardenTokens.
1
function enableGardenTokensTransfers() external;
Copied!

EditLiquidityReserve

Only governance can call this function.
This function edits the minimum liquidity an asset must have on Uniswap.
1
function editLiquidityReserve(address _reserve, uint256 _minRiskyPairLiquidityEth) external;
Copied!

PatchIntegration

Only governance or multi-sig can call this function.
This function replaces old integration with a new one for all the strategies using this integration.
1
function patchIntegration(address _old, address _new) external;
Copied!

SetPauseGuardian

Only governance or current pause guardian can call this function.
This function
Other privileged internal functions are:
1
​
2
​
3
​
4
​
5
​
6
​
7
​
8
​
9
function setPauseGuardian(address _guardian) external;
10
​
11
function setGlobalPause(bool _state) external returns (bool);
12
​
13
function setSomePause(address[] memory _address, bool _state) external returns (bool);
Copied!

View Functions

The following functions can be called by anyone without a transaction to retrieve information from the controller.
1
function gardenCreationIsOpen() external view returns (bool);
2
​
3
function owner() external view returns (address);
4
​
5
function EMERGENCY_OWNER() external view returns (address);
6
​
7
function guardianGlobalPaused() external view returns (bool);
8
​
9
function guardianPaused(address _address) external view returns (bool);
10
​
11
function isPaused(address _contract) external view returns (bool);
12
​
13
function priceOracle() external view returns (address);
14
​
15
function gardenValuer() external view returns (address);
16
​
17
function heart() external view returns (address);
18
​
19
function gardenNFT() external view returns (address);
20
​
21
function strategyNFT() external view returns (address);
22
​
23
function rewardsDistributor() external view returns (address);
24
​
25
function gardenFactory() external view returns (address);
26
​
27
function treasury() external view returns (address);
28
​
29
function ishtarGate() external view returns (address);
30
​
31
function mardukGate() external view returns (address);
32
​
33
function strategyFactory() external view returns (address);
34
​
35
function masterSwapper() external view returns (address);
36
​
37
function gardenTokensTransfersEnabled() external view returns (bool);
38
​
39
function bablMiningProgramEnabled() external view returns (bool);
40
​
41
function allowPublicGardens() external view returns (bool);
42
​
43
function enabledOperations(uint256 _kind) external view returns (address);
44
​
45
function getGardens() external view returns (address[] memory);
46
​
47
function getReserveAssets() external view returns (address[] memory);
48
​
49
function getOperations() external view returns (address[20] memory);
50
​
51
function isGarden(address _garden) external view returns (bool);
52
​
53
function protocolWantedAssets(address _wantedAsset) external view returns (bool);
54
​
55
function gardenAffiliateRates(address _wantedAsset) external view returns (uint256);
56
​
57
function affiliateRewards(address _user) external view returns (uint256);
58
​
59
function patchedIntegrations(address _integration) external view returns (address);
60
​
61
function isValidReserveAsset(address _reserveAsset) external view returns (bool);
62
​
63
function isValidKeeper(address _keeper) external view returns (bool);
64
​
65
function isSystemContract(address _contractAddress) external view returns (bool);
66
​
67
function protocolPerformanceFee() external view returns (uint256);
68
​
69
function protocolManagementFee() external view returns (uint256);
70
​
71
function minLiquidityPerReserve(address _reserve) external view returns (uint256);
Copied!