• Jerkface@lemmy.world
        link
        fedilink
        arrow-up
        20
        ·
        8 days ago

        Updating the balance after granting the wish is bad practice. This genie is begging for a reentrancy attack.

      • bestelbus22@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        edit-2
        8 days ago

        If the genie knows the wish counter automatically decrements after every wish execution, he should set the wish counter to 1 to fullfill a total of 0 wishes. But since he’s a genie I’m sure he has unrestricted rights to modify the wish counter.