From 876b822dc3c76082232e936051e6979affb6ebc4 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Fri, 18 Mar 2022 10:17:42 -0700 Subject: [PATCH] feat: generalize conversion rules This commit refactors and changes conversion semantics to be in line with VIP 2507. The main changes from existing behavior are: - fewer allowed conversions with address (eg. decimal/address unallowed) - decimals are bitcasted with bytes - fixes involving sign extension By generalizing the conversion rules to not use hardcoded integer/bytes types, this commit lays some groundwork for more integer/bytes types since we will not have to add a case for every single type. This commit is a first pass; the tests should be consolidated and refactored before release, and some cases involving conversion to bytes have not been added yet. Also, the logic should probably be cleaned up so that it is easier to validate/reason about.