-
Notifications
You must be signed in to change notification settings - Fork 105
[Framework Add] implement payable #990
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
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cb0e876
implement payable
Jim8y 729414c
Merge branch 'master' into implement-NEP-payable
Jim8y a83423a
Merge branch 'master' into implement-NEP-payable
vncoelho 5534919
Merge branch 'master' into implement-NEP-payable
Jim8y a1a950a
adopt NEP25 and NEP26
Jim8y 8795eeb
Apply suggestions from code review
shargon c8273ea
Merge branch 'master' into implement-NEP-payable
shargon f37b86d
Fix nep11
shargon 8670f71
Remove safe check
shargon 9148455
fix onnep11payable
Jim8y 8767b34
Merge branch 'master' into implement-NEP-payable
vncoelho 213e3b1
Merge branch 'master' into implement-NEP-payable
shargon 049ba8a
Merge branch 'master' into implement-NEP-payable
Jim8y bcf35f0
use NEP 26 and NEP 27
Jim8y b96f968
Merge branch 'master' into implement-NEP-payable
Jim8y 027d399
Merge branch 'master' into implement-NEP-payable
Jim8y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
20 changes: 20 additions & 0 deletions
20
tests/Neo.SmartContract.Framework.TestContracts/Contract_SupportedStandard11Payable.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using Neo.SmartContract.Framework.Attributes; | ||
| using System.ComponentModel; | ||
| using System.Numerics; | ||
| using Neo.SmartContract.Framework.Interfaces; | ||
|
|
||
| namespace Neo.SmartContract.Framework.TestContracts | ||
| { | ||
| [DisplayName(nameof(Contract_SupportedStandard11Payable))] | ||
| [ContractDescription("<Description Here>")] | ||
| [ContractAuthor("<Your Name Or Company Here>", "<Your Public Email Here>")] | ||
| [ContractVersion("<Version String Here>")] | ||
| [ContractPermission(Permission.Any, Method.Any)] | ||
| [SupportedStandards(NepStandard.Nep11Payable)] | ||
| public class Contract_SupportedStandard11Payable : SmartContract, INep11Payable | ||
| { | ||
| public void OnNEP11Payment(UInt160 from, BigInteger amount, string tokenId, object? data = null) | ||
| { | ||
| } | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
tests/Neo.SmartContract.Framework.TestContracts/Contract_SupportedStandard17Payable.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using Neo.SmartContract.Framework.Attributes; | ||
| using System.ComponentModel; | ||
| using System.Numerics; | ||
| using Neo.SmartContract.Framework.Interfaces; | ||
|
|
||
| namespace Neo.SmartContract.Framework.TestContracts | ||
| { | ||
| [DisplayName(nameof(Contract_SupportedStandard17Payable))] | ||
| [ContractDescription("<Description Here>")] | ||
| [ContractAuthor("<Your Name Or Company Here>", "<Your Public Email Here>")] | ||
| [ContractVersion("<Version String Here>")] | ||
| [ContractPermission(Permission.Any, Method.Any)] | ||
| [SupportedStandards(NepStandard.Nep17Payable)] | ||
| public class Contract_SupportedStandard17Payable : SmartContract, INep17Payable | ||
| { | ||
| public void OnNEP17Payment(UInt160 from, BigInteger amount, object? data = null) | ||
| { | ||
| } | ||
| } | ||
| } |
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
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
34 changes: 34 additions & 0 deletions
34
...SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Payable.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| using Neo.Cryptography.ECC; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Numerics; | ||
|
|
||
| namespace Neo.SmartContract.Testing; | ||
|
|
||
| public abstract class Contract_SupportedStandard11Payable : Neo.SmartContract.Testing.SmartContract | ||
| { | ||
| #region Compiled data | ||
|
|
||
| public static readonly Neo.SmartContract.Manifest.ContractManifest Manifest = Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard11Payable"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-25""],""abi"":{""methods"":[{""name"":""onNEP11Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":15,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Description"":""\u003CDescription Here\u003E"",""Author"":""\u003CYour Name Or Company Here\u003E"",""Version"":""\u003CVersion String Here\u003E""}}"); | ||
|
|
||
| public static readonly Neo.SmartContract.NefFile Nef = Neo.IO.Helper.AsSerializable<Neo.SmartContract.NefFile>(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVXAAVAVwABeDQDQFcAAUDCSjTzIu1tevRy")); | ||
|
|
||
| #endregion | ||
|
|
||
| #region Unsafe methods | ||
|
|
||
| /// <summary> | ||
| /// Unsafe method | ||
| /// </summary> | ||
| [DisplayName("onNEP11Payment")] | ||
| public abstract void OnNEP11Payment(UInt160? from, BigInteger? amount, string? tokenId, object? data = null); | ||
|
|
||
| #endregion | ||
|
|
||
| #region Constructor for internal use only | ||
|
|
||
| protected Contract_SupportedStandard11Payable(Neo.SmartContract.Testing.SmartContractInitialize initialize) : base(initialize) { } | ||
|
|
||
| #endregion | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.