Unilock: Campaigns Redefined.

Case Scenarios:

End Goal:

Voting System:

Your funds are SAFU :

unilockFactory.sol: Line 110.uniLock(campaign_address).initilaize(_data,_token,msg.sender,_pool_rate,_lock_duration,_uniswap_rate);unilock.sol: Line 432.function initilaize(uint[] calldata _data,address _token,address _owner_Address,uint _pool_rate,uint _lock_duration,uint _uniswap_rate) external returns (uint)
uniLock.sol:Line 490:function failed() public view returns(bool){
if((block.timestamp >= end_date) && (softCap > collected)){
return true;

}
return false;
}
uniLock.sol:Line 510:function isLive() public view returns(bool){
if((block.timestamp < start_date)) return false;
if((block.timestamp >= end_date)) return false;
if((collected >= hardCap)) return false;
return true;
}
unilock.sol:Line 465:function uniLOCK() public returns(uint){
require(locked ==0,'Liquidity is already locked');
require(!isLive(),'Presale is still live');
require(!failed(),"Presale failed , can't lock liquidity");
require(softCap <= collected,"didn't reach soft cap");
require(addLiquidity(),'error adding liquidity to uniswap');
locked = 1;
IERC20(address(token)).transfer(address(0x000000000000000000000000000000000000dEaD),IERC20(address(token)).balanceOf(address(this)));
unlock_date = (block.timestamp).add(lock_duration);
return 1;
}

function addLiquidity() internal returns(bool){
uint campaign_amount = collected.mul(uint(IUniLockFactory(factory).fee())).div(1000);
IERC20(address(token)).approve(address(IUniLockFactory(factory).uni_router()),(hardCap.mul(rate)).div(1e18));
if(uniswap_rate > 0){
IUniswapV2Router02(address(IUniLockFactory(factory).uni_router())).addLiquidityETH{value : campaign_amount.mul(uniswap_rate).div(1000)}(address(token),((campaign_amount.mul(uniswap_rate).div(1000)).mul(pool_rate)).div(1e18),0,0,address(this),block.timestamp + 100000000);
}
payable(IUniLockFactory(factory).toFee()).transfer(collected.sub(campaign_amount));
payable(owner).transfer(campaign_amount.sub(campaign_amount.mul(uniswap_rate).div(1000)));
return true;
}
uniLock.sol:Line 456:function unlock(address _LPT,uint _amount) public returns (bool){
require(locked == 1 || failed(),'liquidity is not yet locked');
require(block.timestamp >= unlock_date ,"can't receive LP tokens");
require(msg.sender == owner,'You are not the owner');
IERC20(address(_LPT)).transfer(msg.sender,_amount);
}
uniLock.sol:Line 499:function withdrawFunds() public returns(uint){
require(failed(),"campaign didn't fail");
require(participant[msg.sender] >0 ,"You didn't participate in the campaign");
uint withdrawAmount = participant[msg.sender].mul(uint(IUniLockFactory(factory).fee())).div(1000);
(msg.sender).transfer(withdrawAmount);
payable(IUniLockFactory(factory).toFee()).transfer(participant[msg.sender].sub(withdrawAmount));
participant[msg.sender] = 0;
}

Roadmap:

Sources:

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What Makes Ethereum a “Deflationary Asset”?

AnySwap Integrates with Moonriver!

Will Shiba Inu be in the top 3 Crypto coins?

StakingCabin Connects with Wanchain Network

OUR VISION: STEAMBULK AIMS TO EXTEND OUR BUSINESS TO ENTIRE CRYPTOCURRENCY INDUSTRY CHAIN IN THE…

DeFi: Blockchain’s Latest Revolution

2022 06 19 YOLO Markets Weekly Recap

[Strategy Paper] Overview of Stablecoin Investments

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
unilock

unilock

More from Medium

CPAD announces technical partnership with PureFi

Does Charity need a rebrand?

WakeUp protocol: an On-Chain mechanism to Delegate NFTs

An on-chain mechanism to delegate NFTs in a simple and secure way.

Web3 Newsletter — Edition #29