This PR adds a new C++ contract and benchmark based on the SnailTracer Solidity contract, as well as a new SafeVar type for the bytes Solidity type (SafeBytes), derived directly from SafeVector (basically using a fixed std::vector<uint8_t> type instead of templates) and required as a return by some of the functions on SnailTracer.
There are two different SnailTracer contracts: the "original" one, using (u)int256 integers as per the Solidity original code (int = int256), and an "optimized" version that uses (u)int136 instead ((u)int128 and below seem to not be enough for the original contract's math logic, over/underflows happen every time).
Due to practical reasons, there's also a new raw() function on SafeTuple which does the same as get() on other vars (return the raw type beneath the class, since SafeTuple already has a get() that has its own functionality). This was implemented mostly because of SnailTracer, but can be used anywhere just like the other vars' get() wrappers.
This PR adds a new C++ contract and benchmark based on the SnailTracer Solidity contract, as well as a new SafeVar type for the bytes Solidity type (SafeBytes), derived directly from SafeVector (basically using a fixed
std::vector<uint8_t>
type instead of templates) and required as a return by some of the functions on SnailTracer.There are two different SnailTracer contracts: the "original" one, using
(u)int256
integers as per the Solidity original code (int = int256), and an "optimized" version that uses(u)int136
instead ((u)int128
and below seem to not be enough for the original contract's math logic, over/underflows happen every time).Due to practical reasons, there's also a new
raw()
function on SafeTuple which does the same asget()
on other vars (return the raw type beneath the class, since SafeTuple already has aget()
that has its own functionality). This was implemented mostly because of SnailTracer, but can be used anywhere just like the other vars'get()
wrappers.