Skip to content

Commit a9ad27f

Browse files
committed
2 parents 55dee86 + a9e391f commit a9ad27f

File tree

19 files changed

+213
-152
lines changed

19 files changed

+213
-152
lines changed

Assets/Thirdweb/Core/Scripts/Transaction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using MinimalForwarder = Thirdweb.Contracts.Forwarder.ContractDefinition;
1111
using UnityEngine.Networking;
1212

13+
#pragma warning disable CS0618
14+
1315
namespace Thirdweb
1416
{
1517
/// <summary>

Assets/Thirdweb/Core/Scripts/TransactionManager.cs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using Nethereum.RPC.Eth.Transactions;
1111
using Nethereum.Web3;
1212

13+
#pragma warning disable CS0618
14+
1315
namespace Thirdweb
1416
{
1517
public static class TransactionManager

Assets/Thirdweb/Plugins/AsyncAwaitUtil/Source/Awaiters.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using UnityEngine;
33

4+
#pragma warning disable CS0436
5+
46
// TODO: Remove the allocs here, use a static memory pool?
57
public static class Awaiters
68
{

Assets/Thirdweb/Plugins/AsyncAwaitUtil/Source/IEnumeratorAwaitExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
using UnityAsyncAwaitUtil;
1212
using UnityEngine.Networking;
1313

14+
#pragma warning disable CS0436
15+
1416
// We could just add a generic GetAwaiter to YieldInstruction and CustomYieldInstruction
1517
// but instead we add specific methods to each derived class to allow for return values
1618
// that make the most sense for the specific instruction type

Assets/Thirdweb/Plugins/MetaMask/Plugins/Libraries/evm.net/Runtime/Generator/CodeGenerator.cs

+86-33
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,89 @@ public string ToFunctionName(string name)
2525

2626
public bool IsValidIdentifier(string identifier)
2727
{
28-
if (String.IsNullOrEmpty(identifier)) return false;
28+
if (String.IsNullOrEmpty(identifier))
29+
return false;
2930

3031
// C# keywords: http://msdn.microsoft.com/en-us/library/x53a06bb(v=vs.71).aspx
3132
var keywords = new[]
3233
{
33-
"abstract", "event", "new", "struct",
34-
"as", "explicit", "null", "switch",
35-
"base", "extern", "object", "this",
36-
"bool", "false", "operator", "throw",
37-
"breal", "finally", "out", "true",
38-
"byte", "fixed", "override", "try",
39-
"case", "float", "params", "typeof",
40-
"catch", "for", "private", "uint",
41-
"char", "foreach", "protected", "ulong",
42-
"checked", "goto", "public", "unchekeced",
43-
"class", "if", "readonly", "unsafe",
44-
"const", "implicit", "ref", "ushort",
45-
"continue", "in", "return", "using",
46-
"decimal", "int", "sbyte", "virtual",
47-
"default", "interface", "sealed", "volatile",
48-
"delegate", "internal", "short", "void",
49-
"do", "is", "sizeof", "while",
50-
"double", "lock", "stackalloc",
51-
"else", "long", "static",
52-
"enum", "namespace", "string"
34+
"abstract",
35+
"event",
36+
"new",
37+
"struct",
38+
"as",
39+
"explicit",
40+
"null",
41+
"switch",
42+
"base",
43+
"extern",
44+
"object",
45+
"this",
46+
"bool",
47+
"false",
48+
"operator",
49+
"throw",
50+
"breal",
51+
"finally",
52+
"out",
53+
"true",
54+
"byte",
55+
"fixed",
56+
"override",
57+
"try",
58+
"case",
59+
"float",
60+
"params",
61+
"typeof",
62+
"catch",
63+
"for",
64+
"private",
65+
"uint",
66+
"char",
67+
"foreach",
68+
"protected",
69+
"ulong",
70+
"checked",
71+
"goto",
72+
"public",
73+
"unchekeced",
74+
"class",
75+
"if",
76+
"readonly",
77+
"unsafe",
78+
"const",
79+
"implicit",
80+
"ref",
81+
"ushort",
82+
"continue",
83+
"in",
84+
"return",
85+
"using",
86+
"decimal",
87+
"int",
88+
"sbyte",
89+
"virtual",
90+
"default",
91+
"interface",
92+
"sealed",
93+
"volatile",
94+
"delegate",
95+
"internal",
96+
"short",
97+
"void",
98+
"do",
99+
"is",
100+
"sizeof",
101+
"while",
102+
"double",
103+
"lock",
104+
"stackalloc",
105+
"else",
106+
"long",
107+
"static",
108+
"enum",
109+
"namespace",
110+
"string"
53111
};
54112

55113
// definition of a valid C# identifier: http://msdn.microsoft.com/en-us/library/aa664670(v=vs.71).aspx
@@ -58,15 +116,10 @@ public bool IsValidIdentifier(string identifier)
58116
const string decimalDigitCharacter = @"\p{Nd}";
59117
const string combiningCharacter = @"\p{Mn}|\p{Mc}";
60118
const string letterCharacter = @"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}";
61-
const string identifierPartCharacter = letterCharacter + "|" +
62-
decimalDigitCharacter + "|" +
63-
connectingCharacter + "|" +
64-
combiningCharacter + "|" +
65-
formattingCharacter;
119+
const string identifierPartCharacter = letterCharacter + "|" + decimalDigitCharacter + "|" + connectingCharacter + "|" + combiningCharacter + "|" + formattingCharacter;
66120
const string identifierPartCharacters = "(" + identifierPartCharacter + ")+";
67121
const string identifierStartCharacter = "(" + letterCharacter + "|_)";
68-
const string identifierOrKeyword = identifierStartCharacter + "(" +
69-
identifierPartCharacters + ")*";
122+
const string identifierOrKeyword = identifierStartCharacter + "(" + identifierPartCharacters + ")*";
70123
var validIdentifierRegex = new Regex("^" + identifierOrKeyword + "$", RegexOptions.Compiled);
71124
var normalizedIdentifier = identifier.Normalize();
72125

@@ -123,14 +176,14 @@ public void CompleteCodeBlocks()
123176
}
124177

125178
protected abstract void DoWrite();
126-
179+
127180
public abstract string Filename { get; }
128181

129182
public string Write(bool force = false)
130183
{
131184
if (!string.IsNullOrWhiteSpace(_cachedString) && !force)
132185
return _cachedString;
133-
186+
134187
DoWrite();
135188

136189
_cachedString = builder.ToString();
@@ -142,7 +195,7 @@ public Dictionary<string, string> GenerateAll()
142195
{
143196
var dict = new Dictionary<string, string>();
144197
dict.Add(Filename, ToString());
145-
198+
146199
// Add any additional files
147200
foreach (var generator in _context.Generators)
148201
{
@@ -152,9 +205,9 @@ public Dictionary<string, string> GenerateAll()
152205
return dict;
153206
}
154207

155-
public string ToString()
208+
public override string ToString()
156209
{
157210
return Write();
158211
}
159212
}
160-
}
213+
}

Assets/Thirdweb/Plugins/MetaMask/Plugins/Libraries/evm.net/Runtime/Models/ABI/ABIDefConverter.cs

+13-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ namespace evm.net.Models.ABI
66
{
77
public class ABIDefConverter : JsonConverter
88
{
9+
#nullable enable
910
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
1011
{
1112
serializer.Serialize(writer, value);
1213
}
1314

15+
#nullable disable
16+
17+
#pragma warning disable CS8632
18+
1419
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
1520
{
1621
if (reader.TokenType == JsonToken.Null)
@@ -19,11 +24,12 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
1924
}
2025

2126
var obj = JObject.Load(reader);
22-
23-
if (obj["type"] == null) return serializer.Deserialize(reader, objectType);
27+
28+
if (obj["type"] == null)
29+
return serializer.Deserialize(reader, objectType);
2430
var typeName = obj["type"].ToString();
2531

26-
ABIDefType type = (ABIDefType) Enum.Parse(typeof(ABIDefType), typeName, true);
32+
ABIDefType type = (ABIDefType)Enum.Parse(typeof(ABIDefType), typeName, true);
2733

2834
switch (type)
2935
{
@@ -42,7 +48,7 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
4248
default:
4349
throw new ArgumentOutOfRangeException();
4450
}
45-
51+
4652
ABIDef result = (existingValue as ABIDef ?? (ABIDef)serializer.ContractResolver.ResolveContract(objectType).DefaultCreator()); // Reuse existingValue if present
4753
// the structure of the object matches the first format,
4854
// so just deserialize it directly using the serializer
@@ -52,9 +58,11 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
5258
return result;
5359
}
5460

61+
#pragma warning restore CS8632
62+
5563
public override bool CanConvert(Type objectType)
5664
{
5765
return typeof(ABIDef).IsAssignableFrom(objectType);
5866
}
5967
}
60-
}
68+
}

