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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Scribble properties to the codebase #453

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JoranHonig
Copy link

Hey Everyone,

In this pull request, I've added several properties to the codebase.

This is still a work in progress; however, I've opened this pull request to discuss the properties as they are now.

In a follow up PR, I'll add a configuration for setting up a fuzzing campaign 馃憤 .

Testability

There are some parts of the codebase where the structure is not optimal for testing.

An example is the _executeDonationSwaps function in the RoundManager. This function implements both logic to loop over the swaps and to execute swaps. It is possible to consider extracting the logic for executing a single swap into a separate function, which would allow you to write properties & tests for this code in isolation.

For example, take the following property, which ensures that you get the minimum amount out of the swap.

  ///#if_succeeds 
  /// let outToken = IERC20(swap.path.toAddress(swap.path.length - 20)) in
  /// old(outToken.balanceOf(address(this))) + swap.minOutAmount == outToken.balanceOf(address(this));
  function executeDonationSwap(SwapSummary swap, uint256 _deadline) internal {
   ...
  }

@JoranHonig JoranHonig changed the title Add Scribble properties to the codebase WIP: Add Scribble properties to the codebase Oct 26, 2021
@phutchins phutchins added this to Doing in dGrants Oct 26, 2021
@thelostone-mc
Copy link
Collaborator

@JoranHonig could you drop in the scribble doc / reading material as well for folks to checkout and get a better sense of the PR ?

@thelostone-mc thelostone-mc marked this pull request as draft October 26, 2021 15:35
@thelostone-mc thelostone-mc added test contracts Smart contract issues labels Oct 26, 2021
@phutchins phutchins moved this from Doing to Backlog in dGrants Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Smart contract issues test
Projects
dGrants
Backlog
Development

Successfully merging this pull request may close these issues.

None yet

2 participants