Skip to content

Conversation

@erikzhang
Copy link
Member

No description provided.

@github-actions github-actions bot added the N4 label Jan 4, 2026
@erikzhang
Copy link
Member Author

@superboyiii Can you fix the UTs? 🙏🙏🙏

@superboyiii
Copy link
Member

@superboyiii Can you fix the UTs? 🙏🙏🙏

Sure

@superboyiii
Copy link
Member

@erikzhang All done on erikzhang#3. Please review.

@erikzhang erikzhang marked this pull request as ready for review January 7, 2026 04:23
# Conflicts:
# tests/Neo.UnitTests/SmartContract/Native/UT_NativeContract.cs
@erikzhang
Copy link
Member Author

Need review again.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request moves NEO token functionality from a standalone native contract (NeoToken) into the Governance contract, managed through TokenManagement. This is a major architectural change that consolidates token management.

Changes:

  • Deleted NeoToken and FungibleToken classes, moving NEO token logic into the Governance contract
  • Removed AssetDescriptor class and NEO-specific extension methods
  • Updated all references from NativeContract.NEO to NativeContract.Governance for governance-related operations and NativeContract.TokenManagement for balance/transfer operations
  • Modified storage structure: NEO balances now stored in TokenManagement (prefix 12), while NEO-specific state (voting, gas distribution) stored in Governance (prefix 10)
  • Updated test files extensively to use reflection for accessing internal types and adapted to new storage patterns

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/Neo/SmartContract/Native/NeoToken.cs Deleted - NEO token logic moved to Governance
src/Neo/SmartContract/Native/FungibleToken.cs Deleted - base class no longer needed
src/Neo/SmartContract/Native/Governance.cs Major expansion - now handles NEO token, voting, rewards, and committee management
src/Neo/SmartContract/Native/NativeContract.cs Removed NEO property, updated committee checks
src/Neo/Wallets/AssetDescriptor.cs Deleted - asset descriptor functionality removed
src/Neo/Wallets/Wallet.cs Simplified to use TokenManagement.BalanceOf for all tokens
tests/Neo.UnitTests/SmartContract/Native/UT_NeoToken.cs Extensively refactored to use reflection for internal types
tests/Neo.UnitTests/Wallets/UT_Wallet.cs Updated storage setup for NEO/GAS balances

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[ContractMethod(CpuFee = 1 << 17, RequiredCallFlags = CallFlags.ReadStates)]
public BigInteger UnclaimedGas(ApplicationEngine engine, UInt160 account, uint end)
{
var expectEnd = Ledger.CurrentIndex(engine.SnapshotCache) + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use PersistingBlock?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But UnclaimedGas can be called in verify, and verify typically runs in an environment without a PersistingBlock.

@erikzhang erikzhang merged commit 0df0272 into neo-project:master Jan 23, 2026
7 checks passed
@erikzhang erikzhang deleted the move-neo branch January 23, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants