Add ContractDefinition::interfaceId() helper

This commit is contained in:
Alex Beregszaszi
2020-09-14 20:34:52 +01:00
parent 83934254ea
commit 9aa9962f71
5 changed files with 13 additions and 13 deletions
+8
View File
@@ -208,6 +208,14 @@ vector<pair<util::FixedHash<4>, FunctionTypePointer>> const& ContractDefinition:
});
}
uint64_t ContractDefinition::interfaceId() const
{
uint64_t result{0};
for (auto const& function: interfaceFunctionList(false))
result ^= util::fromBigEndian<uint64_t>(function.first.ref());
return result;
}
TypePointer ContractDefinition::type() const
{
return TypeProvider::typeType(TypeProvider::contract(*this));