-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeployProxy.s.sol
More file actions
28 lines (21 loc) · 1.04 KB
/
DeployProxy.s.sol
File metadata and controls
28 lines (21 loc) · 1.04 KB
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
28
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import {IProxyForge} from "src/interfaces/IProxyForge.sol";
import {BaseScript} from "./BaseScript.sol";
contract DeployProxy is BaseScript {
IProxyForge internal constant FORGE = IProxyForge(0x58b819827cB18Ba425906C69E1Bfb22F27Cb1bCe);
function run() external broadcast returns (address proxy) {
require(address(FORGE).code.length != 0, "ProxyForge not exists");
address implementation = vm.promptAddress("Implementation");
address owner = promptAddress("Owner", broadcaster);
bool isDeterministic = promptBool("Is Deterministic");
bytes32 salt;
if (isDeterministic) salt = promptBytes32("Salt");
bytes memory data = promptBytes("Data");
uint256 value;
if (data.length != 0) value = promptUint256("msg.value");
proxy = isDeterministic
? FORGE.deployDeterministicAndCall{value: value}(implementation, owner, salt, data)
: FORGE.deployAndCall{value: value}(implementation, owner, data);
}
}