Skip to content

Conversation

@shargon
Copy link
Member

@shargon shargon commented Nov 4, 2025

Description

Part of the N4 changes, this is focus in the treasury content, no more changes wanted like reward this contract.

  • Allow Nep17 payment.
  • Allow Nep11 payment.
  • Verified by the committee.

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • UT_NativeContract

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shargon shargon requested a review from erikzhang November 4, 2025 13:13
@erikzhang
Copy link
Member

What is the purpose of this native contract?

@shargon
Copy link
Member Author

shargon commented Nov 4, 2025

What is the purpose of this native contract?

2.4 Neo4 roadmap said:

GAS Treasury Allocation:
A portion of newly generated GAS is allocated to the Treasury.

So we will need a treasury contract, isn't it?

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

I think it looks like to be a good idea.

@erikzhang
Copy link
Member

OK, it's a good idea.

erikzhang
erikzhang previously approved these changes Nov 5, 2025
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Unit-tests are failing.

@shargon shargon added the Discussion Initial issue state - proposed but not yet accepted label Nov 5, 2025
/// <param name="tokenId">Nep11 token Id</param>
/// <param name="data">Optional data</param>
[ContractMethod(CpuFee = 1 << 15, RequiredCallFlags = CallFlags.States)]
private void OnNEP11Payment(ApplicationEngine engine, UInt160 from, BigInteger amount, byte[] tokenId, StackItem data) { }
Copy link
Contributor

Choose a reason for hiding this comment

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

1<<15 for an empty payment callback?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use just 1

Copy link
Member Author

Choose a reason for hiding this comment

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

@AnnaShaleva do you have a cost estimation of empty calls?

Copy link
Member

@AnnaShaleva AnnaShaleva Nov 7, 2025

Choose a reason for hiding this comment

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

Not yet, but we may include native method prices evaluation to nspcc-dev/neo-go#4043. @Turalchik is working on this issue right now.

For now I agree to use 1, later we may upgrade prices in a subsequent hardfork once benchmarks are done.

Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Discussion Initial issue state - proposed but not yet accepted Hardfork

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants