Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: [L-01] Incorrect or misleading documentation #251

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,23 @@ abstract contract SpokePool is
function _authorizeUpgrade(address newImplementation) internal override onlyAdmin {}

/**
* @notice Pauses deposit and fill functions. This is intended to be used during upgrades or when
* @notice Pauses deposit-related functions. This is intended to be used if this contract is deprecated or when
* something goes awry.
* @dev Affects `deposit()` but not `speedUpDeposit()`, so that existing deposits can be sped up and still
* relayed.
* @param pause true if the call is meant to pause the system, false if the call is meant to unpause it.
*/
function pauseDeposits(bool pause) public override onlyAdmin nonReentrant {
pausedDeposits = pause;
emit PausedDeposits(pause);
}

/**
* @notice Pauses fill-related functions. This is intended to be used if this contract is deprecated or when
* something goes awry.
* @dev Affects fillRelayWithUpdatedDeposit() and fillRelay().
* @param pause true if the call is meant to pause the system, false if the call is meant to unpause it.
*/
function pauseFills(bool pause) public override onlyAdmin nonReentrant {
pausedFills = pause;
emit PausedFills(pause);
Expand Down Expand Up @@ -1000,13 +1008,13 @@ abstract contract SpokePool is
// This allows the caller to add in frontrunning protection for quote validity.
require(fillCounter[relayData.destinationToken] <= relayExecution.maxCount, "Above max count");

// Stores the equivalent amount to be sent by the relayer before fees have been taken out.
if (relayExecution.maxTokensToSend == 0) return 0;

// Derive the amount of the relay filled if the caller wants to send exactly maxTokensToSend tokens to
// the recipient. For example, if the user wants to send 10 tokens to the recipient, the full relay amount
// is 100, and the fee %'s total 5%, then this computation would return ~10.5, meaning that to fill 10.5/100
// of the full relay size, the caller would need to send 10 tokens to the user.
// This is equivalent to the amount to be sent by the relayer before fees have been taken out.
fillAmountPreFees = _computeAmountPreFees(
relayExecution.maxTokensToSend,
(relayData.realizedLpFeePct + relayExecution.updatedRelayerFeePct)
Expand Down