1
This commit is contained in:
parent
f621b3a5e3
commit
435ed2d331
@ -17,7 +17,7 @@ contracts = lambda : json.load(open('contract.json', 'r'))
|
||||
stat = {
|
||||
'nft_total': 0,
|
||||
'nft_mint': 0,
|
||||
'bindBox': {
|
||||
'blindBox': {
|
||||
'user_hold': 0,
|
||||
'open': 0,
|
||||
'total': 0,
|
||||
@ -79,10 +79,10 @@ def statData():
|
||||
tokenId = rawData['returnValues']['tokenId'].lower()
|
||||
if fromAddress == EMPTY_ADDRESS:
|
||||
stat['nft_total'] += 1
|
||||
stat['bindBox']['total'] += 1
|
||||
stat['blindBox']['total'] += 1
|
||||
boxUser[tokenId] = toAddress
|
||||
if toAddress == EMPTY_ADDRESS:
|
||||
stat['bindBox']['open'] += 1
|
||||
stat['blindBox']['open'] += 1
|
||||
del boxUser[tokenId]
|
||||
else:
|
||||
boxUser[tokenId] = toAddress
|
||||
@ -92,13 +92,13 @@ def statData():
|
||||
del merchant_box[rawData['returnValues']['tokenId']]
|
||||
|
||||
#end for
|
||||
assert(len(boxUser) == stat['bindBox']['total'] - stat['bindBox']['open'])
|
||||
stat['bindBox']['merchant_hold'] = len(merchant_box)
|
||||
stat['bindBox']['user_hold'] = stat['bindBox']['total'] - stat['bindBox']['open'] - stat['bindBox']['merchant_hold']
|
||||
assert(len(boxUser) == stat['blindBox']['total'] - stat['blindBox']['open'])
|
||||
stat['blindBox']['merchant_hold'] = len(merchant_box)
|
||||
stat['blindBox']['user_hold'] = stat['blindBox']['total'] - stat['blindBox']['open'] - stat['blindBox']['merchant_hold']
|
||||
for key, value in boxUser.copy().items():
|
||||
if value == MERCHANT_ADDRESS:
|
||||
del boxUser[key]
|
||||
assert(len(boxUser) == stat['bindBox']['user_hold'])
|
||||
assert(len(boxUser) == stat['blindBox']['user_hold'])
|
||||
userHoldNums = {}
|
||||
for key, value in boxUser.items():
|
||||
userHoldNums[value] = 1
|
||||
@ -132,7 +132,7 @@ def statData():
|
||||
stat['nft_rank'] = sorted(userHoldList, key=functools.cmp_to_key(cmpFunc))
|
||||
for i in range(len(stat['nft_rank'])):
|
||||
stat['nft_rank'][i]['rank'] = i + 1
|
||||
stat['nft_mint'] += stat['bindBox']['merchant_hold']
|
||||
stat['nft_mint'] += stat['blindBox']['merchant_hold']
|
||||
rankList = [
|
||||
(
|
||||
'address',
|
||||
|
Loading…
x
Reference in New Issue
Block a user