-
Notifications
You must be signed in to change notification settings - Fork 49
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 #552 from hats-finance/hat-arbitrator-deployment-s…
…cript HATArbitrator deployment script
- Loading branch information
Showing
10 changed files
with
139 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const { network } = require("hardhat"); | ||
const CONFIG = require("../config.js"); | ||
|
||
const func = async function (hre) { | ||
const config = CONFIG[network.name]; | ||
const { deployments, getNamedAccounts } = hre; | ||
const { deploy, execute, read } = deployments; | ||
|
||
const { deployer } = await getNamedAccounts(); | ||
|
||
await deploy('HATArbitrator', { | ||
from: deployer, | ||
args: [ | ||
config.hatArbitratorConf.expertCommittee, | ||
config.hatArbitratorConf.token, | ||
config.hatArbitratorConf.bondsNeededToStartDispute, | ||
config.hatArbitratorConf.minBondAmount, | ||
config.hatArbitratorConf.resolutionChallengePeriod, | ||
config.hatArbitratorConf.submitClaimRequestReviewPeriod | ||
], | ||
log: true, | ||
}); | ||
|
||
await deploy('HATKlerosConnector', { | ||
from: deployer, | ||
args: [ | ||
config.hatKlerosConnectorConf.klerosArbitrator, | ||
config.hatKlerosConnectorConf.arbitratorExtraData, | ||
(await deployments.get('HATArbitrator')).address, | ||
config.hatKlerosConnectorConf.metaEvidence, | ||
config.hatKlerosConnectorConf.winnerMultiplier, | ||
config.hatKlerosConnectorConf.loserMultiplier | ||
], | ||
log: true, | ||
}); | ||
|
||
if((await read('HATArbitrator', {}, 'court')) !== (await deployments.get('HATKlerosConnector')).address) { | ||
await execute('HATArbitrator', { from: deployer, log: true }, 'setCourt', (await deployments.get('HATKlerosConnector')).address); | ||
} | ||
|
||
if ((await read('HATArbitrator', {}, 'owner')) !== (await deployments.get('HATTimelockController')).address) { | ||
await execute('HATArbitrator', { from: deployer, log: true }, 'transferOwnership', (await deployments.get('HATTimelockController')).address); | ||
} | ||
|
||
if ((await read('HATKlerosConnector', {}, 'owner')) !== (await deployments.get('HATTimelockController')).address) { | ||
await execute('HATKlerosConnector', { from: deployer, log: true }, 'transferOwnership', (await deployments.get('HATTimelockController')).address); | ||
} | ||
}; | ||
|
||
module.exports = func; | ||
func.tags = ['HATArbitrator']; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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