-
Notifications
You must be signed in to change notification settings - Fork 8
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 #178 from dexe-network/dev
Dev
- Loading branch information
Showing
13 changed files
with
598 additions
and
188 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 |
---|---|---|
@@ -1,14 +1,24 @@ | ||
const config = require("./config/config.json"); | ||
const config = require("./config/utils.js").getConfig(); | ||
|
||
const { ZERO_ADDR } = require("../scripts/utils/constants"); | ||
|
||
const ContractsRegistry = artifacts.require("ContractsRegistry"); | ||
const BABT = artifacts.require("BABTMock"); | ||
const DexeExpertNft = artifacts.require("ERC721Expert"); | ||
|
||
module.exports = async (deployer) => { | ||
const contractsRegistry = await deployer.deployed(ContractsRegistry, "proxy"); | ||
|
||
let babtAddress = config.tokens.BABT; | ||
|
||
if (babtAddress == ZERO_ADDR) { | ||
babtAddress = (await deployer.deploy(BABT)).address; | ||
} | ||
|
||
const nftAddress = (await deployer.deploy(DexeExpertNft, { name: "GlobalExpert" })).address; | ||
|
||
await contractsRegistry.addContract(await contractsRegistry.USD_NAME(), config.tokens.BUSD); | ||
await contractsRegistry.addContract(await contractsRegistry.DEXE_NAME(), config.tokens.DEXE); | ||
await contractsRegistry.addContract(await contractsRegistry.BABT_NAME(), config.tokens.BABT); | ||
await contractsRegistry.addContract(await contractsRegistry.BABT_NAME(), babtAddress); | ||
await contractsRegistry.addProxyContract(await contractsRegistry.DEXE_EXPERT_NFT_NAME(), nftAddress); | ||
}; |
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,10 +1,10 @@ | ||
const config = require("./config/config.json"); | ||
const config = require("./config/utils.js").getConfig(); | ||
|
||
const ContractsRegistry = artifacts.require("ContractsRegistry"); | ||
|
||
module.exports = async (deployer) => { | ||
const contractsRegistry = await deployer.deployed(ContractsRegistry, "proxy"); | ||
|
||
await contractsRegistry.addContract(await contractsRegistry.UNISWAP_V2_ROUTER_NAME(), config.uniswapV2.router); | ||
await contractsRegistry.addContract(await contractsRegistry.UNISWAP_V2_FACTORY_NAME(), config.uniswapV2.factory); | ||
await contractsRegistry.addContract(await contractsRegistry.UNISWAP_V2_ROUTER_NAME(), config.uniswap.router); | ||
await contractsRegistry.addContract(await contractsRegistry.UNISWAP_V2_FACTORY_NAME(), config.uniswap.factory); | ||
}; |
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,170 +1,31 @@ | ||
const { Reporter } = require("@solarity/hardhat-migrate"); | ||
|
||
const config = require("./config/config.json"); | ||
const { getBytesPolynomialPowerInit } = require("./config/utils.js"); | ||
const config = require("./config/utils.js").getConfig(); | ||
|
||
const { ZERO_ADDR, PRECISION } = require("../scripts/utils/constants"); | ||
const { accounts, wei } = require("../scripts/utils/utils"); | ||
const { accounts } = require("../scripts/utils/utils"); | ||
|
||
const ContractsRegistry = artifacts.require("ContractsRegistry"); | ||
const PoolFactory = artifacts.require("PoolFactory"); | ||
|
||
let POOL_PARAMETERS = { | ||
settingsParams: { | ||
proposalSettings: [ | ||
{ | ||
earlyCompletion: true, | ||
delegatedVotingAllowed: false, | ||
validatorsVote: false, | ||
duration: 432000, // 5 days | ||
durationValidators: 432000, // 5 days | ||
quorum: PRECISION.times("5").toFixed(), // 5% | ||
quorumValidators: PRECISION.times("51").toFixed(), // 51% | ||
minVotesForVoting: wei("13"), // 13 votes | ||
minVotesForCreating: wei("10000"), // 10000 votes | ||
executionDelay: 1800, // 30 mins | ||
rewardsInfo: { | ||
rewardToken: ZERO_ADDR, | ||
creationReward: 0, | ||
executionReward: 0, | ||
voteRewardsCoefficient: 0, | ||
}, | ||
executorDescription: "default", | ||
}, | ||
{ | ||
earlyCompletion: true, | ||
delegatedVotingAllowed: false, | ||
validatorsVote: false, | ||
duration: 432000, // 5 days | ||
durationValidators: 432000, // 5 days | ||
quorum: PRECISION.times("5").toFixed(), // 5% | ||
quorumValidators: PRECISION.times("51").toFixed(), // 51% | ||
minVotesForVoting: wei("13"), // 13 votes | ||
minVotesForCreating: wei("10000"), // 10000 votes | ||
executionDelay: 1800, // 30 mins | ||
rewardsInfo: { | ||
rewardToken: ZERO_ADDR, | ||
creationReward: 0, | ||
executionReward: 0, | ||
voteRewardsCoefficient: 0, | ||
}, | ||
executorDescription: "internal", | ||
}, | ||
{ | ||
earlyCompletion: true, | ||
delegatedVotingAllowed: false, | ||
validatorsVote: false, | ||
duration: 432000, // 5 days | ||
durationValidators: 432000, // 5 days | ||
quorum: PRECISION.times("5").toFixed(), // 5% | ||
quorumValidators: PRECISION.times("51").toFixed(), // 51% | ||
minVotesForVoting: wei("13"), // 13 votes | ||
minVotesForCreating: wei("10000"), // 10000 votes | ||
executionDelay: 1800, // 30 mins | ||
rewardsInfo: { | ||
rewardToken: ZERO_ADDR, | ||
creationReward: 0, | ||
executionReward: 0, | ||
voteRewardsCoefficient: 0, | ||
}, | ||
executorDescription: "validators", | ||
}, | ||
], | ||
additionalProposalExecutors: [], | ||
}, | ||
validatorsParams: { | ||
name: "DEXE Validator Token", | ||
symbol: "DEXEVT", | ||
proposalSettings: { | ||
duration: 432000, // 5 days | ||
executionDelay: 1800, // 30 mins | ||
quorum: PRECISION.times("51").toFixed(), // 51% | ||
}, | ||
validators: [], | ||
balances: [], | ||
}, | ||
userKeeperParams: { | ||
tokenAddress: config.tokens.DEXE, | ||
nftAddress: ZERO_ADDR, | ||
individualPower: 0, | ||
nftsTotalSupply: 0, | ||
}, | ||
tokenParams: { | ||
name: "", | ||
symbol: "", | ||
users: [], | ||
cap: 0, | ||
mintedTotal: 0, | ||
amounts: [], | ||
}, | ||
votePowerParams: { | ||
voteType: 1, | ||
initData: getBytesPolynomialPowerInit(PRECISION.times("1.08"), PRECISION.times("0.92"), PRECISION.times("0.97")), | ||
presetAddress: ZERO_ADDR, | ||
}, | ||
verifier: ZERO_ADDR, | ||
onlyBABTHolders: false, | ||
descriptionURL: "", | ||
name: config.DEXEDAO.name, | ||
}; | ||
|
||
const DP_SETTINGS = { | ||
earlyCompletion: true, | ||
delegatedVotingAllowed: true, | ||
validatorsVote: false, | ||
duration: 432000, // 5 days | ||
durationValidators: 432000, // 5 days | ||
quorum: PRECISION.times("5").toFixed(), // 5% | ||
quorumValidators: PRECISION.times("51").toFixed(), // 51% | ||
minVotesForVoting: wei("13"), // 13 votes | ||
minVotesForCreating: wei("10000"), // 10000 votes | ||
executionDelay: 1800, // 30 mins | ||
rewardsInfo: { | ||
rewardToken: ZERO_ADDR, | ||
creationReward: 0, | ||
executionReward: 0, | ||
voteRewardsCoefficient: 0, | ||
}, | ||
executorDescription: "distribution-proposal", | ||
}; | ||
|
||
const TOKENSALE_SETTINGS = { | ||
earlyCompletion: true, | ||
delegatedVotingAllowed: false, | ||
validatorsVote: false, | ||
duration: 432000, // 5 days | ||
durationValidators: 432000, // 5 days | ||
quorum: PRECISION.times("5").toFixed(), // 5% | ||
quorumValidators: PRECISION.times("51").toFixed(), // 51% | ||
minVotesForVoting: wei("13"), // 13 votes | ||
minVotesForCreating: wei("10000"), // 10000 votes | ||
executionDelay: 1800, // 30 mins | ||
rewardsInfo: { | ||
rewardToken: ZERO_ADDR, | ||
creationReward: 0, | ||
executionReward: 0, | ||
voteRewardsCoefficient: 0, | ||
}, | ||
executorDescription: "tokensale-proposal", | ||
}; | ||
|
||
module.exports = async (deployer) => { | ||
const contractsRegistry = await deployer.deployed(ContractsRegistry, "proxy"); | ||
|
||
const poolFactory = await deployer.deployed(PoolFactory, await contractsRegistry.getPoolFactoryContract()); | ||
|
||
const predictedGovAddresses = await poolFactory.predictGovAddresses(await accounts(0), POOL_PARAMETERS.name); | ||
const predictedGovAddresses = await poolFactory.predictGovAddresses(await accounts(0), config.DEXE_DAO_NAME); | ||
deployer.dexeDaoAddress = predictedGovAddresses.govPool; | ||
|
||
await contractsRegistry.addContract(await contractsRegistry.TREASURY_NAME(), deployer.dexeDaoAddress); | ||
|
||
POOL_PARAMETERS.settingsParams.proposalSettings.push(DP_SETTINGS); | ||
POOL_PARAMETERS.settingsParams.additionalProposalExecutors.push(predictedGovAddresses.distributionProposal); | ||
const PARAMETERS = config.POOL_PARAMETERS; | ||
|
||
PARAMETERS.settingsParams.proposalSettings.push(config.DP_SETTINGS); | ||
PARAMETERS.settingsParams.additionalProposalExecutors.push(predictedGovAddresses.distributionProposal); | ||
|
||
POOL_PARAMETERS.settingsParams.proposalSettings.push(TOKENSALE_SETTINGS); | ||
POOL_PARAMETERS.settingsParams.additionalProposalExecutors.push(predictedGovAddresses.govTokenSale); | ||
PARAMETERS.settingsParams.proposalSettings.push(config.TOKENSALE_SETTINGS); | ||
PARAMETERS.settingsParams.additionalProposalExecutors.push(predictedGovAddresses.govTokenSale); | ||
|
||
await poolFactory.deployGovPool(POOL_PARAMETERS); | ||
await poolFactory.deployGovPool(PARAMETERS); | ||
|
||
Reporter.reportContracts(["DEXE DAO", deployer.dexeDaoAddress]); | ||
}; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.