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

Add automated toolings for testing contracts #151

Merged
merged 6 commits into from
Jun 24, 2024

Conversation

matjazv
Copy link
Contributor

@matjazv matjazv commented May 30, 2024

What was the problem?

This PR resolves #150.

How was it solved?

Integrate Slither:

  • GitHub actions are using Slither when PR is created
  • It is possible to locally execute Slither tool to see the results

Integrate slither-mutate:

  • It is possible to locally execute slither-mutate tool to see the results

It is not possible to use slither-mutate inside GitHub actions. If target system is:

  • Linux: the error is: The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled. Process completed with exit code 143. This error doesn't say what is a specific reason to fail but this link explains meaning of the given error. On Linux machine slither-mutate fails because of runner has fallen due to high CPU usage rate.
  • MacOS: the error is: The job running on runner GitHub Actions has exceeded the maximum execution time of 360 minutes. The operation was canceled.
  • Windows: the error is: The job running on runner GitHub Actions has exceeded the maximum execution time of 360 minutes. The operation was canceled.

Integrate Echidna:

  • It is possible to locally execute Echidna tool to see the results
  • To use Echidna tool, a new tests need to be written. There is one test implemented to demonstrate its usage
  • To get familiar with Echidna, a provided link may be used: Echidna docs

How was it tested?

Tested locally + GitHub Actions

@matjazv matjazv self-assigned this May 30, 2024
@matjazv matjazv force-pushed the 150-automated-test-toolings branch 2 times, most recently from 3089015 to 2da6792 Compare May 30, 2024 07:40
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@matjazv matjazv force-pushed the 150-automated-test-toolings branch 11 times, most recently from d895a46 to 38c7d25 Compare June 3, 2024 14:38
@matjazv matjazv changed the title Add Slither support in GH actions Add automated toolings for testing contracts Jun 5, 2024
@matjazv matjazv changed the base branch from main to development June 5, 2024 16:01
@matjazv matjazv force-pushed the 150-automated-test-toolings branch from 4c5e33b to 24945a8 Compare June 6, 2024 07:14
@matjazv matjazv requested review from has5aan and gkoumout June 6, 2024 07:21
@matjazv matjazv force-pushed the 150-automated-test-toolings branch 10 times, most recently from 3684068 to 25eebbd Compare June 6, 2024 17:37
@matjazv matjazv force-pushed the 150-automated-test-toolings branch 2 times, most recently from 13b4259 to fd0387b Compare June 10, 2024 10:06
@matjazv matjazv force-pushed the development branch 2 times, most recently from cd27bb5 to 221d1c7 Compare June 18, 2024 07:08
@matjazv matjazv force-pushed the 150-automated-test-toolings branch from fd0387b to a105603 Compare June 18, 2024 07:20
Copy link
Contributor

@gkoumout gkoumout left a comment

Choose a reason for hiding this comment

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

Just left few minor comments

@matjazv matjazv force-pushed the 150-automated-test-toolings branch from 773c03b to 5431c58 Compare June 21, 2024 11:20
@matjazv matjazv merged commit a8c0e71 into development Jun 24, 2024
4 checks passed
@matjazv matjazv deleted the 150-automated-test-toolings branch June 24, 2024 07:43
matjazv added a commit that referenced this pull request Jun 24, 2024
* Add Slither support in GH actions

* Add slither-mutate support for local execution

* Add readme for test directory

* Fix rebasing with development

* Add Echidna support for local execution

* Fix spelling typo
matjazv added a commit that referenced this pull request Jun 26, 2024
* Add Slither support in GH actions

* Add slither-mutate support for local execution

* Add readme for test directory

* Fix rebasing with development

* Add Echidna support for local execution

* Fix spelling typo
shuse2 pushed a commit that referenced this pull request Jun 26, 2024
* Add Slither support in GH actions

* Add slither-mutate support for local execution

* Add readme for test directory

* Fix rebasing with development

* Add Echidna support for local execution

* Fix spelling typo
shuse2 pushed a commit that referenced this pull request Jul 11, 2024
* Add SwapAndBridge contract and Lido deployment and tests

* SwapAndBridge: Remove duplicate variables, add check against 0 address in constructor, and add slippage check

