Skip to content

Commit

Permalink
TimelockProposal Arbitrum L1 example (#72)
Browse files Browse the repository at this point in the history
* Add arbitrum addresses

* Arbitrum L1 Timelock Proposal integration tests

* tests passing LFG

* remove Vault.sol

* Remove Mock Token

* remediate compiler warnings

* lint

* natspec typo
  • Loading branch information
anajuliabit authored May 15, 2024
1 parent 05ecdd8 commit 81d8db9
Show file tree
Hide file tree
Showing 12 changed files with 314 additions and 316 deletions.
3 changes: 2 additions & 1 deletion .solhintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"contract-name-camelcase": "off",
"no-unused-import": "error",
"explicit-types": "off",
"const-name-snakecase": "off"
"const-name-snakecase": "off",
"gas-custom-errors": "off"
}
}
30 changes: 30 additions & 0 deletions addresses/Addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,35 @@
"chainId": 1,
"name": "OPTIMISM_L1_NFT_BRIDGE_IMPLEMENTATION",
"isContract": true
},
{
"addr": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
"chainId": 1,
"name": "ARBITRUM_L1_TIMELOCK",
"isContract": true
},
{
"addr": "0x3ffFbAdAF827559da092217e474760E2b2c3CeDd",
"chainId": 1,
"name": "ARBITRUM_L1_UPGRADE_EXECUTOR",
"isContract": true
},
{
"addr": "0x9aD46fac0Cf7f790E5be05A0F15223935A0c0aDa",
"chainId": 1,
"name": "ARBITRUM_L1_PROXY_ADMIN",
"isContract": true
},
{
"addr": "0xd92023e9d9911199a6711321d1277285e6d4e2db",
"chainId": 1,
"name": "ARBITRUM_L1_WETH_GATEWAY_PROXY",
"isContract": true
},
{
"addr": "0x8315177aB297bA92A06054cE80a67Ed4DBd7ed3a",
"chainId": 1,
"name": "ARBITRUM_BRIDGE",
"isContract": true
}
]
53 changes: 0 additions & 53 deletions mocks/IERC20.sol

This file was deleted.

145 changes: 0 additions & 145 deletions mocks/MockERC20.sol

This file was deleted.

18 changes: 7 additions & 11 deletions mocks/MockMultisigProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ import {Addresses} from "@addresses/Addresses.sol";

import {MultisigProposal} from "@proposals/MultisigProposal.sol";

import {Vault} from "@mocks/Vault.sol";
import {IProxy} from "@interface/IProxy.sol";
import {IProxyAdmin} from "@interface/IProxyAdmin.sol";

interface ProxyAdmin {
function upgrade(address proxy, address implementation) external;
}

interface Proxy {
function implementation() external view returns (address);
}
import {MockUpgrade} from "@mocks/MockUpgrade.sol";

contract MockMultisigProposal is MultisigProposal {
function name() public pure override returns (string memory) {
Expand All @@ -35,7 +30,7 @@ contract MockMultisigProposal is MultisigProposal {

function deploy() public override {
if (!addresses.isAddressSet("OPTIMISM_L1_NFT_BRIDGE_IMPLEMENTATION")) {
address l1NFTBridgeImplementation = address(new Vault());
address l1NFTBridgeImplementation = address(new MockUpgrade());

addresses.addAddress(
"OPTIMISM_L1_NFT_BRIDGE_IMPLEMENTATION",
Expand All @@ -50,7 +45,7 @@ contract MockMultisigProposal is MultisigProposal {
override
buildModifier(addresses.getAddress("OPTIMISM_MULTISIG"))
{
ProxyAdmin proxy = ProxyAdmin(
IProxyAdmin proxy = IProxyAdmin(
addresses.getAddress("OPTIMISM_PROXY_ADMIN")
);

Expand All @@ -67,10 +62,11 @@ contract MockMultisigProposal is MultisigProposal {
}

function validate() public override {
Proxy proxy = Proxy(
IProxy proxy = IProxy(
addresses.getAddress("OPTIMISM_L1_NFT_BRIDGE_PROXY")
);

// implementation() caller must be the owner
vm.startPrank(addresses.getAddress("OPTIMISM_PROXY_ADMIN"));
require(
proxy.implementation() ==
Expand Down
Loading

0 comments on commit 81d8db9

Please sign in to comment.