-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from neo-project/dev
Merge recent updates from dev to master
- Loading branch information
Showing
136 changed files
with
934 additions
and
818 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
|
@@ -57,9 +57,9 @@ using System; | |
|
||
| | Neo Legacy | Neo N3 | | ||
| ----------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| Contract info | You need to fill in contract information such as the name, author, email, etc. when deploying the contract. | Add the contract features to the contract file, written as [C# Features](https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/concepts/attributes/), for example:<br/>[ManifestExtra("Author", "Neo")]<br/>[ManifestExtra("Email", "[email protected]")]<br/>[ContractTrust("\*")]<br/>[ContractPermission("\*", "\*")]<br/>[SupportedStandards("NEP-17")]<br/>[ManifestExtra("Description", "This is a contract example")]<br/>public class Contract1 : SmartContract | | ||
| Contract info | You need to fill in contract information such as the name, author, email, etc. when deploying the contract. | Add the contract features to the contract file, written as [C# Features](https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/concepts/attributes/), for example:<br/>[ContractAuthor("core-dev", "[email protected]")]<br/>[ContractEmail("[email protected]")]<br/>[ContractDescription("A sample NEP-17 token")]<br/>[ContractPermission(Permission.Any, Method.Any)]<br/>[ContractTrust(Permission.Any)]<br/>[SupportedStandards(NepStandard.Nep17)]<br/>public class Contract1 : SmartContract | | ||
| Contract function | When deploying a contract, you need to declare contract features such as whether to use storage, whether it can be called dynamically, and whether to accept NEP-5 assets. | All contracts can use the storage and dynamic calls by default. You can implement the OnNEP17Payment method to accept NEP-17 assets and implement the OnNEP11Payment method to accept NEP-11 (NFT standard) assets. | | ||
| Declare support for NEP | Code example:<br/>public static string[] SupportedStandards()<br/>{<br/> string[] result = { "NEP-5", "NEP-7", "NEP-10" };<br/> return result;<br/>} | Directly add the feature to the contract class name `[SupportedStandards("NEP-17")]` | | ||
| Declare support for NEP | Code example:<br/>public static string[] SupportedStandards()<br/>{<br/> string[] result = { "NEP-11", "NEP-17", "NEP-24" };<br/> return result;<br/>} | Directly add the feature to the contract class name `[SupportedStandards(NepStandard.Nep17)]` | | ||
|
||
### Declaration of static variables | ||
|
||
|
@@ -72,8 +72,7 @@ private static readonly byte[] InitialOwnerScriptHash = "AJhZmdHxW44FWMiMxD5bTiF | |
Neo N3 | ||
|
||
```cs | ||
[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)] | ||
static readonly UInt160 Owner = default; | ||
static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB"; | ||
``` | ||
|
||
### Methods and Events | ||
|
This file contains 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 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 |
---|---|---|
|
@@ -286,7 +286,7 @@ The name method is moved to the manifest file, and you need to add `[DisplayName | |
[ContractAuthor("core-dev", "[email protected]")] | ||
[ContractEmail("[email protected]")] | ||
[ContractDescription("This is a NEP17 example")] | ||
[SupportedStandards("NEP-17")] | ||
[SupportedStandards(NepStandard.Nep17)] | ||
public class NEP17 : Nep17Token | ||
{ | ||
public override string Symbol { [Safe] get => "EXAMPLE"; } | ||
|
@@ -309,6 +309,6 @@ The ability of the contract to receive assets has been changed from a fixed cons | |
|
||
### Compatibility check | ||
|
||
Compatibility checks will be activated for any contract that includes the `[SupportedStandards("NEP-17")]` or `[SupportedStandards("NEP-11")]` attribute. | ||
Compatibility checks will be activated for any contract that includes the `[SupportedStandards(NepStandard.Nep17)]`, `[SupportedStandards(NepStandard.Nep11)]` or `[SupportedStandards(NepStandard.Nep24)]` attribute. | ||
The Compatibility Check reviews method names, parameters, return values, events, and similar elements to ensure they comply with the standard, and alerts about any failures in the check. | ||
|
This file contains 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 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 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 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
Oops, something went wrong.