evmts / tevm-monorepo

A library that enables next-generation UX and DX via putting an ethereum node in the browser and solidity in javascript
https://tevm.sh
MIT License
266 stars 26 forks source link

🐛Bug: `updatePragma` does not support multiple bounds for Solidity versions #1330

Closed emo-eth closed 3 months ago

emo-eth commented 3 months ago

The updatePragma util function fails on valid pragmas, namely those that specify upper and lower bounds, such as Solarray.

I believe /pragma\s+solidity\s+((\^|~|>|>=|<|<=)?(\d+\.\d+\.\d+\s?)){1,2}\s*;/ should cover up to two bounds as well as extra whitespace before the semicolon (i.e., not run through a linter, but semantically correct Solidity).

roninjin10 commented 3 months ago

Lol nice touch with the emoji. TIL you can specify both lower and upper bind

roninjin10 commented 3 months ago

good call with the whitespace too

roninjin10 commented 3 months ago

Fixed will release this plus remappings.txt support in a bit