-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdeploy-snapshot-gate.js
32 lines (29 loc) · 1.3 KB
/
deploy-snapshot-gate.js
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
const hre = require("hardhat");
const { getContractFactory } = hre.ethers;
const environments = require("../../../environments");
const confirmations = hre.network.name == "hardhat" ? 1 : environments.confirmations;
const { getFees } = require("../../util/utils");
/**
* Deploy the SnapshotGate example contract
*
* Examples are not part of the protocol, but rather show how to
* enhance the protocol with contracts that mediate interaction
* with it.
*
* This particular example demonstrates a way to leverage the
* protocol's built-in conditional commit capability in order to
* token-gate offers using a snapshot of holders of an ERC-1155
* token which could be deployed on a different chain.
*
* @param snapshotGateArgs - the constructor arguments for the SnapshotGate contract
* @param maxPriorityFeePerGas - maxPriorityFeePerGas for transactions
* @returns {Promise<(*|*|*)[]>}
*/
async function deploySnapshotGateExample(snapshotGateArgs, maxPriorityFeePerGas) {
// Deploy the SnapshotGate
const SnapshotGate = await getContractFactory("SnapshotGate");
const snapshotGate = await SnapshotGate.deploy(...snapshotGateArgs, await getFees(maxPriorityFeePerGas));
await snapshotGate.waitForDeployment(confirmations);
return [snapshotGate];
}
exports.deploySnapshotGateExample = deploySnapshotGateExample;