diff --git a/src/@types/NFT.ts b/src/@types/NFT.ts index 4ba47066..1e85c7b7 100644 --- a/src/@types/NFT.ts +++ b/src/@types/NFT.ts @@ -14,7 +14,7 @@ export interface MetadataAndTokenURI { export interface NftRoles { manager: boolean - deployERC20: boolean + deployDatatoken: boolean updateMetadata: boolean store: boolean } diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index 46794344..b9d74840 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -621,7 +621,7 @@ export class Datatoken extends SmartContract { const isNftOwner = nftAddress && (await this.nft.getNftOwner(nftAddress)) === address const nftPermissions = nftAddress && !isNftOwner && (await this.nft.getNftPermissions(nftAddress, address)) - const isDatatokenDeployer = nftPermissions?.deployERC20 + const isDatatokenDeployer = nftPermissions?.deployDatatoken if (!isPaymentManager && !isNftOwner && !isDatatokenDeployer) { throw new Error(`Caller is not Fee Manager, owner or erc20 Deployer`) } @@ -1129,7 +1129,7 @@ export class Datatoken extends SmartContract { return nftAddress } - /** Returns true if address has deployERC20 role + /** Returns true if address has deployDatatoken role * @param {String} dtAddress Datatoken adress * @param {String} dtAddress Datatoken adress * @return {Promise} diff --git a/src/contracts/tokens/NFT.ts b/src/contracts/tokens/NFT.ts index 6d49d400..9c3c6110 100644 --- a/src/contracts/tokens/NFT.ts +++ b/src/contracts/tokens/NFT.ts @@ -81,7 +81,7 @@ export class Nft extends SmartContract { symbol?: string, templateIndex?: number ): Promise { - if ((await this.getNftPermissions(nftAddress, address)).deployERC20 !== true) { + if ((await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true) { throw new Error(`Caller is not DatatokenDeployer`) } if (!templateIndex) templateIndex = 1 @@ -316,7 +316,7 @@ export class Nft extends SmartContract { if ( (await this.getNftPermissions(nftAddress, address)).manager !== true || (address === datatokenDeployer && - (await this.getNftPermissions(nftAddress, address)).deployERC20 !== true) + (await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true) ) { throw new Error(`Caller is not Manager nor DatatokenDeployer`) } diff --git a/test/unit/tokens/Datatoken.test.ts b/test/unit/tokens/Datatoken.test.ts index beab155e..3ad1719f 100644 --- a/test/unit/tokens/Datatoken.test.ts +++ b/test/unit/tokens/Datatoken.test.ts @@ -303,7 +303,7 @@ describe('Datatoken', () => { it('#setPaymentCollector - should set a new paymentCollector, if ERC 20 DEPLOYER', async () => { assert( (await nftDatatoken.getNftPermissions(nftAddress, datatokenDeployer)) - .deployERC20 === true + .deployDatatoken === true ) await datatoken.setPaymentCollector(datatokenAddress, datatokenDeployer, user3)