fix(@desktop/communities): Fix minting crash when community name length is <3 chars

Fix #11906
This commit is contained in:
Michal Iskierko 2023-08-16 15:59:18 +02:00 committed by Michał Iskierko
parent 1c50ec17a8
commit a6d7ec2536

View File

@ -185,8 +185,9 @@ method deployOwnerToken*(self: Module, communityId: string, fromAddress: string,
self.tempChainId = chainId self.tempChainId = chainId
let communityDto = self.controller.getCommunityById(communityId) let communityDto = self.controller.getCommunityById(communityId)
let commName = communityDto.name let commName = communityDto.name
self.tempOwnerDeploymentParams = DeploymentParameters(name: "Owner-" & commName, symbol: "OWN" & commName[0 .. 2].toUpper, supply: stint.u256("1"), infiniteSupply: false, transferable: true, remoteSelfDestruct: false, tokenUri: utl.changeCommunityKeyCompression(communityId) & "/") let commNameShort = try: commName[0 .. 2].toUpper except: commName.toUpper
self.tempMasterDeploymentParams = DeploymentParameters(name: "TMaster-" & commName, symbol: "TM" & commName[0 .. 2].toUpper, infiniteSupply: true, transferable: false, remoteSelfDestruct: true, tokenUri: utl.changeCommunityKeyCompression(communityId) & "/") self.tempOwnerDeploymentParams = DeploymentParameters(name: "Owner-" & commName, symbol: "OWN" & commNameShort, supply: stint.u256("1"), infiniteSupply: false, transferable: true, remoteSelfDestruct: false, tokenUri: utl.changeCommunityKeyCompression(communityId) & "/")
self.tempMasterDeploymentParams = DeploymentParameters(name: "TMaster-" & commName, symbol: "TM" & commNameShort, infiniteSupply: true, transferable: false, remoteSelfDestruct: true, tokenUri: utl.changeCommunityKeyCompression(communityId) & "/")
self.tempOwnerTokenMetadata.description = ownerDescription self.tempOwnerTokenMetadata.description = ownerDescription
self.tempOwnerTokenMetadata.tokenType = TokenType.ERC721 self.tempOwnerTokenMetadata.tokenType = TokenType.ERC721
self.tempMasterTokenMetadata.description = masterDescription self.tempMasterTokenMetadata.description = masterDescription