You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
Some kind of interval analysis for bit-width arguments would be nice to have, although the most frequent case is by far when it's just an integer literal or a constant.
Context
A frequent case is when due to a typo people put incorrect amount for bit width of some date they store in a builder or parse from a slice. For instance, I've seen contracts with an attempt to store 0 bits.
Some functions from @stdlib/std/cells.tact:
storeInt(self: Builder, value: Int, bits: Int) must have its 3d argument bits to be in the range [1; 257];
storeUint(self: Builder, value: Int, bits: Int) must have its 3d argument bits to be in the range [1; 256];
loadBits(self: Slice, l: Int) must have the l argument to be at least non-zero;
It looks useful to have. I think the linter should support only a specified set of the Func standard library functions and process all the native Tact functions that are aliased to them.
Summary
Some kind of interval analysis for bit-width arguments would be nice to have, although the most frequent case is by far when it's just an integer literal or a constant.
Context
A frequent case is when due to a typo people put incorrect amount for bit width of some date they store in a builder or parse from a slice. For instance, I've seen contracts with an attempt to store
0
bits.Some functions from
@stdlib/std/cells.tact
:storeInt(self: Builder, value: Int, bits: Int)
must have its 3d argumentbits
to be in the range[1; 257]
;storeUint(self: Builder, value: Int, bits: Int)
must have its 3d argumentbits
to be in the range[1; 256]
;loadBits(self: Slice, l: Int)
must have thel
argument to be at least non-zero;Examples
Use instead:
The text was updated successfully, but these errors were encountered: