Skip to main content

Type and Namespace Restrictions

When deploying new contract code, Nodes perform checks against a whitelist. If any type used in the code is not listed in the whitelist, or if the method access or type name is denied, the deployment will fail. This ensures that only approved types and namespaces can be utilized within the contract code.

Assembly Dependencies

AssemblyTrust
netstandard.dllPartial
System.Runtime.dllPartial
System.Runtime.Extensions.dllPartial
System.Private.CoreLib.dllPartial
System.ObjectModel.dllPartial
System.Linq.dllFull
System.CollectionsFull
Google.Protobuf.dllFull
AElf.Sdk.CSharp.dllFull
AElf.Types.dllFull
AElf.CSharp.Core.dllFull
AElf.Cryptography.dllFull

Types and Members Whitelist in System Namespace

TypeMember (Field / Method)Allowed
ArrayAsReadOnlyAllowed
Func<T>ALLAllowed
Func<T,T>ALLAllowed
Func<T,T,T>ALLAllowed
Nullable<T>ALLAllowed
EnvironmentCurrentManagedThreadIdAllowed
BitConverterGetBytesAllowed
NotImplementedExceptionALLAllowed
NotSupportedExceptionALLAllowed
ArgumentOutOfRangeExceptionALLAllowed
DateTimePartiallyAllowed
DateTimeNow, UtcNow, TodayDenied
UriTryCreateAllowed
UriSchemeAllowed
UriUriSchemeHttpAllowed
UriUriSchemeHttpsAllowed
voidALLAllowed
objectALLAllowed
TypeALLAllowed
IDisposableALLAllowed
ConvertALLAllowed
MathALLAllowed
boolALLAllowed
byteALLAllowed
sbyteALLAllowed
charALLAllowed
intALLAllowed
uintALLAllowed
longALLAllowed
ulongALLAllowed
decimalALLAllowed
stringALLAllowed
stringConstructorDenied
Byte[]ALLAllowed

Types and Members Whitelist in System.Reflection Namespace

TypeMember (Field / Method)Allowed
AssemblyCompanyAttributeALLAllowed
AssemblyConfigurationAttributeALLAllowed
AssemblyFileVersionAttributeALLAllowed
AssemblyInformationalVersionAttributeALLAllowed
AssemblyProductAttributeALLAllowed
AssemblyTitleAttributeALLAllowed

Other Whitelisted Namespaces

NamespaceTypeMemberAllowed
System.LinqALLALLAllowed
System.CollectionsALLALLAllowed
System.Collections.GenericALLALLAllowed
System.Collections.ObjectModelALLALLAllowed
System.GlobalizationCultureInfoInvariantCultureAllowed
System.Runtime.CompilerServicesRuntimeHelpersInitializeArrayAllowed
System.TextEncodingUTF8, GetByteCountAllowed

Allowed Types for Arrays

TypeArray Size Limit
byte40960
short20480
int10240
long5120
ushort20480
uint10240
ulong5120
decimal2560
char20480
string320
Type5
Object5
FileDescriptor10
GeneratedClrTypeInfo100