-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-bridge-l2.s.sol
84 lines (68 loc) · 2.67 KB
/
deploy-bridge-l2.s.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* Copyright 2024 Circle Internet Group, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
Deploy the RadiusL2Bridge contract on the L2 network.
*/
pragma solidity 0.6.12;
import "forge-std/console.sol"; // solhint-disable no-global-import, no-console
import { Script } from "forge-std/Script.sol";
import { DeployImpl } from "./DeployImpl.sol";
import { FiatTokenProxy } from "../../contracts/v1/FiatTokenProxy.sol";
import { FiatTokenV2_2 } from "../../contracts/v2/FiatTokenV2_2.sol";
import { MasterMinter } from "../../contracts/minting/MasterMinter.sol";
import { RadiusL2Bridge } from "../../contracts/RadiusL2Bridge.sol";
/**
* A utility script to directly deploy Fiat Token contract with the latest implementation
*
* @dev The proxy needs to be deployed before the master minter; the proxy cannot
* be initialized until the master minter is deployed.
*/
contract DeployFiatToken is Script, DeployImpl {
address private immutable THROWAWAY_ADDRESS = address(1);
address private fiat_token_proxy_address;
uint256 private deployerPrivateKey;
/**
* @notice initialize variables from environment
*/
function setUp() public {
fiat_token_proxy_address = vm.envAddress("FIAT_TOKEN_PROXY_ADDRESS");
deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
console.log("FIAT TOKEN PROXY ADDRESS: '%s'", fiat_token_proxy_address);
}
/**
* @dev For testing only: splitting deploy logic into an internal function to expose for testing
*/
function _deploy() internal returns (RadiusL2Bridge) {
vm.startBroadcast(deployerPrivateKey);
RadiusL2Bridge bridge = new RadiusL2Bridge(fiat_token_proxy_address);
vm.stopBroadcast();
return (bridge);
}
/**
* @dev For testing only: Helper function that runs deploy script with a specific implementation address
*/
function deploy() external returns (RadiusL2Bridge) {
return _deploy();
}
/**
* @notice main function that will be run by forge
*/
function run() external returns (RadiusL2Bridge) {
return _deploy();
}
}