-
Notifications
You must be signed in to change notification settings - Fork 106
Update neo submodule #1417
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
Merged
Merged
Update neo submodule #1417
+1
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jim8y
approved these changes
Oct 30, 2025
shargon
added a commit
that referenced
this pull request
Nov 13, 2025
* Update neo (#1333) * Fix GitHub Actions build issue by targeting only .NET 9 (#1328) * Fix GitHub Actions build issue by targeting only .NET 9 - Remove netstandard2.1 target from Neo.SmartContract.Testing build step - Prevents package downgrade error between Neo 3.8.1 and 3.8.1-CI01961 - Aligns with project's net9.0 target framework specification Fixes the error: error NU1605: Warning As Error: Detected package downgrade: Neo from 3.8.1 to 3.8.1-CI01961 * SafeAttribute supports in properties (#1330) * SafeAttribute supports in properties * Update Nep11Token.cs * Safe setters are not allowed --------- Co-authored-by: Erik Zhang <[email protected]> Co-authored-by: Shargon <[email protected]> * udpate reference to 3.8.1 (#1326) * udpate reference to 3.8.1 * prioritize the nuget over myget * fix verison * SafeAttribute supports in properties (#1330) * SafeAttribute supports in properties * Update Nep11Token.cs * Safe setters are not allowed * Fix Neo.SmartContract.Framework 3.8.1 package resolution for temporary projects - Update package version from 3.8.1-* to 3.8.1 to use stable release - Create proper temp directory structure instead of single temp file - Add isolated nuget.config for temp projects that prioritizes NuGet.org - Remove hardcoded MyGet source parameter in dotnet restore command - Ensures temporary projects can resolve Neo.SmartContract.Framework 3.8.1 from NuGet.org 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Erik Zhang <[email protected]> Co-authored-by: Claude <[email protected]> * Update packages (#1336) * Update packages * indent * Disable implicit usings for smart contract projects (#1334) * SafeAttribute supports in properties (#1330) * SafeAttribute supports in properties * Update Nep11Token.cs * Safe setters are not allowed * Disable implicit usings for smart contract projects - Add ImplicitUsings=disable to examples/Directory.Build.props and all smart contract templates for deterministic compilation --------- Co-authored-by: Erik Zhang <[email protected]> Co-authored-by: Shargon <[email protected]> * Implement automated optimization strategy pipeline (#1338) * Implement automated optimization strategy pipeline Replace hardcoded optimization sequence with attribute-driven reflection-based system that discovers and executes optimization strategies based on their StrategyAttribute priority values. Key improvements: - Automated strategy discovery using reflection and StrategyAttribute - Priority-based execution order (highest priority first) - Robust error handling with graceful degradation - Comprehensive test coverage for automated pipeline - Maintained backward compatibility with all existing functionality - Made StrategyAttribute public for reflection access This resolves the TODO comment in Optimizer.cs and provides a maintainable, extensible optimization system that automatically incorporates new optimization strategies as they are added with proper attributes. All existing compiler tests continue to pass, confirming compatibility. * Apply code formatting to automate-optimizer-strategies-clean implementation - Run dotnet format to ensure consistent code style - Clean up automated optimizer strategy implementation - Maintain proper formatting for reflection-based strategy discovery - Keep priority-based execution logic intact * Enhance error messages with better context and actionable guidance (#1335) * Add enhanced error message infrastructure and core updates - Add ErrorMessageBuilder helper class for context-aware error messages - Enhance CompilationException with factory methods for common scenarios - Update CompilationContext, Expression, and Helper with enhanced error patterns - Provide location information and actionable guidance for developers * Update expression files with enhanced error messages - BinaryExpression: improved operator guidance - LiteralExpression: better type context for defaults - IdentifierNameExpression: specific symbol guidance - InvocationExpression: clearer invocation patterns - MemberExpression: detailed member access help * Complete enhanced error message implementation - Update ObjectCreationExpression with specific initializer guidance - Enhance Statement.cs with statement type suggestions - Improve CallHelpers with parameter and identifier context - Provide comprehensive error messages across all major compiler components This completes the enhanced error message feature with actionable guidance and precise location information for better developer experience. * Update all remaining SyntaxNotSupported errors and apply formatting - Update SlotHelpers with out parameter guidance - Update SwitchStatement with label type guidance - Apply consistent CompilationException.UnsupportedSyntax pattern - Run dotnet format to ensure code style consistency This completes the comprehensive enhanced error message implementation across all 70+ occurrences in the codebase. * Update SDK requirement to use latestPatch rollForward policy This allows any .NET 9.0.x version (9.0.300 or higher) instead of requiring exactly 9.0.300, providing more flexibility for developers while maintaining compatibility with the minimum required features. * Revert SDK rollForward policy back to latestFeature Restore original global.json configuration as requested. * Verify code formatting with .NET 9.0.301 Ran 'dotnet format' with .NET 9.0.301 - no formatting changes needed. Code already follows proper formatting standards. Note: RS1039 analyzer warnings present but no associated code fixes available. * Fix compilation errors: revert ISymbol-based UnsupportedSyntax calls - Revert to regular CompilationException for ISymbol parameters - Keep CompilationException.UnsupportedSyntax only for SyntaxNodeOrToken - Maintain enhanced error messages where appropriate - Fix all CI build errors while preserving error message improvements * simplify the example structure (#1325) * simplify the example structure, to make it easier to build and run examples and uts. * update missing change * delete unnecessary file * Revert unnecessary syntax downgrades based on PR feedback - Reverted string concatenation back to string interpolation - Reverted explicit constructors back to target-typed new - Reverted inequality checks back to pattern matching - Removed manually created artifact file that should be auto-generated These changes address reviewer concerns about unnecessary conversions from modern C# syntax to older syntax patterns. * Fix automatic artifact generation system Updated Directory.Build.props to use local nccs compiler instead of expecting a global installation. This ensures all smart contract artifacts are generated automatically during build. Changes: - Modified ExecuteBeforeBuild target to use dotnet run with local nccs project - Updated GenerateSmartContractArtifacts target to use local nccs project - Regenerated artifacts for HelloWorld and Event examples to demonstrate working system All example projects now automatically generate: - .nef files (compiled bytecode) - .manifest.json files (contract metadata) - .artifacts.cs files (testing interfaces) This eliminates the need for manually created artifact files. --------- Co-authored-by: Will <[email protected]> Co-authored-by: Shargon <[email protected]> * Enhance security analyzer diagnostics with source code context (#1339) * Enhance security analyzer diagnostics with source code context Implement debugInfo integration in WriteInTryAnalyzer and ReEntrancyAnalyzer to provide enhanced diagnostic messages with source code locations instead of just instruction addresses. Features: - Parse debug information to map instruction addresses to source locations - Enhanced warning messages with file names, line numbers, and column positions - Graceful fallback to address-only messages when debug info is unavailable - Improved recommendations and context for security vulnerabilities - Comprehensive test coverage for enhanced diagnostic output This addresses TODO comments in the security analyzers and significantly improves the developer experience when analyzing smart contract security. * Apply code formatting and clean up enhance-security-diagnostics implementation - Run dotnet format to ensure consistent code style - Clean up security analyzer diagnostic enhancements - Maintain proper formatting for enhanced error messages - Keep source location mapping functionality intact * Fix logging in Optimizer: use Debug.WriteLine instead of Console.WriteLine * Fix duplicate test methods in UnitTest_OptimizerAutomation - Remove duplicate Test_StrategyAttributeDiscovery method - Update Test_StrategyDiscovery to use GetStrategyMethods() helper instead of reflection on private field - All optimizer automation tests now pass * Update tests/Neo.Compiler.CSharp.UnitTests/UnitTest_OptimizerAutomation.cs --------- Co-authored-by: Shargon <[email protected]> * [`Feature`] Increase/decrease (#1341) * Increase/Decrease * With amount * Fix: remove obsolete XUnitVerifier (#1342) * Add comprehensive guidance documentation for NEO smart contract development (#1346) This commit introduces a complete guidance directory with enterprise-grade documentation covering all aspects of NEO smart contract development. ### New Documentation Structure - **Contributing Guide**: Development workflow, branch strategy, and best practices - **Getting Started Guide**: Complete tutorial with local development setup and IDE configuration - **Security Implementation Guide**: Comprehensive security patterns including Oracle security, randomness, and DoS protection - **Performance Optimization Guide**: Advanced gas optimization, storage efficiency, and computational optimization techniques - **Debugging Guide**: Comprehensive debugging tools, techniques, and troubleshooting procedures - **Production Deployment Guide**: Complete deployment checklist with operational runbooks and monitoring setup ### Key Features ✅ **Zero content duplication** across documents ✅ **Standardized placeholder format** for easy customization ✅ **Visual navigation** with difficulty indicators ✅ **Comprehensive code examples** and practical patterns ✅ **Complete coverage** from beginner to advanced topics ### Documentation Quality - **Enterprise-grade standards** with consistent formatting - **Professional structure** with clear cross-references - **Comprehensive coverage** of all development phases - **Practical examples** with runnable code ### Benefits - Reduces onboarding time for new developers - Provides production-ready deployment procedures - Includes comprehensive security patterns and best practices - Offers advanced performance optimization techniques - Ensures consistent development practices across teams * Fix build errors and nullable reference warnings (#1349) * fix: resolve nullable reference type warnings in Neo.SmartContract.Framework This commit fixes all nullable reference type warnings (CS8618, CS8625, CS8604, CS8602, CS8600) in the Neo.SmartContract.Framework project to ensure clean builds with nullable reference types enabled. Changes include: - Added nullable annotations to method parameters accepting null values (GAS, NEO, Runtime) - Used null-forgiving operators for fields initialized at runtime (Native classes, token states) - Added pragma directives to suppress CS8618 for runtime-populated service classes - Fixed nullable parameter types in delegate signatures and PostTransfer methods - Used null-forgiving operators in storage access and Contract.Call invocations This resolves all nullable reference warnings in the Framework project, resulting in a clean build. * fix: remove non-existent OnNewSnapshot event from RpcStore The RpcStore was referencing IStore.OnNewSnapshotDelegate which doesn't exist in the IStore interface, causing compilation errors. This removes the undefined event and its invocation from the GetSnapshot method. This resolves build errors CS0426 and CS0066 in the Testing project. * Fix GitHub Actions failure by implementing IStore.OnNewSnapshot event in RpcStore - Add OnNewSnapshot event implementation to comply with IStore interface requirements - Event is properly invoked when GetSnapshot() is called - Resolves CS0535 compilation error in GitHub Actions CI/CD pipeline 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update NEO.cs * Update Contract.cs * Apply suggestions from code review * Update src/Neo.SmartContract.Framework/Nep17Token.cs * Update src/Neo.SmartContract.Framework/Nep11Token.cs --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Shargon <[email protected]> * Fix Neo.SmartContract.Template compilation issue in Release mode (#1359) * Fix Neo.SmartContract.Template compilation issue in Release mode (#1358) This fixes the compilation error when building smart contract templates in Release configuration. The issue was caused by an undefined DebugArgument property in non-Debug builds, which resulted in malformed arguments being passed to the nccs compiler. Changes: - Add explicit empty value for DebugArgument in non-Debug configurations - Add space before -d flag in Debug configuration for proper argument parsing - Add integration tests to verify templates compile in both Debug and Release modes Fixes #1358 * Fix code formatting in TemplateCompilationTests.cs * Remove integration tests that require nccs compiler in CI environment * Fix template debug argument spacing issue Remove leading space from DebugArgument property value to fix compilation issues when building templates in Debug configuration. The space is now properly handled in the Exec command line. Fixes the issue reported in PR review where templates fail to compile due to incorrect argument formatting. * Add comprehensive security documentation for Neo smart contracts (#1345) This commit introduces a complete security guide covering: - Security best practices and implementation patterns - Common vulnerabilities with prevention strategies - Access control and role-based authorization - Safe arithmetic operations and overflow protection - Secure storage patterns and data protection - Gas optimization security considerations - Runtime and randomness security patterns - Comprehensive security testing frameworks The documentation provides practical, production-ready code examples and follows Neo N3 specific patterns for secure smart contract development. Each guide focuses on specific security aspects while maintaining clear cross-references and a logical learning progression. Co-authored-by: Will <[email protected]> * docs: improve security documentation based on reviewer feedback (#1366) - Add witness check for new owner in TransferOwnership to prevent unauthorized transfers - Add UInt160.Zero check to prevent transfers to zero address - Update BigInteger documentation to clarify Neo VM's automatic 256-bit overflow protection - Clarify that explicit bounds checking is for business logic validation, not overflow prevention These improvements address security suggestions from PR #1345 review comments. * improve gas (#1369) * Implement ordered release workflow to resolve dependency issues (#1360) * Implement ordered release workflow to resolve dependency issues This implements a dependency-aware release process that ensures packages are released in the correct order to avoid "dependency not found" errors. Changes: - Add release-ordered.sh script that releases packages in dependency order - Add package availability checks with retry logic - Create new release.yml workflow for ordered releases - Update main workflow to use ordered publishing for CI packages - Handle special cases like Neo.SmartContract.Testing's Neo reference Release order: 1. Neo.SmartContract.Framework (no dependencies) 2. Neo.SmartContract.Analyzer (depends on Framework) 3. Neo.Disassembler.CSharp (external dependencies only) 4. Neo.SmartContract.Testing (depends on Disassembler) 5. Neo.Compiler.CSharp (depends on Framework and Testing) 6. Neo.SmartContract.Template (template package) This ensures all packages can be released successfully in a single workflow run. * Update existing workflow to use ordered release process Instead of creating new workflows, updated the existing main.yml to: - Use dependency-ordered package building in PublishPackage job - Use the ordered release script in Release job - Maintain all existing functionality while adding ordered release logic This ensures packages are built and published in the correct dependency order to avoid "dependency not found" errors during the release process. * fix: improve release script robustness for dependency order The release script now properly handles the package dependency ordering during the release process. This addresses the build order issues that were occurring when packages reference each other during release. * fix: handle RpcStore.cs compatibility during package release Fixes the compilation error "The type name 'OnNewSnapshotDelegate' does not exist in the type 'IStore'" that occurs when Neo.SmartContract.Testing switches from project reference to package reference during release. Also updates grep commands for macOS compatibility. Fixes #1360 --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: NGD Admin <[email protected]> * feat: add Makefile and Docker support for improved developer experience (#1365) - Add comprehensive Makefile with build, test, install, and compile commands - Support for Docker-based development workflow - Platform-specific build configurations (Windows, Linux, macOS) - Convenient commands for contract compilation and template creation - Additional utilities for formatting, linting, and dependency management - Docker multi-stage build for optimized container size - Documentation and help commands for easy onboarding This enhancement simplifies the development workflow and provides standardized commands for common tasks when working with the Neo C# compiler (nccs). Co-authored-by: Shargon <[email protected]> * Update neo submodule (#1370) * Update neo * Clean --------- Co-authored-by: Jimmy <[email protected]> * Update neo submodule dev (#1377) * chore: update neo submodule to latest master Update neo submodule reference to include latest changes from master branch * chore: update neo submodule to latest dev branch Update neo submodule from 9b9be473 to 257756e7 to include: - unit-tests: Use proper 'Assert' methods - Allow HF in syscalls - IComparable, Casting to UInt160 & UInt256 - Clean JsonSerializer - Fix RpcSendByHashOrIndexAsync comment * Fix/analyzer netstandard2 (#1373) * fix: update analyzer to target netstandard2.0 - Changed TargetFramework from net9.0 to netstandard2.0 in Neo.SmartContract.Analyzer - Removed dependency on Neo.SmartContract.Framework - Created local copy of NepStandard enum to avoid framework dependency - Removed unnecessary Xunit.Sdk reference from CollectionTypesUsageAnalyzer - Fixed ArgumentNullException usage - Restored test packages to test project This addresses RS1041 analyzer rule recommendation for better compatibility. Fixes #1371 * fix: remove PackAsTool for netstandard2.0 compatibility * fix: add final newline to pass format check * fix: improve analyzer packaging and remove duplicate property - Configure analyzer to be packaged in analyzers/dotnet/cs folder - Add IncludeBuildOutput=false for proper analyzer packaging - Remove duplicate IsPackable property in test project * fix: remove unnecessary tools reference from analyzer project - Remove unused 'tools\*.ps1' reference that doesn't exist - Keep the analyzer DLL packaging configuration which is required - Addresses review comment from @shargon about unused lines --------- Co-authored-by: Shargon <[email protected]> * Add automated nccs compiler build and release workflow (#1362) * feat(workflow): add nccs compiler build and release automation - Add automated build for nccs compiler across multiple platforms (Windows, Linux, macOS x64/ARM64) - Generate and upload platform-specific binaries to GitHub releases - Include SHA256 checksums for all release artifacts - Add workflow_dispatch trigger for manual testing - Implement robust error handling and logging for release uploads - Update deprecated GitHub Actions syntax to use GITHUB_OUTPUT This ensures users can download pre-built nccs binaries directly from releases without needing to build from source. * fix: correct nccs executable rename logic - Replace redundant mv commands with proper conditional checks - Check if source file exists before attempting rename - Properly handle Neo.Compiler.CSharp -> nccs renaming for all platforms --------- Co-authored-by: Shargon <[email protected]> * Remove repository restriction from release workflow (#1383) Remove the startsWith(github.repository, 'neo-project/') check from PublishPackage and Release jobs to enable testing and releases from forked repositories. This change improves the developer experience by allowing forks to test the full release workflow without needing to be under the neo-project organization. * Update GitHub workflow to use modern release action (#1382) - Replace deprecated actions/create-release@v1 with softprops/action-gh-release@v2 - Consolidate release creation and asset upload into single step - Add automatic release notes generation - Simplify workflow by removing complex JavaScript upload logic - Maintain all existing functionality and conditions Co-authored-by: Will <[email protected]> * feat: Add GuardHelpers utility class for smart contract validation (#1381) * feat: Add GuardHelpers utility class for smart contract validation Introduces a comprehensive validation helper library to standardize precondition and postcondition checks in Neo smart contracts. Features: - Basic validation: Require(), Ensure(), Revert() - Null checks: RequireNotNull() - Numeric validation: RequireNonNegative(), RequirePositive(), RequireInRange() - Address validation: RequireValidAddress(), RequireWitness() - Security checks: RequireCaller(), RequireEquals() - String validation: RequireNotEmpty() Benefits: - Reduces boilerplate validation code - Standardizes error messages with short codes for gas efficiency - Improves contract security and reliability - Makes smart contracts more readable and maintainable * feat: add GuardHelpers utility class for smart contract validation Introduces a new GuardHelpers static class that provides common validation patterns for Neo smart contracts with gas-efficient error codes. Features: - Require/Ensure methods for preconditions and postconditions - Common validation helpers (RequireNotNull, RequirePositive, etc.) - Address validation (RequireValidAddress, RequireWitness) - Range and equality checks (RequireInRange, RequireEquals) - Caller verification (RequireCaller) - String validation (RequireNotEmpty) All methods use short error codes to minimize GAS consumption while maintaining clear error identification. * test: add comprehensive unit tests for GuardHelpers Adds test contract and unit tests covering all GuardHelpers methods: - Basic validation tests (Require, Ensure, Revert) - Type validation tests (RequireNotNull, RequireNonNegative, RequirePositive) - Address validation tests (RequireValidAddress, RequireWitness) - Range and equality tests (RequireInRange, RequireEquals) - Caller verification tests (RequireCaller) - String validation tests (RequireNotEmpty) - Real-world Transfer scenario test All tests verify both success and failure cases with appropriate error messages. * style: fix formatting and remove duplicate generated file - Remove duplicate Contract_GuardHelpers_Inline.cs from TestingArtifacts - Fix minor formatting issues in source files - Ensure no file conflicts during build * fix: resolve GitHub Actions build failure for GuardHelpers tests - Remove duplicate and conflicting artifact files - Keep only the generated wrapper (Contract_GuardHelpers_Inline.cs) - Follow existing test artifact pattern used by other test contracts - Binary artifacts (.nef, .manifest.json, etc.) are generated during build * Revert "fix: resolve GitHub Actions build failure for GuardHelpers tests" This reverts commit 47b7336. * fix: resolve artifact naming conflict for GuardHelpers tests - Rename Contract_GuardHelpers_Inline.artifacts.cs to Contract_GuardHelpers_Inline.cs - Keep all test artifacts (.nef, .manifest.json, .nefdbgnfo) as required - This follows the consistent naming pattern and avoids build conflicts * Update tests/Neo.SmartContract.Framework.UnitTests/GuardHelpersTest.cs * Update src/Neo.SmartContract.Framework/Helpers/GuardHelpers.cs Co-authored-by: Will <[email protected]> * Update src/Neo.SmartContract.Framework/Helpers/GuardHelpers.cs Co-authored-by: Will <[email protected]> --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Will <[email protected]> * fix: Replace Exception throwing with Assert.False in GuardHelpers (#1384) * fix: Replace Exception throwing with ExecutionEngine.Assert in GuardHelpers This change ensures proper revert behavior in smart contracts by using ExecutionEngine.Assert instead of throwing exceptions. When ExecutionEngine.Assert is called with a false condition, it properly reverts the transaction instead of just throwing an exception that might not be handled correctly. Changes: - Updated all Require* methods to use ExecutionEngine.Assert - Updated Ensure method to use ExecutionEngine.Assert - Updated Revert method to use ExecutionEngine.Abort(errorCode) - Removed incorrect using statement for OpCode namespace This fix ensures that: - Validation failures in smart contracts properly revert the entire transaction - State consistency is maintained when guard conditions fail - Smart contracts behave correctly when using these helper methods * perf: Add aggressive inlining to all GuardHelpers methods This optimization adds the [MethodImpl(MethodImplOptions.AggressiveInlining)] attribute to all GuardHelpers methods to eliminate method call overhead in smart contracts. Changes: - Added System.Runtime.CompilerServices using statement - Added MethodImpl(AggressiveInlining) to all public methods Benefits: - Reduced GAS costs by eliminating method call overhead - Improved smart contract execution performance - Maintains same functionality with better runtime characteristics * Remove unused files (#1387) * Add neps to `NepStandard` enum (#1390) * Add neps * Clean * Implement Local Storage (#1388) * #4148 * change summary * Update submodule * Template * fix artifacts --------- Co-authored-by: Alvaro <[email protected]> * feat: add template generation command to NCCS (#1380) * feat: add template generation command to NCCS - Add 'new' subcommand to create smart contracts from templates - Implement TemplateManager with 5 built-in templates (Basic, NEP17, NEP11, Ownable, Oracle) - Support custom author, email, and description parameters - Add comprehensive unit tests for template generation - Add integration tests for the new command functionality - Validate project names and handle existing directories with --force option * fix: resolve nullable warnings in unit tests - Add null-forgiving operators to test class fields - Fixes CS8618 warnings for non-nullable fields * fix: use wildcard version for Neo.SmartContract.Framework in templates - Change framework version from hardcoded 3.8.1-* to * (wildcard) - This allows the template to work with any available version - Fixes compatibility issues in CI environments * test: skip integration tests in CI environment - Add CI detection to skip process-spawning tests in GitHub Actions - These tests require local environment setup that isn't available in CI - Tests will still run locally for developers * fix: properly skip integration tests in CI environment The previous approach using Assert.Inconclusive in TestInitialize was insufficient as MSTest still attempts to run the test methods, which then fail due to uninitialized fields. This fix adds CI checks to each individual test method to ensure they are properly skipped. Also added null check in TestCleanup to prevent potential issues when tests are skipped. * fix: correct Oracle template compilation issues - Removed non-existent IOracle interface inheritance - Fixed incorrect API usage for OracleResponseCode and event invocation - Updated GetLastResponse to properly handle ByteString return type - Fixed nullable reference warnings in Update method signature - Ensured template compiles successfully to NEF format * style: fix formatting issues in test file - Remove trailing whitespace - Ensure consistent formatting per .editorconfig rules * fix: hardcode net9.0 target framework in temporary project generation The CompilationEngine was using AppContext.TargetFrameworkName which could return net8.0 in CI environments, causing package compatibility errors. This change ensures temporary projects always target net9.0 to match the Neo.SmartContract.Framework requirements. * chore: exclude development tool directories from repository * fix: pass custom author and email parameters to template generation The HandleNew method was receiving the author and email parameters from command line arguments but not passing them to the template manager. This fix ensures custom author and email values are properly applied to generated contracts instead of using the default Environment.UserName. * fix: Oracle template should implement IOracle interface - Added IOracle interface implementation to Oracle contract template - Changed OnOracleResponse from static to instance method to properly implement the interface - Fixed test expectation for package version to match wildcard pattern - Added using statement for Neo.SmartContract.Framework.Interfaces * fix: use proper version pattern for Neo.SmartContract.Framework package Changed from wildcard Version="*" to Version="3.8.1-*" to match the expected versioning pattern and ensure compatibility with the current framework version. This allows using prerelease versions while maintaining version consistency. * test: fix string interpolation in test assertion Remove unnecessary string interpolation where literal string suffices * Apply suggestion from @Jim8y * Update src/Neo.Compiler.CSharp/TemplateManager.cs Co-authored-by: Shargon <[email protected]> * update neo * fix conflicts * Fix sensitive information exposure --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Alvaro <[email protected]> * Guard oracle callback against unauthorized callers (#1392) * Remove: several compiling warnins (#1396) * Optimize: use explicit foreach DesignationSyntax instead to avoid warning (#1397) Co-authored-by: Shargon <[email protected]> * Update WriteInTry artifacts for latest Neo (#1400) * Update WriteInTry artifact and ensure temp projects target net9 * Refresh WriteInTry artifacts and include local storage syscalls * Document supported C# syntax coverage (#1403) * Simplify system method control flow with DSL (#1401) * Update WriteInTry artifact and ensure temp projects target net9 * Refresh WriteInTry artifacts and include local storage syscalls * Add control flow DSL helpers for opcode emission * Support break/continue and do-while in opcode DSL * Adopt control flow DSL in numeric Parse/CreateChecked handlers * Replace raw jump opcodes with DSL wrappers * Wrap comparison jumps with DSL helpers * Use EmitIf for nullable guard logic * Refactor system method control flow to DSL helpers * Improve compiler new command handling and cover system call DSL --------- Co-authored-by: Shargon <[email protected]> * Guard base-name usage and polish analyzer output (#1405) * refactor: share numeric rotation emitters (#1407) * refactor: share numeric rotation emitters * docs: document rotation helper algorithms * refactor: centralize BigInteger range checks (#1406) Co-authored-by: Shargon <[email protected]> * Use enum-based SupportedStandards in test contract (#1411) * Support out parameters for static and instance fields (#1408) Co-authored-by: Shargon <[email protected]> * Unify numeric system call handlers (#1410) * Unify numeric system call handlers * Restore legacy numeric clamp/copySign behaviour * refactor: enforce numeric system call registration requirements --------- Co-authored-by: Alvaro <[email protected]> * refactor: improve compiler exception diagnostics (#1412) * Add analyzer enforcement for NEP interface compliance (#1413) * Add analyzer enforcement for NEP standard interfaces * Fix nullable guards in NEP standard codefix * Enhance string Split and Trim system call support (#1414) * Update submodule (#1417) * Document record handling and expand coverage (#1419) * Docs/Test: restructure C# syntax checklists and probes (#1420) * Docs/Test: restructure C# syntax checklists and probes * Docs: clarify checklist wording * Docs: reference official C# what's-new pages * Cleanup: drop python helper scripts * Update to net 10 (#1421) * Update to net 10 * LF * update actions * update neo-vm * fix * LF * remove globals * Remove NeoVM package * LF * fix ut * use spaces * Optimize syntax probe execution (#1422) * Optimize syntax probe execution * Update tests/Neo.Compiler.CSharp.UnitTests/SyntaxProbes/Helper.cs Co-authored-by: Shargon <[email protected]> * Fix * use lock --------- Co-authored-by: Shargon <[email protected]> * Fix forward-referenced contract dependencies (#1415) * Fix forward-referenced contract dependencies * Update src/Neo.Compiler.CSharp/CompilationEngine/CompilationEngine.cs --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: Alvaro <[email protected]> * Fix INITSLOT parameter count for generic methods (#1423) * Fix INITSLOT parameter count for generic methods * Add regression tests for InitSlot generic handling * Fix SupportedStandards analyzer enum parsing * Add StringBuilder runtime support and analyzer (#1425) * Add multi-dimensional array support (#1424) * Clarify LINQ usage guidance (#1428) * Clarify LINQ guidance and update analyzer * Clarify LINQ guidance and stabilize tests * Add C# 14 syntax feature support (#1429) * Add support for key C# 14 syntax * Limit CI workflows to 20 minute timeout * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: Shargon <[email protected]> * docs: add C# 14 support badge (#1432) --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Erik Zhang <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: NGD Admin <[email protected]> Co-authored-by: Alvaro <[email protected]>
Jim8y
pushed a commit
that referenced
this pull request
Nov 14, 2025
Jim8y
pushed a commit
that referenced
this pull request
Nov 14, 2025
Jim8y
pushed a commit
that referenced
this pull request
Nov 14, 2025
shargon
added a commit
that referenced
this pull request
Nov 14, 2025
* Update neo (#1333) * Fix build errors and nullable reference warnings (#1349) * fix: resolve nullable reference type warnings in Neo.SmartContract.Framework This commit fixes all nullable reference type warnings (CS8618, CS8625, CS8604, CS8602, CS8600) in the Neo.SmartContract.Framework project to ensure clean builds with nullable reference types enabled. Changes include: - Added nullable annotations to method parameters accepting null values (GAS, NEO, Runtime) - Used null-forgiving operators for fields initialized at runtime (Native classes, token states) - Added pragma directives to suppress CS8618 for runtime-populated service classes - Fixed nullable parameter types in delegate signatures and PostTransfer methods - Used null-forgiving operators in storage access and Contract.Call invocations This resolves all nullable reference warnings in the Framework project, resulting in a clean build. * fix: remove non-existent OnNewSnapshot event from RpcStore The RpcStore was referencing IStore.OnNewSnapshotDelegate which doesn't exist in the IStore interface, causing compilation errors. This removes the undefined event and its invocation from the GetSnapshot method. This resolves build errors CS0426 and CS0066 in the Testing project. * Fix GitHub Actions failure by implementing IStore.OnNewSnapshot event in RpcStore - Add OnNewSnapshot event implementation to comply with IStore interface requirements - Event is properly invoked when GetSnapshot() is called - Resolves CS0535 compilation error in GitHub Actions CI/CD pipeline 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update NEO.cs * Update Contract.cs * Apply suggestions from code review * Update src/Neo.SmartContract.Framework/Nep17Token.cs * Update src/Neo.SmartContract.Framework/Nep11Token.cs --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Shargon <[email protected]> * Update neo submodule dev (#1377) * chore: update neo submodule to latest master Update neo submodule reference to include latest changes from master branch * chore: update neo submodule to latest dev branch Update neo submodule from 9b9be473 to 257756e7 to include: - unit-tests: Use proper 'Assert' methods - Allow HF in syscalls - IComparable, Casting to UInt160 & UInt256 - Clean JsonSerializer - Fix RpcSendByHashOrIndexAsync comment * feat: Add GuardHelpers utility class for smart contract validation (#1381) * feat: Add GuardHelpers utility class for smart contract validation Introduces a comprehensive validation helper library to standardize precondition and postcondition checks in Neo smart contracts. Features: - Basic validation: Require(), Ensure(), Revert() - Null checks: RequireNotNull() - Numeric validation: RequireNonNegative(), RequirePositive(), RequireInRange() - Address validation: RequireValidAddress(), RequireWitness() - Security checks: RequireCaller(), RequireEquals() - String validation: RequireNotEmpty() Benefits: - Reduces boilerplate validation code - Standardizes error messages with short codes for gas efficiency - Improves contract security and reliability - Makes smart contracts more readable and maintainable * feat: add GuardHelpers utility class for smart contract validation Introduces a new GuardHelpers static class that provides common validation patterns for Neo smart contracts with gas-efficient error codes. Features: - Require/Ensure methods for preconditions and postconditions - Common validation helpers (RequireNotNull, RequirePositive, etc.) - Address validation (RequireValidAddress, RequireWitness) - Range and equality checks (RequireInRange, RequireEquals) - Caller verification (RequireCaller) - String validation (RequireNotEmpty) All methods use short error codes to minimize GAS consumption while maintaining clear error identification. * test: add comprehensive unit tests for GuardHelpers Adds test contract and unit tests covering all GuardHelpers methods: - Basic validation tests (Require, Ensure, Revert) - Type validation tests (RequireNotNull, RequireNonNegative, RequirePositive) - Address validation tests (RequireValidAddress, RequireWitness) - Range and equality tests (RequireInRange, RequireEquals) - Caller verification tests (RequireCaller) - String validation tests (RequireNotEmpty) - Real-world Transfer scenario test All tests verify both success and failure cases with appropriate error messages. * style: fix formatting and remove duplicate generated file - Remove duplicate Contract_GuardHelpers_Inline.cs from TestingArtifacts - Fix minor formatting issues in source files - Ensure no file conflicts during build * fix: resolve GitHub Actions build failure for GuardHelpers tests - Remove duplicate and conflicting artifact files - Keep only the generated wrapper (Contract_GuardHelpers_Inline.cs) - Follow existing test artifact pattern used by other test contracts - Binary artifacts (.nef, .manifest.json, etc.) are generated during build * Revert "fix: resolve GitHub Actions build failure for GuardHelpers tests" This reverts commit 47b7336. * fix: resolve artifact naming conflict for GuardHelpers tests - Rename Contract_GuardHelpers_Inline.artifacts.cs to Contract_GuardHelpers_Inline.cs - Keep all test artifacts (.nef, .manifest.json, .nefdbgnfo) as required - This follows the consistent naming pattern and avoids build conflicts * Update tests/Neo.SmartContract.Framework.UnitTests/GuardHelpersTest.cs * Update src/Neo.SmartContract.Framework/Helpers/GuardHelpers.cs Co-authored-by: Will <[email protected]> * Update src/Neo.SmartContract.Framework/Helpers/GuardHelpers.cs Co-authored-by: Will <[email protected]> --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Will <[email protected]> * Remove unused files (#1387) * Implement Local Storage (#1388) * #4148 * change summary * Update submodule * Template * fix artifacts --------- Co-authored-by: Alvaro <[email protected]> * feat: add template generation command to NCCS (#1380) * feat: add template generation command to NCCS - Add 'new' subcommand to create smart contracts from templates - Implement TemplateManager with 5 built-in templates (Basic, NEP17, NEP11, Ownable, Oracle) - Support custom author, email, and description parameters - Add comprehensive unit tests for template generation - Add integration tests for the new command functionality - Validate project names and handle existing directories with --force option * fix: resolve nullable warnings in unit tests - Add null-forgiving operators to test class fields - Fixes CS8618 warnings for non-nullable fields * fix: use wildcard version for Neo.SmartContract.Framework in templates - Change framework version from hardcoded 3.8.1-* to * (wildcard) - This allows the template to work with any available version - Fixes compatibility issues in CI environments * test: skip integration tests in CI environment - Add CI detection to skip process-spawning tests in GitHub Actions - These tests require local environment setup that isn't available in CI - Tests will still run locally for developers * fix: properly skip integration tests in CI environment The previous approach using Assert.Inconclusive in TestInitialize was insufficient as MSTest still attempts to run the test methods, which then fail due to uninitialized fields. This fix adds CI checks to each individual test method to ensure they are properly skipped. Also added null check in TestCleanup to prevent potential issues when tests are skipped. * fix: correct Oracle template compilation issues - Removed non-existent IOracle interface inheritance - Fixed incorrect API usage for OracleResponseCode and event invocation - Updated GetLastResponse to properly handle ByteString return type - Fixed nullable reference warnings in Update method signature - Ensured template compiles successfully to NEF format * style: fix formatting issues in test file - Remove trailing whitespace - Ensure consistent formatting per .editorconfig rules * fix: hardcode net9.0 target framework in temporary project generation The CompilationEngine was using AppContext.TargetFrameworkName which could return net8.0 in CI environments, causing package compatibility errors. This change ensures temporary projects always target net9.0 to match the Neo.SmartContract.Framework requirements. * chore: exclude development tool directories from repository * fix: pass custom author and email parameters to template generation The HandleNew method was receiving the author and email parameters from command line arguments but not passing them to the template manager. This fix ensures custom author and email values are properly applied to generated contracts instead of using the default Environment.UserName. * fix: Oracle template should implement IOracle interface - Added IOracle interface implementation to Oracle contract template - Changed OnOracleResponse from static to instance method to properly implement the interface - Fixed test expectation for package version to match wildcard pattern - Added using statement for Neo.SmartContract.Framework.Interfaces * fix: use proper version pattern for Neo.SmartContract.Framework package Changed from wildcard Version="*" to Version="3.8.1-*" to match the expected versioning pattern and ensure compatibility with the current framework version. This allows using prerelease versions while maintaining version consistency. * test: fix string interpolation in test assertion Remove unnecessary string interpolation where literal string suffices * Apply suggestion from @Jim8y * Update src/Neo.Compiler.CSharp/TemplateManager.cs Co-authored-by: Shargon <[email protected]> * update neo * fix conflicts * Fix sensitive information exposure --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Alvaro <[email protected]> * Guard oracle callback against unauthorized callers (#1392) * Remove: several compiling warnins (#1396) * Update WriteInTry artifacts for latest Neo (#1400) * Update WriteInTry artifact and ensure temp projects target net9 * Refresh WriteInTry artifacts and include local storage syscalls * Document supported C# syntax coverage (#1403) * Simplify system method control flow with DSL (#1401) * Update WriteInTry artifact and ensure temp projects target net9 * Refresh WriteInTry artifacts and include local storage syscalls * Add control flow DSL helpers for opcode emission * Support break/continue and do-while in opcode DSL * Adopt control flow DSL in numeric Parse/CreateChecked handlers * Replace raw jump opcodes with DSL wrappers * Wrap comparison jumps with DSL helpers * Use EmitIf for nullable guard logic * Refactor system method control flow to DSL helpers * Improve compiler new command handling and cover system call DSL --------- Co-authored-by: Shargon <[email protected]> * Guard base-name usage and polish analyzer output (#1405) * refactor: share numeric rotation emitters (#1407) * refactor: share numeric rotation emitters * docs: document rotation helper algorithms * refactor: centralize BigInteger range checks (#1406) Co-authored-by: Shargon <[email protected]> * Use enum-based SupportedStandards in test contract (#1411) * Support out parameters for static and instance fields (#1408) Co-authored-by: Shargon <[email protected]> * Unify numeric system call handlers (#1410) * Unify numeric system call handlers * Restore legacy numeric clamp/copySign behaviour * refactor: enforce numeric system call registration requirements --------- Co-authored-by: Alvaro <[email protected]> * refactor: improve compiler exception diagnostics (#1412) * Add analyzer enforcement for NEP interface compliance (#1413) * Add analyzer enforcement for NEP standard interfaces * Fix nullable guards in NEP standard codefix * Enhance string Split and Trim system call support (#1414) * Update submodule (#1417) * Document record handling and expand coverage (#1419) * Docs/Test: restructure C# syntax checklists and probes (#1420) * Docs/Test: restructure C# syntax checklists and probes * Docs: clarify checklist wording * Docs: reference official C# what's-new pages * Cleanup: drop python helper scripts * Update to net 10 (#1421) * Update to net 10 * LF * update actions * update neo-vm * fix * LF * remove globals * Remove NeoVM package * LF * fix ut * use spaces * Optimize syntax probe execution (#1422) * Optimize syntax probe execution * Update tests/Neo.Compiler.CSharp.UnitTests/SyntaxProbes/Helper.cs Co-authored-by: Shargon <[email protected]> * Fix * use lock --------- Co-authored-by: Shargon <[email protected]> * Fix forward-referenced contract dependencies (#1415) * Fix forward-referenced contract dependencies * Update src/Neo.Compiler.CSharp/CompilationEngine/CompilationEngine.cs --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: Alvaro <[email protected]> * Fix INITSLOT parameter count for generic methods (#1423) * Fix INITSLOT parameter count for generic methods * Add regression tests for InitSlot generic handling * Fix SupportedStandards analyzer enum parsing * Add StringBuilder runtime support and analyzer (#1425) * Add multi-dimensional array support (#1424) * Clarify LINQ usage guidance (#1428) * Clarify LINQ guidance and update analyzer * Clarify LINQ guidance and stabilize tests * Fix published nccs missing framework references * Support skipping restore/build during publish * Fix framework reference probing * Restore doc files to master version * Fix duplicate OnNewSnapshot event * Align compiler helper files with master * Align neo submodule with master * Align temp project build with compiler TFM * Add deployment toolkit and scaffolding * Revert "Add deployment toolkit and scaffolding" This reverts commit 79c852a. --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: Alvaro <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just a neo update