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

Merge queued PRs into dev #31

Merged
merged 15 commits into from
Jul 3, 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
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Please put an x in the boxes related to your change.

## Checklist

*Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.*
_Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/kaiachain/kaia/blob/main/CONTRIBUTING.md) doc
- [ ] I have read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) and signed by comment ```I have read the CLA Document and I hereby sign the CLA``` in first time contribute
- [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/kaiachain/kaia/blob/main/CONTRIBUTING.md) doc
- [ ] I have read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) and signed by comment `I have read the CLA Document and I hereby sign the CLA` in first time contribute
- [ ] Lint and unit tests pass locally with my changes (`$ make test`)
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
Expand Down
2 changes: 1 addition & 1 deletion api/api_private_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Byt
return common.Address{}, errors.New("signature must be 65 bytes long")
}
if sig[crypto.RecoveryIDOffset] != 27 && sig[crypto.RecoveryIDOffset] != 28 {
return common.Address{}, errors.New("invalid Klaytn signature (V is not 27 or 28)")
return common.Address{}, errors.New("invalid signature (V is not 27 or 28)")
}

// Transform yellow paper V from 27/28 to 0/1
Expand Down
4 changes: 2 additions & 2 deletions api/api_public_transaction_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,10 @@ func (s *PublicTransactionPoolAPI) RecoverFromMessage(
ctx context.Context, address common.Address, data, sig hexutil.Bytes, blockNumber rpc.BlockNumber,
) (common.Address, error) {
if len(sig) != crypto.SignatureLength {
return common.Address{}, fmt.Errorf("signature must be 65 bytes long")
return common.Address{}, errors.New("signature must be 65 bytes long")
}
if sig[crypto.RecoveryIDOffset] != 27 && sig[crypto.RecoveryIDOffset] != 28 {
return common.Address{}, fmt.Errorf("invalid Klaytn signature (V is not 27 or 28)")
return common.Address{}, errors.New("invalid signature (V is not 27 or 28)")
}

// Transform yellow paper V from 27/28 to 0/1
Expand Down
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
2 changes: 1 addition & 1 deletion contracts/docs/CnStakingV3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A member of Kaia Governance Council (GC) must own at least one CnStaking contract. There are three versions of CnStaking contract so far.

- [Deprecated] legacy/CnStakingContract (CnSV1): The original CnStaking contract that is being used since the start of Kaia mainnet.
- [Deprecated] legacy/CnStakingContract (CnSV1): The original CnStaking contract that is being used since the start of Klaytn mainnet.
- CnStakingV2 (CnSV2): An upgraded version of CnSV1, having all interfaces of V1 as well as new governance-related features.
- CnStakingV3MultiSig (CnSV3): An upgraded version of CnSV2, having all features of V2 as well as new public delegation features.

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
Loading