mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
fix(contract): mutated function -> mutation function (#377)
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
This commit is contained in:
@@ -16,9 +16,9 @@ interface IL1ScrollMessenger is IScrollMessenger {
|
||||
bytes merkleProof;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Relay a L2 => L1 message with message proof.
|
||||
/// @param from The address of the sender of the message.
|
||||
|
||||
@@ -91,9 +91,9 @@ contract L1ScrollMessenger is PausableUpgradeable, ScrollMessengerBase, IL1Scrol
|
||||
xDomainMessageSender = ScrollConstants.DEFAULT_XDOMAIN_MESSAGE_SENDER;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IScrollMessenger
|
||||
function sendMessage(
|
||||
|
||||
@@ -47,9 +47,9 @@ interface IL1ERC20Gateway {
|
||||
/// @param _l1Token The address of l1 token.
|
||||
function getL2ERC20Address(address _l1Token) external view returns (address);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Deposit some token to a caller's account on L2.
|
||||
/// @dev Make this function payable to send relayer fee in Ether.
|
||||
|
||||
@@ -64,9 +64,9 @@ interface IL1ERC721Gateway {
|
||||
uint256[] _tokenIds
|
||||
);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Deposit some ERC721 NFT to caller's account on layer 2.
|
||||
/// @param _token The address of ERC721 NFT in layer 1.
|
||||
|
||||
@@ -21,9 +21,9 @@ interface IL1ETHGateway {
|
||||
/// @param data The optional calldata passed to recipient in L2.
|
||||
event DepositETH(address indexed from, address indexed to, uint256 amount, bytes data);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Deposit ETH to caller's account in L2.
|
||||
/// @param amount The amount of ETH to be deposited.
|
||||
|
||||
@@ -65,9 +65,9 @@ contract L1CustomERC20Gateway is OwnableUpgradeable, ScrollGatewayBase, L1ERC20G
|
||||
return tokenMapping[_l1Token];
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC20Gateway
|
||||
function finalizeWithdrawERC20(
|
||||
|
||||
@@ -49,9 +49,9 @@ contract L1ERC1155Gateway is OwnableUpgradeable, ERC1155HolderUpgradeable, Scrol
|
||||
ScrollGatewayBase._initialize(_counterpart, address(0), _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC1155Gateway
|
||||
function depositERC1155(
|
||||
|
||||
@@ -7,9 +7,9 @@ import {IL1ERC20Gateway} from "./IL1ERC20Gateway.sol";
|
||||
// solhint-disable no-empty-blocks
|
||||
|
||||
abstract contract L1ERC20Gateway is IL1ERC20Gateway {
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC20Gateway
|
||||
function depositERC20(
|
||||
|
||||
@@ -49,9 +49,9 @@ contract L1ERC721Gateway is OwnableUpgradeable, ERC721HolderUpgradeable, ScrollG
|
||||
ScrollGatewayBase._initialize(_counterpart, address(0), _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC721Gateway
|
||||
function depositERC721(
|
||||
|
||||
@@ -33,9 +33,9 @@ contract L1ETHGateway is Initializable, ScrollGatewayBase, IL1ETHGateway {
|
||||
ScrollGatewayBase._initialize(_counterpart, _router, _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ETHGateway
|
||||
function depositETH(uint256 _amount, uint256 _gasLimit) external payable override {
|
||||
|
||||
@@ -80,9 +80,9 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter {
|
||||
return _gateway;
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* Public Mutated Functions from L1ERC20Gateway *
|
||||
************************************************/
|
||||
/*************************************************
|
||||
* Public Mutating Functions from L1ERC20Gateway *
|
||||
*************************************************/
|
||||
|
||||
/// @inheritdoc IL1ERC20Gateway
|
||||
function depositERC20(
|
||||
@@ -132,9 +132,9 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter {
|
||||
revert("should never be called");
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
* Public Mutated Functions from L1ETHGateway *
|
||||
**********************************************/
|
||||
/***********************************************
|
||||
* Public Mutating Functions from L1ETHGateway *
|
||||
***********************************************/
|
||||
|
||||
/// @inheritdoc IL1ETHGateway
|
||||
function depositETH(uint256 _amount, uint256 _gasLimit) external payable override {
|
||||
|
||||
@@ -80,9 +80,9 @@ contract L1StandardERC20Gateway is Initializable, ScrollGatewayBase, L1ERC20Gate
|
||||
return Clones.predictDeterministicAddress(l2TokenImplementation, _salt, l2TokenFactory);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC20Gateway
|
||||
function finalizeWithdrawERC20(
|
||||
|
||||
@@ -70,9 +70,9 @@ contract L1WETHGateway is Initializable, ScrollGatewayBase, L1ERC20Gateway {
|
||||
return l2WETH;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1ERC20Gateway
|
||||
function finalizeWithdrawERC20(
|
||||
|
||||
@@ -47,9 +47,9 @@ interface IL1MessageQueue {
|
||||
uint256 gasLimit
|
||||
) external view returns (uint256);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Append a L1 to L2 message into this contract.
|
||||
/// @param target The address of target contract to call in L2.
|
||||
|
||||
@@ -74,9 +74,9 @@ interface IScrollChain {
|
||||
/// @param batchHash The hash of the batch to query.
|
||||
function getL2MessageRoot(bytes32 batchHash) external view returns (bytes32);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice commit a batch in layer 1
|
||||
/// @param batch The layer2 batch to commit.
|
||||
|
||||
@@ -72,9 +72,9 @@ contract L1MessageQueue is OwnableUpgradeable, IL1MessageQueue {
|
||||
return IL2GasPriceOracle(_oracle).estimateCrossDomainMessageFee(_sender, _target, _message, _gasLimit);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1MessageQueue
|
||||
function appendCrossDomainMessage(
|
||||
|
||||
@@ -115,9 +115,9 @@ contract L2GasPriceOracle is OwnableUpgradeable, IL2GasPriceOracle {
|
||||
}
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Allows the owner to modify the l2 base fee.
|
||||
/// @param _l2BaseFee The new l2 base fee.
|
||||
|
||||
@@ -131,9 +131,9 @@ contract ScrollChain is OwnableUpgradeable, IScrollChain {
|
||||
return batches[_batchHash].withdrawTrieRoot;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Import layer 2 genesis block
|
||||
function importGenesisBatch(Batch memory _genesisBatch) external {
|
||||
|
||||
@@ -14,9 +14,9 @@ interface IL2ScrollMessenger is IScrollMessenger {
|
||||
bytes stateRootProof;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice execute L1 => L2 message
|
||||
/// @dev Make sure this is only called by privileged accounts.
|
||||
|
||||
@@ -177,10 +177,9 @@ contract L2ScrollMessenger is ScrollMessengerBase, PausableUpgradeable, IL2Scrol
|
||||
return uint256(_storageValue) == 1;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
/// @inheritdoc IScrollMessenger
|
||||
function sendMessage(
|
||||
address _to,
|
||||
|
||||
@@ -72,9 +72,9 @@ interface IL2ERC1155Gateway {
|
||||
uint256[] amounts
|
||||
);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Withdraw some ERC1155 NFT to caller's account on layer 1.
|
||||
/// @param token The address of ERC1155 NFT in layer 2.
|
||||
|
||||
@@ -51,9 +51,9 @@ interface IL2ERC20Gateway {
|
||||
/// @param l1Token The address of l1 token.
|
||||
function getL2ERC20Address(address l1Token) external view returns (address);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Withdraw of some token to a caller's account on L1.
|
||||
/// @dev Make this function payable to send relayer fee in Ether.
|
||||
|
||||
@@ -64,9 +64,9 @@ interface IL2ERC721Gateway {
|
||||
uint256[] tokenIds
|
||||
);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Withdraw some ERC721 NFT to caller's account on layer 1.
|
||||
/// @param token The address of ERC721 NFT in layer 2.
|
||||
|
||||
@@ -21,9 +21,9 @@ interface IL2ETHGateway {
|
||||
/// @param data The optional calldata passed to recipient in L2.
|
||||
event FinalizeDepositETH(address indexed from, address indexed to, uint256 amount, bytes data);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Withdraw ETH to caller's account in L1.
|
||||
/// @param amount The amount of ETH to be withdrawn.
|
||||
|
||||
@@ -63,9 +63,9 @@ contract L2CustomERC20Gateway is OwnableUpgradeable, ScrollGatewayBase, L2ERC20G
|
||||
revert("unimplemented");
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC20Gateway
|
||||
function finalizeDepositERC20(
|
||||
|
||||
@@ -47,9 +47,9 @@ contract L2ERC1155Gateway is OwnableUpgradeable, ERC1155HolderUpgradeable, Scrol
|
||||
ScrollGatewayBase._initialize(_counterpart, address(0), _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC1155Gateway
|
||||
function withdrawERC1155(
|
||||
|
||||
@@ -7,9 +7,9 @@ import {IL2ERC20Gateway} from "./IL2ERC20Gateway.sol";
|
||||
// solhint-disable no-empty-blocks
|
||||
|
||||
abstract contract L2ERC20Gateway is IL2ERC20Gateway {
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC20Gateway
|
||||
function withdrawERC20(
|
||||
|
||||
@@ -47,9 +47,9 @@ contract L2ERC721Gateway is OwnableUpgradeable, ERC721HolderUpgradeable, ScrollG
|
||||
ScrollGatewayBase._initialize(_counterpart, address(0), _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC721Gateway
|
||||
function withdrawERC721(
|
||||
|
||||
@@ -33,9 +33,9 @@ contract L2ETHGateway is Initializable, ScrollGatewayBase, IL2ETHGateway {
|
||||
ScrollGatewayBase._initialize(_counterpart, _router, _messenger);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ETHGateway
|
||||
function withdrawETH(uint256 _amount, uint256 _gasLimit) external payable override {
|
||||
|
||||
@@ -82,9 +82,9 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter {
|
||||
return _gateway;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC20Gateway
|
||||
function withdrawERC20(
|
||||
|
||||
@@ -66,9 +66,9 @@ contract L2StandardERC20Gateway is Initializable, ScrollGatewayBase, L2ERC20Gate
|
||||
return IScrollStandardERC20Factory(tokenFactory).computeL2TokenAddress(address(this), _l1Token);
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC20Gateway
|
||||
function finalizeDepositERC20(
|
||||
|
||||
@@ -70,9 +70,9 @@ contract L2WETHGateway is Initializable, ScrollGatewayBase, L2ERC20Gateway {
|
||||
return WETH;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL2ERC20Gateway
|
||||
function finalizeDepositERC20(
|
||||
|
||||
@@ -47,9 +47,9 @@ interface IL1BlockContainer {
|
||||
/// @return timestamp The corresponding block timestamp.
|
||||
function getBlockTimestamp(bytes32 blockHash) external view returns (uint256 timestamp);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Import L1 block header to this contract.
|
||||
/// @param blockHash The hash of block.
|
||||
|
||||
@@ -46,9 +46,9 @@ interface IL1GasPriceOracle {
|
||||
/// @return Amount of L1 gas used to publish the transaction.
|
||||
function getL1GasUsed(bytes memory data) external view returns (uint256);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Allows whitelisted caller to modify the l1 base fee.
|
||||
/// @param _l1BaseFee New l1 base fee.
|
||||
|
||||
@@ -107,9 +107,9 @@ contract L1BlockContainer is OwnableBase, IL1BlockContainer {
|
||||
return metadata[_blockHash].timestamp;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1BlockContainer
|
||||
function importBlockHeader(
|
||||
|
||||
@@ -87,9 +87,9 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle {
|
||||
}
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @inheritdoc IL1GasPriceOracle
|
||||
function setL1BaseFee(uint256 _l1BaseFee) external override {
|
||||
|
||||
@@ -38,9 +38,9 @@ interface IScrollMessenger {
|
||||
/// @notice Return the sender of a cross domain message.
|
||||
function xDomainMessageSender() external view returns (address);
|
||||
|
||||
/****************************
|
||||
* Public Mutated Functions *
|
||||
****************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
/// @notice Send cross chain message from L1 to L2 or L2 to L1.
|
||||
/// @param target The address of account who recieve the message.
|
||||
|
||||
@@ -9,7 +9,9 @@ import {IScrollMessenger} from "../../libraries/IScrollMessenger.sol";
|
||||
contract MockScrollMessenger is IScrollMessenger {
|
||||
address public override xDomainMessageSender;
|
||||
|
||||
/**************************************** Mutated Functions ****************************************/
|
||||
/*****************************
|
||||
* Public Mutating Functions *
|
||||
*****************************/
|
||||
|
||||
function setXDomainMessageSender(address _xDomainMessageSender) external {
|
||||
xDomainMessageSender = _xDomainMessageSender;
|
||||
|
||||
Reference in New Issue
Block a user