-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-safe-vault-contract.js
23 lines (21 loc) · 1.08 KB
/
deploy-safe-vault-contract.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { prop } = require('ramda')
const { getProvider } = require('./get-provider')
const { checkEndpoint } = require('./check-endpoint')
const { ENDPOINT_ENV_VAR_KEY } = require('./constants')
const { getEthersWallet } = require('./get-ethers-wallet')
const { getEnvConfiguration } = require('./get-env-configuration')
const { deployEthersContract } = require('./deploy-ethers-contract')
const { getEnvironmentVariable } = require('./get-environment-variable')
const { getSafeVaultContractFactory } = require('./get-contract-factory')
const deploySafeVaultContract = _ =>
console.info('✔ Deploying safe vault contract...') ||
getEnvConfiguration()
.then(() => getEnvironmentVariable(ENDPOINT_ENV_VAR_KEY))
.then(getProvider)
.then(checkEndpoint)
.then(getEthersWallet)
.then(getSafeVaultContractFactory)
.then(_factory => deployEthersContract(_factory, []))
.then(_contract => _contract.deployTransaction.wait())
.then(_receipt => console.info(`✔ Tx Mined! Contract address: ${prop('contractAddress', _receipt)}`))
module.exports = { deploySafeVaultContract }