diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index 1afbddf..9a93512 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -21,8 +21,6 @@ const ( nameKey = "name" notaryDisabledKey = "notary" - - version = 1 ) // OnNEP17Payment is a callback for NEP-17 compatible native GAS and NEO @@ -270,5 +268,5 @@ func Name() string { // Version returns version of the contract. func Version() int { - return version + return common.Version } diff --git a/audit/audit_contract.go b/audit/audit_contract.go index fb02385..a3f459d 100644 --- a/audit/audit_contract.go +++ b/audit/audit_contract.go @@ -36,8 +36,6 @@ func (a auditHeader) ID() []byte { } const ( - version = 1 - netmapContractKey = "netmapScriptHash" notaryDisabledKey = "notary" @@ -212,7 +210,7 @@ loop: // Version returns version of the contract. func Version() int { - return version + return common.Version } // readNext reads length from first byte and then reads data (max 127 bytes). diff --git a/balance/balance_contract.go b/balance/balance_contract.go index 066e398..7213b4f 100644 --- a/balance/balance_contract.go +++ b/balance/balance_contract.go @@ -38,7 +38,6 @@ const ( symbol = "NEOFS" decimals = 12 circulation = "MainnetGAS" - version = 1 netmapContractKey = "netmapScriptHash" containerContractKey = "containerScriptHash" @@ -431,7 +430,7 @@ func Burn(from interop.Hash160, amount int, txDetails []byte) { // Version returns version of the contract. func Version() int { - return version + return common.Version } // getSupply gets the token totalSupply value from VM storage. diff --git a/common/version.go b/common/version.go new file mode 100644 index 0000000..f599460 --- /dev/null +++ b/common/version.go @@ -0,0 +1,9 @@ +package common + +const ( + major = 0 + minor = 10 + patch = 1 + + Version = major*1_000_000 + minor*1_000 + patch +) diff --git a/container/container_contract.go b/container/container_contract.go index 17c6734..69ac1f4 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -43,8 +43,6 @@ type ( ) const ( - version = 1 - neofsIDContractKey = "identityScriptHash" balanceContractKey = "balanceScriptHash" netmapContractKey = "netmapScriptHash" @@ -556,7 +554,7 @@ func StopContainerEstimation(epoch int) { // Version returns version of the contract. func Version() int { - return version + return common.Version } func addContainer(ctx storage.Context, id, owner []byte, container Container) { diff --git a/neofs/neofs_contract.go b/neofs/neofs_contract.go index abe5534..7141955 100644 --- a/neofs/neofs_contract.go +++ b/neofs/neofs_contract.go @@ -24,8 +24,6 @@ const ( candidateFeeConfigKey = "InnerRingCandidateFee" withdrawFeeConfigKey = "WithdrawFee" - version = 3 - alphabetKey = "alphabet" candidatesKey = "candidates" notaryDisabledKey = "notary" @@ -560,7 +558,7 @@ func InitConfig(args [][]byte) { // Version returns version of the contract. func Version() int { - return version + return common.Version } // getNodes returns deserialized slice of nodes from storage. diff --git a/neofsid/neofsid_contract.go b/neofsid/neofsid_contract.go index 1772941..eafa72c 100644 --- a/neofsid/neofsid_contract.go +++ b/neofsid/neofsid_contract.go @@ -18,8 +18,6 @@ type ( ) const ( - version = 1 - netmapContractKey = "netmapScriptHash" containerContractKey = "containerScriptHash" notaryDisabledKey = "notary" @@ -235,7 +233,7 @@ func Key(owner []byte) [][]byte { // Version returns version of the contract. func Version() int { - return version + return common.Version } func getUserInfo(ctx storage.Context, key interface{}) UserInfo { diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index d1c4f41..dce982d 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -32,8 +32,6 @@ type ( ) const ( - version = 1 - configuredKey = "initconfig" notaryDisabledKey = "notary" innerRingKey = "innerring" @@ -534,7 +532,7 @@ func ListConfig() []record { // Version returns version of the contract. func Version() int { - return version + return common.Version } func addToNetmap(ctx storage.Context, n storageNode) { diff --git a/processing/processing_contract.go b/processing/processing_contract.go index bdeafad..28c71ac 100644 --- a/processing/processing_contract.go +++ b/processing/processing_contract.go @@ -11,8 +11,6 @@ import ( ) const ( - version = 1 - neofsContractKey = "neofsScriptHash" multiaddrMethod = "alphabetAddress" @@ -79,5 +77,5 @@ func Verify() bool { // Version returns version of the contract. func Version() int { - return version + return common.Version } diff --git a/proxy/proxy_contract.go b/proxy/proxy_contract.go index 44ad859..961808a 100644 --- a/proxy/proxy_contract.go +++ b/proxy/proxy_contract.go @@ -12,8 +12,6 @@ import ( ) const ( - version = 1 - netmapContractKey = "netmapScriptHash" ) @@ -82,5 +80,5 @@ func Verify() bool { // Version returns version of the contract. func Version() int { - return version + return common.Version } diff --git a/reputation/reputation_contract.go b/reputation/reputation_contract.go index 7debcda..8b5375f 100644 --- a/reputation/reputation_contract.go +++ b/reputation/reputation_contract.go @@ -13,8 +13,6 @@ import ( const ( notaryDisabledKey = "notary" - - version = 1 ) func _deploy(data interface{}, isUpdate bool) { @@ -162,7 +160,7 @@ loop: // Version returns version of the contract. func Version() int { - return version + return common.Version } func storageID(epoch int, peerID []byte) []byte {