FarmingFactory

link to FarmingFactory source code (will update when protocol goes live)

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
) external

Creates new farming pool based on the provided liquidity and reward pools info.

Only for DEFAULT_ADMIN_ROLE or ADMIN_ROLE role

addBonusPool

function addBonusPool(
address farming,
RewardPool calldata rew
) external

Adds rew bonus reward pool to the farming farming pool.

Only for DEFAULT_ADMIN_ROLE or ADMIN_ROLE role

initialize

function initialize(
address _admin,
address _esKnine,
address _router,
address _wbone
) public

Initializer function, not called after initialization.

Only for the initializer role

Default Admin Functions

setFarmingImplementation

function setFarmingImplementation(address instance) external

Set the farming logic implementation contract address.

setRouter

function setRouter(address instance) external

Set the address of UniswapV2Router02 (ShibaSwap).

setWrappedBone

function setWrappedBone(address instance) external

Set the wrapped native coin address.

setEsKnine

function setEsKnine(address instance) external

Set the esKnine token address.

setFees

function setFees(ZapFees calldata fees) external

Replace zapping and unzapping fee.

stopBonusPool

function stopBonusPool(
address farming,
uint256 halfId
) external

Stop the rewards distribution of a specific bonus pool at a specific farming pool.

stopFarming

function stopFarming(
address farming - farming address to stop
) external

Stop all rewards distribution (main reward pool and each bonus reward pool) for a specific farming.

changeFarmingRPS

function changeFarmingRPS(address farming,
uint256 value
) external

Change the RPS value of the main reward pool at the specified farming farming pool.

recovery

function recovery(address token) external

Withdraw transferred tokens from the contract.

If the output is a wrapped native coin, it will unwrap and return the native coin itself

View Functions

getAllCreatedPools

function getAllCreatedPools() external view returns (address[] memory)

Get a list of all farming pools ever deployed using this factory.

Last updated