为什么合约写的函数返回值 address[] ,web3.js获取不到,数据是空的 [],这个 uint256[] 没问题。
Solidity部分
mapping(address => address[]) private teamAddress; function getAddress() public view returns (address[] memory) { return teamAddress[msg.sender]; }
abi部分
{ "inputs": [], "name": "getAddress", "outputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "stateMutability": "view", "type": "function" },
web3.js部分
await contract.methods.getAddress().call();