Seemingly ethers will not let you access a contract function named signer. Ran into this last night when we were testing a contract with a public signer variable. Is there a way around this naming conflict?
I can create a minimal working example (the stacktrace for the error unfortunately has details that need to be obfuscated) if you need one.
~You can see this https://github.com/ethers-io/ethers.js/issues/1160#issuecomment-730176442~
In TypeChain we were having similar discussion about reserved names in ethers.js https://github.com/ethereum-ts/TypeChain/issues/298#issuecomment-723280952
@zemse thanks, I will take a look, but on first glance, those issues are talking about solidity overrides where there are different function signatures. I'm referring to an issue where ethers itself adds properties that conflict. In particular, ethers adds its own signer property, which leads ethers to believe there is no signer method on the contract.
So seemingly we aren't allowed to use contract functions that conflict with ethers? Am I missing something simple here?
Edit: Now that I actually read the second link closely, I see you provide a workaround to the property conflict. We'll try that then. Thanks! :)
Oh, the first link I think I mentioned by error. You're correct that is about same name but different signatures. Sorry for that, maybe I'm too tired.
There are a few names that collide with the properties present on the object already. And with JavaScript objects in general. Unfortunately the only way to get at these is to use the signature format accessors, contract["signer()"](), for example if your method does not take in any parameters.
It is similar if you have a method that collides with a JavaScript built-in, like prototype.
Let me know if that solves things...
(I see now that鈥檚 the same as the suggestion by @zemse)
Thanks everyone. I think we can close the issue now. Haven't had a chance to try it today, but seems unlikely to not work. If in the strange event, it does not work, this would seemingly warrant its own issue :)