Skip to content

Commit

Permalink
setting contracts as core on deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalman6 committed Aug 28, 2024
1 parent e104429 commit d2fd833
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 16 deletions.
4 changes: 4 additions & 0 deletions contracts/DiamondDao.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ contract DiamondDao is IDiamondDao, Initializable, ReentrancyGuardUpgradeable, V
address _validatorSet,
address _stakingHbbft,
address _reinsertPot,
address _txPermission,
uint256 _createProposalFee,
uint64 _startTimestamp
) external initializer {
Expand Down Expand Up @@ -174,6 +175,9 @@ contract DiamondDao is IDiamondDao, Initializable, ReentrancyGuardUpgradeable, V
);

isCoreContract[address(this)] = true;
isCoreContract[_stakingHbbft] = true;
isCoreContract[_txPermission] = true;
isCoreContract[_reinsertPot] = true;
}

function setCreateProposalFee(uint256 _fee) external onlyGovernance withinAllowedRange(_fee) {
Expand Down
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function deploy() {
"0x1000000000000000000000000000000000000001", // ValidatorSetHbbf
"0x1100000000000000000000000000000000000001", // StakingHbbft
"0x2000000000000000000000000000000000000001", // _reinsertPot
"0x4000000000000000000000000000000000000001", // _txPermission,
createProposalFee,
startTimestamp,
]);
Expand Down
1 change: 1 addition & 0 deletions scripts/deployForChainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async function compileProxy() {
"0x1000000000000000000000000000000000000001", //address _validatorSet,
"0x1100000000000000000000000000000000000001", //address _stakingHbbft,
"0x2000000000000000000000000000000000000001", //address _reinsertPot,
"0x4000000000000000000000000000000000000001", //address _txPermission,
ethers.parseEther("1"),//uint256 _createProposalFee,
startTimeBigInt //uint64 _startTimestamp
];
Expand Down
9 changes: 9 additions & 0 deletions test/DiamondDao.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe("DiamondDao contract", function () {
await mockValidatorSet.getAddress(),
await mockStaking.getAddress(),
reinsertPot.address,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand Down Expand Up @@ -151,6 +152,7 @@ describe("DiamondDao contract", function () {
ethers.ZeroAddress,
users[1].address,
users[2].address,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand All @@ -168,6 +170,7 @@ describe("DiamondDao contract", function () {
users[1].address,
ethers.ZeroAddress,
users[2].address,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand All @@ -185,6 +188,7 @@ describe("DiamondDao contract", function () {
users[1].address,
users[2].address,
ethers.ZeroAddress,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand All @@ -202,6 +206,7 @@ describe("DiamondDao contract", function () {
users[1].address,
users[2].address,
users[3].address,
ethers.ZeroAddress,
0n,
startTime + 1
], {
Expand All @@ -219,6 +224,7 @@ describe("DiamondDao contract", function () {
users[1].address,
users[2].address,
users[3].address,
ethers.ZeroAddress,
createProposalFee,
startTime - 10
], {
Expand All @@ -235,6 +241,7 @@ describe("DiamondDao contract", function () {
users[1].address,
users[2].address,
users[3].address,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand All @@ -248,6 +255,7 @@ describe("DiamondDao contract", function () {
users[1].address,
users[2].address,
users[3].address,
ethers.ZeroAddress,
createProposalFee,
startTime + 1
)
Expand Down Expand Up @@ -452,6 +460,7 @@ describe("DiamondDao contract", function () {
await mockValidatorSet.getAddress(),
await mockValidatorSet.getAddress(),
await mockValidatorSet.getAddress(),
ethers.ZeroAddress,
createProposalFee,
startTime + 1
], {
Expand Down
1 change: 1 addition & 0 deletions test/ProposalExecution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe("DAO proposal execution", function () {
await mockValidatorSet.getAddress(),
await mockStaking.getAddress(),
reinsertPot.address,
ethers.ZeroAddress,
createProposalFee,
startTime + 10
], {
Expand Down
1 change: 1 addition & 0 deletions test/ProposalFinalization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe("Proposal Acceptance Threshold", function () {
await mockValidatorSet.getAddress(),
await mockStaking.getAddress(),
reinsertPot.address,
ethers.ZeroAddress,
createProposalFee,
startTime + 10
], {
Expand Down
1 change: 1 addition & 0 deletions test/ProposalValueGuards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe("DAO Ecosystem Paramater Change Value Guards Test", function () {
await mockValidatorSet.getAddress(),
await mockStaking.getAddress(),
reinsertPot.address,
ethers.ZeroAddress,
createProposalFee,
startTime + 10
], {
Expand Down

0 comments on commit d2fd833

Please sign in to comment.