proposals icon indicating copy to clipboard operation
proposals copied to clipboard

Don't check the caller in NEP17

Open shargon opened this issue 3 years ago • 4 comments

This is not needed, and redundat because it's done during the syscall https://github.com/neo-project/neo/blob/736c346b9d8b1404f10023eeecb3a8e92ae0c542/src/neo/SmartContract/ApplicationEngine.Runtime.cs#L216

shargon avatar Jun 08 '22 14:06 shargon

Yep, https://github.com/neo-project/proposals/pull/126#discussion_r522309255

roman-khimov avatar Jun 08 '22 14:06 roman-khimov

Yep, https://github.com/neo-project/proposals/pull/126#discussion_r522309255

Maybe we can add just a note, this syscall will compare against the callingScriptHash first..?

shargon avatar Jun 08 '22 15:06 shargon

We need to explain what the contract is supposed to do and give the best practices for doing it in one step using CheckWitness.

erikzhang avatar Jun 10 '22 04:06 erikzhang

We need to explain what the contract is supposed to do and give the best practices for doing it in one step using CheckWitness.

We can add a note like this Take into account that <code>Neo.Runtime.CheckWitness</code> already will check whether the <code>from</code> address equals the caller contract hash.

shargon avatar Jun 10 '22 07:06 shargon