This commit is contained in:
aozhiwei 2023-02-22 15:49:50 +08:00
parent 1d1d06a766
commit 0fa6e094c7

View File

@ -29,6 +29,8 @@ stat = {
EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000'
MERCHANT_ADDRESS = '0x14ea40648fc8c1781d19363f5b9cc9a877ac2469'.lower()
merchant_box = {}
def exportMintTable():
rows = []
with open('mint.raw.csv', 'w', newline='') as f:
@ -69,13 +71,20 @@ def statData():
rawData = json.loads(row['raw_data'])
if rawData['address'].lower() == '0x8444404bD78089A5a6d5Cc57f7Df8924f2DdACB4'.lower() and \
rawData['event'] == 'Transfer':
if rawData['returnValues']['from'] == EMPTY_ADDRESS:
fromAddress = rawData['returnValues']['from'].lower()
toAddress = rawData['returnValues']['to'].lower()
if fromAddress == EMPTY_ADDRESS:
stat['nft_total'] += 1
stat['bindBox']['total'] += 1
if rawData['returnValues']['to'] == EMPTY_ADDRESS:
if toAddress == EMPTY_ADDRESS:
stat['bindBox']['open'] += 1
if toAddress == MERCHANT_ADDRESS:
merchant_box[rawData['returnValues']['tokenId']] = 1
if fromAddress == MERCHANT_ADDRESS:
del merchant_box[rawData['returnValues']['tokenId']]
#end for
stat['bindBox']['user_hold'] = 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']
for row in nftTable:
if row['owner_address'] != EMPTY_ADDRESS:
stat['nft_total'] += 1