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

Aave COW Swaps #138

Merged
merged 7 commits into from
Aug 23, 2023
Merged

Aave COW Swaps #138

merged 7 commits into from
Aug 23, 2023

Conversation

efecarranza
Copy link
Contributor

Changelog

Add AaveCOWSwap contract.
Add helper payloads.
Add tests.
Add README.

address public constant BAL80WETH20 = 0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56;
address public constant BPT_PRICE_CHECKER = 0xBeA6AAC5bDCe0206A9f909d80a467C93A7D6Da7c;

address public chainlinkPriceChecker = 0xe80a1C615F75AFF7Ed8F08c9F21f9d00982D666c;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We think that it would be better to pass the priceChecker and milkman addresses as input to the swap method, this way you would be forcing the user, to check / get up to date addresses for the specific swap.
This would be safer, as if not, possibility that user just forgets to set the new addresses could be high. It would also make it so you don't need to hardcode BAL token and price checker.

Then a section on README could be added on how to find up to date addresses, and / or an other option could be to add these kind of addresses in a different lib (maybe like address-book) depending on how often they get updated

data
);

emit SwapRequested(fromToken, toToken, fromOracle, toOracle, amount, recipient);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would need to emit milkman address also right? as its needed in the cancel swap input, and could change between swap and cancel?
Also the slippage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately there's no way to get the milkman address, it's only available via event so we'd have to retrieve it to get it. Added slippage.

@efecarranza
Copy link
Contributor Author

@sendra updated!

src/swaps/AaveSwapper.sol Outdated Show resolved Hide resolved
@efecarranza
Copy link
Contributor Author

@sendra updated.

src/swaps/README.md Outdated Show resolved Hide resolved
@efecarranza
Copy link
Contributor Author

@sendra updated docs.

@sendra sendra merged commit e6e780a into bgd-labs:master Aug 23, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants