This commit is contained in:
aozhiwei 2024-07-25 14:49:34 +08:00
parent 123e1760c5
commit f0a4cd7a17

View File

@ -32,6 +32,16 @@ async function approveErc20(session) {
return;
}
}
const contractMeta = bc.getContractByName(currencyName);
if (!contractMeta) {
session.rspErr(500, 'currency meta not found');
return;
}
console.log(contractMeta);
if (contractMeta['type'] != 'erc20') {
session.rspErr(500, 'currency meta type error');
return;
}
const instance = bc.getInstanceByName(currencyName);
if (!instance) {
@ -46,7 +56,7 @@ async function approveErc20(session) {
session.rspData({
'trans_id' : '',
'trans_req': {
'to': '',
'to': contractMeta['address'],
'data': data
}
});