Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

zeroSWAP Swap.sol module #52

Open
raymondpulver opened this issue Jan 28, 2022 · 0 comments
Open

zeroSWAP Swap.sol module #52

raymondpulver opened this issue Jan 28, 2022 · 0 comments
Assignees

Comments

@raymondpulver
Copy link
Contributor

Write a zeroDAO module contract which should accept an ABI encoded (address[] memory path, uint256 amountIn, address recipient, bytes memory callData) as its data parameter, and the collateralization requirement should simply be 100%

0.1% of the received renBTC should be charged as a supplementary fee which should be deposited into the BTCVault and the resulting zeroBTC be sent to the ZeroUnderwriterLock contract associated with the underwriter, retrieved from IZeroController(msg.sender).lockFor(underwriter)

receiveLoan should handle executing the trade, charging the extra fee, then releasing the funds immediately. If callData is not 0x then the module should approve the recipient to transferFrom the output token for the value of the output, then send a transaction with callData passed as input to the target contract with 200000 gas

Guard against reentrancy

If callData is 0x then simply transfer the funds to the recipient and exit

repayLoan should be a no-op. We would like to just execute the trade eagerly

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

No branches or pull requests

3 participants