Hello everyone. I’m new to this and adapting someone else’s code so may well be doing something stupid. Apologies in advance if this is the wrong place for this question. I am trying to retrieve token symbols, and am getting a shortened result for MKR. Could someone explain why this is the case?
Here is the code (fyi this is using Google Apps script):
function readContract()
{
var data = {"jsonrpc":"2.0","method":"eth_call","params":[{ "to": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2","data": "0x95d89b41" },"latest"], "id":1};
var options = {
'method' : 'post',
'contentType': 'application/json',
'payload' : JSON.stringify(data)
};
var response = UrlFetchApp.fetch('https://mainnet.infura.io/v3/xxx', options);
return JSON.parse(response);
}
Most contracts give a response in the form: {id=1.0, result=0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000035946490000000000000000000000000000000000000000000000000000000000, jsonrpc=2.0}
But MKR gives: {result=0x4d4b520000000000000000000000000000000000000000000000000000000000, id=1.0, jsonrpc=2.0}
Thank you!