Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 19, 2023
1 parent f5a6576 commit 5e56ffd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions omnichain/staking/contracts/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ contract Staking is ERC20, zContract {
} else {
(, beneficiary) = abi.decode(message, (uint8, address));
}
setBeneficiary(staker, beneficiary);
beneficiaries[staker] = beneficiary;
} else if (action == 4) {
if (chainID == 18332) {
withdrawAddress = bytesToBech32Bytes(message, 1);
} else {
withdrawAddress = context.origin;
}
setWithdraw(staker, withdrawAddress);
withdraw[staker] = withdrawAddress;
} else {
revert UnknownAction();
}
Expand All @@ -100,14 +100,6 @@ contract Staking is ERC20, zContract {
updateRewards(staker);
}

function setBeneficiary(address staker, address beneficiaryAddress) public {
beneficiaries[staker] = beneficiaryAddress;
}

function setWithdraw(address staker, bytes memory withdrawAddress) public {
withdraw[staker] = withdrawAddress;
}

function updateRewards(address staker) public {
uint256 timeDifference = block.timestamp - lastStakeTime[staker];
uint256 rewardAmount = timeDifference * stakes[staker] * rewardRate;
Expand Down

0 comments on commit 5e56ffd

Please sign in to comment.