foundry
foundry copied to clipboard
feat: weight invariant selectors by number of selectors, not number of contracts.
Component
Forge
Describe the feature you would like
Let's say right now my invariant test is setup with two contracts:
- Contract A has 1 function selector,
fn0. - Contract B has 20 function selectors,
fn1throughfn20.
As I understand it, right now the process is:
- First Contract A or Contract B will be chosen randomly
- Then we look at the available selectors for each and randomly choose one.
This means fn0 will be chosen ~50% of the time, and fn1 through fn20 are each only chosen 50 / 20 = 2.5% of the time. Ideally, each of the 21 functions would be chosen 100 / 21 = ~4.76% of the time
Additional context
No response