Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
superboyiii committed Nov 28, 2024
1 parent 79c1d7d commit 6b86a9a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nep-X1.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ Neo N3 has the native <code>ContractManagement</code> contract that is responsib
{
"name": "destroy",
"safe": false,
"parameters": [],
"parameters": not restricted,
"returntype": "Void"
}
</pre>
This method MUST invoke the <code>destroy</code> method of <code>ContractManagement</code> contract when the contract is destroyed.

<code>destroy</code> method can have multi parameters for any specific purpose since it's an operation only for contract owner.

This function SHOULD check whether the <code>signer</code> address equals the <code>owner</code> hash of contract 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).
<code>destroy</code> method SHOULD do checkwitness 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 function is not allowed to call another contract when executing <code>destroy</code> method of native <code>ContractManagement</code> contract since <code>RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify</code>
It's strongly recommended to execute all codes before calling ContractManagement.Destroy() to ensure they can be executed correctly.

<code>destroy</code> method is not allowed to call another contract when executing the <code>destroy</code> method of native <code>ContractManagement</code> contract since <code>RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify</code>

===Events===

Expand Down

0 comments on commit 6b86a9a

Please sign in to comment.