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