-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat: add an AMO minter and an Aave AMO #956
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.
Refer to our other smart contracts for code styles.
Never reference token symbols as identifiers. Besides we already renamed uad to uusd, causing developer confusion down the road.
uAD -> Dollar
UBQ -> Governance
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.
I'm not a solidity developer, but nothing really stands out except for my one comment
Notes:
Question:
|
Used AaveAMO_V2 Yes, there is still some stuff to be tuned, will wrap it this week. |
Yo it should be well directed now. I've:
The AMO has the minter address to return collateral. I have implemented borrow and repay as well, this could be kept or removed - its a trust decision. I still have to write tests and addapt code style, will be pushing this when I get some free time. A little more context on 5: to handle rewards, borrows and repays, the system would need some way to swap, could design a Uniswap AMO. There could already be something in place, I haven't checked if it exists as a facet. |
Cowswap is preferred if that's an option! |
Can do that! Let me wrap this one first though. |
@rndquu I've marked this PR as ready for review. Please let me know if it is up to your standards. I agree an issue to write a non-forked test suite is appropriate, I would be down to go through with 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.
Ok, here comes a list of code style refactors:
- The whole codebase uses camel cases naming so all snake case variables should be refactored to camel case
- There's also a convention across the whole code base to use camel case for abbreviations (like
Nft
notNFT
). So allAMO
related namings should be refactored toAmo
. Examples:
receiveCollatFromAMO => receiveCollatFromAmo
validAMO => validAmo
- All
UAD
namings should be refactored toDollar
- No shortages. Be as explicit as possible. Example:
receiveCollatFromAMO => receiveCollateralFromAMO
Regarding the code:
- TransferHelper lib should removed and SafeERC20 should be used. Otherwise we'll have to perform a new audit contest solely for the copy/pasted lib.
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.
Overall this PR looks good:
- natspecs everywhere
- unit tests make sense
- owner seems to able to transfer collateral to aave
There're a couple of things that we'll have to work out (not part of this PR):
- remove forked tests in favor of unit tests
AmoMinter
owner should be able to transfer tokens to aave in a single tx (right now owner has to execute a 2nd tx to deposit collateral to aave)IAmo
could havedeposit()
andwithdraw()
methods (which fits at least with lending and DEX protocols)
I will review this PR in detail on Monday. Meanwhile pls fix minor issues in the comments.
There are a couple ways to do that. Adding AMO contracts to the main diamond or a specific AMO diamond is one of them. If so the IAmo concept will be extinguished, as function names can't be shared.
Another oposing idea could be adhering to this IAmo idea, keep standalone AMO contracts and implement overriden deposit and withdraw methods so that |
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 PR implements basic functionality for the AMO minter and aave AMO. I've opened another issue for polishing this PR and preparing deployment migrations.
Then we could utilize https://www.findaudit.xyz/ or ask 0xAdrii
to look though the contracts.
@0x4007 FYI
Resolves #611