-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into features/add-sushi-token
- Loading branch information
Showing
14 changed files
with
82 additions
and
299 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
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 |
---|---|---|
@@ -1,43 +1,17 @@ | ||
|
||
const saveJSON = require('../utils/saveJSON') | ||
const verifyContract = require('../utils/verify') | ||
const validateAddress = require('../utils/validateAddress') | ||
|
||
internalTask('deployBS', 'Deploy Black Scholes') | ||
.addFlag('verify', 'if true, it should verify the contract after the deployment') | ||
.addParam('normaldist', 'Normal Distribution Address') | ||
.addOptionalParam('fixidity', 'fixidity address to use') | ||
.addOptionalParam('logarithm', 'logarithm address to use') | ||
.addOptionalParam('exponent', 'exponent address to use') | ||
.addFlag('deploylibs', 'Activate this parameter if you want to deploy libs') | ||
.setAction(async ({ normaldist, fixidity, logarithm, deploylibs, verify }, hre) => { | ||
const path = `../../deployments/${hre.network.name}.json` | ||
let libs = { | ||
fixidity, | ||
logarithm | ||
} | ||
|
||
if (deploylibs) { | ||
libs = await run('deployLibs') | ||
} | ||
|
||
console.log('libs', libs) | ||
|
||
const libObj = { | ||
FixidityLib: libs.fixidity, | ||
LogarithmLib: libs.logarithm | ||
} | ||
|
||
const BlackScholes = await hre.ethers.getContractFactory('BlackScholes', { | ||
libraries: libObj | ||
.setAction(async ({ normaldist, verify }, hre) => { | ||
validateAddress(normaldist, 'normaldist') | ||
|
||
const bsAddress = await hre.run('deploy', { | ||
name: 'BlackScholes', | ||
args: [normaldist], | ||
save: true, | ||
verify | ||
}) | ||
|
||
const bs = await BlackScholes.deploy(normaldist) | ||
await bs.deployed() | ||
await saveJSON(path, { BlackScholes: bs.address }) | ||
|
||
if (verify) { | ||
await verifyContract(hre, bs.address, [normaldist], libObj) | ||
} | ||
console.log('BlackScholes Address', bs.address) | ||
return bs.address | ||
return bsAddress | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.