This contract X7DAODiscountAuthority is a contract that implements an interface called IDiscountAuthority. This interface has one public view function called discountRatio which takes an address parameter called swapper and returns two uint256 values: numerator and denominator.
The contract also extends the Ownable contract, which provides basic ownership functionality such as setting and transferring ownership, as well as a modifier called onlyOwner which can be applied to function to restrict the function to be called only by the owner of the contract.
The X7DAODiscountAuthority contract has two public variables of type IERC721 called ecoMaxiNFT and liqMaxiNFT, which seem to be used to store the addresses of two ERC-721 tokens. The contract has two public functions called setEcosystemMaxiNFT and setLiquidityMaxiNFT which allow the owner of the contract to set the addresses of these tokens.
The discountRatio function of the X7DAODiscountAuthority contract checks the balances of the ecoMaxiNFT and liqMaxiNFT tokens for the swapper address and returns a discount ratio based on the balance. If the swapper has a balance of either token greater than 0, a discount is applied. If the swapper has a balance of the liqMaxiNFT token, a 15% discount is applied. If the swapper has a balance of the ecoMaxiNFT token, a 10% discount is applied. If the swapper has a balance of 0 for both tokens, no discount is applied and the ratio returned is 1:1.
IERC721 public ecoMaxiNFT;
IERC721 public liqMaxiNFT;
IERC721 is an interface for an ERC-721 token. ERC-721 is a standard for non-fungible tokens NFTs) on the Ethereum blockchain. NFTs are unique digital assets that represent ownership of a unique item or asset, such as a piece of art, a collectible, or a virtual real estate. ERC-721 defines a set of functions and events that an NFT contract must implement to be considered compliant with the standard.
The IERC721 interface specifies the functions and events that an ERC-721 token contract should implement. It has functions for transferring and approving the transfer of NFTs, as well as functions for querying the balance and owner of an NFT.
