This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSNstDeploy.sol
44 lines (35 loc) · 1.61 KB
/
SNstDeploy.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
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity ^0.8.21;
import { ScriptTools } from "dss-test/ScriptTools.sol";
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "dss-interfaces/Interfaces.sol";
import { SNst } from "src/SNst.sol";
import { SNstInstance } from "./SNstInstance.sol";
library SNstDeploy {
function deploy(
address deployer,
address owner,
address nstJoin
) internal returns (SNstInstance memory instance) {
ChainlogAbstract chainlog = ChainlogAbstract(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F);
address _sNstImp = address(new SNst(nstJoin, chainlog.getAddress("MCD_VOW")));
address _sNst = address(new ERC1967Proxy(_sNstImp, abi.encodeCall(SNst.initialize, ())));
ScriptTools.switchOwner(_sNst, deployer, owner);
instance.sNst = _sNst;
instance.sNstImp = _sNstImp;
}
}