[#204] *: check contract version during update

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-12-27 11:49:30 +03:00 committed by Alex Vanin
parent 8226bd4e43
commit 74cc2d0aea
12 changed files with 29 additions and 2 deletions

View file

@ -19,9 +19,11 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
}
}
func _deploy(_ interface{}, isUpdate bool) {
ctx := storage.GetContext()
func _deploy(data interface{}, isUpdate bool) {
if isUpdate {
ctx := storage.GetContext()
args := data.([]interface{})
common.CheckVersion(args[len(args)-1].(int))
storage.Delete(ctx, common.LegacyOwnerKey)
return
}