neu-fi / regen-bingo

Monorepo for both backend and contract developments of Regen Bingo!
https://regen.bingo
2 stars 1 forks source link

25 fetching numbers one by one #36

Closed koybasimuhittin closed 1 year ago

koybasimuhittin commented 1 year ago

@hantuzun This implemtation will take much time on goerli or ethereum. I've tried to add a luckyNumbers array and public view function to return this array to the contract but the bytcode exceeded this time. The latest implementation was scanning all the blocks for drawnNumber events. It was working with hardhat but it would not work with goerli or ethereum because of large block range.

hantuzun commented 1 year ago

@koybasimuhittin, I've merged @tahos81's branch to main. Now we have a function "getDrawnNumbers()" that returns the array of drawn numbers. Would that help?

hantuzun commented 1 year ago

@koybasimuhittin, yes I reviewed the code. I think you should do the following:

Initial state

Use getDrawnNumbers

On DrawNumber events

Notify with toasts

oytuncoban commented 1 year ago

I think it's quite done @hantuzun. You can review.

oytuncoban commented 1 year ago

WARNING: This implementation doesn't include Txn hashes and timestamps like main do:

image

Reason: getDrawnNumbers() doesn't return this information. We can only have this information for recently drawn numbers.

hantuzun commented 1 year ago

Thanks for the warning @oytuncoban, we intended that behavior.