1

I have a function in my Solidity which takes a struct as first parameter:

function mintGenesisAnimal(AnimalInfo memory _animalInfo, string memory _tokenUri) onlyOwner public {
    // ...
}

but when I'm trying to test this function with the code below:

const animalInfo = {
    raceName: 'Tiger',
}

await Animal.mintGenesisAnimal(animalInfo, 'https://google.com')

The test fails with a weird issue relative to "BigNumber": Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.0)

Why is a BigNumber reported when I'm trying to pass a struct (js object) as parameter ?

Alxndr BRL
  • 371
  • 1
  • 2
  • 9
  • I have the same error. but your error seems like the value is undefined. Error: invalid BigNumber value (argument="value", value={"value":"25000000000000000"}, code=INVALID_ARGUMENT, version=bignumber/5.6.0) – Lucky Arthas May 11 '22 at 15:52

0 Answers0