-
Notifications
You must be signed in to change notification settings - Fork 11
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
LockstakeClipper Callee #43
Conversation
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.
Only looked at the new callee contract, looks good.
Made some minor comments.
All changes look good, I'm not able to resolve the comments, so please do that on your side. |
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.
All comments are addressed and the changes look good to me.
Feel free to resolve the above comments as I'm not able to do it.
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.
- Checked callee contract
- Static Interfaces
- No unused static interfaces
- Interface naming style should match with
Like
suffix (e.g.VatLike
)- EXCEPTION: known interface naming exceptions
- Each static interface declare only functions actually used in the spell code
- Precision units
- Precision units match their defined values:
WAD = 10 ** 18
RAY = 10 ** 27
RAD = 10 ** 45
- Precision units match with Numerical Ranges
- Precision units match their defined values:
- Ensure every variable is declared as
public
/internal
- Static Interfaces
- Checked tests
- Ensure solc version is matching with contract
- Checked
MockUniswapRouter02
- Simulates
UniswapV2Router02
deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D- address found in the uniswap docs
- Interface for function
swapExactTokensForTokens
matches - Behaviour of the function is correctly mocked
- Simulates
- Checked
UniswapV2LockstakeCalleeTest
- Function
setUp
matches with provided existing test function - Function
_urnSetUp
matches with provided existing test function - Function
_forceLiquidation
matches with provided existing test function - Checked
setUpCallee
- Correctly sets up test callee
- Checked
_testCalleeTake
- Simulates and tests multiple actors using the callee to take from an auction
- Function
- Test calls cover all relevant cases
- Checked formatting
- Check all tests are passing locally using
make test
Ran 16 tests for src/test/UniswapV2LockstakeCallee.t.sol:UniswapV2LockstakeCalleeTest
[PASS] testCalleeTake_NoDelegate_NoStaking_MkrDai() (gas: 3476105)
[PASS] testCalleeTake_NoDelegate_NoStaking_MkrNst() (gas: 3401278)
[PASS] testCalleeTake_NoDelegate_NoStaking_NgtDai() (gas: 3576068)
[PASS] testCalleeTake_NoDelegate_NoStaking_NgtNst() (gas: 3501285)
[PASS] testCalleeTake_NoDelegate_WithStaking_MkrDai() (gas: 3515101)
[PASS] testCalleeTake_NoDelegate_WithStaking_MkrNst() (gas: 3440273)
[PASS] testCalleeTake_NoDelegate_WithStaking_NgtDai() (gas: 3615082)
[PASS] testCalleeTake_NoDelegate_WithStaking_NgtNst() (gas: 3540253)
[PASS] testCalleeTake_WithDelegate_NoStaking_MkrDai() (gas: 3513726)
[PASS] testCalleeTake_WithDelegate_NoStaking_MkrNst() (gas: 3438942)
[PASS] testCalleeTake_WithDelegate_NoStaking_NgtDai() (gas: 3613688)
[PASS] testCalleeTake_WithDelegate_NoStaking_NgtNst() (gas: 3538862)
[PASS] testCalleeTake_WithDelegate_WithStaking_MkrDai() (gas: 3552697)
[PASS] testCalleeTake_WithDelegate_WithStaking_MkrNst() (gas: 3477869)
[PASS] testCalleeTake_WithDelegate_WithStaking_NgtDai() (gas: 3654092)
[PASS] testCalleeTake_WithDelegate_WithStaking_NgtNst() (gas: 3612389)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 50.59s (52.86s CPU time)
This PR implements callee contract for the LockstakeClipper using UniswapV2. It allows anyone to participate in auctions using UniswapV2 path to exchange MKR (or NGT) into DAI (or NST).
Notes:
forge test --match-contract=UniswapV2LockstakeCalleeTest
locally--use solc:0.6.12
) while strictly setting it in every callee contract instead. This is due to LockstakeEngine requiring at least 0.8.21 solidity version