Skip to main content
deleted 55 characters in body
Source Link

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Then, you can parse the mintPower and numOfDays to excel sheet using pandas library

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Then, you can parse the mintPower and numOfDays to excel sheet using pandas library

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Then, you can parse the mintPower and numOfDays to excel sheet using pandas library

added 87 characters in body
Source Link

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Then, you can parse the mintPower and numOfDays to excel sheet using pandas library

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36

Then, you can parse the mintPower and numOfDays to excel sheet using pandas library

Source Link

Basically, there are two approaches to decode the value of Mint Power and Number of Days.

#1: Using abi-decoder and/or parseTransaction utilities for web3. The details can be seen in this How to decode input data from a transaction?

#2: Decode manually based on the input data based on the following rule. The input data represented in blockchain is illustrated as bit string.

  • The first 10 bit string is the transaction signature which is 0x635d70f4 in your example
  • Next 64 bit string represents the first input (which is mintPower)
  • Next 64 bit string represents the second input (which is numOfDays)

=> Thus, you just need to slice the input string to decode from hexadecimal to decimal.

Given the following transaction https://etherscan.io/tx/0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f

You can create a Python code snippet to decode it as

from web3 import Web3
from moralis import evm_api
api_key = "YOUR_API_KEY"
# Connect to an Ethereum node 
web3 = Web3(Web3.HTTPProvider('https://rpc.ankr.com/eth'))

# Incase you have a list of txns to decode
listTxns = ['0x958ccfe41ea002afe69234aa10a106ba5e87d6807ccaf6b3a23a5826bfc1399f']
# SafeMint signature
for txn in listTxns:
    trans = web3.eth.get_transaction(txn)
    inputs = trans['input']

    # 0:10 is transaction signature
    mintPower = int(inputs[10:10+64], 16)
    numOfDays = int(inputs[10+64:10+64*2], 16)
    print('mintPower: ', mintPower)
    print('numOfDays: ', numOfDays)

Results will be

mintPower: 100
numOfDays: 36