-
Notifications
You must be signed in to change notification settings - Fork 17
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 initial LockstakeEngine/Urn/Clipper logic + tests #1
Conversation
* Create urn and allow to operate without defined delegate * fix more error messages * Option to remove delegate * Move delegate function * Improve test coverage
src/LockstakeEngine.sol
Outdated
bytes32 immutable public ilk; | ||
GemLike immutable public gov; | ||
GemLike immutable public stkGov; | ||
uint256 immutable public fee; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making fee
configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done here: #5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? still seems immutable there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this message was wrongly set, it was for another issue. I still have my reservations about this change. Let's leave it as it until we have some discussion.
Co-authored-by: oldchili <[email protected]>
* Allow urn management to another address * Add tests * Add isUrnAuth getter * Remove README * Extend testHopeNope * Remove line Co-authored-by: oldchili <[email protected]> --------- Co-authored-by: oldchili <[email protected]>
Co-authored-by: oldchili <[email protected]>
* Support multicall for LockstakeEngine * Sketch use of converter inside LockstakeEngine * Send out ngt from converter, separate events * Add index parameter to open() * Approve tokens to mkrNgt in the constructor * gov => mkr, stkGov => stkMkr * public => external Co-authored-by: sunbreak1211 <[email protected]> * Change revert message * new line at end of file Co-authored-by: sunbreak1211 <[email protected]> * Put ngt functions after regular ones * Change order of events as well Co-authored-by: sunbreak1211 <[email protected]> * ngt tests and testing open with wrong index --------- Co-authored-by: sunbreak <[email protected]> Co-authored-by: sunbreak1211 <[email protected]>
* Stake with lock, withdraw with free * clean farm onTakeLeftovers * Add missing farm reset in onTakeLeftovers * Reset farm and delegate on each onKick and onTakeLeftovers * Fixes on _selectFarm * Minor move of call * Fix issue in onKick + reorder some functions * First round of adapting tests for new structure * Fix for onTakeLeftovers * Revert on selecting the same farm as existing one * Use ink also for farm operations * Use local var for ink before kick * Modify comment - correctly undelegate and unstake --------- Co-authored-by: oldchili <[email protected]>
function init() external isEngine { | ||
vat.hope(msg.sender); | ||
lsmkr.approve(msg.sender, type(uint256).max); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small optimization here, since you seem to care about open
gas, would be to use engine
instead of msg.sender
(since engine
is immutable) and remove the isEngine
modifier. But it will not make a large difference.
* Add a few Readme comments * Update README.md Co-authored-by: telome <[email protected]> --------- Co-authored-by: telome <[email protected]>
* Use owner/index as key for user functions * Fix in README * Renaming * Change to isUrnAuth * Minor tests change * Use grab instead of frob in onRemove * Use jug.drip to update rate in selectVoteDelegate
* Certora setup (#37) * builtin sanity, pre_condition rule * folders * more rules with advanced CVL properties * document examples * more options for ClipperCallee concrete implementations * fix also fr Clipper * where am I taken from * fix * remove kick summarization * remove kick * update links * added rule sanity to configs * added basic multicall spec * adds a test solidity contract for multicall * final setup touches and multicall * added certora files and vim to gitignore --------- Co-authored-by: EyalHochCertora <[email protected]> Co-authored-by: EyalHCertora <[email protected]> * LockstakeUrn * Fix file header * Use real Vat code and some changes to urn conf * Use double quotes * Add LockstakeMkr spec * Fix * Revert removal of end line * LockstakeEngine (WIP) + Minor change for LockstakeUrn * Remove space * Remove factory from voteDelegate file * Add missing check for selectVoteDelegate + add selectFarm and selectFarm_revert specs * Add lock spec + minor changes to others * lock_revert spec * Improve comments * lockNgt and lockNgt_revert specs * Add free and feeeNgt specs * Add free_revert and freeNgt_revert specs * Add some new invariant rules + tidy up * Add freeNoFee and freeNoFee_revert specs * Simplify messages for non revert rules * Add draw and draw_revert specs * Add wipe, wipeAll and getReward specs * Add wipe_revert and onKick specs * Add wipeAll_revert spec * Add getReward_revert spec * farm renaming + minor changes * Add onKick_revert spec + minor comments fix * Fixes for inkMatchesLsmkrFarm * Add onTake and onTake_revert specs * Add onRemove and onRemove_revert specs * Separate Multicall rules to different file + fix wipe_revert * Minor changes * Comment change * First batch of LocstakeClipper specs * Add redo and redo_specs + fix in storageAffected * Clean up * Fix specs timeouts for LockstakeEngine * Add take spec + changes to storageAffected * stopped revert conditions better matching with code * Add take_revert spec * Clipper: some variables renaming * Add upchost upchost_revert specs * Fix for take spec + add yank and yank_revert specs * Engine: Rename several variables * Update specs to newer version * Remove unused function * Fix CI * Fix missing solc versions CI * Fix timeouts * Fix * Change * Some cleaning in multicall specs * Add more invariants to LockstakeEngine * Improve invariants for staking * Fix * Changes in invariants * Include view functions invariants as well * Fix --------- Co-authored-by: Shoham Shamir <[email protected]> Co-authored-by: EyalHochCertora <[email protected]> Co-authored-by: EyalHCertora <[email protected]>
No description provided.