* SwapAndBridge: Remove duplicate variables, add check against 0 address in constructor, and add slippage check

* Added e2e tests.

* clean up deploy.sh

* SwapAndBridge.sol: add docs to constructor

* Clean up test

* update .env.example

* Clean up deployment script

* Clean up env file

* Add more balance for tests

* Add unit tests

* forge install: solady

v0.0.180

* remove unused contracts, update tests

* automate deployment

* fix env.example

* cleanup SwapAndBridge tests

* address review

* update contract license

* address review

* Fix E2E tests for Diva

* Minor fixes to Utils.sol

* Update Utils.sol with SwapAndBridge functionalities

* Fix import in Utils.sol

* Fix import in Utils.sol

* Fix variable usage

* Move env variables to contract constants to fix CI

* Fix formatting

* Remove use of env variables

* remove unused TOKEN_HOLDER_PRIV_KEY variable

* Save temporary data files to local storage

* fix fmt

* Move e2e tests to script

* Move integration tests to script; add unit tests

* remove old test folder

* Fix integration tests

* remove unnecessary function

* Add new unit tests

* Add mock contracts

* add tests for L2WdivETH

* Add AccessControl to VestingWallet

* Add NatSpec comments

* Update contract owner

* Added NatSpec and beneficiary check

* Remove redundant mappings

* Improve contract interface

* Increase test coverage

* Update data for Testnet migration (#135)

Merkle root was added and unneeded account removed from accounts_2.json

* Add address checking to contract

* Update error message

* Add virtual to functions

* Vesting Wallet on Ethereum L1 Mainnet (#123)

* Added L1VestingWallet, added testnet Vesting Plans, Added L1 Vesting deployment script

* Updated vesting plans script

* Update vesting data

* Add explanation to L1VestingWallet

* Update format

* Update READMEs

* Update vesting amount

* Update vesting amounts

* Update devnet data

* Update according to suggestion

* Update L1 contract code and deployment scripts

* Update README

* Update PR review

* Use OptimismMintableERC20Factory for Diva ERC20

* remove optimism library

* remove unnecessary contracts

* add deployment scripts

* fixing e2e

* fix e2e tests

* remove optimism lib

* fix e2e tests

* Add Airdrop contract Testnet deployment data (#159)

* Set 6_deployUSDTContract.sh script file as executable

* Set 5_deployAirdropContract.sh script file as executable

* Add Airdrop contract deployment data

* Fix GitHub CI regarding Forge version

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq

* Merkle root for Airdrop contract is set inside deployment script (#161)

Set Merkle root on Airdrop contract deployment

* Add automated toolings for testing contracts (#151)

* Add Slither support in GH actions

* Add slither-mutate support for local execution

* Add readme for test directory

* Fix rebasing with development

* Add Echidna support for local execution

* Fix spelling typo

* fix env files

* forge install: openzeppelin-contracts

v5.0.2

* forge install: openzeppelin-contracts-upgradeable

v5.0.2

* forge install: openzeppelin-contracts

01ef448981be9d20ca85f2faf6ebdf591ce409f3

* forge install: openzeppelin-contracts-upgradeable

fbdb824a735891908d5588b28e0da5852d7ed7ba

* forge install: forge-std

v1.8.2

* cleanup

* cleanup

* address Slither and Matjaz comments

* add extra deployment checks

* Update script/swap_and_bridge/example/README.md

Co-authored-by: Matjaz Verbole <verbole@gmail.com>

* Update pr.yaml

* improving deployment script

* improving testing scripts

* improve test scripts and rename folder

* Address review comments

* Fix contracts folder path inside deployment directory

* Fix typo in e2e test and move contracts to test folder

* remove unnecessary interaction with deployment folder

* Fix contracts folder path inside deployment directory

* add testing contracts

* merge from development

* fix sed rule

* remove store of L@_DIVA_TOKEN

* Improve README file

* add readme

* fix typo

* add readme

* change folder structure

* Update script/swap_and_bridge/README.md

Co-authored-by: Matjaz Verbole <verbole@gmail.com>

---------

Co-authored-by: Franco NG <franco.ng@lightcurve.io>
Co-authored-by: Matjaz Verbole <verbole@gmail.com>
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.

Integrate automated toolings for testing smart contracts
3 participants