This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.8.4; | |
contract PmknFarm { | |
function stake() public payable { | |
require( | |
msg.value > 0, | |
"You cannot stake zero tokens" | |
); | |
if(isStaking[msg.sender] == true){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.8.4; | |
function unstake(uint256 amount) public { | |
require( | |
isStaking[msg.sender] = true && | |
stakingBalance[msg.sender] >= amount, | |
"Nothing to unstake" | |
); | |
uint256 yieldTransfer = calculateYieldTotal(msg.sender); | |
startTime[msg.sender] = block.timestamp; // bug fix |