Currently #define annotations are quite limited, being only applicable at the contract level.
It would be nice to be able to use a #define, rather than supplying a function, simply replacing the code inside other annotations.
Example:
#define voterId uint256 = voterList[_wallet]; // _wallet is a function parameter
#define voter Voter = listOfVoters[voterId];
#if_succeeds "registered the update"
voter.isActive == _isActive;
Would be translated into
#if_succeeds "registered the update"
listOfVoters[voterList[_wallet]].isActive == _isActive;
This would give #define a second purpose for functions and help clean up annotations.
Currently
#defineannotations are quite limited, being only applicable at the contract level.It would be nice to be able to use a
#define, rather than supplying a function, simply replacing the code inside other annotations.Example:
Would be translated into
#if_succeeds "registered the update" listOfVoters[voterList[_wallet]].isActive == _isActive;This would give
#definea second purpose for functions and help clean up annotations.