-
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.
Merge pull request #37 from The-Poolz/moonbeam
add menu item `deploy core contracts without refund` 1642919062
- Loading branch information
Showing
4 changed files
with
69 additions
and
8 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
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
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 deployAllContractsWithoutRefund(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 || "" | ||
|
||
deployAllContractsWithoutRefund(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() | ||
} | ||
} |