// File: contracts/DegentralizedFinance.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @author 0xG
/// @title Degentralized Finance.
///        A worthless NFT holds on to a worthless $PEPE.

contract DegentralizedFinance {
  uint256 public tokenId;

  function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
    return (
      interfaceId == /* IERC721CreatorExtensionBurnable */ 0x45a1b92c ||
      interfaceId == /* IERC165 */ 0x01ffc9a7
    );
  }

  function mint/*🐸*/() external {
    require(tokenId == 0, "Already minted");
    tokenId =
      IExtContract(0x63294eb6997912f50C8d8717f79268C9DC98C357)
        .mintExtension(
          msg.sender,
          "ipfs://bafkreidaocajddcih7lokoqhauy2i2ms7uglopwm4545pn2vl764orxzhy"
        );
  }

  /// @dev Burning the token at 0x63294eb6997912f50C8d8717f79268C9DC98C357 will release one $PEPE
  function onBurn/*💰*/(address owner, uint256 _tokenId) external {
    require(msg.sender == address(0x63294eb6997912f50C8d8717f79268C9DC98C357), "Unauthorized");
    require(tokenId == _tokenId, "Invalid token id");
    require(
      IExtContract(0x6982508145454Ce325dDbE47a25d4ec3d2311933)
        .transfer(owner, 1000000000000000000),
      "Burning failed: could not transfer $PEPE"
    );
  }
}

interface IExtContract {
  function mintExtension(address to, string calldata uri) external returns (uint256);
  function transfer(address to, uint256 amount) external returns (bool);
}