-
Notifications
You must be signed in to change notification settings - Fork 50
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
Should we pass the token address to the callback functions ? #245
Comments
From #238 (comment)
|
I'm in favor |
Are we talking about the token address or the market parameters? In the case of the token address, it only makes sense to me to pass it into callbacks upon flash loan, which is already what we're doing. For all other callbacks, it seems odd and incomplete to pass the borrowable asset address instead of all the market parameters. I believe passing the whole market struct as parameter of callback functions is not complex and has a relatively low gas cost so I'm ok with doing so |
Yes you are right, I just thought about it while doing the PR and just passing one token address to the callback function doesn't seem appropriate (particularly for the liquidate callback) |
I think similarly to Patrick. I'm not in favor of passing the token address, and even less of passing the entire market structure – it contains too much unnecessary data (nobody cares about the IRM or the oracles). I would even be in favor of removing |
For the sake of simplicity and minimalism, I am against adding anything that cannot be know in advance by the user. So at a first sight, everything except amount in repay. One could even argue that since the caller is synchronous, they can compute the amount in repay but I'm ok with keeping it too, and even in supply/supplyCollat for harmony. |
I think you mean anything that can be known in advance by the user. I agree and I'd even add anything that can be known without any additional gas cost in advance by the user. That way, it excludes the amount to repay. |
I agree, let's remove any amount except in repay |
But not having the same interface for all callbacks is also a bit weird, that's why I'm ok with keeping amount in other callbacks. |
As you want I don't have a strong opinion on this tbh |
After thinking about it I agree with you. |
I'm ok too, should we close your PR then @MathisGD ? |
As it stands the callback functions don't take the token address as argument, but the flashloan function does.
Do we want to add this argument to these functions or assume the the caller handle it by himself with
bytes calldata data
?I think we should as it doesn't mean adding new arguments to the entry points functions.
The text was updated successfully, but these errors were encountered: