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: add solidity multi protocol xCall #86

Merged
merged 30 commits into from
Oct 23, 2023

Conversation

AntonAndell
Copy link
Collaborator

@AntonAndell AntonAndell commented Sep 18, 2023

Description:

Commit Message

type: commit message

see the guidelines for commit messages.

Changelog Entry

version: <log entry>

Checklist:

  • I have performed a self-review of my own code
  • I have documented my code in accordance with the documentation guidelines
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the unit tests
  • I only have one commit (if not, squash them into one commit).
  • I have a descriptive commit message that adheres to the commit message guidelines

Please review the CONTRIBUTING.md file for detailed contributing guidelines.

AntonAndell and others added 15 commits August 21, 2023 10:23
* remove msg encoding in encodeCSMessageResponse

* chore: forge init

* forge install: forge-std

v1.6.1

* initial foundry setup

* forge install: openzeppelin-contracts-upgradeable

v4.9.3

* forge install: openzeppelin-contracts

v4.9.3

* add contract setup script for Callservice for Xcall

* add initial test setup for Xcall
* add setAdmin testCases
- setAdmin by Owner
- setAdmin by unauthorized caller


---------

Co-authored-by: AntonAndell <[email protected]>
* add setProtocolFee and getProtocolFee testCases
- setProtocolFee by Owner
- setProtocolFee by added admin
- setProtocolFee by unauthrorized user

---------

Co-authored-by: AntonAndell <[email protected]>
* add setProtocolFeeHandler and getProtocolFeeHandler testCases
- setProtocolFeeHandler by Owner/Admin
- setProtocolFee by unauthrorized user

---------

Co-authored-by: AntonAndell <[email protected]>
* add defaultConnection check on sendCallMessage

* add defaultConnection setter for xCall

* add revert messages on require()
* update encodeCSMessageRequest with protocol encoded code
* add defaultConnection check on sendCallMessage

* add defaultConnection setter for xCall

* add revert messages on require()

* - add CallMessage eventLog for assertion
- Add Connection instances
- Add required const variables for netTo for NID and dstAccount for addr

* add testCase for HandleResponse
- DefaultProtocol with access
- DefaultProtocol with unauthorized access

* TestCases
- handleResponse with singleProtocol
- handleResponse with singleProtocol by unauthorized

* TestCases
- handleResponse with MultiProtocol

---------

Co-authored-by: AntonAndell <[email protected]>
* TestCases
- executeCall using singleProtocol

* Add `CallExecuted` eventlogs for assertions

* TestCases
- executeCall using defaultProtocol

* TestCases
- executeCall using multiProtocols
* fix: clearing out unused code

* fix: clearing out contract part in library

---------

Co-authored-by: AntonAndell <[email protected]>
* update solidity document to deploy tthe contract as well as getting ready with forge commands

* update solidity document to deploy tthe contract as well as getting ready with forge commands
* TestCases
- Rollback using singleProtocol

* TestCases
- Rollback using DefaultProtocol
- Rollback using DefaultProtocol NotAuthorized

* TestCases
- Rollback using MultiProtocol
- Rollback with SuccessMessage

* fix rollbackSuccess testcase to remove rollbackMessage eventlog

* remove rollbackMessage eventlogs from executeCall()
* - Fix variables
- Fix Imports
- TestCases
    - ExecuteRollback using SingleProtocol
    - ExecuteRollback with DefaultProtocol
    - ExecuteRollback using MultiProtocol

* fix executeRollack testcases
@sdpisreddevil sdpisreddevil changed the title Feature/add evm multi protocol xcall feat: add solidity multi protocol xCall Sep 26, 2023
sdpisreddevil and others added 5 commits September 26, 2023 08:18
* fix sendCallMessageSingleProtocol testCase

* add `CallMessgeSent` eventLog for test

* add testCase for sendMessage using multiProtocol

* add testCase for sendMessage using defaultProtocol

* Fix expectCall on sendMessage TestCases

---------

Co-authored-by: AntonAndell <[email protected]>
* fix: deployment script updated

* fix: foundry.toml

* fix: nid taken from env

* update deployment script to add the setup params for xcall-multi

* update deploy script on shellScript file to deploy the contracts easily from CLI

* add .env example file to follow to deploy the xcall

---------

Co-authored-by: sdpbhandari <[email protected]>
* fix imports error after merge

* Fix verifySuccess()
Add assert on verifySuccess for rollback tests
Add assert on verifySuccess for executeRollback tests
* ci: add solidity coverage workflow

* ci: test codcov workflow

* ci: debug foundy setup issue

* ci: debug foundy setup issue

* ci: debug foundy setup issue

* ci: debug foundy setup issue

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: export foundryup PATH

* ci: fix build on forge

* ci: fix build on forge

* ci: fix build on forge

* ci: fix build on forge

* ci: fix build on forge

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build path on workflows

* ci: fix build paths on workflows

* ci: add workflow for solidity-tests

* ci: add env on workflow

* ci: update test workflow

* ci: update test workflow ignore libraries from coverage folder

* ci: install lcov

* ci: install lcov

---------

Co-authored-by: Deepak Bomjan <[email protected]>
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #86 (f60af4f) into main (caaf7a0) will decrease coverage by 5.97%.
The diff coverage is 62.63%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #86      +/-   ##
============================================
- Coverage     68.60%   62.63%   -5.97%     
============================================
  Files            29        3      -26     
  Lines          1736      182    -1554     
  Branches         33        0      -33     
============================================
- Hits           1191      114    -1077     
+ Misses          529       68     -461     
+ Partials         16        0      -16     
Flag Coverage Δ
java ?
rust ?
solidity 62.63% <62.63%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...racts/evm/contracts/mocks/dapp/DAppProxySample.sol 0.00% <0.00%> (ø)
...ks/multi-protocol-dapp/MultiProtocolSampleDapp.sol 0.00% <0.00%> (ø)
contracts/evm/contracts/xcall/CallService.sol 80.85% <80.85%> (ø)

... and 29 files with indirect coverage changes

@AntonAndell AntonAndell marked this pull request as ready for review October 23, 2023 04:05
@github-actions github-actions bot added documentation Improvements or additions to documentation cicd labels Oct 23, 2023
@AntonAndell AntonAndell added feature enhancement New feature or request and removed documentation Improvements or additions to documentation cicd feature labels Oct 23, 2023
@github-actions github-actions bot added documentation Improvements or additions to documentation cicd labels Oct 23, 2023
@AntonAndell AntonAndell merged commit 6779754 into main Oct 23, 2023
22 of 24 checks passed
@AntonAndell AntonAndell deleted the feature/add-evm-multi-protocol-xcall branch October 23, 2023 13:06
Copy link
Collaborator Author

@AntonAndell AntonAndell left a comment

Choose a reason for hiding this comment

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

Looks good to me, moving it to main to ease development of dependent projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xCall - Solidity - Smart Contract Internal Security Review
4 participants