Skip to content

Commit

Permalink
added expected fee change
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitAudit committed Jan 25, 2024
1 parent d2ae701 commit 33dd40d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ cache
.env
contracts/proxy_test
scripts/proxy_deploy.ts
contracts/demo_contracts/delegate_test
contracts/demo_contracts/delegate_test
test/delegate_test.ts
3 changes: 2 additions & 1 deletion contracts/nexus_bridge/NexusBridgeDAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ abstract contract NexusBridgeDAO is NexusBaseBridge {
validatorCount -= 1;
}

function redeemRewards(address reward_account) external onlyDAO validNexusFee(NexusFeePercentage){
function redeemRewards(address reward_account,uint256 expectedFee) external onlyDAO validNexusFee(NexusFeePercentage){
if(expectedFee!=NexusFeePercentage) revert IncorrectNexusFee();
uint256 total_rewards = getRewards();
if(total_rewards > VALIDATOR_DEPOSIT) revert WaitingForValidatorExits();
uint256 _nexus_rewards = (NexusFeePercentage*total_rewards)/BASIS_POINT;
Expand Down
7 changes: 3 additions & 4 deletions contracts/nexus_bridge/nexusLibrary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ contract NexusLibrary {
slashedAmount;
}

function redeemRewards(
address reward_account
) external onlyDAO validNexusFee(getVariable(NEXUS_FEE_PERCENTAGE_SLOT)) {
function redeemRewards(address reward_account,uint256 expectedFee) external onlyDAO validNexusFee(getVariable(NEXUS_FEE_PERCENTAGE_SLOT)) {
uint256 NexusFeePercentage = getVariable(NEXUS_FEE_PERCENTAGE_SLOT);
if(expectedFee!=NexusFeePercentage) revert IncorrectNexusFee();
uint256 total_rewards = getRewards();
if (total_rewards > VALIDATOR_DEPOSIT)
revert WaitingForValidatorExits();
uint256 NexusFeePercentage = getVariable(NEXUS_FEE_PERCENTAGE_SLOT);
uint256 _nexus_rewards = (NexusFeePercentage * total_rewards) /
BASIS_POINT;
(bool nexus_success, bytes memory nexus_data) = NEXUS_FEE_ADDRESS.call{
Expand Down

0 comments on commit 33dd40d

Please sign in to comment.