diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index f5d5643..c0fe9a4 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -34,6 +34,10 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -70,7 +74,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log(name + " contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -78,7 +82,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("alphabet contract updated") return true diff --git a/audit/audit_contract.go b/audit/audit_contract.go index c5e1be0..6a243d4 100644 --- a/audit/audit_contract.go +++ b/audit/audit_contract.go @@ -43,6 +43,10 @@ const ( ) func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -70,7 +74,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("audit contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -78,7 +82,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("audit contract updated") return true diff --git a/balance/balance_contract.go b/balance/balance_contract.go index b9bd6dd..82360fd 100644 --- a/balance/balance_contract.go +++ b/balance/balance_contract.go @@ -59,6 +59,10 @@ func init() { } func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -89,7 +93,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("balance contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -97,7 +101,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("balance contract updated") return true diff --git a/container/container_contract.go b/container/container_contract.go index f47a437..186252f 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -64,6 +64,10 @@ var ( ) func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -96,7 +100,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("container contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -104,7 +108,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("container contract updated") return true diff --git a/neofs/neofs_contract.go b/neofs/neofs_contract.go index 73e5998..9898a7f 100644 --- a/neofs/neofs_contract.go +++ b/neofs/neofs_contract.go @@ -78,6 +78,10 @@ var ( // _deploy sets up initial alphabet node keys. func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -126,7 +130,7 @@ func _deploy(data interface{}, isUpdate bool) { } // Migrate updates smart contract execution script and manifest. -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -134,7 +138,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("neofs contract updated") return true diff --git a/neofsid/neofsid_contract.go b/neofsid/neofsid_contract.go index 4fd3fea..b4de65a 100644 --- a/neofsid/neofsid_contract.go +++ b/neofsid/neofsid_contract.go @@ -25,6 +25,10 @@ const ( ) func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -55,7 +59,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("neofsid contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -63,7 +67,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("neofsid contract updated") return true diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index b2a3053..006fb53 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -60,6 +60,10 @@ var ( // _deploy function sets up initial list of inner ring public keys. func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -108,7 +112,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("netmap contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -116,7 +120,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("netmap contract updated") return true diff --git a/processing/processing_contract.go b/processing/processing_contract.go index 9d7b705..3bb856a 100644 --- a/processing/processing_contract.go +++ b/processing/processing_contract.go @@ -26,6 +26,10 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + arr := data.([]interop.Hash160) owner := arr[0] addrNeoFS := arr[1] @@ -46,7 +50,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("processing contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -54,7 +58,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("processing contract updated") return true diff --git a/proxy/proxy_contract.go b/proxy/proxy_contract.go index 953e009..ffc8a2b 100644 --- a/proxy/proxy_contract.go +++ b/proxy/proxy_contract.go @@ -24,6 +24,10 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) owner := args[0].(interop.Hash160) addrNetmap := args[1].(interop.Hash160) @@ -44,7 +48,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("proxy contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -52,7 +56,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("proxy contract updated") return true diff --git a/reputation/reputation_contract.go b/reputation/reputation_contract.go index 60d050c..479f8da 100644 --- a/reputation/reputation_contract.go +++ b/reputation/reputation_contract.go @@ -17,6 +17,10 @@ const ( ) func _deploy(data interface{}, isUpdate bool) { + if isUpdate { + return + } + args := data.([]interface{}) notaryDisabled := args[0].(bool) owner := args[1].(interop.Hash160) @@ -39,7 +43,7 @@ func _deploy(data interface{}, isUpdate bool) { runtime.Log("reputation contract initialized") } -func Migrate(script []byte, manifest []byte) bool { +func Migrate(script []byte, manifest []byte, data interface{}) bool { ctx := storage.GetReadOnlyContext() if !common.HasUpdateAccess(ctx) { @@ -47,7 +51,7 @@ func Migrate(script []byte, manifest []byte) bool { return false } - management.Update(script, manifest) + management.UpdateWithData(script, manifest, data) runtime.Log("reputation contract updated") return true