Skip to content

Commit

Permalink
Merge pull request #133 from neo-project/dev
Browse files Browse the repository at this point in the history
 Merge recent updates from dev to master
  • Loading branch information
Celia18305 authored Aug 14, 2024
2 parents 3e476a9 + d3e4d6e commit 75bdd16
Show file tree
Hide file tree
Showing 136 changed files with 934 additions and 818 deletions.
2 changes: 1 addition & 1 deletion docs/faq/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Since each new block is require to pass majority consensus, forks may not occur.

Neo consensus nodes are elected by NEO holders. The network itself is permissionless; anyone may register as a candidate or cast a vote for a candidate. Candidates with a sufficient share of the total number of votes are elected as Neo Council members. The top 7 of these 21 Council members are the network's consensus (validator) nodes.

For more information, visit the following [link](https://docs.neo.org/docs/en-us/basic/consensus/vote_validator.html).
For more information, visit the following [link](../n3/foundation/consensus/vote_validator.md).

## How do I check the status of my transaction?

Expand Down
6 changes: 3 additions & 3 deletions docs/n3/develop/deploy/invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can query a contract details using Neo-CLI or Neo-GUI, such as the contract

### Querying using Neo-CLI

Use the RPC API [getcontractstate method](../../reference/rpc/latest-version/api/getcontractstate.md) to query the contract information.
Use the RPC API [getcontractstate method](../../reference/rpc/getcontractstate.md) to query the contract information.

### Querying using Neo-GUI

Expand All @@ -31,7 +31,7 @@ You can choose one of the following ways to invoke the contract using Neo-CLI:

For more information refer to [invoke](../../node/cli/cli.md#invoke).

- Use the RPC API [invokefunction](../../reference/rpc/latest-version/api/invokefunction.md) or [invokescript](../../reference/rpc/latest-version/api/invokescript.md). The former is recommended.
- Use the RPC API [invokefunction](../../reference/rpc/invokefunction.md) or [invokescript](../../reference/rpc/invokescript.md). The former is recommended.

### Invoking a contract using Neo-GUI

Expand Down Expand Up @@ -108,7 +108,7 @@ The key statement is `Contract.Call(scriptHash, method, flags, params)`, where:

### Invocation permission

Three fields related to the contract invocation permission are defined in the contract manifest file, as shown in the following table. The wallet decides whether to give a security warning to the user based on the setting in the Groups and Trusts fields. Permissions and signature scopes determine whether contracts can be called by each other. For more information about signature scopes, refer to parameters description in [invokefunction method](../../reference/rpc/latest-version/api/invokefunction.md).
Three fields related to the contract invocation permission are defined in the contract manifest file, as shown in the following table. The wallet decides whether to give a security warning to the user based on the setting in the Groups and Trusts fields. Permissions and signature scopes determine whether contracts can be called by each other. For more information about signature scopes, refer to parameters description in [invokefunction method](../../reference/rpc/invokefunction.md).

| Fields | Type | Description |
| ------------- | ----------------------------- | ------------------------------------------------------------ |
Expand Down
16 changes: 8 additions & 8 deletions docs/n3/develop/write/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ namespace Helloworld
public class Contract1 : SmartContract
{
//TODO: Replace it with your own address.
[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)]
static readonly UInt160 Owner = default;
static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB";

private static bool IsOwner() => Runtime.CheckWitness(Owner);

Expand Down Expand Up @@ -69,8 +68,7 @@ Inside the contract class, the property defined with `static readonly` or `const

```cs
// Represents onwner of this contract, which is a fixed address. Usually should be the contract creator
[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)]
static readonly UInt160 Owner = default;
static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB";

// A constant number
private const ulong factor = 100000000;
Expand Down Expand Up @@ -196,8 +194,8 @@ You can declare more features:
[ContractSourceCode("https://github.com/neo-project/neo-devpack-dotnet/tree/master/examples/")]
[ContractVersion("0.0.1")]
[DisplayName("SampleNep17Token")]
[SupportedStandards("NEP-17")]
[ContractPermission("*", "onNEP17Payment")]
[SupportedStandards(NepStandard.Nep17)]
[ContractPermission(Permission.Any, "onNEP17Payment")]
[ContractTrust("0x0a0b00ff00ff00ff00ff00ff00ff00ff00ff00a4")]
[ManifestExtra("WebSite", "https://neo.org")]
public class Contract1 : SmartContract
Expand All @@ -210,7 +208,7 @@ public class Contract1 : SmartContract
```

- `DisplayName`: The name of the nef and manifest.json files generated by the compiler, and the DisplayName is also written to the name field of manifest.json.
- `SupportedStandards`: The NEP standards the contract conform to, such as NEP-17, a token standard on Neo.
- `SupportedStandards`: The NEP standards the contract conform to, such as `NepStandard.Nep17`, a token standard on Neo.
- `ContractPermission` : The permission requested by the contract, and `ContractTrust` indicates which contracts trust the contract to call itself. See [invocation-permission](../deploy/invoke.md#invocation-permission).
- `ContractAuthor`: The author field, which can be filled with the author's name and email address. It will output to the extra json object in manifest.json.
- `ContractEmail`: The email field. It will be output to the extra json object in manifest.json.
Expand All @@ -224,7 +222,9 @@ The generated manifest is as follows:
```json
{
"name": "SampleNep17Token",
"supportedstandards": [],
"supportedstandards": [
"NEP-17"
],
"abi": {
},
"permissions": [
Expand Down
7 changes: 3 additions & 4 deletions docs/n3/develop/write/difference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions docs/n3/develop/write/nep11.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ using System;

namespace Contract1
{
[SupportedStandards("NEP-11")]
[SupportedStandards(NepStandard.Nep11)]
public class Contract1 : Nep11Token<MyTokenState>
{
//TODO: Replace it with your own address.
[InitialValue("NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB", ContractParameterType.Hash160)]
static readonly UInt160 Owner = default;
static readonly UInt160 Owner = "NiNmXL8FjEUEs1nfX9uHFBNaenxDHJtmuB";

private static bool IsOwner() => Runtime.CheckWitness(Owner);

Expand Down Expand Up @@ -155,7 +154,7 @@ The base class `Nep11Token` also provides the following methods and events:

### 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)]` or `[SupportedStandards(NepStandard.Nep11)]` 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.

### NFT Royalty Standard
Expand Down
4 changes: 2 additions & 2 deletions docs/n3/develop/write/nep17.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }
Expand All @@ -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.

2 changes: 1 addition & 1 deletion docs/n3/exchange/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ There are two methods to generate deposit addresses:

- When the user deposit (NEO/GAS) for the first time, the program dynamically generates a NEO address. The advantage is that there is no need to generate addresses at fixed time intervals, while the disadvantage is that it's not convenient for backup.

To develop the program to dynamically generate addresses, use the RpcServer API [getnewaddress Method](../reference/rpc/latest-version/api/getnewaddress). The created address is returned.
To develop the program to dynamically generate addresses, use the RpcServer API [getnewaddress Method](../reference/rpc/getnewaddress). The created address is returned.

- The exchange creates a batch of NEO addresses in advance. When the user charges (NEO/GAS) for the first time, the exchange assigns a NEO address to him or her. The advantage is the convenience to backup the wallet, while the disadvantage is the need to generate NEO addresses manually.
To generate addresses in batch, run the NEO- CLI command `create address [n]`. The addresses are exported automatically to the address.txt file.
Expand Down
2 changes: 1 addition & 1 deletion docs/n3/exchange/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following RPC method can be used to help exchanges query users' GAS informat

| Method | Description |
| ------------------------------------------------------------ | ------------------------------------------------------- |
| [getunclaimedgas](../reference/rpc/latest-version/api/getunclaimedgas.md) | Returns the unclaimed GAS amount in the current wallet. |
| [getunclaimedgas](../reference/rpc/getunclaimedgas.md) | Returns the unclaimed GAS amount in the current wallet. |

## Claiming GAS

Expand Down
2 changes: 1 addition & 1 deletion docs/n3/foundation/Wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Example:

The full-node wallet is a complete backup of blockchain data, which saves all the onchain data and participates in p2p network, therefore it needs a large storage space.

Neo-CLI and Neo-GUI are all full-node wallet. For more information refer to [Neo node](../../node/introduction.md).
Neo-CLI and Neo-GUI are all full-node wallet. For more information refer to [Neo node](../node/introduction.md).

### SPV wallet

Expand Down
6 changes: 3 additions & 3 deletions docs/n3/node/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The following table lists all the plugins:

|Plugin|Description|API Included||
|--- |--- |--- |--- |
|ApplicationLogs|Synchronizes the smart contract log with the NativeContract log (Notify)|[getapplicationlog](../../reference/rpc/latest-version/api/getapplicationlog)|Recommended|
|ApplicationLogs|Synchronizes the smart contract log with the NativeContract log (Notify)|[getapplicationlog](../../reference/rpc/getapplicationlog)|Recommended|
|DBFTPlugin|dBFT consensus plugin||Mandatory when served as a consensus node|
|LevelDBStore|Uses LevelDB to store the blockchain data||Mandatory|
|MPTTrie|Uses LevelDB to store the MPT data||Mandatory when served as a StateRoot consensus node|
Expand All @@ -115,8 +115,8 @@ The following table lists all the plugins:
|RpcServer|Enables RPC for the node|[RPC API](../../reference/rpc/latest-version/api)|Mandatory|
|SQLiteWallet|A SQLite-based wallet provider that supports wallet files with .db3 suffix||Optional|
|StatesDumper|Exports Neo-CLI status data.||Optional|
|StateService|StateRoot consensus service plugin|[getstateroot](../../reference/rpc/latest-version/api/getstateroot) [getproof](../../reference/rpc/latest-version/api/getproof) [verifyproof](../../reference/rpc/latest-version/api/verifyproof.md) [getstateheight](../../reference/rpc/latest-version/api/getstateheight.md) |Mandatory when served as a StateRoot consensus node|
|TokensTracker|Enquiries NEP-11 and NEP-17 assets balance and transactions history of accounts through RPC|[getnep11balances](../../reference/rpc/latest-version/api/getnep11balances) [getnep11properties](../../reference/rpc/latest-version/api/getnep11properties) [getnep11transfers](../../reference/rpc/latest-version/api/getnep11transfers) [getnep17balances](../../reference/rpc/latest-version/api/getnep17balances) [getnep17transfers](../../reference/rpc/latest-version/api/getnep17transfers) |Recommended|
|StateService|StateRoot consensus service plugin|[getstateroot](../../reference/rpc/getstateroot) [getproof](../../reference/rpc/getproof) [verifyproof](../../reference/rpc/verifyproof.md) [getstateheight](../../reference/rpc/getstateheight.md) |Mandatory when served as a StateRoot consensus node|
|TokensTracker|Enquiries NEP-11 and NEP-17 assets balance and transactions history of accounts through RPC|[getnep11balances](../../reference/rpc/getnep11balances) [getnep11properties](../../reference/rpc/getnep11properties) [getnep11transfers](../../reference/rpc/getnep11transfers) [getnep17balances](../../reference/rpc/getnep17balances) [getnep17transfers](../../reference/rpc/getnep17transfers) |Recommended|

You can choose one of the following ways to install plugins:

Expand Down
Loading

0 comments on commit 75bdd16

Please sign in to comment.