basically I have this ABI for a contract
{"internalType":"bytes","name":"_DATA","type":"bytes"}],"name":"function","outputs":
I'm wondering if it's possible to fetch the value from _DATA and if it is, how would one achieve that?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityThe "internalType" is the representation used by solidity.
For example the contract
contract B {
struct View {
uint x;
}
function foo(View memory bad) public view {
this;
}
}
Will produce the following ABI
[
{
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "x",
"type": "uint256"
}
],
"internalType": "struct B.View",
"name": "bad",
"type": "tuple"
}
],
"name": "foo",
"outputs": [],
"stateMutability": "view",
"type": "function"
}
]
The "type" says it is a tuple, but the "internalType" indicates it is a struct B.View.
The internal type is useful for debugging, but it is not required for the contract to encode/decode parameters.