Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
superboyiii committed Dec 3, 2024
1 parent e422629 commit 9b27f65
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nep-22.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ All contracts SHOULD implement this NEP in case of any bug hotfix or improvement
}
</pre>

This method MUST callback <code>Update</code> method in native <code>ContractManagement</code> contract. It will update contract state if it's executed successfully.
This method MUST CALL <code>update</code> method in native <code>ContractManagement</code> contract. It will update contract state if it's executed successfully.

Updating a smart contract MUST have <code>nefFile</code> or <code>manifest.json</code>. How do they work is in reference of [NEP-15](https://github.com/neo-project/proposals/blob/master/nep-15.mediawiki) and [NEP-16](https://github.com/neo-project/proposals/blob/master/nep-16.mediawiki). Just updating one of them at a time is OK. This means no change on another, so another SHOULD be set as null. It MUST be passed to ContractManagement.Update() in this method.

The parameter <code>data</code> can be any type of supported parameters for contract-specific purpose. For [example](https://github.com/nspcc-dev/neofs-contract/blob/99fb86c35a48ed12017423aa4fee13f7d07fa4c0/contracts/proxy/contract.go#L33) some kinds of json parameters can be put into data for specific check.
The parameter <code>data</code> can be any type of supported parameters for contract-specific purpose. For [example](https://github.com/nspcc-dev/neofs-contract/blob/99fb86c35a48ed12017423aa4fee13f7d07fa4c0/contracts/proxy/contract.go#L33) some kinds of parameters can be put into data for specific check. Also some reference in [NEP-29](https://github.com/neo-project/proposals/blob/master/nep-29.mediawiki).

This method SHOULD do <code>Checkwitness</code> for contract <code>owner</code> to avoid security risks. This function SHOULD use the SYSCALL <code>Neo.Runtime.CheckWitness</code> to verify the <code>signer</code>. Details has been explained in [NEP-30](https://github.com/superboyiii/proposals/blob/upgrade-standard/nep-30.mediawiki).
This method SHOULD do <code>Checkwitness</code> for contract <code>owner</code> to avoid security risks. This function SHOULD use the SYSCALL <code>Neo.Runtime.CheckWitness</code> to verify the <code>signer</code>.

It's strongly recommended to execute all codes before calling ContractManagement.Update() to ensure they can be executed correctly.

Expand All @@ -64,8 +64,6 @@ https://github.com/neo-project/proposals/blob/master/nep-16.mediawiki

https://github.com/neo-project/proposals/blob/master/nep-29.mediawiki

https://github.com/neo-project/proposals/blob/master/nep-30.mediawiki

===Implementation===

* C#: https://github.com/neo-project/neo-devpack-dotnet/blob/003a50095efe88f63f518a0c989921be086409f3/examples/Example.SmartContract.NEP17/SampleNep17Token.cs#L130
Expand Down

0 comments on commit 9b27f65

Please sign in to comment.