Skip to content

Commit a303603

Browse files
committed
SmartContract: fix native NEP-17 manifest construction
Take into account event attributes declared onto the base class for native contracts. Close #3194. Signed-off-by: Anna Shaleva <[email protected]>
1 parent 3a12f3d commit a303603

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Neo/SmartContract/Native/NativeContract.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ protected NativeContract()
152152
eventsDescriptors =
153153
GetType().GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Array.Empty<Type>(), null)?.
154154
GetCustomAttributes<ContractEventAttribute>().
155+
// Take into account not only the contract constructor, but also the base type constructor for proper FungibleToken events handling.
156+
Concat(GetType().BaseType?.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Array.Empty<Type>(), null)?.
157+
GetCustomAttributes<ContractEventAttribute>()).
155158
OrderBy(p => p.Order).ToList().AsReadOnly();
156159

157160
// Calculate the initializations forks

0 commit comments

Comments
 (0)