CryptoBlades / cryptoblades

534 stars 259 forks source link

[BUG] - Raids rewards not showing #1760

Open MrBaptista69 opened 1 year ago

MrBaptista69 commented 1 year ago

Prerequisites

Contact Details

Englishh

What does this bug relate to

Design Issues

Describe the bug

Raid rewards not showing some weapons in popup

Expected behavior

It should show in the message the weapon that they have won as well

Current behavior

they get a popup that they only won the junk but in the TX they also won a sword image image image

To Reproduce

When the raid ends, the messages are wrong The message says that they won only the Junk, but actually they have won the sword which doesnt shown

Device

PC

Browser

Chrome

Additional Context

No response

poshdan commented 1 year ago

Probably a relic of the "fresh lookup" limitation we used to have in our contracts until recently, making it impossible to query swords during the block they were minted. If this is the case, the raid rewards are using a delayed event read of some sort to get the raid drops and missing the weapons because it's not a reliable way. There are events emitted by the raid contract that give a full detail on all that has dropped. (besides the minted events emitted by the weapons contract, for instance)

These events are the following: event RewardedXpBonus(uint256 indexed raidIndex, address indexed user, uint256 indexed charID, uint16 amount); event RewardedDustLB(uint256 indexed raidIndex, address indexed user, uint32 amount); event RewardedDust4B(uint256 indexed raidIndex, address indexed user, uint32 amount); event RewardedDust5B(uint256 indexed raidIndex, address indexed user, uint32 amount); event RewardedWeapon(uint256 indexed raidIndex, address indexed user, uint8 stars, uint256 indexed tokenID); event RewardedJunk(uint256 indexed raidIndex, address indexed user, uint8 stars, uint256 indexed tokenID); event RewardedTrinket(uint256 indexed raidIndex, address indexed user, uint8 stars, uint256 effect, uint256 indexed tokenID); event RewardedKeyBox(uint256 indexed raidIndex, address indexed user, uint256 indexed tokenID);