In a react/ethers web page connected to Polygon Mumbai, I get this classic error:

Uncaught (in promise) Error: invalid address or ENS name (argument="name", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.5.0)

when calling

const factory = new ethers.Contract("0xb4aF5bdB5E4d5e0b079920A5C83082348DC529e5", abis['BeaconProxyFactory'], signer);
await factory.createBookBeaconProxy({
    "owner": "0xC8834C1FcF0Df6623Fc8C8eD25064A4148D99388",
    "name": "example_name",
    "symbol": "example_symbol",
    "supply": 1000000,
    "price": {
        "type": "BigNumber",
        "hex": "0x8ac7230489e80000"
    "priceToken": "0x35935060E9160a8815312a2c2586109e8C10AD86",
    "resaleEnabled": false,
    "category": "Comic Book",
    "description": "example description",
    "initialVersionHash": "1fcdf69cdbb461aec07737b15b87ae16091b51a4ed1ea8b9b3a786948c77d4f1",
    "initialVersionURI": "QmbfSRwp4t7e2e6shULedb9rANGKsv7c1BCkmtVvYFxKkw"

However, I don't get it in a hardhat local environment. My test scripts which call that function run just fine with hardhat when Mumbai is forked as well.

This code in ethers.js also worked before I refactored my code to take a struct as an argument. But it seems ethers and hardhat both have the same syntax for structs, so perhaps this error was from something else which changed...

1 Answer 1


Apparently, ethers.js and hardhat use different syntax when passing structs as arguments. Changing the argument to createBookBeaconProxy to

["0xC8834C1FcF0Df6623Fc8C8eD25064A4148D99388", "example_name", "example_symbol", 1000000, 14, "0x35935060E9160a8815312a2c2586109e8C10AD86", false, "Coming-of-age", "example desriptipn", "1fcdf69cdbb461aec07737b15b87ae16091b51a4ed1ea8b9b3a786948c77d4f1", "QmbfSRwp4t7e2e6shULedb9rANGKsv7c1BCkmtVvYFxKkw"]

fixed this issue.

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.