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

alternative implementation to use FL #109

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

adamskrodzki
Copy link
Contributor

This is alternative approach How to use FlashLoans cleanly

Every business operation (OpenMultiply, Increase,Decreas, CloseToDai, CloseToCollateral, OpenGUNI, etc)

Has it's own Action contract which adress is stored in service registry,

Each Action contract iherits from BaseAction and therefore implements 4 methods:

then to call an action

You call one central contract call runner (as delegateCall on dsProxy)

function executeAction(string calldata actionName, bytes calldata actionData)

depending on action implementation FL is called or not,

Comment on lines +24 to +25
manager = _manager;
exchange = _exchange;
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it better to move this to service registry?

Comment on lines +5 to +17
struct CdpData {
address gemJoin;
address payable fundsReceiver;
uint256 cdpId;
bytes32 ilk;
uint256 requiredDebt;
uint256 borrowCollateral;
uint256 withdrawCollateral;
uint256 withdrawDai;
uint256 depositDai;
uint256 depositCollateral;
bool skipFL;
string methodName;
Copy link
Contributor

Choose a reason for hiding this comment

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

are we sticking with this struct? it has an abundance of unnecessary fields. could we maybe break it out into CloseCDPData, OpenCDPData etc

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.

2 participants