From f0a4cd7a17bba631880b3b43a7a58d390501c43d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 25 Jul 2024 14:49:34 +0800 Subject: [PATCH] 1 --- server/web3sign/controllers/erc.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/web3sign/controllers/erc.js b/server/web3sign/controllers/erc.js index 132778d..5a55da2 100644 --- a/server/web3sign/controllers/erc.js +++ b/server/web3sign/controllers/erc.js @@ -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 } });