Last active
May 8, 2021 04:41
-
-
Save percybolmer/d610d63b8f6690580c2174b127a55e33 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* @notice | |
* removeStake removes a stake from the stakes mapping and returns the amount to the owner | |
*/ | |
function removeStake(uint256 _stake) public { | |
require(stakes[msg.sender] >= _stake, "Cannot withdraw more than you have staked"); | |
// Remove by subtracting the money unstaked | |
stakes[msg.sender] = stakes[msg.sender] - _stake; | |
// Return staked tokens to user | |
_mint(msg.sender, _stake); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment