Skip to content

alternative implementation to use FL#109

Draft
adamskrodzki wants to merge 8 commits intodevelopfrom
as/alternative_approach
Draft

alternative implementation to use FL#109
adamskrodzki wants to merge 8 commits intodevelopfrom
as/alternative_approach

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