abi.map is not a function error
See original GitHub issueReopening https://github.com/ethers-io/ethers.js/issues/1196
const interface = new ethers.utils.Interface(FILL_ORDER_ABI); <----- this line raise the error.
const sig = "fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes),uint256,bytes)";
const data = interface.encodeFunctionData(sig, [orderTuple,fillAmount, signature])
The error;
TypeError: abi.map is not a function,
My abi ;
{"constant":false,"inputs":[
{"components":[
{"internalType":"address","name":"makerAddress","type":"address"},
{"internalType":"address","name":"takerAddress","type":"address"},
{"internalType":"address","name":"feeRecipientAddress","type":"address"},
{"internalType":"address","name":"senderAddress","type":"address"},
{"internalType":"uint256","name":"makerAssetAmount","type":"uint256"},
{"internalType":"uint256","name":"takerAssetAmount","type":"uint256"},
{"internalType":"uint256","name":"makerFee","type":"uint256"},
{"internalType":"uint256","name":"takerFee","type":"uint256"},
{"internalType":"uint256","name":"expirationTimeSeconds","type":"uint256"},
{"internalType":"uint256","name":"salt","type":"uint256"},
{"internalType":"bytes","name":"makerAssetData","type":"bytes"},
{"internalType":"bytes","name":"takerAssetData","type":"bytes"},
{"internalType":"bytes","name":"makerFeeAssetData","type":"bytes"},
{"internalType":"bytes","name":"takerFeeAssetData","type":"bytes"}
],
"internalType":"struct LibOrder.Order","name":"order","type":"tuple"
},
{"internalType":"uint256","name":"takerAssetFillAmount","type":"uint256"},
{"internalType":"bytes","name":"signature","type":"bytes"}
],
"name":"fillOrder",
"outputs":[
{"components":[
{"internalType":"uint256","name":"makerAssetFilledAmount","type":"uint256"},
{"internalType":"uint256","name":"takerAssetFilledAmount","type":"uint256"},
{"internalType":"uint256","name":"makerFeePaid","type":"uint256"},
{"internalType":"uint256","name":"takerFeePaid","type":"uint256"},
{"internalType":"uint256","name":"protocolFeePaid","type":"uint256"}
],
"internalType":"struct LibFillResults.FillResults",
"name":"fillResults","type":"tuple"}
],
"payable":true,
"stateMutability":"payable",
"type":"function"}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
abi.map not a function error trying to connect to uniswap
I've been following their docs on V3 but I can't get past this "abi.map is not a function" error. When I output the...
Read more >I get an error for a function I don't even call
map , and the variable name suggests it's abi , though this is from ethers.js codebase not yours. Share.
Read more >A brand new website interface for an even better experience!
abi.map is not a function error.
Read more >[Hardhat] Having trouble passing an ABI to my contract object.
The only output I am getting is TypeError: abi.map is not a function. I assume this means that it is improperly reading the...
Read more >Contract ABI Specification — Solidity 0.8.16 documentation
The return type of a function is not part of this signature. ... We define enc , the actual encoding, as a mapping...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Currently the value you have stored in abi var is actually an abi fragment. An
abi
is actually an array of abi fragments.Change your
const abi = {......}
toconst abi = [{......}]
Change the property
gas
togasLimit
You can find list of accepted overrides/options here: https://github.com/ethers-io/ethers.js/blob/e0ccafb140ad8a10353a49909b8d425ba71b87de/packages/contracts/src.ts/index.ts#L17-L30