Skip to content
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

ATokenYieldSource save gas with pre-approval #93

Open
code423n4 opened this issue Jun 23, 2021 · 3 comments
Open

ATokenYieldSource save gas with pre-approval #93

code423n4 opened this issue Jun 23, 2021 · 3 comments

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

ATokenYieldSource should approve the lending contract once during initialization with the max value.
This saves gas on every supplyTokenTo/_depositToAave call as the approval can be removed from there.

@asselstine
Copy link
Collaborator

We considered this, but it's possible for a malicious user to "drain" the approval of the contract, so there would need to be checks to see if approval dropped below a certain level. We opted to leave out the complexity.

@asselstine
Copy link
Collaborator

Actually, we'll tackle this. We will:

  1. approve max on init
  2. provide a function to approve max again

@PierrickGT
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants