Arachnid / solidity-stringutils

Basic string utilities for Solidity
Apache License 2.0
1.12k stars 369 forks source link

Migrate to dapp, fix compiler warnings for solidity ^0.4.21 #25

Closed ovangle closed 6 years ago

ovangle commented 6 years ago

This PR accomplishes a couple of things.

For a start, I couldn't run unit tests because I was getting an error from boost using dapple. I noted that the dapple utils have been deprecated in favour of dapp, so I migrated the project to using that.

I'm not sure if the migration to dapp is ready for publishing, it would require a major version change at least, because strings.sol and strings_test.sol have been (necessarily, because of the new package format) moved to src/strings.sol and src/strings.t.sol respectively.

All compiler warnings have been fixed and all functions have been marked as pure with solc version 0.4.21 -- this includes the jump instructions in findPtr and rFindPtr. I was a little nervous about changing those, since my changes resulted in a slight de-optimisation of the functions (approx. 3% gas per byte according to some simple benchmarks which I didn't commit but can provide).

What do you think?

Arachnid commented 6 years ago

Amazing work, thank you! I agree that this needs a major version bump; in addition the .dapple directory shouldn't be included (and should be in .gitignore). Other than that, this looks good.

ovangle commented 6 years ago

I removed all the files that shouldn't have been included in the repo and bumped the major release to 2.0.0.