Assets/Thirdweb/Plugins/MetaMask/Plugins/Libraries/evm.net/Runtime/Models/EvmAddress.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public EvmAddress(string value)
1111
Value = value;
1212
}
1313

14+
#nullable enable
15+
1416
public static implicit operator string?(EvmAddress d) => d?.Value;
17+
18+
#nullable disable
19+
1520
public static implicit operator EvmAddress(string b) => new EvmAddress(b);
1621

1722
public override string ToString() => Value.StartsWith("0x") ? Value : $"0x{Value}";
@@ -21,4 +26,4 @@ public object Convert()
2126
return ToString();
2227
}
2328
}
24-
}
29+
}

Assets/Thirdweb/Plugins/MetaMask/Plugins/Libraries/evm.net/Runtime/Models/HexString.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ public byte[] ToBytes()
1616
return Value.HexToByteArray();
1717
}
1818

19+
#nullable enable
20+
1921
public static implicit operator string?(HexString d) => d?.Value;
22+
23+
#nullable disable
24+
2025
public static implicit operator HexString(string b) => new HexString(b);
2126

2227
public override string ToString() => Value.StartsWith("0x") ? Value : $"0x{Value}";
@@ -26,4 +31,4 @@ public object Convert()
2631
return ToString();
2732
}
2833
}
29-
}
34+
}

0 commit comments

Comments
 (0)