Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update max commission rate of public delegation #18

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading