From 8c3ecd395f3c46052d1f1d96479d5c74b49f25aa Mon Sep 17 00:00:00 2001 From: Kenn Date: Tue, 18 Jun 2024 02:31:20 +0100 Subject: [PATCH] chore: spelling fixes (#1378) --- bridge-history-api/internal/logic/event_update.go | 2 +- contracts/docs/apis/L2GatewayRouter.md | 2 +- contracts/docs/apis/ScrollChain.md | 4 ++-- contracts/src/L1/L1ScrollMessenger.sol | 2 +- contracts/src/L1/gateways/L1ERC20Gateway.sol | 2 +- contracts/src/L1/gateways/L1GatewayRouter.sol | 2 +- contracts/src/L1/gateways/L1StandardERC20Gateway.sol | 2 +- contracts/src/L1/rollup/ScrollChain.sol | 10 +++++----- contracts/src/L2/gateways/L2GatewayRouter.sol | 2 +- contracts/src/L2/predeploys/L1BlockContainer.sol | 2 +- .../src/libraries/token/ScrollStandardERC20Factory.sol | 2 +- .../libraries/verifier/PatriciaMerkleTrieVerifier.sol | 4 ++-- contracts/src/libraries/verifier/ZkTrieVerifier.sol | 4 ++-- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/bridge-history-api/internal/logic/event_update.go b/bridge-history-api/internal/logic/event_update.go index 5255ccc9e..6ecaf0962 100644 --- a/bridge-history-api/internal/logic/event_update.go +++ b/bridge-history-api/internal/logic/event_update.go @@ -147,7 +147,7 @@ func (b *EventUpdateLogic) updateL2WithdrawMessageInfos(ctx context.Context, bat } if withdrawTrie.NextMessageNonce != l2WithdrawMessages[0].MessageNonce { - log.Error("nonce mismatch", "expected next message nonce", withdrawTrie.NextMessageNonce, "actuall next message nonce", l2WithdrawMessages[0].MessageNonce) + log.Error("nonce mismatch", "expected next message nonce", withdrawTrie.NextMessageNonce, "actual next message nonce", l2WithdrawMessages[0].MessageNonce) return fmt.Errorf("nonce mismatch") } diff --git a/contracts/docs/apis/L2GatewayRouter.md b/contracts/docs/apis/L2GatewayRouter.md index 7b6d55154..48df049f0 100644 --- a/contracts/docs/apis/L2GatewayRouter.md +++ b/contracts/docs/apis/L2GatewayRouter.md @@ -38,7 +38,7 @@ Mapping from L2 ERC20 token address to corresponding L2ERC20Gateway. function defaultERC20Gateway() external view returns (address) ``` -The addess of default L2 ERC20 gateway, normally the L2StandardERC20Gateway contract. +The address of default L2 ERC20 gateway, normally the L2StandardERC20Gateway contract. diff --git a/contracts/docs/apis/ScrollChain.md b/contracts/docs/apis/ScrollChain.md index fd0444b41..c052a0062 100644 --- a/contracts/docs/apis/ScrollChain.md +++ b/contracts/docs/apis/ScrollChain.md @@ -945,7 +945,7 @@ error ErrorRevertFinalizedBatch() -*Thrown when reverting a finialized batch.* +*Thrown when reverting a finalized batch.* ### ErrorRevertNotStartFromEnd @@ -956,7 +956,7 @@ error ErrorRevertNotStartFromEnd() -*Thrown when the reverted batches are not in the ending of commited batch chain.* +*Thrown when the reverted batches are not in the ending of committed batch chain.* ### ErrorRevertZeroBatches diff --git a/contracts/src/L1/L1ScrollMessenger.sol b/contracts/src/L1/L1ScrollMessenger.sol index 544beb2b9..a5405a9ea 100644 --- a/contracts/src/L1/L1ScrollMessenger.sol +++ b/contracts/src/L1/L1ScrollMessenger.sol @@ -44,7 +44,7 @@ contract L1ScrollMessenger is ScrollMessengerBase, IL1ScrollMessenger { struct ReplayState { // The number of replayed times. uint128 times; - // The queue index of lastest replayed one. If it is zero, it means the message has not been replayed. + // The queue index of latest replayed one. If it is zero, it means the message has not been replayed. uint128 lastIndex; } diff --git a/contracts/src/L1/gateways/L1ERC20Gateway.sol b/contracts/src/L1/gateways/L1ERC20Gateway.sol index 42c51144d..f94035dce 100644 --- a/contracts/src/L1/gateways/L1ERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1ERC20Gateway.sol @@ -167,7 +167,7 @@ abstract contract L1ERC20Gateway is IL1ERC20Gateway, IMessageDropCallback, Scrol /// @dev Internal function to do all the deposit operations. /// /// @param _token The token to deposit. - /// @param _to The recipient address to recieve the token in L2. + /// @param _to The recipient address to receive the token in L2. /// @param _amount The amount of token to deposit. /// @param _data Optional data to forward to recipient's account. /// @param _gasLimit Gas limit required to complete the deposit on L2. diff --git a/contracts/src/L1/gateways/L1GatewayRouter.sol b/contracts/src/L1/gateways/L1GatewayRouter.sol index 25bf1aa7d..83f15e4f9 100644 --- a/contracts/src/L1/gateways/L1GatewayRouter.sol +++ b/contracts/src/L1/gateways/L1GatewayRouter.sol @@ -25,7 +25,7 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter { /// @notice The address of L1ETHGateway. address public ethGateway; - /// @notice The addess of default ERC20 gateway, normally the L1StandardERC20Gateway contract. + /// @notice The address of default ERC20 gateway, normally the L1StandardERC20Gateway contract. address public defaultERC20Gateway; /// @notice Mapping from ERC20 token address to corresponding L1ERC20Gateway. diff --git a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol index ac31c37e1..2b36e2bf6 100644 --- a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol @@ -97,7 +97,7 @@ contract L1StandardERC20Gateway is L1ERC20Gateway { /// @inheritdoc IL1ERC20Gateway function getL2ERC20Address(address _l1Token) public view override returns (address) { - // In StandardERC20Gateway, all corresponding l2 tokens are depoyed by Create2 with salt, + // In StandardERC20Gateway, all corresponding l2 tokens are deployed by Create2 with salt, // we can calculate the l2 address directly. bytes32 _salt = keccak256(abi.encodePacked(counterpart, keccak256(abi.encodePacked(_l1Token)))); diff --git a/contracts/src/L1/rollup/ScrollChain.sol b/contracts/src/L1/rollup/ScrollChain.sol index 62b46e3ab..c2fe3252c 100644 --- a/contracts/src/L1/rollup/ScrollChain.sol +++ b/contracts/src/L1/rollup/ScrollChain.sol @@ -89,10 +89,10 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @dev Thrown when the number of batches to revert is zero. error ErrorRevertZeroBatches(); - /// @dev Thrown when the reverted batches are not in the ending of commited batch chain. + /// @dev Thrown when the reverted batches are not in the ending of committed batch chain. error ErrorRevertNotStartFromEnd(); - /// @dev Thrown when reverting a finialized batch. + /// @dev Thrown when reverting a finalized batch. error ErrorRevertFinalizedBatch(); /// @dev Thrown when the given state root is zero. @@ -580,7 +580,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @param _chunks The list of chunks to commit. /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. /// @return _batchDataHash The computed data hash for the list of chunks. - /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages poped in this batch, including skipped one. + /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages popped in this batch, including skipped one. function _commitChunksV0( uint256 _totalL1MessagesPoppedOverall, bytes[] memory _chunks, @@ -627,7 +627,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @param _skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not. /// @return _blobVersionedHash The blob versioned hash for the blob carried in this transaction. /// @return _batchDataHash The computed data hash for the list of chunks. - /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages poped in this batch, including skipped one. + /// @return _totalL1MessagesPoppedInBatch The total number of L1 messages popped in this batch, including skipped one. function _commitChunksV1( uint256 _totalL1MessagesPoppedOverall, bytes[] memory _chunks, @@ -950,7 +950,7 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain { /// @dev Internal function to pop finalized l1 messages. /// @param bitmapPtr The memory offset of `skippedL1MessageBitmap`. - /// @param totalL1MessagePopped The total number of L1 messages poped in all batches including current batch. + /// @param totalL1MessagePopped The total number of L1 messages popped in all batches including current batch. /// @param l1MessagePopped The number of L1 messages popped in current batch. function _popL1Messages( uint256 bitmapPtr, diff --git a/contracts/src/L2/gateways/L2GatewayRouter.sol b/contracts/src/L2/gateways/L2GatewayRouter.sol index 3c982b380..2bf214757 100644 --- a/contracts/src/L2/gateways/L2GatewayRouter.sol +++ b/contracts/src/L2/gateways/L2GatewayRouter.sol @@ -21,7 +21,7 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter { /// @notice The address of L2ETHGateway. address public ethGateway; - /// @notice The addess of default L2 ERC20 gateway, normally the L2StandardERC20Gateway contract. + /// @notice The address of default L2 ERC20 gateway, normally the L2StandardERC20Gateway contract. address public defaultERC20Gateway; /// @notice Mapping from L2 ERC20 token address to corresponding L2ERC20Gateway. diff --git a/contracts/src/L2/predeploys/L1BlockContainer.sol b/contracts/src/L2/predeploys/L1BlockContainer.sol index 6c163379d..054a7dff1 100644 --- a/contracts/src/L2/predeploys/L1BlockContainer.sol +++ b/contracts/src/L2/predeploys/L1BlockContainer.sol @@ -242,7 +242,7 @@ contract L1BlockContainer is OwnableBase, IL1BlockContainer { let _computedBlockHash := keccak256(memPtr, headerPayloadLength) require(eq(_blockHash, _computedBlockHash), "Block hash mismatch") - // load 16 vaules + // load 16 values for { let i := 0 } lt(i, 16) { diff --git a/contracts/src/libraries/token/ScrollStandardERC20Factory.sol b/contracts/src/libraries/token/ScrollStandardERC20Factory.sol index 67767a08f..8b7628457 100644 --- a/contracts/src/libraries/token/ScrollStandardERC20Factory.sol +++ b/contracts/src/libraries/token/ScrollStandardERC20Factory.sol @@ -23,7 +23,7 @@ contract ScrollStandardERC20Factory is Ownable, IScrollStandardERC20Factory { /// @inheritdoc IScrollStandardERC20Factory function computeL2TokenAddress(address _gateway, address _l1Token) external view returns (address) { - // In StandardERC20Gateway, all corresponding l2 tokens are depoyed by Create2 with salt, + // In StandardERC20Gateway, all corresponding l2 tokens are deployed by Create2 with salt, // we can calculate the l2 address directly. bytes32 _salt = _getSalt(_gateway, _l1Token); diff --git a/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol b/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol index e1b65ea05..81541e43d 100644 --- a/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol +++ b/contracts/src/libraries/verifier/PatriciaMerkleTrieVerifier.sol @@ -369,7 +369,7 @@ library PatriciaMerkleTrieVerifier { // first item is considered the root node. // Otherwise verifies that the hash of the current node - // is the same as the previous choosen one. + // is the same as the previous chosen one. switch i case 1 { rootHash := hash @@ -425,7 +425,7 @@ library PatriciaMerkleTrieVerifier { } } - // lastly, derive the path of the choosen one (TM) + // lastly, derive the path of the chosen one (TM) path := derivePath(key, depth) } diff --git a/contracts/src/libraries/verifier/ZkTrieVerifier.sol b/contracts/src/libraries/verifier/ZkTrieVerifier.sol index 803a35dd8..4bb5932d8 100644 --- a/contracts/src/libraries/verifier/ZkTrieVerifier.sol +++ b/contracts/src/libraries/verifier/ZkTrieVerifier.sol @@ -113,7 +113,7 @@ library ZkTrieVerifier { // first item is considered the root node. // Otherwise verifies that the hash of the current node - // is the same as the previous choosen one. + // is the same as the previous chosen one. switch depth case 1 { rootHash := hash @@ -262,7 +262,7 @@ library ZkTrieVerifier { ptr, storageValue := verifyStorageProof(poseidon, storageKey, storageRootHash, ptr) // the one and only boundary check - // in case an attacker crafted a malicous payload + // in case an attacker crafted a malicious payload // and succeeds in the prior verification steps // then this should catch any bogus accesses if iszero(eq(ptr, add(proof.offset, proof.length))) {