ELP Locking Mechanism
This page provide information about Early Liquidity Provider (ELP) locking mechanism.
The ELP are locked for 18 months with penalties applied should they choose to withdraw during the early stage of the development. For more details of the penalties, please click here. Source code: This code can be found in the ELP Distribute Contract. Below is the reference of the locking mechanism.
function checkEntitledNature(address _address) public view returns(uint256,uint256) {
require(hasDeposit[_address] == true, "ELPDistribute: User has no deposit");
Deposit storage userDeposit = deposits[_address];
uint256 amountToWithdraw = 0;
//30.5 days = 2635200
//4hours = 14400 Testing
uint32 currentMonth = safe32((now.sub(startTime)).div(2635200));
// check the no of month of between current time and last withdrawal
uint32 lastWithdrawMonthFromCurrentMonth = safe32((now.sub(userDeposit.lastWithdrawTime)).div(2635200));
// check the no of month of between current time and last withdrawal
uint32 lastWithdrawMonthFromStartTime = safe32(uint256(userDeposit.lastWithdrawTime).sub(startTime).div(2635200));
// check if no withdrawal done since startTime;
if(userDeposit.lastWithdrawTime == startTime){
amountToWithdraw = amountToWithdraw.add(userDeposit.totalDeposit.div(50));
}
//check if the lastWithdraw month
if(currentMonth >= 1 && lastWithdrawMonthFromStartTime <1){
amountToWithdraw = amountToWithdraw.add((userDeposit.totalDeposit.div(50)));
}
uint32 month = 0;
if(currentMonth >= 2 && lastWithdrawMonthFromStartTime <8){
if(currentMonth >= uint32(8)){
month = uint32(uint256(8).sub(uint256(lastWithdrawMonthFromStartTime)));
}else{
month = lastWithdrawMonthFromCurrentMonth;
}
if(lastWithdrawMonthFromStartTime < 1){
month = month - 1;
}
amountToWithdraw = amountToWithdraw.add((userDeposit.totalDeposit.div(25)).mul(month));
}
if(currentMonth >= 9 && lastWithdrawMonthFromStartTime <14){
if(currentMonth > uint32(14)){
month = uint32(uint256(14).sub(uint256(lastWithdrawMonthFromStartTime)));
}else{
month = lastWithdrawMonthFromCurrentMonth;
}
if(lastWithdrawMonthFromStartTime < 8){
month = month - (8 - lastWithdrawMonthFromStartTime);
}
amountToWithdraw = amountToWithdraw.add((userDeposit.totalDeposit.mul(3).div(50)).mul(month));
}
if(currentMonth >= 15 && lastWithdrawMonthFromStartTime <18){
if(currentMonth > uint32(18)){
month = uint32(uint256(18).sub(uint256(lastWithdrawMonthFromStartTime)));
}else{
month = lastWithdrawMonthFromCurrentMonth;
}
if(lastWithdrawMonthFromStartTime < 14){
month = month - (14 - lastWithdrawMonthFromStartTime);
}
amountToWithdraw = amountToWithdraw.add((userDeposit.totalDeposit.mul(2).div(25)).mul(month));
}
uint256 amountBeforePenalty = amountToWithdraw;
//Penalty
if(currentMonth <= 6){
amountToWithdraw = amountToWithdraw.div(2);
amountToWithdraw = amountToWithdraw.div(2);
} else if(currentMonth <= 12 && currentMonth > 6 ){
amountToWithdraw = amountToWithdraw.mul(3).div(4);
amountToWithdraw = amountToWithdraw.mul(3).div(4);
}
return (amountToWithdraw,amountBeforePenalty);
}
Copy link