Contract that holds all protocol funds
-
onlyController()
-
onlyFarmer()
-
constructor(address _addressBook) (public)
-
transferToPool(address _asset, address _user, uint256 _amount) (public)
-
transferToUser(address _asset, address _user, uint256 _amount) (public)
-
getStoredBalance(address _asset) (external)
-
batchTransferToPool(address[] _asset, address[] _user, uint256[] _amount) (external)
-
batchTransferToUser(address[] _asset, address[] _user, uint256[] _amount) (external)
-
farm(address _asset, address _receiver, uint256 _amount) (external)
-
setFarmer(address _farmer) (external)
-
TransferToPool(address asset, address user, uint256 amount)
-
TransferToUser(address asset, address user, uint256 amount)
-
FarmerUpdated(address oldAddress, address newAddress)
-
AssetFarmed(address asset, address receiver, uint256 amount)
check if the sender is the Controller module
check if the sender is the farmer address
contructor
_addressBook
: AddressBook module
transfers an asset from a user to the pool
-
_asset
: address of the asset to transfer -
_user
: address of the user to transfer assets from -
_amount
: amount of the token to transfer from _user
transfers an asset from the pool to a user
-
_asset
: address of the asset to transfer -
_user
: address of the user to transfer assets to -
_amount
: amount of the token to transfer to _user
get the stored balance of an asset
_asset
: asset address
- asset balance
transfers multiple assets from users to the pool
-
_asset
: addresses of the assets to transfer -
_user
: addresses of the users to transfer assets to -
_amount
: amount of each token to transfer to pool
transfers multiple assets from the pool to users
-
_asset
: addresses of the assets to transfer -
_user
: addresses of the users to transfer assets to -
_amount
: amount of each token to transfer to _user
function to collect the excess balance of a particular asset
can only be called by the farmer address. Do not farm otokens.
-
_asset
: asset address -
_receiver
: receiver address -
_amount
: amount to remove from pool
function to set farmer address
can only be called by MarginPool owner
_farmer
: farmer address
emits an event when marginpool receive funds from controller
emits an event when marginpool transfer funds to controller
emit event after updating the farmer address
emit event when an asset gets harvested from the pool