From b43c0d6f083e1e2bec84929ae82e02ab26c85bb4 Mon Sep 17 00:00:00 2001 From: Ryan Sauge Date: Tue, 12 Sep 2023 14:36:58 +0200 Subject: [PATCH] Add contract version with tests --- contracts/modules/wrapper/core/BaseModule.sol | 5 +++++ test/common/BaseModuleCommon.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/contracts/modules/wrapper/core/BaseModule.sol b/contracts/modules/wrapper/core/BaseModule.sol index bfbdeb82..8526294a 100644 --- a/contracts/modules/wrapper/core/BaseModule.sol +++ b/contracts/modules/wrapper/core/BaseModule.sol @@ -8,6 +8,11 @@ import "../../security/AuthorizationModule.sol"; import "../../../libraries/Errors.sol"; abstract contract BaseModule is AuthorizationModule { + /* + @notice + Get the current version of the smart contract + */ + string public constant VERSION = "2.3.1"; // to initialize inside the implementation constructor when deployed with a Proxy bool internal deployedWithProxy; /* Events */ diff --git a/test/common/BaseModuleCommon.js b/test/common/BaseModuleCommon.js index e3d1ef75..7979ef82 100644 --- a/test/common/BaseModuleCommon.js +++ b/test/common/BaseModuleCommon.js @@ -7,6 +7,10 @@ const { should } = require('chai').should() function BaseModuleCommon (owner, address1, address2, address3, proxyTest) { context('Token structure', function () { + it('testHasTheDefinedVersion', async function () { + // Act + Assert + (await this.cmtat.VERSION()).should.equal('2.3.1') + }) it('testHasTheDefinedTokenId', async function () { // Act + Assert (await this.cmtat.tokenId()).should.equal('CMTAT_ISIN')