diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index f2cf2ee1b5f..317252bdf9b 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -204,6 +204,6 @@ library TaikoData { mapping(bytes32 blobHash => uint256 since) reusableBlobs; SlotA slotA; // slot 6 SlotB slotB; // slot 7 - uint256[143] __gap; + uint256[43] __gap; } } diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index 8a0cb5010f1..dbd183d6e8b 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -34,7 +34,7 @@ import "./TaikoEvents.sol"; /// This contract doesn't hold any Ether. Ether deposited to L2 are held by the Bridge contract. contract TaikoL1 is EssentialContract, ITaikoL1, ITierProvider, TaikoEvents, TaikoErrors { TaikoData.State public state; - uint256[100] private __gap; + uint256[50] private __gap; modifier whenProvingNotPaused() { if (state.slotB.provingPaused) revert L1_PROVING_PAUSED(); diff --git a/packages/protocol/contracts/L1/TaikoToken.sol b/packages/protocol/contracts/L1/TaikoToken.sol index 373a29cb169..730b468b670 100644 --- a/packages/protocol/contracts/L1/TaikoToken.sol +++ b/packages/protocol/contracts/L1/TaikoToken.sol @@ -25,6 +25,8 @@ import "../common/EssentialContract.sol"; /// in the form of bonds. It is an ERC20 token with 18 decimal places of /// precision. contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUpgradeable { + uint256[50] private __gap; + error TKO_INVALID_ADDR(); /// @notice Initializes the TaikoToken contract and mints initial tokens. diff --git a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol index 445504ba473..3fa59d60c41 100644 --- a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol +++ b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol @@ -49,6 +49,8 @@ contract AssignmentHook is EssentialContract, IHook { // get paid within this limit. uint256 public constant MAX_GAS_PAYING_PROVER = 50_000; + uint256[50] private __gap; + event BlockAssigned( address indexed assignedProver, TaikoData.BlockMetadata meta, ProverAssignment assignment ); diff --git a/packages/protocol/contracts/L1/provers/GuardianProver.sol b/packages/protocol/contracts/L1/provers/GuardianProver.sol index 1b771d3afc3..466fbf999f2 100644 --- a/packages/protocol/contracts/L1/provers/GuardianProver.sol +++ b/packages/protocol/contracts/L1/provers/GuardianProver.sol @@ -20,6 +20,8 @@ import "./Guardians.sol"; /// @title GuardianProver contract GuardianProver is Guardians { + uint256[50] private __gap; + event GuardianApproval( address indexed addr, uint256 indexed blockId, bytes32 blockHash, bool approved ); diff --git a/packages/protocol/contracts/L1/tiers/OptimisticTierProvider.sol b/packages/protocol/contracts/L1/tiers/OptimisticTierProvider.sol index 4f58a8978f7..c025131593d 100644 --- a/packages/protocol/contracts/L1/tiers/OptimisticTierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/OptimisticTierProvider.sol @@ -18,6 +18,8 @@ import "../../common/EssentialContract.sol"; import "./ITierProvider.sol"; contract OptimisticTierProvider is EssentialContract, ITierProvider { + uint256[50] private __gap; + error TIER_NOT_FOUND(); /// @notice Initializes the contract with the provided address manager. diff --git a/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol b/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol index 3e058b54ece..adb5d980808 100644 --- a/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol @@ -26,6 +26,8 @@ import "./ITierProvider.sol"; // these many tokens: 1,000,000,000 * 10% / 86400=1157 TOK per block, which is // about 722 USD. contract TestnetTierProvider is EssentialContract, ITierProvider { + uint256[50] private __gap; + error TIER_NOT_FOUND(); /// @notice Initializes the contract with the provided address manager. diff --git a/packages/protocol/contracts/L2/TaikoL2.sol b/packages/protocol/contracts/L2/TaikoL2.sol index e8cc9b12568..7f3ff8f1dc3 100644 --- a/packages/protocol/contracts/L2/TaikoL2.sol +++ b/packages/protocol/contracts/L2/TaikoL2.sol @@ -53,7 +53,7 @@ contract TaikoL2 is CrossChainOwned { uint64 public gasExcess; // slot 3 uint64 public lastSyncedBlock; - uint256[147] private __gap; + uint256[47] private __gap; event Anchored(bytes32 parentHash, uint64 gasExcess); diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index 8c4e0b0bc9d..1697104ab26 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -67,6 +67,7 @@ contract Bridge is EssentialContract, IBridge { event MessageReceived(bytes32 indexed msgHash, Message message, bool isRecall); event MessageRecalled(bytes32 indexed msgHash); event MessageExecuted(bytes32 indexed msgHash); + event MessageRetried(bytes32 indexed msgHash); event MessageStatusChanged(bytes32 indexed msgHash, Status status); event MessageSuspended(bytes32 msgHash, bool suspended); event AddressBanned(address indexed addr, bool banned); @@ -377,6 +378,7 @@ contract Bridge is EssentialContract, IBridge { } else if (isLastAttempt) { _updateMessageStatus(msgHash, Status.FAILED); } + emit MessageRetried(msgHash); } /// @notice Checks if the message was sent. diff --git a/packages/protocol/contracts/common/AddressManager.sol b/packages/protocol/contracts/common/AddressManager.sol index 4cf76d1c43c..50b1ef83f89 100644 --- a/packages/protocol/contracts/common/AddressManager.sol +++ b/packages/protocol/contracts/common/AddressManager.sol @@ -39,6 +39,7 @@ contract AddressManager is OwnerUUPSUpgradable, IAddressManager { uint64 indexed chainId, bytes32 indexed name, address newAddress, address oldAddress ); + error AM_INVALID_PARAMS(); error AM_UNSUPPORTED(); /// @notice Initializes the owner for the upgradable contract. @@ -60,6 +61,7 @@ contract AddressManager is OwnerUUPSUpgradable, IAddressManager { onlyOwner { address oldAddress = addresses[chainId][name]; + if (newAddress == oldAddress) revert AM_INVALID_PARAMS(); addresses[chainId][name] = newAddress; emit AddressSet(chainId, name, newAddress, oldAddress); } diff --git a/packages/protocol/contracts/libs/LibAddress.sol b/packages/protocol/contracts/libs/LibAddress.sol index 5f5ab1ce81b..b8fee839b0c 100644 --- a/packages/protocol/contracts/libs/LibAddress.sol +++ b/packages/protocol/contracts/libs/LibAddress.sol @@ -31,7 +31,7 @@ library LibAddress { /// @param amount The amount of Ether to send in wei. /// @param gasLimit The max amount gas to pay for this transaction. function sendEther(address to, uint256 amount, uint256 gasLimit) internal { - // Check for zero-value or zero-address transactions + // Check for zero-address transactions if (to == address(0)) revert ETH_TRANSFER_FAILED(); // Attempt to send Ether to the recipient address diff --git a/packages/protocol/contracts/tokenvault/BaseVault.sol b/packages/protocol/contracts/tokenvault/BaseVault.sol index 8d58739f181..91d09077454 100644 --- a/packages/protocol/contracts/tokenvault/BaseVault.sol +++ b/packages/protocol/contracts/tokenvault/BaseVault.sol @@ -26,6 +26,8 @@ abstract contract BaseVault is IMessageInvocable, IERC165Upgradeable { + uint256[50] private __gap; + error VAULT_PERMISSION_DENIED(); modifier onlyFromBridge() { diff --git a/packages/protocol/test/L1/TaikoL1TestBase.sol b/packages/protocol/test/L1/TaikoL1TestBase.sol index 873d0c00e63..b7e3dc09ca2 100644 --- a/packages/protocol/test/L1/TaikoL1TestBase.sol +++ b/packages/protocol/test/L1/TaikoL1TestBase.sol @@ -112,7 +112,6 @@ abstract contract TaikoL1TestBase is TaikoTest { registerAddress("tier_provider", address(cp)); registerAddress("signal_service", address(ss)); registerAddress("guardian_prover", address(gp)); - registerAddress("bridge", address(bridge)); registerL2Address("taiko", address(L2)); registerL2Address("signal_service", address(L2SS)); registerL2Address("taiko_l2", address(L2)); diff --git a/packages/protocol/test/tokenvault/ERC20Vault.t.sol b/packages/protocol/test/tokenvault/ERC20Vault.t.sol index 68af505f05a..51d1f23055a 100644 --- a/packages/protocol/test/tokenvault/ERC20Vault.t.sol +++ b/packages/protocol/test/tokenvault/ERC20Vault.t.sol @@ -153,8 +153,6 @@ contract TestERC20Vault is TaikoTest { addressManager.setAddress(destChainId, "signal_service", address(mockProofSignalService)); - addressManager.setAddress(uint64(block.chainid), "bridge", address(bridge)); - addressManager.setAddress(uint64(block.chainid), "erc20_vault", address(erc20Vault)); addressManager.setAddress(destChainId, "erc20_vault", address(destChainIdERC20Vault));