-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
438cfb0
commit 5d66467
Showing
3 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { | ||
LockDealNFT, | ||
DealProvider, | ||
LockDealProvider, | ||
TimedDealProvider, | ||
VaultManager, | ||
SimpleBuilder | ||
} from "../typechain-types" | ||
import { deploy } from "./utility/deployment" | ||
|
||
async function deployMoonbeamContracts(baseURI: string = "") { | ||
const vaultManager: VaultManager = await deploy("VaultManager") | ||
|
||
// Deploy LockDealNFT contract | ||
const lockDealNFT: LockDealNFT = await deploy("LockDealNFT", vaultManager.address, baseURI) | ||
|
||
// Deploy DealProvider contract | ||
const dealProvider: DealProvider = await deploy("DealProvider", lockDealNFT.address) | ||
|
||
// Deploy LockDealProvider contract | ||
const lockProvider: LockDealProvider = await deploy("LockDealProvider", lockDealNFT.address, dealProvider.address) | ||
|
||
// Deploy TimedDealProvider contract | ||
const timedDealProvider: TimedDealProvider = await deploy("TimedDealProvider", lockDealNFT.address, lockProvider.address) | ||
|
||
// Deploy Buiders | ||
const simpleBuilder: SimpleBuilder = await deploy("SimpleBuilder", lockDealNFT.address) | ||
|
||
let tx = await vaultManager.setTrustee(lockDealNFT.address) | ||
await tx.wait() | ||
await setApprovedContracts(lockDealNFT, [ | ||
dealProvider.address, | ||
lockProvider.address, | ||
timedDealProvider.address, | ||
simpleBuilder.address | ||
]) | ||
} | ||
|
||
const baseURI = process.env.BASEURI || "" | ||
|
||
deployMoonbeamContracts(baseURI).catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) | ||
|
||
async function setApprovedContracts(lockDealNFT: LockDealNFT, contracts: string[]) { | ||
for (const contract of contracts) { | ||
const tx = await lockDealNFT.setApprovedContract(contract, true) | ||
await tx.wait() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters