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

feat(eth-contracts): add multisig to TokenLockerV2 and CKBChainV2 #87

Merged
merged 15 commits into from Dec 17, 2020

Conversation

cosinlink
Copy link
Contributor

@cosinlink cosinlink commented Dec 8, 2020

  • add multisig to TokenLockerV2 contract based on TokenLocker
  • add new tests to TokenLockerV2
  • add multisig to CKBChainV2 contract based on CKBChain
  • add new tests to CKBChainV2
  • add solidity-coverage to generate coverage reports for eth-contracts
  • upload coverage reports of eth-contracts to codecov in ci

@cosinlink cosinlink force-pushed the multisig branch 2 times, most recently from ef62a2c to f62cbf6 Compare December 9, 2020 03:10
@cosinlink cosinlink changed the title [WIP]feat(eth-contracts): add multisig to TokenLockerV2 and CKBChainV2 feat(eth-contracts): add multisig to TokenLockerV2 and CKBChainV2 Dec 9, 2020
@cosinlink cosinlink force-pushed the multisig branch 2 times, most recently from f06582c to 8d26ba0 Compare December 11, 2020 00:47
@codecov-io
Copy link

codecov-io commented Dec 15, 2020

Codecov Report

Merging #87 (16ec322) into main (6b1a289) will increase coverage by 52.97%.
The diff coverage is 69.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##            main      #87       +/-   ##
==========================================
+ Coverage   8.22%   61.20%   +52.97%     
==========================================
  Files         28       14       -14     
  Lines       4290      750     -3540     
  Branches       0      130      +130     
==========================================
+ Hits         353      459      +106     
+ Misses      3937      291     -3646     
Impacted Files Coverage Δ
eth-contracts/contracts/TokenLocker.sol 52.63% <ø> (ø)
eth-contracts/contracts/libraries/Blake2b.sol 50.00% <ø> (ø)
eth-contracts/contracts/TokenLockerV2.sol 57.14% <57.14%> (ø)
...th-contracts/contracts/libraries/MultisigUtils.sol 80.00% <80.00%> (ø)
eth-contracts/contracts/CKBChainV2.sol 66.45% <94.44%> (ø)
.../eth-recipient-typescript-lib/src/adapter/chain.rs
...ontracts/types/src/generated/eth_recipient_cell.rs
...eth-light-client-lockscript-lib/src/adapter/mod.rs
...s/lib/eth-bridge-lockscript-lib/src/adapter/mod.rs
...ib/eth-recipient-typescript-lib/src/adapter/mod.rs
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e43bdf...16ec322. Read the comment docs.

uint public constant SIGNATURE_SIZE = 65;
uint public constant VALIDATORS_SIZE_LIMIT = 20;
string public constant name = "Force Bridge CKBChain";
// ADD_HEADERS_TYPEHASH = keccak256("AddHeaders(bytes data)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature of the add_header function is AddHeaders(bytes data, bytes signatures), but the hash we used here is AddHeaders(bytes data)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In eip-712, when calc TYPEHASH, the signature of the function should not consider the signatures or r, s, v paramters, I think this is also the norm.

@cryptowen cryptowen merged commit 1f8ee15 into nervosnetwork:main Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants