Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Encoder should only accept arbitrary input for booleans only when in loose mode (i.e. when no overloading) #6081

Open
haltman-at opened this issue Jun 9, 2023 · 0 comments

Comments

@haltman-at
Copy link
Contributor

Issue

Right now, when strictBooleans isn't turned on, the encoder allows arbitrary input for booleans. This is because ethers does and we wanted to be mostly compatible.

This behavior is kind of dangerous. It should only be allowed when there's no overloading to resolve (in internal terms, when the encoder is in loose mode -- which is not the same as having strictBooleans turned off).

The reason it works this way right now is because I implemented handling for booleans before we later had the idea of only allowing certain input in loose mode (something we presently do for integers). But we can apply that idea here too to make the encoder safer.

Environment

  • Truffle version (truffle version): 5.9.4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants
@eggplantzzz @haltman-at and others