Issue Description
When calling the triggerconstantcontract endpoint to check if a TRON address is blacklisted using the isBlackListed(address) function, a NullPointerException is thrown when the address is actually blacklisted.
Environment
- TRON Network: Mainnet
- API Endpoint:
https://tron-mainnet.gateway.tatum.io/wallet/triggerconstantcontract
- Contract Address:
TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t (USDT TRC-20)
- Function:
isBlackListed(address)
Steps to Reproduce
- Call the
triggerconstantcontract endpoint with the following payload:
{
"owner_address": "TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "isBlackListed(address)",
"parameter": "0000000000000000000000418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f6",
"visible": true
}
- The address
TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v is confirmed to be blacklisted.
Expected Behavior
The endpoint should return a successful response with the blacklist status in the constant_result field, for example:
{
"result": {
"result": true,
"constant_result": ["0000000000000000000000000000000000000000000000000000000000000001"]
}
}
Actual Behavior
The endpoint returns an error:
{
"result": {
"code": "OTHER_ERROR",
"message": "class java.lang.NullPointerException : null"
}
}
Error Details
- Error Type:
java.lang.NullPointerException
- Error Code:
OTHER_ERROR
- Message:
class java.lang.NullPointerException : null
Additional Information
Test Cases
-
Blacklisted Address (Fails with NullPointerException):
- Address:
TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v
- Expected: Should return
true or 1 in constant_result
- Actual: Returns NullPointerException
-
Non-blacklisted Address (May work correctly):
- Should be tested to confirm if the issue only occurs with blacklisted addresses
Request Details
- Method: POST
- URL:
/wallet/triggerconstantcontract
- Content-Type:
application/json
- Parameter Encoding: The address is converted from Base58 to hex format, padded to 64 characters (32 bytes)
Address Conversion
The address TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v is converted as follows:
- Base58 to hex:
418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f6
- Ensure
41 prefix (TRON address prefix)
- Pad to 64 hex characters:
0000000000000000000000418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f6
Possible Root Cause
The NullPointerException suggests that when processing a blacklisted address, the TRON node may be encountering a null reference when:
- Accessing the blacklist mapping
- Processing the return value
- Encoding the response
This could indicate a bug in the contract execution or response encoding logic when dealing with blacklisted addresses.
Impact
This issue prevents applications from properly checking blacklist status for addresses that are actually blacklisted, which is critical for compliance and security purposes.
Requested Action
Please investigate and fix the NullPointerException that occurs when calling triggerconstantcontract with isBlackListed(address) for blacklisted addresses. The function should return a proper boolean value instead of throwing an exception.
Related Information
- TRON USDT Contract:
TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
- Function Signature:
isBlackListed(address)
- Test Address:
TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v (confirmed blacklisted)
Issue Description
When calling the
triggerconstantcontractendpoint to check if a TRON address is blacklisted using theisBlackListed(address)function, aNullPointerExceptionis thrown when the address is actually blacklisted.Environment
https://tron-mainnet.gateway.tatum.io/wallet/triggerconstantcontractTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t(USDT TRC-20)isBlackListed(address)Steps to Reproduce
triggerconstantcontractendpoint with the following payload:{ "owner_address": "TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v", "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "function_selector": "isBlackListed(address)", "parameter": "0000000000000000000000418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f6", "visible": true }TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6vis confirmed to be blacklisted.Expected Behavior
The endpoint should return a successful response with the blacklist status in the
constant_resultfield, for example:{ "result": { "result": true, "constant_result": ["0000000000000000000000000000000000000000000000000000000000000001"] } }Actual Behavior
The endpoint returns an error:
{ "result": { "code": "OTHER_ERROR", "message": "class java.lang.NullPointerException : null" } }Error Details
java.lang.NullPointerExceptionOTHER_ERRORclass java.lang.NullPointerException : nullAdditional Information
Test Cases
Blacklisted Address (Fails with NullPointerException):
TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6vtrueor1in constant_resultNon-blacklisted Address (May work correctly):
Request Details
/wallet/triggerconstantcontractapplication/jsonAddress Conversion
The address
TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6vis converted as follows:418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f641prefix (TRON address prefix)0000000000000000000000418a8e8b8c8d8e8f9a9b9c9d9e9f0a1b2c3d4e5f6Possible Root Cause
The
NullPointerExceptionsuggests that when processing a blacklisted address, the TRON node may be encountering a null reference when:This could indicate a bug in the contract execution or response encoding logic when dealing with blacklisted addresses.
Impact
This issue prevents applications from properly checking blacklist status for addresses that are actually blacklisted, which is critical for compliance and security purposes.
Requested Action
Please investigate and fix the
NullPointerExceptionthat occurs when callingtriggerconstantcontractwithisBlackListed(address)for blacklisted addresses. The function should return a proper boolean value instead of throwing an exception.Related Information
TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6tisBlackListed(address)TKgD8Qnx9Zw3RNjdiU2i5y2Swa2y4QvG6v(confirmed blacklisted)