Closed orionstardust closed 2 years ago
We created the special ExitAlchemica function to be a permissioned function only for the GameManager, and also to emit the ExitAlchemica event so that the game frontend can index the event onchain. It's not possible for normal players to transfer alchemica from the contract to gotchis/owners.
@cinnabarhorse To clarify things, the exitAlchemica
function has this line of code in it:
That line of code could be changed to this which is a little better:
alchemica.transfer(alchemicaRecipient(_gotchiId), _alchemica[i]);
The reason this can be a little better is because transferFrom
might require an approval from the sender, and transfer
does not.
Description
In the AlchemicaFacet contract, the exitAlchemica function transfer the AlchemicaToken to the gotchi through the transferFrom function and the Alchemica Token needs to be approved to this contract.
https://github.com/aavegotchi/aavegotchi-realm-diamond/blob/cee38d37307c49dc41cdb737a962d5d313c1cd4f/contracts/RealmDiamond/facets/AlchemicaFacet.sol#L345
Solution
It is recommended to use the transfer function directly for transfers in this contract.