Submitted by MrPotatoMagic, also found by hgrano, 20centclub, 0xNirix, and 0xCiphky
When a PhiNFT1155.sol contract instance is created from the PhiFactory contract, the initialize() function is called to setup it. One of the parameters passed along is the protocolFeeDestination address, which is used as the default royalty recipient (see here) and the address that will receive the artCreate fees (see here).
The issue is that if the protocolFeeDestinationAddress contract is changed in the PhiFactory contract by the owner using function setProtocolFeeDestination(), the existing PhiNFT1155.sol contract instances created would still be using the old protocol fee destination address stored in them since it is not being dynamically retrieved from the PhiFactory contract. The protocolFeeDestination address could be updated for several reasons such as in case it is compromised, becomes malicious or there has been a decision made to make the address non-privileged.
Due to this, the old protocol fee destination address would still be receiving all the royalties (i.e., 500 bps = 5%) from all PhiNFT1155.sol contract instances. It would also be receiving all the artCreateFee amount of tokens when art is created through the createArtFromFactory() function.
To solve the issue in CreatorRoyaltiesControl, consider retrieving the default royalty recipient variable dynamically from the phiFactory contract. The same would also need to be applied to the protocolFeeDestination address currently stored in the PhiNFT1155.sol contract.
Using dynamic retrieval from the factory would solve the issue for all PhiNFT1155.sol contract instances that were created.
Error
ZaK3939 (Phi) confirmed and commented:
MrPotatoMagic (warden) commented:
bronze_pickaxe (warden) commented:
0xDjango (judge) commented:
