TaikoL1
can be deployed on L2 as a base contract for L3. Hence when the reentrancy lock is loaded using transient storage, it should compare chain id of base chain, instead of chain id = 1.
Same for Bridge.sol
For example
if (block.chainid == BASE_CHAIN_ID) {
assembly {
tstore(_REENTRY_SLOT, _reentry)
}
}
This BASE_CHAIN_ID
can be initialized as an immutable variable.
Same signature can be used to claim grants on multiple chain, if the contract is deployed on multiple chains. It is recommend to hash chain id and address of the contract.
bytes32 hash = keccak256(abi.encodePacked("Withdraw unlocked Taiko token to: ", _to, block.chainid, address(this)));
Context
is packed into 2 slots (when used in storage) so the gap is off by one. Correct code is below
/// @dev Slots 3 and 4.
Context private __ctx;
/// @notice Mapping to store banned addresses.
/// @dev Slot 5.
mapping(address addr => bool banned) public addressBanned;
/// @notice Mapping to store the proof receipt of a message from its hash.
/// @dev Slot 6.
mapping(bytes32 msgHash => ProofReceipt receipt) public proofReceipt;
uint256[44] private __gap;