-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
4,744 additions
and
20,184 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
18,905 changes: 1,677 additions & 17,228 deletions
18,905
packages/contracts/.openzeppelin/unknown-51.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
49 changes: 49 additions & 0 deletions
49
packages/contracts/deploy/04_testing_configs/01_add_master_node.ts
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,49 @@ | ||
import DaoData from '../../dao-initial-data-internal-demo.json'; | ||
import {DaofinPluginSetupParams} from '../../plugin-settings'; | ||
import {XDCValidator__factory} from '../../typechain'; | ||
import {BigNumberish} from 'ethers'; | ||
import {ethers} from 'hardhat'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
|
||
export type DaofinPluginInstall = { | ||
globalSettings: { | ||
xdcValidator: string; | ||
amounts: BigNumberish[]; | ||
}; | ||
committeeSettings: any[]; | ||
electionPeriods: BigNumberish[]; | ||
}; | ||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
console.log('Adding MasterNodes...'); | ||
|
||
const [deployer] = await hre.ethers.getSigners(); | ||
const network = process.env.NETWORK_NAME | ||
? process.env.NETWORK_NAME | ||
: hre.network.name; | ||
|
||
const {METADATA, XDCMasterNodeTestingAddress} = DaofinPluginSetupParams; | ||
Check failure on line 25 in packages/contracts/deploy/04_testing_configs/01_add_master_node.ts GitHub Actions / tests
|
||
// @ts-ignore | ||
Check failure on line 26 in packages/contracts/deploy/04_testing_configs/01_add_master_node.ts GitHub Actions / tests
|
||
const daoParams = DaoData[network]; | ||
|
||
if (network === 'apothem' || network === 'anvil') { | ||
const validatorContract = await ethers.getContractAt( | ||
'XDCValidator', | ||
daoParams['xdcValidatorAddress'] | ||
); | ||
for (const address of daoParams['dummyMasterNodeAddresses']) { | ||
const isExist = await validatorContract.isCandidate(address); | ||
|
||
if (!isExist) { | ||
const tx = await validatorContract.addCandidate(address); | ||
console.log('XDCValidatorMock', `${address} : ${tx.hash}`); | ||
await tx.wait(); | ||
} else { | ||
console.log(`${address}`); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default func; | ||
func.tags = []; |
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
Oops, something went wrong.