FarmingFactory
Link to FarmingFactory source code on Shibarium
Farming pool Factory contract. Executes the functionality of deploying new farming pools (for Shibaswap liquidity), as well as their settings and management.
Variables
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); - admin role identifier.
address public esKnine; - esKNINE token address.
address public router; - UniswapV2Router02 (ShibaSwap) contract address. 
address public wbone; - wrapped native coin address.
address public farmingImplementation; - contract storing the farming implementation code (FarmingInstanceV2) address.
ZapFees public zapFees; - ZapFees struct object.
struct ZapFees {
uint8 entry; - zapping entry fee.
uint8 exit;  - zapping exit fee.
}
Events
event CreateFarming(
address proxyDeployed, - deployed farming pool (FarmingProxyV2) address.
address currentImplementation, - current implementation (FarmingInstanceV2) address.
address token0, -  token0 address from the liquidity pool.
address token1, - token1 address from the liquidity pool.
); - upon createFarming method call.
event NativeReceived(uint256 amount); - upon receiving the native coin.
Admin Functions
LiquidityPool 
struct LiquidityPool {
address token0;
address token1;
}Struct describing the liquidity pool used for farming pool creation.
RewardPool 
struct RewardPool {
address rewardToken;
uint64startTime;
uint64endTime;
uint256 rps;
}Struct describing the reward pool:
- Reward token address (for the main reward pool this is esKNINE), 
- Reward distribution start time and end time, 
- Reward per second. 
createFarming
function createFarming(
LiquidityPool memory liq,
RewardPool calldata rew
) externalCreates new farming pool based on the provided liquidity and reward pools info.
addBonusPool
function addBonusPool(
address farming,
RewardPool calldata rew
) externalAdds rew bonus reward pool  to the farming farming pool.
initialize
function initialize(
address _admin,
address _esKnine,
address _router,
address _wbone
) publicInitializer function, not called after initialization.
Default Admin Functions
setFarmingImplementation
function setFarmingImplementation(address instance) externalSet the farming logic implementation contract address.
setRouter
function setRouter(address instance) externalSet the address of UniswapV2Router02 (ShibaSwap).
setWrappedBone
function setWrappedBone(address instance) externalSet the wrapped native coin address.
setEsKnine
function setEsKnine(address instance) externalSet the esKnine token address.
setFees
function setFees(ZapFees calldata fees) externalReplace zapping and unzapping fee.
stopBonusPool
function stopBonusPool(
address farming,
uint256 halfId
) externalStop the rewards distribution of a specific bonus pool at a specific farming pool.
stopFarming
function stopFarming(
address farming - farming address to stop
) externalStop all rewards distribution (main reward pool and each bonus reward pool) for a specific farming.
changeFarmingRPS
function changeFarmingRPS(address farming,
uint256 value
) externalChange the RPS value of the main reward pool at the specified farming farming pool.
recovery
function recovery(address token) externalWithdraw transferred tokens from the contract.
View Functions
getAllCreatedPools
function getAllCreatedPools() external view returns (address[] memory)Get a list of all farming pools ever deployed using this factory.
Last updated