Incorrect Throw Error `cannot have constant payable function` due to Vyper ABI output
See original GitHub issueWhen initializing contracts using `new ethers.Contract(address, abi, provider) I occasionally get the following error.
cannot have constant payable function
However this seems to be incorrect, because both values are set to false and the reason why this throws is due to the lack of stateMutability: 'nonpayable'
in the function ABI.
Using the ABI from the uniswap_factory.json
file, which can be found at https://github.com/Uniswap/uniswap-v1/tree/master/abi
you will notice the ABI has both the constant
and payable
set too false for the initializeFactory
and createExchange
functions, but is missing the stateMutability: 'nonpayable'
entry.
I’ve run vyper -f abi contracts/uniswap_factory.vy
to ensure the output as the same as the saved uniswap_factory.json
- it was.
Is there a way to support Vyper compiled contracts in the verifyState
function without breaking expected functionality?
Or should I leave a ticket on the Vyper repo?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Awesome! 😃
I’ve also (on my local machine) updated the Fragments file to use the proper ethers logger, so this should be easier to catch in the future (since the error would include the ethers version).
Thanks! 😃
Woops… sorry about that. It was that silly
yarn.lock
file that got me.Working now!