The X7100DiscountAuthority contract allows the owner to set the addresses of four different NFT & token contracts: ecoMaxiNFT, liqMaxiNFT, magisterNFT, and x7dao. The X7100DiscountAuthority contract also has a public function called discountRatio that takes an address as an argument and returns a fraction representing a discount. This contract allows for a discount percentage on X7100 Series tokens.
The discountRatio function determines the discount that should be applied to a given user (whose address is passed as an argument) based on the balance of certain tokens that they own.
constructor() Ownable(address(0x7000a09c425ABf5173FF458dF1370C25d1C58105)) {}
function setEcosystemMaxiNFT(address tokenAddress) external onlyOwner {
require(address(ecoMaxiNFT) != tokenAddress);
address oldTokenAddress = address(ecoMaxiNFT);
ecoMaxiNFT = IERC721(tokenAddress);
emit EcosystemMaxiNFTSet(oldTokenAddress, tokenAddress);
}
The setEcosystemMaxiNFT function is a public function that is marked with the onlyOwner modifier, which means that it can only be called by the owner of the X7100DiscountAuthority contract.
The function takes a single argument tokenAddress, which is the address of an IERC721 token contract. The function first checks that the address of the IERC721 contract currently stored in the ecoMaxiNFT variable is not the same as tokenAddress. If they are the same, the function does nothing and returns.
If the address of the IERC721 contract currently stored in ecoMaxiNFT is different from tokenAddress, the function stores the address of tokenAddress in the ecoMaxiNFT variable and emits an EcosystemMaxiNFTSet event. The EcosystemMaxiNFTSet event logs the previous address of the IERC721 contract stored in ecoMaxiNFT and the new address that is being set.
The setEcosystemMaxiNFT function allows the owner of the X7100DiscountAuthority contract to change the address of the IERC721 contract that is stored in the ecoMaxiNFT variable. This may be useful if the contract address of the contract needs to be changed for some reason.
