nullable Storage.Get; refactor TokenContract
This PR is a bit risky and may affect existing contract codes. I do not mind abandoning it if not good.
Storage.Get may actually return null. Ignoring it without generating any warning for the contract developer is not good.
Also it is not the best to blindly translate null to BigInteger 0. And it costs GAS to check whether a ByteString is null, when converting it to BigInteger.
Judging null increases contract size, but can be optimized by https://github.com/neo-project/neo-devpack-dotnet/pull/1213 .
This will not affect existing contract, unless they compile it again.... so, not really a big deal, we can add a warning to the contract when they build it. But the behavior should be properly commented. Such that developers can see how it works when they use it.
NUMEQUAL can be used in TokenContract
@shargon please review
I prefer to move the uint optimizations in a different PR
Ok I am on it. is null will be still used in TokenContract for this PR.