Skip to content

Commit

Permalink
Update Staking.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
arbazkiraak authored Jan 30, 2022
1 parent 58a3e9c commit 82573d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/vulnerable/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract Staking {
event Unstaked(address indexed user, uint256 amount);

constructor(address _token, uint256 _reward) payable {
require(msg.value >= 100, "100 ETH required");
require(msg.value >= 100, "Staking: Minimum ETH required");
owner = msg.sender;
token = IERC223(_token);
reward = _reward;
Expand All @@ -35,7 +35,7 @@ contract Staking {

function unstake(uint256 amount) public {
uint256 userBal = balances[msg.sender];
require(userBal >= amount, "Staking: user doesn't have enough deposited funds");
require(userBal >= amount, "Staking: not enough deposited funds");
uint256 stakedDiff = block.timestamp - stakeDuration[msg.sender];
require(stakedDiff >= 604800, "Staking: wait till 7 days elapsed");
if (!rewardClaimed[msg.sender]) {
Expand All @@ -52,7 +52,7 @@ contract Staking {
uint256 _amount,
bytes memory _data
) public {
require(msg.sender == address(token), "Staking: Call only allowed from ERC223 token");
require(msg.sender == address(token), "Staking: call only allowed from ERC223 token");
require(_amount > 0, "Staking: Non-zero");
_stake(_from, _amount);
}
Expand Down

0 comments on commit 82573d3

Please sign in to comment.