Skip to content

Commit

Permalink
Better logging for option factory
Browse files Browse the repository at this point in the history
  • Loading branch information
ggviana committed Jul 9, 2021
1 parent 432ed31 commit 407d50e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions tasks/option/deployOptionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ internalTask('deployOptionBuilder', 'Deploy OptionBuilder')
.addParam('optiontype', 'Eg: PodPut, WPodPut, AavePodPut, PodCall, WPodCall, AavePodCall')
.addFlag('save', 'if true, it should save the contract address inside the deployments folder')
.addFlag('verify', 'if true, it should verify the contract after the deployment')
.setAction(async ({ optiontype, save, verify }, hre) => {
.addFlag('quiet', 'makes the deployment process less verbose')
.setAction(async ({ optiontype, save, verify, quiet }, hre) => {
switch (optiontype) {
case 'PodPut':
case 'WPodPut':
Expand All @@ -15,7 +16,8 @@ internalTask('deployOptionBuilder', 'Deploy OptionBuilder')
return await hre.run('deploy', {
name: contractName,
save,
verify
verify,
quiet
})
default:
throw new Error('Builder not found! Available Builders: PodPut, WPodPut, AavePodPut, PodCall, WPodCall, AavePodCall')
Expand Down
14 changes: 8 additions & 6 deletions tasks/option/deployOptionFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ task('deployOptionFactory', 'Deploy OptionFactory')
validateAddress(configuration, 'configuration')

if (builders) {
podputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'PodPut', save: true, verify })
wpodputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'WPodPut', save: true, verify })
aavepodputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'AavePodPut', save: true, verify })
podcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'PodCall', save: true, verify })
wpodcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'WPodCall', save: true, verify })
aavepodcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'AavePodCall', save: true, verify })
console.log(`Deploying OptionBuilders...`)
podputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'PodPut', save: true, verify, quiet: true })
wpodputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'WPodPut', save: true, verify, quiet: true })
aavepodputbuilder = await hre.run('deployOptionBuilder', { optiontype: 'AavePodPut', save: true, verify, quiet: true })
podcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'PodCall', save: true, verify, quiet: true })
wpodcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'WPodCall', save: true, verify, quiet: true })
aavepodcallbuilder = await hre.run('deployOptionBuilder', { optiontype: 'AavePodCall', save: true, verify, quiet: true })
console.log(`OptionBuilders deployed successfully!`)
}

const factoryAddress = await hre.run('deploy', {
Expand Down

0 comments on commit 407d50e

Please sign in to comment.