@@ -426,31 +426,37 @@ private void ProcessClass(SemanticModel model, INamedTypeSymbol symbol)
426
426
bool isSmartContract = isPublic && ! isAbstract && isContractType ;
427
427
if ( isSmartContract )
428
428
{
429
- if ( scTypeFound ) throw new CompilationException ( DiagnosticId . MultiplyContracts , $ "Only one smart contract is allowed.") ;
429
+ if ( scTypeFound ) throw new CompilationException ( DiagnosticId . MultiplyContracts , "Only one smart contract is allowed." ) ;
430
430
scTypeFound = true ;
431
431
foreach ( var attribute in symbol . GetAttributesWithInherited ( ) )
432
432
{
433
+ if ( attribute . AttributeClass ! . IsSubclassOf ( nameof ( ManifestExtraAttribute ) ) )
434
+ {
435
+ manifestExtra [ ManifestExtraAttribute . AttributeType [ attribute . AttributeClass ! . Name ] ] = ( string ) attribute . ConstructorArguments [ 0 ] . Value ! ;
436
+ continue ;
437
+ }
438
+
433
439
switch ( attribute . AttributeClass ! . Name )
434
440
{
435
441
case nameof ( DisplayNameAttribute ) :
436
442
displayName = ( string ) attribute . ConstructorArguments [ 0 ] . Value ! ;
437
443
break ;
438
- case nameof ( scfx . Neo . SmartContract . Framework . Attributes . ContractSourceCodeAttribute ) :
444
+ case nameof ( ContractSourceCodeAttribute ) :
439
445
Source = ( string ) attribute . ConstructorArguments [ 0 ] . Value ! ;
440
446
break ;
441
- case nameof ( scfx . Neo . SmartContract . Framework . Attributes . ManifestExtraAttribute ) :
447
+ case nameof ( ManifestExtraAttribute ) :
442
448
manifestExtra [ ( string ) attribute . ConstructorArguments [ 0 ] . Value ! ] = ( string ) attribute . ConstructorArguments [ 1 ] . Value ! ;
443
449
break ;
444
- case nameof ( scfx . Neo . SmartContract . Framework . Attributes . ContractPermissionAttribute ) :
450
+ case nameof ( ContractPermissionAttribute ) :
445
451
permissions . Add ( ( string ) attribute . ConstructorArguments [ 0 ] . Value ! , attribute . ConstructorArguments [ 1 ] . Values . Select ( p => ( string ) p . Value ! ) . ToArray ( ) ) ;
446
452
break ;
447
- case nameof ( scfx . Neo . SmartContract . Framework . Attributes . ContractTrustAttribute ) :
453
+ case nameof ( ContractTrustAttribute ) :
448
454
string trust = ( string ) attribute . ConstructorArguments [ 0 ] . Value ! ;
449
455
if ( ! ValidateContractTrust ( trust ) )
450
456
throw new ArgumentException ( $ "The value { trust } is not a valid one for ContractTrust") ;
451
457
trusts . Add ( trust ) ;
452
458
break ;
453
- case nameof ( scfx . Neo . SmartContract . Framework . Attributes . SupportedStandardsAttribute ) :
459
+ case nameof ( SupportedStandardsAttribute ) :
454
460
supportedStandards . UnionWith (
455
461
attribute . ConstructorArguments [ 0 ] . Values
456
462
. Select ( p => p . Value )
0 commit comments