I am trying to convert Javascript code to Python and believe the equivalent "web3.eth.abi.encodeFunctionSignature" function in JS to encode ABI in Python is with the "encode_abi" function from the "eth-abi" library (https://eth-abi.readthedocs.io/en/latest/encoding.html).
However, I am completely stuck on the correct syntax to encode the below "_maxTxAmount" function call with "encode_abi". Any help/explanation would be greatly appreciated.
let sig = web3.eth.abi.encodeFunctionSignature({ name: '_maxTxAmount', type: 'function', inputs: [] });
d = {
to: address,
from: '0x8894e0a0c962cb723c1976a4421c95949be2d4e3',
value: 0,
gas: 15000000,
data: sig,
};
try {
let val = await web3.eth.call(d);
maxTXAmount = web3.utils.toBN(val);
The above excerpt is from a anti-honeypot script I found on Github and want to use this function call to enquire the above function with non-verified contracts e.g. I cannot make a "regular" contract call.