-
Notifications
You must be signed in to change notification settings - Fork 586
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/enable disable flashloan config #710
feat/enable disable flashloan config #710
Conversation
contracts/protocol/libraries/configuration/ReserveConfiguration.sol
Outdated
Show resolved
Hide resolved
contracts/protocol/libraries/configuration/ReserveConfiguration.sol
Outdated
Show resolved
Hide resolved
contracts/protocol/libraries/configuration/ReserveConfiguration.sol
Outdated
Show resolved
Hide resolved
Co-authored-by: miguelmtz <[email protected]>
…n.sol Co-authored-by: miguelmtz <[email protected]>
…n.sol Co-authored-by: miguelmtz <[email protected]>
…n.sol Co-authored-by: miguelmtz <[email protected]>
…n.sol Co-authored-by: miguelmtz <[email protected]>
Co-authored-by: miguelmtz <[email protected]>
Co-authored-by: miguelmtz <[email protected]>
Co-authored-by: miguelmtz <[email protected]>
Co-authored-by: miguelmtz <[email protected]>
Comments addressed - ready for re-review |
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.
Missing a couple of test cases, but lgtm in general
Co-authored-by: miguelmtz <[email protected]>
…e/aave-v3-core into feat/enable-disable-flashloan-config
Additional updates added - ready for re-review
|
Hey @stevenvaleri ! How is it achieved in PR? Maybe I'm missing something, but by default this bit will be 0 and an asset will become flashloanable only when you set it to 1 (for existing deployments, I mean) |
@@ -472,6 +472,7 @@ library ValidationLogic { | |||
.configuration; | |||
require(!configuration.getPaused(), Errors.RESERVE_PAUSED); | |||
require(configuration.getActive(), Errors.RESERVE_INACTIVE); | |||
require(configuration.getFlashLoanEnabled(), Errors.FLASHLOAN_DISABLED); |
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.
the same require missing in the validateFlashloanSimple
in some lines above. Because of that looks like a good idea to reuse simple
ie:
...
require(assets.length == amounts.length, Errors.INCONSISTENT_FLASHLOAN_PARAMS);
for (uint256 i = 0; i < assets.length; i++) {
validateFlashloanSimple(reservesData[assets[i]].configuration);
}
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.
Good catch. Let's add tests and evaluate this change!
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.
Agreed - will update
@kyzia551 It's updated in the deploy repo. If you re-install dependencies in this repo, it will pull in beta version of the deploy repo with this update. |
Why don't make it enabled by default? Because it sounds more like expected
behaviour
Best regards,
Andrei
…On Thu, 27 Oct 2022, 15:46 Steven Valeri, ***@***.***> wrote:
All existing assets will continue to have flashloans enabled. In the
future this will allow for explicit errors when attempting to flashloan gho.
Hey @stevenvaleri <https://github.com/stevenvaleri> ! How is it achieved
in PR? Maybe I'm missing something, but by default this bit will be 0 and
an asset will become flashloanable only when you set it to 1 (for existing
deployments, I mean)
@kyzia551 <https://github.com/kyzia551> It's updated in the deploy repo.
If you re-install dependencies in this repo, it will pull in beta version
of the deploy repo with this update.
—
Reply to this email directly, view it on GitHub
<#710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEFXTWXL4SYNRX7UCB2WU3LWFKBVDANCNFSM575K7BAQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think it makes more sense to enable separately after the reserve is added - this would be consistent with making something borrowable, or enabled as collateral. If you want an asset not flashloanable, but it is configured to be enabled by default, you'd need to remember to disable it in the same transaction when listing it, or we'd need to change the initReserve function to have a flag to override the default. I think it is less risky / prone to error to have all disabled by default and I don't think we'd consider updating the initReserve params. |
Totally agree. Having it enabled by default would lead to errors because breaks the consistency across the reserve configuration. |
Adds a configuration to enable and disable flashloans for a specific asset.
All existing assets will continue to have flashloans enabled. In the future this will allow for explicit errors when attempting to flashloan gho.
This is dependent on an update to the deploy repo. The update enables flashloans for all assets during the reserve configuration process.