From 0762479dd518a23821eeb17c622f1227461441d1 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 31 Mar 2022 23:41:05 -0300 Subject: [PATCH] Fix tests on upgradeable contracts after transpilation --- contracts/mocks/crosschain/bridges.sol | 4 ++++ contracts/mocks/crosschain/receivers.sol | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/contracts/mocks/crosschain/bridges.sol b/contracts/mocks/crosschain/bridges.sol index 5b9d20358a8..6a2b974702e 100644 --- a/contracts/mocks/crosschain/bridges.sol +++ b/contracts/mocks/crosschain/bridges.sol @@ -41,7 +41,9 @@ contract BridgeAMBMock is BaseRelayMock { * Arbitrum */ contract BridgeArbitrumL1Mock is BaseRelayMock { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable inbox = address(new BridgeArbitrumL1Inbox()); + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable outbox = address(new BridgeArbitrumL1Outbox()); function activeOutbox() public view returns (address) { @@ -54,10 +56,12 @@ contract BridgeArbitrumL1Mock is BaseRelayMock { } contract BridgeArbitrumL1Inbox { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable bridge = msg.sender; } contract BridgeArbitrumL1Outbox { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable bridge = msg.sender; function l2ToL1Sender() public view returns (address) { diff --git a/contracts/mocks/crosschain/receivers.sol b/contracts/mocks/crosschain/receivers.sol index 06498c5038e..601a2ac105f 100644 --- a/contracts/mocks/crosschain/receivers.sol +++ b/contracts/mocks/crosschain/receivers.sol @@ -9,10 +9,14 @@ import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; import "../../crosschain/optimism/CrossChainEnabledOptimism.sol"; import "../../crosschain/polygon/CrossChainEnabledPolygonChild.sol"; -abstract contract Receiver is Ownable, CrossChainEnabled { +abstract contract Receiver is CrossChainEnabled { + // we don't use Ownable because it messes up testing for the upgradeable contracts + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment + address public immutable owner = msg.sender; + function crossChainRestricted() external onlyCrossChain {} - function crossChainOwnerRestricted() external onlyCrossChainSender(owner()) {} + function crossChainOwnerRestricted() external onlyCrossChainSender(owner) {} } /**