Open dpekar opened 1 month ago
Hey, thanks for the bug report. I agree with your proposed solution - would you like to submit a PR? Cheers!
Will do when I get a minute in the next week or so!
@vacekj - I don't have write access to push up my branch and submit my PR, but I was just thinking something like:
const validatedVersionFromContract = [1, 2, '1', '2'].includes(versionFromContract)
? versionFromContract
: null;
const version = permitVersion ?? validatedVersionFromContract ?? '1';
How does that look?
Do you wanna open up access or feel free to just use code above if it looks good to you.
@dpekar thanks for the suggestion, that looks good to me. You can fork the repo and submit a PR from your fork
hey @vacekj - do you mind to push an updated version up to npm?
thanks!
When using
wagmi-permit
, I noticed my permits were failing when interacting with Balancer contracts.When I looked in a bit closer, I realized that the
version
function on the balancer pool contracts return a json string, obviously used for some other reason:{"name":"WeightedPool","version":4,"deployment":"20230320-weighted-pool-v4"}
The balancer contracts do support permits, but since
wagmi-permit
uses the wrong version, the permits fails.What about adding some simple validation to
versionFromContract
and using "1" unlessversionFromContract
is an integer?