Skip to content

Commit

Permalink
improve: [N04] Typographical errors (#258)
Browse files Browse the repository at this point in the history
## From Audit

Consider correcting the following typographical errors:
In BondToken.sol :
Line 11, "rootBundleProposer()" should be "rootBundleProposal()".
Line 21: "permissiong" should be "permissioning".
In EIP712CrossChainUpgradeable.sol :
Line 83: "its always" should be "it's always".
In MultiCallerUpgradeable.sol :
Line 5: "@title MockSpokePool" should be "@title MultiCallerUpgradeable".
In Optimism_Adapter.sol :
Line 23: "its only" should be "it's only".
In Polygon_SpokePool.sol :
Line 51: the sentence "See" is incomplete.
Line 139: the sentence is malformed.
In SpokePool.sol :
Line 567: "speedUpRelay()" should be "speedUpDeposit()".
Line 1177: "its always" should be "it's always".
In Succinct_Adapter.sol :
Line 27: "destinatipn" should be "destination".
Line 27: "the message.." should be "the message.".
In Succinct_SpokePool.sol :
Line 22: "callValidated" should be "adminCallValidated".
Line 24: "callValidated" should be "adminCallValidated".
Line 35: "callValidated" should be "adminCallValidated".
  • Loading branch information
nicholaspai authored Mar 17, 2023
1 parent fa59467 commit 43a0ea7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions contracts/BondToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "./interfaces/HubPoolInterface.sol";
import "./external/WETH9.sol";

interface ExtendedHubPoolInterface is HubPoolInterface {
// Specify the automatically-implemented rootBundleProposer() getter.
// Specify the automatically-implemented rootBundleProposal() getter.
function rootBundleProposal() external pure returns (HubPoolInterface.RootBundle memory);
}

Expand All @@ -18,7 +18,7 @@ interface ExtendedHubPoolInterface is HubPoolInterface {
* imposes address-based permissioning on the WETH9 transferFrom() function in order to constrain the movement of ABT
* into the Across v2 HubPool contract. When configured as the required HubPool bond token, ABT can dramatically reduce
* the attack surface of the HubPool by requiring that addresses are explicitly approved before they can successfully
* submit a root bundle proposal. The address-based permissiong does not constrain transfers that are needed to dispute
* submit a root bundle proposal. The address-based permissioning does not constrain transfers that are needed to dispute
* a root bundle proposal, so the ability of decentralised/unknown actors to dispute is unaffected.
*/
contract BondToken is WETH9, Ownable {
Expand Down
7 changes: 4 additions & 3 deletions contracts/Polygon_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool {

// This sets a variable indicating that we're now inside a validated call.
// Note: this is used by other methods to ensure that this call has been validated by this method and is not
// spoofed. See
// spoofed. See comment for `_requireAdminSender` for more details.
callValidated = true;

_;
Expand Down Expand Up @@ -151,8 +151,9 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool {

/**
* @notice Allows the caller to trigger the wrapping of any unwrapped matic tokens.
* @dev Matic sends via L1 -> L2 bridging actions don't call into the contract receiving the tokens, so wrapping
* must be done via a separate transaction.
* @dev Unlike other ERC20 transfers, Matic transfers from L1 -> L2 bridging don't result in an L2 call into
* the contract receiving the tokens, so wrapping must be done via a separate transaction. In other words,
* we can't rely upon a `fallback()` method being triggered to wrap MATIC upon receiving it.
*/
function wrap() public nonReentrant {
_wrap();
Expand Down
4 changes: 2 additions & 2 deletions contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ abstract contract SpokePool is
/**
* @notice Called by relayer to execute same logic as calling fillRelay except that relayer is using an updated
* relayer fee %. The fee % must have been emitted in a message cryptographically signed by the depositor.
* @notice By design, the depositor probably emitted the message with the updated fee by calling speedUpRelay().
* @notice By design, the depositor probably emitted the message with the updated fee by calling speedUpDeposit().
* @param depositor Depositor on origin chain who set this chain as the destination chain.
* @param recipient Specified recipient on this chain.
* @param destinationToken Token to send to recipient. Should be mapped to the origin token, origin chain ID
Expand Down Expand Up @@ -1193,6 +1193,6 @@ abstract contract SpokePool is

// Reserve storage slots for future versions of this base contract to add state variables without
// affecting the storage layout of child contracts. Decrement the size of __gap whenever state variables
// are added. This is at bottom of contract to make sure its always at the end of storage.
// are added. This is at bottom of contract to make sure it's always at the end of storage.
uint256[1000] private __gap;
}
10 changes: 5 additions & 5 deletions contracts/Succinct_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ contract Succinct_SpokePool is SpokePool, ITelepathyHandler {
event SetSuccinctTargetAmb(address indexed newSuccinctTargetAmb);
event ReceivedMessageFromL1(address indexed caller, address indexed rootMessageSender);

// Note: validating calls this way ensures that strange calls coming from the succinctTargetAmb won't be misinterpreted.
// Put differently, just checking that msg.sender == succinctTargetAmb is not sufficient.
// Note: validating calls this way ensures that strange calls coming from the succinctTargetAmb won't be
// misinterpreted. Put differently, just checking that msg.sender == succinctTargetAmb is not sufficient.
// All calls that have admin privileges must be fired from within the handleTelepathy method that's gone
// through validation where the sender is checked and the sender from the other chain is also validated.
// This modifier sets the callValidated variable so this condition can be checked in _requireAdminSender().
// This modifier sets the adminCallValidated variable so this condition can be checked in _requireAdminSender().
modifier validateInternalCalls() {
// Make sure callValidated is set to True only once at beginning of processMessageFromRoot, which prevents
// Make sure adminCallValidated is set to True only once at beginning of processMessageFromRoot, which prevents
// processMessageFromRoot from being re-entered.
require(!adminCallValidated, "adminCallValidated already set");

Expand All @@ -39,7 +39,7 @@ contract Succinct_SpokePool is SpokePool, ITelepathyHandler {

_;

// Reset callValidated to false to disallow admin calls after this method exits.
// Reset adminCallValidated to false to disallow admin calls after this method exits.
adminCallValidated = false;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/chain-adapters/Optimism_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface SynthetixBridgeToOptimism is IL1StandardBridge {
* @notice Contract containing logic to send messages from L1 to Optimism.
* @dev Public functions calling external contracts do not guard against reentrancy because they are expected to be
* called via delegatecall, which will execute this contract's logic within the context of the originating contract.
* For example, the HubPool will delegatecall these functions, therefore its only necessary that the HubPool's methods
* For example, the HubPool will delegatecall these functions, therefore it's only necessary that the HubPool's methods
* that call this contract's logic guard against reentrancy.
*/

Expand Down
2 changes: 1 addition & 1 deletion contracts/chain-adapters/Succinct_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract Succinct_Adapter is AdapterInterface {

/**
* @notice Send cross-chain message to target on the destination.
* @param target Contract on the destinatipn that will receive the message..
* @param target Contract on the destination that will receive the message.
* @param message Data to send to target.
*/
function relayMessage(address target, bytes calldata message) external payable override {
Expand Down
2 changes: 1 addition & 1 deletion contracts/upgradeable/EIP712CrossChainUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ abstract contract EIP712CrossChainUpgradeable is Initializable {

// Reserve storage slots for future versions of this base contract to add state variables without
// affecting the storage layout of child contracts. Decrement the size of __gap whenever state variables
// are added. This is at bottom of contract to make sure its always at the end of storage.
// are added. This is at bottom of contract to make sure it's always at the end of storage.
uint256[1000] private __gap;
}
2 changes: 1 addition & 1 deletion contracts/upgradeable/MultiCallerUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

/**
* @title MockSpokePool
* @title MultiCallerUpgradeable
* @notice Logic is 100% copied from "@uma/core/contracts/common/implementation/MultiCaller.sol" but one
* comment is added to clarify why we allow delegatecall() in this contract, which is typically unsafe for use in
* upgradeable implementation contracts.
Expand Down

0 comments on commit 43a0ea7

Please sign in to comment.