mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding event and error selector fields on the lines of the function selector fields
This commit is contained in:
committed by
chriseth
parent
2cb29dbd35
commit
d4c06d2b4e
@@ -1785,7 +1785,20 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess)
|
||||
functionType.declaration().isPartOfExternalInterface(),
|
||||
""
|
||||
);
|
||||
define(IRVariable{_memberAccess}) << formatNumber(functionType.externalIdentifier() << 224) << "\n";
|
||||
define(IRVariable{_memberAccess}) << formatNumber(
|
||||
util::selectorFromSignature(functionType.externalSignature())
|
||||
) << "\n";
|
||||
}
|
||||
else if (functionType.kind() == FunctionType::Kind::Event)
|
||||
{
|
||||
solAssert(functionType.hasDeclaration());
|
||||
solAssert(functionType.kind() == FunctionType::Kind::Event);
|
||||
solAssert(
|
||||
!(dynamic_cast<EventDefinition const&>(functionType.declaration()).isAnonymous())
|
||||
);
|
||||
define(IRVariable{_memberAccess}) << formatNumber(
|
||||
u256(h256::Arith(util::keccak256(functionType.externalSignature())))
|
||||
) << "\n";
|
||||
}
|
||||
else
|
||||
solAssert(false, "Invalid use of .selector: " + functionType.toString(false));
|
||||
|
||||
Reference in New Issue
Block a user