Skip to content

Commit

Permalink
Merge pull request #18 from kaiachain/pd-commission-rate
Browse files Browse the repository at this point in the history
Update max commission rate of public delegation
  • Loading branch information
blukat29 authored Jul 2, 2024
2 parents e26ddc7 + 30ffe48 commit ec429a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract contract PublicDelegationStorage is IPublicDelegation {

uint256 public constant VERSION = 1;

uint256 public constant MAX_COMMISSION_RATE = 3e3; // 30%
uint256 public constant MAX_COMMISSION_RATE = 1e4; // 100%

uint256 public constant COMMISSION_DENOMINATOR = 1e4;

Expand Down
4 changes: 2 additions & 2 deletions contracts/test/CnV3/cnStakingV3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ describe("CnStakingV3 tests", function () {
);

// check public delegation contract
expect(await pd1.MAX_COMMISSION_RATE()).to.equal(3e3);
expect(await pd1.MAX_COMMISSION_RATE()).to.equal(1e4);
expect(await pd1.COMMISSION_DENOMINATOR()).to.equal(1e4);
expect(await pd1.CONTRACT_TYPE()).to.equal("PublicDelegation");
expect(await pd1.VERSION()).to.equal(1);
Expand All @@ -786,7 +786,7 @@ describe("CnStakingV3 tests", function () {
// Too high commission rate
const pdParam = new ethers.utils.AbiCoder().encode(
["tuple(address, address, uint256, string)"],
[[deployer.address, deployer.address, 3001, "GC"]]
[[deployer.address, deployer.address, 10001, "GC"]]
);

await expect(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/PublicDelegation/publicDelegation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe("PublicDelegation tests", function () {
});
it("#updateCommissionRate: can't set commissionRate to more than MAX_COMMISSION_RATE", async function () {
const { pd1 } = await loadFixture(cnV3PublicDelegationFixture);
await expect(pd1.updateCommissionRate(3001)).to.be.revertedWith(
await expect(pd1.updateCommissionRate(10001)).to.be.revertedWith(
"Commission rate is too high."
);
});
Expand Down

0 comments on commit ec429a7

Please sign in to comment.