Skip to content

Commit

Permalink
refactor: removed dependency on isWhiteListedUser
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGuru7 committed Dec 15, 2023
1 parent b7f8aa1 commit 908e417
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions contracts/Bridge/BaseXVSProxyOFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -283,28 +283,14 @@ abstract contract BaseXVSProxyOFT is Pausable, ExponentialNoError, BaseOFTV2 {
transferredInWindow = chainIdToLast24HourTransferred[dstChainId_];
maxSingleTransactionLimit = chainIdToMaxSingleTransactionLimit[dstChainId_];
maxDailyLimit = chainIdToMaxDailyLimit[dstChainId_];
if (!isWhiteListedUser) {
// Check if the time window has changed (more than 24 hours have passed)
if (currentBlockTimestamp - last24HourWindowStart > 1 days) {
transferredInWindow = amountInUsd;
last24HourWindowStart = currentBlockTimestamp;
} else {
transferredInWindow += amountInUsd;
}
eligibleToSend = (isWhiteListedUser ||
((amountInUsd <= maxSingleTransactionLimit) &&
(transferredInWindow <= chainIdToMaxDailyLimit[dstChainId_])));
if (currentBlockTimestamp - last24HourWindowStart > 1 days) {
transferredInWindow = amountInUsd;
last24HourWindowStart = currentBlockTimestamp;
} else {
return (
true,
maxSingleTransactionLimit,
maxDailyLimit,
amountInUsd,
transferredInWindow,
last24HourWindowStart,
isWhiteListedUser
);
transferredInWindow += amountInUsd;
}
eligibleToSend = (isWhiteListedUser ||
((amountInUsd <= maxSingleTransactionLimit) && (transferredInWindow <= maxDailyLimit)));
}

/**
Expand Down

0 comments on commit 908e417

Please sign in to comment.