forked from scroll-tech/scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScrollTestBase.t.sol
27 lines (19 loc) · 959 Bytes
/
ScrollTestBase.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;
import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol";
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import {ITransparentUpgradeableProxy, TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {EmptyContract} from "../misc/EmptyContract.sol";
abstract contract ScrollTestBase is DSTestPlus {
ProxyAdmin internal admin;
EmptyContract private placeholder;
function __ScrollTestBase_setUp() internal {
admin = new ProxyAdmin();
placeholder = new EmptyContract();
}
function _deployProxy(address _logic) internal returns (address) {
if (_logic == address(0)) _logic = address(placeholder);
TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(_logic, address(admin), new bytes(0));
return address(proxy);
}
}