我想建立一个用于 usdt 支付的网关,为此,我使用 Tronweb tronWeb.utils.accounts.generateAccount()方法,我生成了一个地址,将 1 usdt 转入其中,现在我想将资金转入另一个地址。发送交易时出现错误:
error: 'CONTRACT_VALIDATE_ERROR',
message: 'contract validate error : account does not exist'
This is my code:
const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "c83f36ae2e8661170e798ca73181693b76d75af016666e6f6baad92f69cfa1e2";
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);
const trc20ContractAddress = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t";//contract address
const addressTo = "TYcDSZor5ZgTsVMCZe1czfPEu8kzn6qe7L";
async function transfer() {
try {
const ownerAddress = tronWeb.address.fromPrivateKey(privateKey);
const contractAddressHex …Run Code Online (Sandbox Code Playgroud)