0

I have mapping - mapping(string => uint256[]) public _didToDealIndexes;

and I am trying to access it like this -

 await deals._didToDealIndexes(
     "did1",
      ethers.BigNumber.from("0")
 )

and also tried this -

 await deals._didToDealIndexes(
     "did1",
      0
 )

But I am getting the error - Error: Transaction reverted without a reason string.

1
  • has the array already elements or is it initialized?, maybe add the relevant construct code or the AddDidToDealIndesxes method
    – Majd TL
    Oct 20, 2021 at 9:23

1 Answer 1

0

should not the function be called like this,

 await deals._didToDealIndexes(
     "did1"
 )[ethers.BigNumber.from("0")]

3
  • Apparently, _didToDealIndexes requires 2 args for which the 2nd arg should be of type BigNumberish
    – Ashlesh
    Oct 19, 2021 at 13:38
  • would be helpful if you paste your solidity code here
    – leycun
    Oct 19, 2021 at 13:44
  • Actually its quite huge, even it's exceeding 24kb (a limit introduced in Spurious Dragon) which is making impossible to deploy the contract. Thats the reason am making the mapping as public instead of using function to return the array.
    – Ashlesh
    Oct 19, 2021 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.