I'm currently trying to call Etherscan's API eth_call to check data from a smart contract. To do that, I need to pass the function ABI code and data. However, the data I need is stored in a map and I'm not sure what code that would map to.

The contract in question is here with the variable being

mapping (address => bool) public sendAllowed;

However, by doing

Keccack ("sendAllowed(address)") = 2f0c92d385bd4391c0edec32b0ac39252f8a9ecbcfb630748ddb154a80318288

I got the ABI code of 0x2f0c92d3. Plugging that into the Etherscan API, I didn't get the proper data though:


jsonrpc: "2.0",
id: 1,
result: "0x"

(should return true)

What is the correct ABI code to use for the public getter / how do I properly call the Etherscan API to get the data?

1 Answer 1


You got the function selector right (0x2f0c92d3), but you failed to correctly ABI encode the address parameter. It should be left-padded with zeros so that it's 32 bytes wide. Try this instead:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.