// Contract: IDestinySwap
// Target function: function swapDST(uint DIY_burnAmount, address DST_recipient) public returns (bool)
/*=======================================================================================================================
#                                                           ..                                                          #
#                                                           ::                                                          #
#                                                           !!                                                          #
#                                                          .77.                                                         #
#                                                          ~77~                                                         #
#                                                         .7777.                                                        #
#                                                         !7777!                                                        #
#                                                        ^777777^                                                       #
#                                                       ^77777777^                                                      #
#                                                      ^777!~~!777^                                                     #
#                                                     ^7777!::!7777^                                                    #
#                                                   .~77777!  !77777~.                                                  #
#                                                  :!77777!:  :!77777!:                                                 #
#                                                 ~777777!^    ^!777777~                                                #
#                                               :!7777777^      ^7777777!:                                              #
#                                             :!77777777:        :77777777!:                                            #
#                                           :!77777777!.          .!77777777!:                                          #
#                                        .^!77777777!^              ^!77777777!^.                                       #
#                                      :~7777777777^.       ..       .^7777777777~:                                     #
#                                   .^!777777777!^.         ^^         .^!777777777!^.                                  #
#                               .:~!777777777!~:           :77:           :~!777777777!~:.                              #
#                           .:^!7777777777!~:             ^7777^             :~!7777777777!^:.                          #
#                     ..:^~!77777777!!~^:.             .^!777777!^.             .:^~!!77777777!~^:..                    #
#           ...::^^~!!77777777~~^^:..              .:^!777777777777!^:.              ..:^^~~77777777!!~^^::...          #
#           ...::^^~!!77777777~~^^:..              .:^!777777777777!^:.              ..:^^~~77777777!!~^^::...          #
#                     ..:^~!77777777!!~^:.             .^!777777!^.             .:^~!!77777777!~^:..                    #
#                           .:^!7777777777!~:             ^7777^             :~!7777777777!^:.                          #
#                               .:~!777777777!~:           :77:           :~!777777777!~:.                              #
#                                   .^!777777777!^.         ^^         .^!777777777!^.                                  #
#                                      :~7777777777^.       ..       .^7777777777~:                                     #
#                                        .^!77777777!^              ^!77777777!^.                                       #
#                                           :!77777777!.          .!77777777!:                                          #
#                                             :!77777777:        :77777777!:                                            #
#                                               :!7777777^      ^7777777!:                                              #
#                                                 ~777777!^    ^!777777~                                                #
#                                                  :!77777!:  :!77777!:                                                 #
#                                                   .~77777!  !77777~.                                                  #
#                                                     ^7777!::!7777^                                                    #
#                                                      ^777!~~!777^                                                     #
#                                                       ^77777777^                                                      #
#                                                        ^777777^                                                       #
#                                                         !7777!                                                        #
#                                                         .7777.                                                        #
#                                                          ~77~                                                         #
#                                                          .77.                                                         #
#                                                           !!                                                          #
#                                                           ::                                                          #
#                                                           ..                                                          #
#                                                                                                                       #
/*=======================================================================================================================
#                                                                                                                       #
#     ██████╗ ███████╗███████╗████████╗██╗███╗   ██╗██╗   ██╗████████╗███████╗███╗   ███╗██████╗ ██╗     ███████╗       #   
#     ██╔══██╗██╔════╝██╔════╝╚══██╔══╝██║████╗  ██║╚██╗ ██╔╝╚══██╔══╝██╔════╝████╗ ████║██╔══██╗██║     ██╔════╝       #
#     ██║  ██║█████╗  ███████╗   ██║   ██║██╔██╗ ██║ ╚████╔╝    ██║   █████╗  ██╔████╔██║██████╔╝██║     █████╗         #
#     ██║  ██║██╔══╝  ╚════██║   ██║   ██║██║╚██╗██║  ╚██╔╝     ██║   ██╔══╝  ██║╚██╔╝██║██╔═══╝ ██║     ██╔══╝         #
#     ██████╔╝███████╗███████║   ██║   ██║██║ ╚████║   ██║      ██║   ███████╗██║ ╚═╝ ██║██║     ███████╗███████╗       #
#     ╚═════╝ ╚══════╝╚══════╝   ╚═╝   ╚═╝╚═╝  ╚═══╝   ╚═╝      ╚═╝   ╚══════╝╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝       #
#                                                                                                                       #
========================================================================================================================*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

/**
 *  @notice Allows exchange, burning, and minting between DIY, DST, and DSE tokens at a fixed exchange rate.
 */
contract IDestinySwap{
    address public constant DESTINYTEMPLE = 0x777750401bCacA779C0d53434D4c4d24Cc657777;
    address public constant DST = 0x012312cb7fd428eC140fF55fC5Ac46144b474567;
    address public constant DIY = 0x0000bDC584DB9DEbaF780915bdb26095C8e50007;
    address public constant LIQUIDITY = 0x7777777777777777777777777777777777777777;
	uint public constant RATE = 7777;

    modifier _onlyDestinytemple(){
        require(msg.sender == DESTINYTEMPLE,"not _destinyTemple.");
        _;
    }
    /**
     *  @notice Destroy 7777 $DST tokens from the specified address and mint one $DSE token for the specified recipient.
     *          The specified burn address needs to be approved by you to allow access to a sufficient amount of $DST tokens.
     *          Only allow calls to swapDSE functions via DestinyTempleV7 Constart.
     *          Note: that each address is only allowed to hold at most one $DSE token.
     */
    function swapDSE(address DST_burnFrom, address DSE_mintTo) public _onlyDestinytemple returns (bool) {
        (bool DST_burnFromSuccess,) = DST.call(abi.encodeWithSignature("burn(address,uint256)", DST_burnFrom, RATE));
        (bool DSE_mintToSuccess,) = DESTINYTEMPLE.call(abi.encodeWithSignature("mint(address)", DSE_mintTo));
        require(DST_burnFromSuccess && DSE_mintToSuccess);
        return true;
    }
    /**
     *  @notice Destroy 1 $DSE token from the specified address, and mint 7777 $DST tokens for the specified recipient.
     *          The specified burn address needs to be approved by you to allow access to a sufficient amount of $DSE tokens
     *          Only allow calls to swapDSE functions via DestinyTempleV7 Constart.
     */
    function redeemDST(address DSE_burnFrom,address DST_mintTo) public _onlyDestinytemple returns (bool) {
        (bool DSE_burnFromSuccess,) = DESTINYTEMPLE.call(abi.encodeWithSignature("burn(address)", DSE_burnFrom));
        (bool DST_mintToSuccess,) = DST.call(abi.encodeWithSignature("mint(address,uint256)",DST_mintTo,RATE));
        require(DSE_burnFromSuccess && DST_mintToSuccess);
        return true;
    }