Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neo-devpack-dotnet #1

Open
wants to merge 737 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
737 commits
Select commit Hold shift + click to select a range
0adce1d
[Compiler Fix] Fix exception name typo (#957)
Jim8y Feb 26, 2024
b6c8fb7
[Compiler Fix + Framework Add] add oracle interface and fix issue (#959)
Jim8y Feb 26, 2024
5d4b2c0
TestEngine: Template testing optimization (#956)
shargon Feb 26, 2024
0412d7e
Fix optimizations using `CompilationEngine` (#960)
shargon Feb 26, 2024
157a892
Allow to choose the kind of optimization (#964)
shargon Feb 27, 2024
a86a38a
rename (#965)
Jim8y Feb 27, 2024
c2b4ee8
test assert & abort (#961)
Hecate2 Feb 27, 2024
693f9e9
use optimization in tests (#962)
Hecate2 Feb 27, 2024
277c952
TestEngine: Merge smart contract coverage with coverlet (#963)
shargon Feb 28, 2024
841c440
fixes on optimizer about CATCH, ENDFINALLY and PUSHA (#966)
Hecate2 Feb 28, 2024
37c79b8
[Framwork Add]Add examples (#931)
Jim8y Feb 28, 2024
5590377
TestEngine: Some fixes (#969)
shargon Feb 29, 2024
4c60441
Update native contracts (#967)
shargon Mar 1, 2024
cde176c
test recursion (#970)
Hecate2 Mar 1, 2024
92e1372
Refator: Entry point analyser (#971)
Hecate2 Mar 1, 2024
447ee42
TestEngine: Migrate current Framework's ut (#968)
shargon Mar 2, 2024
eb3a0b8
Add `getCommitteeAddress` (#973)
shargon Mar 2, 2024
2a8cbbb
fix comment (#975)
Jim8y Mar 2, 2024
c0c6d96
Sync native RoleManagement node roles with the Neo core (#977)
AnnaShaleva Mar 3, 2024
f0f797c
Add P2PNotary node role for native RoleManagement contract (#978)
AnnaShaleva Mar 3, 2024
ad041f1
TestingEngine: Native contracts manifest reuse (#976)
shargon Mar 3, 2024
c68b73e
[Compiler Add]allow direct assignment to UInt160, UInt256, and ECPoin…
Jim8y Mar 3, 2024
3c16740
Basic block analyser (#981)
Hecate2 Mar 5, 2024
ac68d6c
[Compuler Bug] fix void bug (#986)
Jim8y Mar 7, 2024
3018cdd
add comments (#988)
Jim8y Mar 8, 2024
53a383a
Fix is (pattern) (#987)
Ashuaidehao Mar 8, 2024
4661dd2
comment for Expression (#980)
chenzhitong Mar 12, 2024
31bedde
comment for Pattern (#991)
chenzhitong Mar 14, 2024
97428c9
[Compiler UT] Ut readonly property (#984)
Jim8y Mar 18, 2024
ebc056d
[Compiler Fix] https://github.com/neo-project/neo-devpack-dotnet/issu…
Jim8y Mar 18, 2024
21f9615
[Compiler Add ]Recursive pattern (#995)
Jim8y Mar 18, 2024
0d3cbc9
[Framework and Examples] Update examples (#993)
Jim8y Mar 20, 2024
a47fb44
Add comment and UT (#999)
chenzhitong Mar 22, 2024
905246d
Add: add neo smart contract syntax analyzer (#839)
Jim8y Mar 23, 2024
ece89dc
Lambda function support (#1000)
Ashuaidehao Mar 25, 2024
5c54976
Clean #1000 (#1003)
shargon Mar 26, 2024
527bdd3
Contract in basic blocks (#1002)
Hecate2 Mar 26, 2024
c93e80b
rename to GetScriptInstructions (#1006)
Hecate2 Mar 27, 2024
e11f87c
add linq methods (#1001)
Ashuaidehao Mar 27, 2024
03e62ce
Allow modify engine pre-deploy (#1007)
shargon Mar 27, 2024
eef290b
Update to net 8 (#1004)
shargon Mar 27, 2024
c9ccbb6
[Analyzer UT FIX]fix UT (#1008)
Jim8y Mar 28, 2024
2b6c42d
Allowing new compatible Dotnet versions to restore, build and publish…
shargon Apr 4, 2024
c392a6e
Fix rvcount (#1014)
Jim8y Apr 11, 2024
b1a66d7
[Compiler Fix] checkstandards (#1015)
chenzhitong Apr 11, 2024
baa82e2
update copyright for nccs and framework (#1016)
chenzhitong Apr 11, 2024
34ab8cd
[fixed bug] ContractSourceCode attribute (#1017)
chenzhitong Apr 11, 2024
869ab8d
Improve test code coverage (#1010)
chenzhitong Apr 11, 2024
226d33e
Optimize the example ut (#1019)
Jim8y Apr 16, 2024
35ee6f5
add example nep11 (#1009)
vikkkko Apr 17, 2024
1f3047e
[Example Testing] Nef use before compile issue (#1021)
Jim8y Apr 17, 2024
efd568f
Review 1009 (#1022)
shargon Apr 17, 2024
3be103a
[Compiler Add ]add support to Collection expression (#1024)
Jim8y Apr 18, 2024
35350f2
Adding example test projects (#1023)
chenzhitong Apr 18, 2024
85d3b3c
use internal class (#1025)
Jim8y Apr 19, 2024
3cfc739
Migrate old ut (#1028)
shargon Apr 23, 2024
c4896cc
Support record (#1030)
Ashuaidehao Apr 23, 2024
875d412
[Compiler Test] add Default lambda parameters tests (#1026)
Jim8y Apr 23, 2024
dd17081
Convert basic types in tests (#1031)
shargon Apr 23, 2024
63f5a35
[Examples] remove examples from workflow and create a solution for ex…
Jim8y Apr 24, 2024
d877eb3
update csproj format (#1032)
Jim8y Apr 25, 2024
e334074
<IsPackable>false</IsPackable> (#1033)
shargon Apr 27, 2024
e807411
TestEnegine: Gas watcher (#1034)
shargon May 2, 2024
93eaf90
Update main.yml (#1037)
shargon May 7, 2024
f346235
Migrate unit tests (#1036)
shargon May 7, 2024
160e8b7
udpate neo (#1038)
Jim8y May 10, 2024
ac6e7c3
Native: extend CryptoLib's `verifyWithECDsa` with compatible `NamedCu…
AnnaShaleva May 11, 2024
b65b43f
v3.7.1 (#1039)
superboyiii May 13, 2024
a2de77d
Fixed Workflow for nuget publish (#1040)
cschuchardt88 May 20, 2024
1cdd0f5
wildcard to any and add nep24 (#1041)
Jim8y May 20, 2024
c75c29a
v3.7.4 (#1043)
superboyiii May 20, 2024
db39e17
fix nullable Part I (#1042)
Jim8y May 21, 2024
0b6b19a
Update neo (#1044)
shargon May 21, 2024
0504733
Migrate some uts (#1045)
shargon May 21, 2024
a1b5832
Migrate some unit tests (#1047)
shargon May 22, 2024
0cffc97
fix crypto test (#1048)
Jim8y May 22, 2024
654760f
Coveralls and packages update (#1046)
shargon May 22, 2024
87a7fa9
Update compile source package version (#1050)
shargon May 23, 2024
436bfc5
Migrate more uts (#1051)
shargon May 23, 2024
6ccf755
Migrate more uts (#1052)
shargon May 27, 2024
de25fb4
TestEngine: Migrate some uts (#1053)
shargon May 30, 2024
868f8e4
Migrate uts (#1054)
shargon May 31, 2024
dfdb002
continue even if no package is found (#1055)
Jim8y Jun 2, 2024
bbda133
[Framework Add] implement payable (#990)
Jim8y Jun 5, 2024
5334d70
TestEngine: Migrate unit tests (#1058)
shargon Jun 6, 2024
f029a65
Check nep24 compliant (#1059)
chenzhitong Jun 7, 2024
8690a99
Update SampleRoyaltyNEP11Token.cs (#1057)
chenzhitong Jun 7, 2024
cbae713
add IWithdrawable (#1056)
Jim8y Jun 7, 2024
29289ce
[Neo Dependency] Update neo to latest (#1061)
Jim8y Jun 7, 2024
7fd56a7
FIX https://github.com/neo-project/neo-devpack-dotnet/issues/1062 (#1…
Jim8y Jun 27, 2024
b62b3e3
update neo and fix ut (#1064)
Jim8y Jun 28, 2024
783b426
[DevPack Compiler Optimize] fix push bool (#1065)
Jim8y Jun 29, 2024
70126c2
TestEngine: Migrate UTS (#1060)
shargon Jul 3, 2024
37c02de
Expose optimization (#1066)
shargon Jul 7, 2024
752a11b
TestEngine: Migrate UT (#1067)
shargon Jul 10, 2024
142eb3c
Update submodule (#1068)
shargon Jul 13, 2024
e363d98
[Devpack Compiler FIX]fix 1070 (#1072)
Jim8y Jul 15, 2024
a6d89e5
Migrate last unit tests (#1069)
shargon Jul 15, 2024
ab78849
Set optimization level from command line (#1071)
Hecate2 Jul 16, 2024
402d6bd
[TestEngine] Remove old test engine (#1073)
shargon Jul 16, 2024
a38d08d
[TestEngine] Unify coverage check (#1074)
shargon Jul 23, 2024
e799d1b
rename and comment various call methods (#1075)
Jim8y Jul 23, 2024
6490e9b
Update nugets (#1077)
shargon Jul 23, 2024
29ec56f
Fix main fee consumed (#1078)
shargon Jul 23, 2024
428b918
Fix obsolete (#1079)
shargon Jul 23, 2024
1136510
Remove debuginfo param in optimizer (#1082)
Hecate2 Jul 25, 2024
d8d1d73
improve CheckStandards CompilationException error message by removing…
Hecate2 Jul 29, 2024
457197a
Fix nullable type (#1086)
Jim8y Jul 29, 2024
62cbae4
[Compiler Fix] complete char type support (#1087)
Jim8y Jul 29, 2024
8f89f7b
[TestEngine] Add `ResetFeeConsumed` (#1091)
shargon Jul 30, 2024
25f8090
[Neo DevPack Compiler] fix type issue and test issue (#1084)
Jim8y Jul 30, 2024
5d04a3f
Add coverage (#1094)
shargon Jul 30, 2024
0c54f84
update neo (#1095)
Jim8y Jul 30, 2024
78b5948
RemoveUnnecessaryJumps optimizer (#1092)
Hecate2 Jul 31, 2024
bcd0d25
[TestEngine] Add coverage (#1097)
shargon Jul 31, 2024
0f7883a
[Neo Devpack Tests] add gas consume to the test (#1076)
Jim8y Jul 31, 2024
6add06c
fix deleting codes after finally when `catch` may throw (#1098)
Hecate2 Jul 31, 2024
c25b9ae
update devcontainer (#1099)
vncoelho Jul 31, 2024
61629db
Unit tests try catch (#1096)
Jim8y Jul 31, 2024
958b63d
fix nullable (#1100)
Jim8y Jul 31, 2024
d898107
[TestEngine] Add coverage (#1106)
shargon Aug 1, 2024
9775b4f
[Devpack Compiler] Nullable (#1081)
Jim8y Aug 1, 2024
65de9a1
delete codes after finally when finally throws or aborts (#1102)
Hecate2 Aug 2, 2024
1d83a05
[TestEngine] IndexOrRange (#1112)
shargon Aug 2, 2024
cf2cb9a
Default support (#1104)
Jim8y Aug 3, 2024
cc1ad62
[FIX] fix string empty (#1108)
Jim8y Aug 3, 2024
3437afa
[FIX] fix call virtaual (#1110)
Jim8y Aug 3, 2024
0ec0b8e
fix warnings. (#1114)
Jim8y Aug 3, 2024
11eef93
[Add Compiler Test] syntax probe (#1115)
Jim8y Aug 5, 2024
9ba0930
[TestEngine] Add coverage (#1116)
shargon Aug 5, 2024
35478a1
Use Original Type to Replace Nullable Type (#1103)
Jim8y Aug 5, 2024
9a66a29
[Update] default constructor (#1113)
Jim8y Aug 5, 2024
d9ac3eb
[TestEngine] Finish coverage errors (#1117)
shargon Aug 5, 2024
e4c9d8a
[Compiler Add] String null or empty (#1118)
Jim8y Aug 5, 2024
383292b
[TestTengine] Test only one contract (#1109)
shargon Aug 5, 2024
6f830f1
[TestEngine] Clean TestCleanup (#1119)
shargon Aug 5, 2024
e81653b
Remove warnings (#1124)
shargon Aug 6, 2024
5c25944
[TestEngine] Fix coverage for Neo.SmartContract.Framework.UnitTests (…
shargon Aug 6, 2024
8f4cd2b
Fix `CompileProjectContractWithPrepare` (#1122)
shargon Aug 6, 2024
5a47612
Add Integer (#1127)
shargon Aug 7, 2024
3d6fef2
[Add] add more string methods (#1126)
Jim8y Aug 8, 2024
adb9838
[Compiler Add] add math methods (#1128)
Jim8y Aug 8, 2024
37b16ba
fixed bug (#1130)
chenzhitong Aug 9, 2024
38d3525
[Compiler Optimize] fix and optimize (#1132)
Jim8y Aug 10, 2024
e3ef333
[Compiler Integer] add integer methods (#1135)
Jim8y Aug 13, 2024
08d0e6a
add more char methods. (#1133)
Jim8y Aug 13, 2024
00832fd
Improve error info on invalid command line arguments (#1137)
Hecate2 Aug 16, 2024
3382a6f
[Compiler Style] change the project structure. (#1138)
Jim8y Aug 19, 2024
545faa7
[Compiler SysCall] Systemcall register (#1131)
Jim8y Aug 20, 2024
e38a7d9
[Compiler Add] Out support (#1139)
Jim8y Aug 20, 2024
766fecb
add switch to gas consume test (#1142)
Jim8y Aug 23, 2024
6784206
fix InterpolatedString (#1143)
Jim8y Aug 23, 2024
ff45048
[Github workflow] update format (#1146)
Jim8y Aug 23, 2024
af295e6
[Devpack Compiler ADD] Numeric out methods (#1144)
Jim8y Aug 23, 2024
a130e81
[Workflow] Cancel existing workflow (#1147)
Jim8y Aug 23, 2024
22c9758
Re entrancy analyzer (#1134)
Hecate2 Aug 23, 2024
651aeb2
update compiler project struct (#1150)
Jim8y Aug 23, 2024
d1d5dc0
[Compiler Fix] fix push integer (#1140)
Jim8y Aug 23, 2024
c4b9952
udpate examples (#1151)
Jim8y Aug 23, 2024
d6f8771
add nested out support (#1148)
Jim8y Aug 23, 2024
2f3fcce
add opcode methods to make it easier to construct instruction scripts…
Jim8y Aug 23, 2024
afbc58b
[Devpack Compiler SysCall]add nullable methods back and add more meth…
Jim8y Aug 23, 2024
9c19cd7
[Analyzer] update analyzer and use it in test contracts (#1149)
Jim8y Aug 24, 2024
2c91d64
[Compiler Add] add pop count (#1154)
Jim8y Aug 25, 2024
9bdb9ba
Add C# syntax checklist doc (#1152)
Jim8y Aug 25, 2024
57f57f7
[Devpack Testing] update artifacts (#1153)
Jim8y Aug 26, 2024
6039fc5
Update CSharpSyntaxCheckList.md (#1156)
Jim8y Aug 29, 2024
88689a5
analyze the catch statement (#1158)
Jim8y Sep 6, 2024
25278fc
ReplaceJumpWithRet (#1159)
Hecate2 Sep 8, 2024
579bd6d
add feature as a standalone .nef file optimizer (#1162)
Hecate2 Sep 10, 2024
17715fe
optimize HandleMathClamp (#1160)
Hecate2 Sep 10, 2024
8becc29
Add IsValidAndNotZero (#1164)
shargon Sep 10, 2024
003a500
optimize IsPow2 (#1163)
Hecate2 Sep 10, 2024
b0c49b9
fix nextBlock of BasicBlock; reduce false positives in re-entrnacy an…
Hecate2 Sep 11, 2024
3a20baf
optimizer supporting CALLA (#1165)
Hecate2 Sep 11, 2024
9be7f36
misc math optimizations (#1167)
Hecate2 Sep 13, 2024
11a01b2
optimizer removes redundant DUP and DROP; throw when optimizer fails …
Hecate2 Sep 17, 2024
a0be8f3
ban the use of diagnostic (#1171)
Jim8y Sep 19, 2024
9bda2cf
fix BigInteger IsPowerOfTwo (#1172)
Hecate2 Sep 19, 2024
9747093
optimize DivRem (#1173)
Hecate2 Sep 23, 2024
55291ed
fix false positive when a basic block write before call (#1174)
Hecate2 Sep 23, 2024
da96f9a
Optimize BigInteger.Parse (#1178)
shargon Sep 24, 2024
d3f8fff
test large overflows and underflows for EnsureIntegerInRange (#1170)
Hecate2 Sep 24, 2024
c4a55aa
[SysCall] add support to enum methods, (#1169)
Jim8y Sep 24, 2024
b5f8c31
Update template version (#1176)
shargon Sep 25, 2024
6a35dde
generate basic block jumps from coverage; enhance basic block analysi…
Hecate2 Sep 27, 2024
ffbe25d
Add ut (#1179)
shargon Sep 27, 2024
add2135
No-reentrant global attribute (#1181)
shargon Sep 28, 2024
2a39c68
[Compiler] add fix nep (#1187)
Jim8y Oct 1, 2024
47b9243
add test for init (#1192)
Jim8y Oct 3, 2024
990542b
fix: char.IsWhitespace (#1193)
nan01ab Oct 4, 2024
be47dc1
fix: string.Trim only trim ' ' (#1194)
nan01ab Oct 4, 2024
bb13c53
cancel constructors (#1185)
Hecate2 Oct 4, 2024
d99de6b
Avoid regex (#1196)
shargon Oct 4, 2024
1c7891c
nep19 comment (#1198)
Jim8y Oct 4, 2024
112a30c
fix basicBlockContinuation after else (#1190)
Hecate2 Oct 5, 2024
f59bbbc
[Compiler UT] unit test string (#1199)
Jim8y Oct 7, 2024
b51fc46
[Test] add instructions to the contract methods (#1191)
Jim8y Oct 8, 2024
6e49189
add reentry doc (#1197)
Jim8y Oct 8, 2024
17ec6d2
[Compiler] fix object creation (#1184)
Jim8y Oct 8, 2024
71695e2
reentrancy analyzer test (#1189)
Hecate2 Oct 8, 2024
38b9591
add comment to value initialize attribute (#1200)
Jim8y Oct 8, 2024
ae0695a
dumpnef performance (#1201)
Hecate2 Oct 10, 2024
9391217
compile multiple .csproj in subdirectories (#1202)
Hecate2 Oct 10, 2024
a75c41e
Cancel unnecessary instance method call (#1204)
Hecate2 Oct 22, 2024
fcd2836
Update master (#1212)
shargon Oct 23, 2024
6e651f5
optimize array and struct construction from APPEND and SETITEM to PAC…
Hecate2 Oct 23, 2024
409ddba
replace STSFLD with PUSH const (#1203)
Hecate2 Oct 24, 2024
3a5b4a2
NumEqual (#1215)
Hecate2 Oct 25, 2024
667ace7
UseNz, UseIsNull & FoldNotInJmp to handle if(a==null), if(a==0) (#1213)
Hecate2 Oct 27, 2024
91ea645
add gas price to artifact (#1210)
Jim8y Oct 27, 2024
541620c
compile Assert(bool,string) with ABORTMSG (#1218)
Hecate2 Oct 29, 2024
528e03e
TryOptimizedObjectCreation (#1207)
Hecate2 Nov 1, 2024
552f958
support new method in contract that hides base method (#1217)
Hecate2 Nov 1, 2024
12b5647
push \xff correctly (#1219)
Hecate2 Nov 1, 2024
07720d0
fix artifact method script (#1221)
Hecate2 Nov 3, 2024
dc63c47
FoldJump; RemoveMultiRet (#1220)
Hecate2 Nov 5, 2024
00b678f
delete unused CALLT method token in nef (#1222)
Hecate2 Nov 5, 2024
a2aa0a9
add missing eaual methods (#1225)
Jim8y Nov 6, 2024
65654df
update example (#1226)
Jim8y Nov 6, 2024
3324668
remove some compiler warnings (#1228)
nan01ab Nov 6, 2024
36c1fb2
update nepcheck (#1227)
Jim8y Nov 6, 2024
1178d8b
Storage UT (#1232)
shargon Nov 7, 2024
569d929
refactor basic block and re-entrancy analyzer (#1234)
Hecate2 Nov 8, 2024
57ca7af
Compiler info in DebugInfo
shargon Nov 8, 2024
e5c8d24
Revert "Compiler info in DebugInfo"
shargon Nov 8, 2024
0e28108
Fix `Dissasembler` (#1236)
shargon Nov 9, 2024
c3355f2
Show ascii as info (#1238)
shargon Nov 10, 2024
542365a
Update neo (#1240)
shargon Nov 11, 2024
b297dd4
Clean remarks and add type information (#1243)
shargon Nov 14, 2024
20d6fa8
Compiler source info into `DebugInfo` (#1235)
shargon Nov 14, 2024
5dddb0d
fix default value (#1241)
Jim8y Nov 15, 2024
580d2ed
Trace remarks (#1245)
shargon Nov 15, 2024
234dcb5
Ut property again (#1246)
Hecate2 Nov 19, 2024
5db6cc0
nullable Storage.Get; refactor TokenContract (#1214)
Hecate2 Nov 19, 2024
e09f7ef
property `get;` loads value in stack if static field not null (#1230)
Hecate2 Nov 20, 2024
921ad30
WriteInTryAnalzyer (#1248)
Hecate2 Nov 20, 2024
c3787a2
fix convert (#1247)
Jim8y Nov 21, 2024
a8dacf4
use ConcurrentDictionary for Parallel.ForEach (#1250)
Hecate2 Nov 22, 2024
246418e
fix debuginfo v2 optimization to array (#1251)
Hecate2 Nov 22, 2024
ec4c53c
Revert (#1254)
shargon Nov 27, 2024
e7f6230
Remove nullable enable (#1255)
shargon Nov 27, 2024
76b15d5
Fix some compiler warnings in `MethodConvert` (#1252)
nan01ab Nov 27, 2024
a65f09a
Small optmizations (#1253)
shargon Nov 27, 2024
a314f55
fix & test WriteInTry analyzer (#1256)
Hecate2 Dec 2, 2024
6e9ee80
test analyzer in recursion (#1258)
Hecate2 Dec 5, 2024
57dc4b3
optimize IsValid (#1259)
Hecate2 Dec 5, 2024
bb8a3b9
remove artifact opcodes line number (#1261)
Jim8y Dec 11, 2024
d8a043b
fix: warning AD0001: Analyzer 'Neo.SmartContract.Analyzer.CollectionT…
nan01ab Dec 11, 2024
028445c
cancel more unnecessary constructor call (#1260)
Hecate2 Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mcr.microsoft.com/devcontainers/dotnet:8.0-jammy
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "devcontainer.dockerfile"
},
"onCreateCommand": "./scripts/load_submodule.sh",
"postCreateCommand": "dotnet restore && dotnet build",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit"
]
}
}
}
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
###############################
# Core EditorConfig Options #
###############################

# dotnet-format requires version 3.1.37601
# dotnet tool update -g dotnet-format
# remember to have: git config --global core.autocrlf false #(which is usually default)

root = true

# Every file

[*]
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
end_of_line = lf
#indent_style = tab # TODO
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: Exciting New Features 🎉
labels:
- enhancement
- title: What's Changed
labels:
- "*"
199 changes: 199 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: .NET Core Test and Publish

on:
push:
branches: [master]
pull_request:

env:
DOTNET_VERSION: 8.0.x
DOTNET_TEST_PARAMETERS: --no-build /p:CollectCoverage=true -l "console;verbosity=detailed"
COVERLET_EXCLUDE_COVERAGE: /p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Disassembler.CSharp]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
COVERLET_OUTPUT: /p:CoverletOutput=${{ github.workspace }}/coverage-join/
COVERLET_MERGE_WITH: /p:MergeWith=${{ github.workspace }}/coverage-join/coverage.json

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check format
run: |
dotnet format --no-restore --verify-no-changes --verbosity diagnostic
- name: Build Neo.Compiler.CSharp
run: dotnet build ./src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj
- name: Build Neo.SmartContract.Template and test templates
run: |
dotnet pack ./src/Neo.SmartContract.Template/Neo.SmartContract.Template.csproj --configuration Debug
dotnet new install ./src/Neo.SmartContract.Template/bin/Debug/Neo.SmartContract.Template.*.nupkg
dotnet new neocontractnep17 -n Nep17Contract -o ./src/Neo.SmartContract.Template/bin/Debug/nep17/ --force
dotnet new neocontractowner -n Ownable -o ./src/Neo.SmartContract.Template/bin/Debug/ownable/ --force
dotnet new neocontractoracle -n OracleRequest -o ./src/Neo.SmartContract.Template/bin/Debug/oracle/ --force
dotnet new uninstall Neo.SmartContract.Template
dotnet remove ./src/Neo.SmartContract.Template/bin/Debug/nep17/Nep17Contract.csproj package Neo.SmartContract.Framework
dotnet add ./src/Neo.SmartContract.Template/bin/Debug/nep17/Nep17Contract.csproj reference ./src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj
dotnet remove ./src/Neo.SmartContract.Template/bin/Debug/ownable/Ownable.csproj package Neo.SmartContract.Framework
dotnet add ./src/Neo.SmartContract.Template/bin/Debug/ownable/Ownable.csproj reference ./src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj
dotnet remove ./src/Neo.SmartContract.Template/bin/Debug/oracle/OracleRequest.csproj package Neo.SmartContract.Framework
dotnet add ./src/Neo.SmartContract.Template/bin/Debug/oracle/OracleRequest.csproj reference ./src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj
dotnet ./src/Neo.Compiler.CSharp/bin/Debug/net8.0/nccs.dll ./src/Neo.SmartContract.Template/bin/Debug/nep17/Nep17Contract.csproj -o ./tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/Artifacts/
dotnet ./src/Neo.Compiler.CSharp/bin/Debug/net8.0/nccs.dll ./src/Neo.SmartContract.Template/bin/Debug/ownable/Ownable.csproj -o ./tests/Neo.SmartContract.Template.UnitTests/templates/neocontractowner/Artifacts/
dotnet ./src/Neo.Compiler.CSharp/bin/Debug/net8.0/nccs.dll ./src/Neo.SmartContract.Template/bin/Debug/oracle/OracleRequest.csproj -o ./tests/Neo.SmartContract.Template.UnitTests/templates/neocontractoracle/Artifacts/
- name: Build Solution
run: dotnet build ./neo-devpack-dotnet.sln
- name: Add package coverlet.msbuild
run: find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
- name: Test Neo.Compiler.CSharp.UnitTests
run: |
dotnet test ./tests/Neo.Compiler.CSharp.UnitTests \
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Framework.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Framework.UnitTests \
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Testing.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Testing.UnitTests \
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Template.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Template.UnitTests \
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
/p:CoverletOutput=${{ github.workspace }}/coverage/lcov \
/p:CoverletOutputFormat=lcov
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: lcov
file: ${{ github.workspace }}/coverage/lcov.info

PublishPackage:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Set Version (dev-pack)
run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV
- name: Set Version (Neo)
run: |
git --git-dir=./neo/.git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX_NEO={}' >> $GITHUB_ENV
sed -n 's/.*<VersionPrefix>\(.*\)<\/VersionPrefix>.*/\1/p' ./neo/src/Directory.Build.props | xargs -I{} echo 'VERSION_NEO={}' >> $GITHUB_ENV

- name : Pack (Neo.SmartContract.Framework)
run: |
dotnet pack ./src/Neo.SmartContract.Framework \
--configuration Debug \
--output ./out \
--version-suffix ${{ env.VERSION_SUFFIX }}
- name : Replace Neo reference by package in Neo.SmartContract.Testing
run: |
dotnet remove ./src/Neo.SmartContract.Testing/Neo.SmartContract.Testing.csproj reference '..\..\neo\src\Neo\Neo.csproj'
dotnet add ./src/Neo.SmartContract.Testing/Neo.SmartContract.Testing.csproj package 'Neo' --version ${{ env.VERSION_NEO }}-${{ env.VERSION_SUFFIX_NEO }}
- name : Build (Neo.SmartContract.Testing)
run: |
dotnet build ./src/Neo.SmartContract.Testing -f net8.0
dotnet build ./src/Neo.SmartContract.Testing -f netstandard2.1
- name : Pack (Neo.SmartContract.Testing)
run: |
dotnet pack ./src/Neo.SmartContract.Testing \
--no-build \
--configuration Debug \
--output ./out \
--version-suffix ${{ env.VERSION_SUFFIX }}
- name: Publish to Github Packages
working-directory: ./out
run: |
dotnet nuget push * \
--source https://nuget.pkg.github.com/neo-project/index.json \
--api-key "${{ secrets.GITHUB_TOKEN }}" \
--disable-buffering \
--no-service-endpoint;
- name: Publish to myGet
working-directory: ./out
run: |
dotnet nuget push * \
--source https://www.myget.org/F/neo/api/v3/index.json \
--api-key "${{ secrets.MYGET_TOKEN }}" \
--disable-buffering \
--no-service-endpoint;

Release:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Get version
id: get_version
run: |
sudo apt install xmlstarlet
find src -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo
- name: Check tag
id: check_tag
run: curl -s -I ${{ format('https://github.com/{0}/releases/tag/{1}', github.repository, steps.get_version.outputs.version) }} | head -n 1 | cut -d$' ' -f2 | xargs printf "::set-output name=statusCode::%s" | xargs echo
- name: Create release
if: steps.check_tag.outputs.statusCode == '404'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: ${{ steps.get_version.outputs.version }}
prerelease: ${{ contains(steps.get_version.outputs.version, '-') }}
- name: Setup .NET Core
if: steps.check_tag.outputs.statusCode == '404'
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish to NuGet
if: steps.check_tag.outputs.statusCode == '404'
run: |
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/neo/neo.csproj
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/Neo.Extensions/Neo.Extensions.csproj
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/Neo.IO/Neo.IO.csproj
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/Neo.Json/Neo.Json.csproj
dotnet sln neo-devpack-dotnet.sln remove ./neo/src/Neo.VM/Neo.VM.csproj
dotnet pack -o pub -c Release
dotnet nuget push "pub/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${NUGET_TOKEN} --skip-duplicate
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
88 changes: 88 additions & 0 deletions .github/workflows/pkgs-delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Package Cleanup

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run every day at 24:00

jobs:

delete-myget-pkgs:
name: Delete Old MyGet Packages
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Requests
run: pip install requests
- name: Install Packaging
run: pip install packaging
- name: Delete versions below 3.6.1
env:
MYGET_FEED: 'neo'
PACKAGE_NAMES: 'Neo.SmartContract.Framework,Neo.SmartContract.Testing'
MYGET_API_KEY: ${{ secrets.MYGET_TOKEN }}
run: |
import requests
from packaging import version
import os

def get_versions(feed, package_name, api_key):
url = f"https://www.myget.org/F/{feed}/api/v2/Packages?$select=Version&$filter=Id eq '{package_name}'&$format=json"
headers = {'Accept': 'application/json'}
response = requests.get(url, headers=headers)
if response.status_code == 200:
versions = response.json()['d']['results']
return [ver['Version'] for ver in versions]
else:
return []

def delete_version(feed, package_name, ver, api_key):
url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}?hardDelete=true"
headers = {"X-NuGet-ApiKey": api_key}
response = requests.delete(url, headers=headers)
return response.status_code == 200 # Success

feed = os.environ['MYGET_FEED']
package_names = os.environ['PACKAGE_NAMES'].split(',')
api_key = os.environ['MYGET_API_KEY']

for package_name in package_names:
versions_to_delete = get_versions(feed, package_name, api_key)
for ver in versions_to_delete:
if version.parse(ver.split("-", 1)[0]) >= version.Version("3.6.1"):
print(f"Omited {ver} of package {package_name}.")
continue
if delete_version(feed, package_name, ver, api_key):
print(f"Deleted version {ver} of package {package_name}.")
else:
print(f"Failed to delete version {ver} of package {package_name}.")

shell: python

delete-git-pkgs:
name: Delete Old Github Packages
runs-on: ubuntu-latest

steps:
- name: Delete Neo.SmartContract.Testing Package
uses: actions/delete-package-versions@v4
with:
package-name: Neo.SmartContract.Testing
package-type: nuget
min-versions-to-keep: 3
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"
continue-on-error: true

- name: Delete Neo.SmartContract.Framework Package
uses: actions/delete-package-versions@v4
with:
package-name: Neo.SmartContract.Framework
package-type: nuget
min-versions-to-keep: 3
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"
continue-on-error: true
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,10 @@ paket-files/
# JetBrains Rider
.idea/
*.sln.iml
/src/Neo.Compiler.MSIL/Properties/launchSettings.json

# VSCode
.vscode/

# MacOS
**/.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "neo"]
path = neo
url = https://github.com/neo-project/neo.git
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "neo-devpack-dotnet.sln"
}
Loading