core: adjust native Notary withdraw call flags

It changes states and calls `transfer` method of GAS which emits `transfer`
notification, so it requires States | AllowCall | AllowNotify, i.e. the
widest permission.

See
https://github.com/nspcc-dev/neo-go/issues/1990#issuecomment-1014911528.
This commit is contained in:
Anna Shaleva 2022-01-19 11:33:33 +03:00
parent 0afe8826ba
commit cc60bca491
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ func newNotary() *Notary {
desc = newDescriptor("withdraw", smartcontract.BoolType,
manifest.NewParameter("from", smartcontract.Hash160Type),
manifest.NewParameter("to", smartcontract.Hash160Type))
md = newMethodAndPrice(n.withdraw, 1<<15, callflag.States)
md = newMethodAndPrice(n.withdraw, 1<<15, callflag.All)
n.AddMethod(md, desc)
desc = newDescriptor("balanceOf", smartcontract.IntegerType,

View file

@ -22,7 +22,7 @@ func LockDepositUntil(addr interop.Hash160, till int) bool {
// Withdraw represents `withdraw` method of Notary native contract.
func Withdraw(from, to interop.Hash160) bool {
return neogointernal.CallWithToken(Hash, "withdraw", int(contract.States),
return neogointernal.CallWithToken(Hash, "withdraw", int(contract.All),
from, to).(bool)
}