Hi, I have this code:
myW3.test = async (account) => {
var web3 = await Moralis.Web3.enable();
var PANCAKE_V2_ROUTER_ADDR = '0x10ED43C718714eb63d5aA57B78B54704E256024E';
var ROUTER_ABI = ['function getAmountsOut(uint amountIn,address[] memory path) public view returns (uint[] memory amounts)',
'function swapExactTokensForTokens(uint amountIn,uint amountOutMin,address[] calldata path,address to,uint deadline) external returns (uint[] memory amounts)',
'function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint amountIn,uint amountOutMin,address[] calldata path,address to,uint deadline) external'
];
// the line bellow throws error...
var ROUTER_CONTRACT = new web3.eth.Contract(ROUTER_ABI, PANCAKE_V2_ROUTER_ADDR);
};
I am using react-moralis; While calling this function on a button Click, I ve got this Error on browser:
Unhandled Rejection (TypeError): Cannot create property ‘constant’ on string ‘function getAmountsOut(uint amountIn,address[] memory path) public view returns (uint[] memory amounts)’
Where did I made it wrong?