Closed terminator0x closed 3 years ago
I have a question about fee and maxfee in No.6. in the contract, fee and maxfee is used in following code snippet.
if (fee > 0) {
uint256 totalFee = (address(this).balance.mul(fee)).div(10000);
if (totalFee > 0) {
payable(owner()).transfer(totalFee);
}
payable(msg.sender).transfer(address(this).balance);
} else {
payable(msg.sender).transfer(address(this).balance);
}
In order to remove fee and maxfee in global states, we need to pass fee as argument to functions. is it okay?
No2, adding addresses [] paths: is it for removing getBestPath()?
Right now the
wrap
andunwrap
functions in the uni contract are poorly optimized and they need to cleaned up as follows.wrap
/unwrap
and the token swap logic into 2 functions and call either of the functions based on the length of the destination tokens as is currently the case.addresses [] paths
and pass this variable anywhere thepaths
are required for conducting a swap.zero address
to check if thesourceToken
isETH
, please import theERC20
and pass the token address and check if the token symbol isWETH
forETH
wrapping i.e.zero address
references in the contract which are meant to representETH
and replace it withe above logic.address lpTokenPairAddress
which will be passed from the frontend and use it to initialize the lp tokenIERC20 lpToken = IERC20(lpTokenPairAddress);
as needed in the contract function.also remove any functions associated with these global variables and for
approvalAmount
Just set it locally in the function where it’s being called.wrap
functionality and make sure I’m able to wrap ERC20 other ERC20 tokens if supported i.e. I’m able to wrap fromDAI
toSUSHI-COMPOUND
LP tokens.11_add_liquidity_sushi.js
and make sure you test for both passes and fails.DAI
in this case.Acceptance Criteria
The wrapping and unwrapping functionality works as before but it’s now better optimizer and uses way less gas after the above changes.
ETA
2 days