慢雾:DeFi 当红项目 YAM 闪电折戟,一行代码如何蒸发数亿美元? (8)
时间:2020-08-14 18:05来源:未知 作者:admin 点击:
次
== uniswap_pair , bad msg.sender ); // enforce that this contract called uniswap require ( sender == address ( this ), bad origin ); ( UniVars memory uniVars ) = abi . decode ( data , ( UniVars )); YA
== uniswap_pair, "bad msg.sender"); // enforce that this contract called uniswap require(sender == address(this), "bad origin"); (UniVars memory uniVars) = abi.decode(data, (UniVars)); YAMTokenInterface yam = YAMTokenInterface(yamAddress); if (uniVars.amountFromReserves > 0) { // transfer from reserves and mint to uniswap yam.transferFrom(reservesContract, uniswap_pair, uniVars.amountFromReserves); if (uniVars.amountFromReserves < uniVars.yamsToUni) { // if the amount from reserves > yamsToUni, we have fully paid for the yCRV tokens // thus this number would be 0 so no need to mint yam.mint(uniswap_pair, uniVars.yamsToUni.sub(uniVars.amountFromReserves)); } } else { // mint to uniswap
(责任编辑:admin1) |
织梦二维码生成器
------分隔线----------------------------