diff --git a/src/@types/DDO/DDO.ts b/src/@types/DDO/DDO.ts index 0a6d0e24..211813d6 100644 --- a/src/@types/DDO/DDO.ts +++ b/src/@types/DDO/DDO.ts @@ -13,7 +13,7 @@ export interface DDO { /** * DID, descentralized ID. - * Computed as sha256(address of ERC721 contract + chainId) + * Computed as sha256(address of NFT contract + chainId) * @type {string} */ id: string diff --git a/src/@types/Erc721.ts b/src/@types/NFT.ts similarity index 100% rename from src/@types/Erc721.ts rename to src/@types/NFT.ts diff --git a/src/@types/index.ts b/src/@types/index.ts index 7ff08ef4..5685baf7 100644 --- a/src/@types/index.ts +++ b/src/@types/index.ts @@ -8,9 +8,9 @@ export * from './Compute' export * from './Dispenser' export * from './DownloadResponse' export * from './Erc20' -export * from './Erc721' export * from './FileMetadata' export * from './FixedPrice' +export * from './NFT' export * from './NFTFactory' export * from './Pool' export * from './Provider' diff --git a/src/config/Config.ts b/src/config/Config.ts index d10aad7b..295ca9f1 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -42,13 +42,7 @@ export class Config { * Factory address * @type {string} */ - public erc721FactoryAddress?: string - - /** - * Factory ABI - * @type {string} - */ - public erc721FFactoryABI?: AbiItem | AbiItem[] + public nftFactoryAddress?: string /** * datatokens ABI diff --git a/src/config/ConfigHelper.ts b/src/config/ConfigHelper.ts index dfb96477..294797fb 100644 --- a/src/config/ConfigHelper.ts +++ b/src/config/ConfigHelper.ts @@ -161,7 +161,7 @@ export class ConfigHelper { startBlock } = customAddresses[network] configAddresses = { - erc721FactoryAddress: ERC721Factory, + nftFactoryAddress: ERC721Factory, sideStakingAddress: Staking, opfCommunityFeeCollector: OPFCommunityFeeCollector, poolTemplateAddress: poolTemplate, @@ -191,7 +191,7 @@ export class ConfigHelper { startBlock } = DefaultContractsAddresses[network] configAddresses = { - erc721FactoryAddress: ERC721Factory, + nftFactoryAddress: ERC721Factory, sideStakingAddress: Staking, opfCommunityFeeCollector: OPFCommunityFeeCollector, poolTemplateAddress: poolTemplate, diff --git a/src/contracts/factories/NFTFactory.ts b/src/contracts/factories/NFTFactory.ts index e2beb9a1..6ef6fbd7 100644 --- a/src/contracts/factories/NFTFactory.ts +++ b/src/contracts/factories/NFTFactory.ts @@ -208,7 +208,7 @@ export class NftFactory extends SmartContractWithAddress { } /** - * Add a new erc721 token template - only factory Owner + * Add a new NFT token template - only factory Owner * @param {String} address * @param {String} templateAddress template address to add * @return {Promise} @@ -367,7 +367,7 @@ export class NftFactory extends SmartContractWithAddress { } /** - * Add a new erc721 token template - only factory Owner + * Add a new NFT token template - only factory Owner * @param {String} address * @param {String} templateAddress template address to add * @return {Promise} diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index 3563ab1c..2ae3a5ac 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -192,7 +192,7 @@ export class Datatoken extends SmartContract { const withMint = fixedRateParams.withMint ? 1 : 0 - // should check ERC20Deployer role using erc721 level .. + // should check ERC20Deployer role using NFT level .. const estGas = await estimateGas( address, @@ -296,7 +296,7 @@ export class Datatoken extends SmartContract { if (!dispenserParams.withMint) dispenserParams.withMint = false - // should check ERC20Deployer role using erc721 level .. + // should check ERC20Deployer role using NFT level .. const estGas = await estimateGas( address, @@ -434,7 +434,7 @@ export class Datatoken extends SmartContract { ): Promise { const dtContract = contractInstance || this.getContract(dtAddress) - // should check ERC20Deployer role using erc721 level .. + // should check ERC20Deployer role using NFT level .. return estimateGas(address, dtContract.methods.removeMinter, minter) } diff --git a/src/contracts/tokens/NFT.ts b/src/contracts/tokens/NFT.ts index 800ba68c..eeeac04a 100644 --- a/src/contracts/tokens/NFT.ts +++ b/src/contracts/tokens/NFT.ts @@ -13,7 +13,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for createERC20 token creation - * @param {String} nftAddress ERC721 addreess + * @param {String} nftAddress NFT address * @param {String} address User address * @param {String} minter User set as initial minter for the ERC20 * @param {String} paymentCollector initial paymentCollector for this DT @@ -55,7 +55,7 @@ export class Nft extends SmartContract { /** * Create new ERC20 datatoken - only user with ERC20Deployer permission can succeed - * @param {String} nftAddress ERC721 addreess + * @param {String} nftAddress NFT address * @param {String} address User address * @param {String} minter User set as initial minter for the ERC20 * @param {String} paymentCollector initial paymentCollector for this DT @@ -130,7 +130,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for add manager call - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @param {String} manager User adress which is going to be assing manager * @param {Contract} nftContract optional contract instance @@ -149,7 +149,7 @@ export class Nft extends SmartContract { /** * Add Manager for NFT Contract (only NFT Owner can succeed) - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @param {String} manager User adress which is going to be assing manager * @return {Promise} trxReceipt @@ -175,7 +175,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for removeManager method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @param {String} manager User adress which is going to be removed as manager * @param {Contract} nftContract optional contract instance @@ -193,7 +193,7 @@ export class Nft extends SmartContract { /** * Removes a specific manager for NFT Contract (only NFT Owner can succeed) - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @param {String} manager User adress which is going to be removed as manager * @return {Promise} trxReceipt @@ -219,7 +219,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for addToCreateERC20List method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} erc20Deployer User adress which is going to have erc20Deployer permission * @param {Contract} nftContract optional contract instance @@ -237,7 +237,7 @@ export class Nft extends SmartContract { /** * Add ERC20Deployer permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} erc20Deployer User adress which is going to have erc20Deployer permission * @return {Promise} trxReceipt @@ -274,7 +274,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for removeFromCreateERC20List method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} erc20Deployer Address of the user to be revoked ERC20Deployer Permission * @param {Contract} nftContract optional contract instance @@ -297,7 +297,7 @@ export class Nft extends SmartContract { /** * Remove ERC20Deployer permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} erc20Deployer Address of the user to be revoked ERC20Deployer Permission * @return {Promise} trxReceipt @@ -336,7 +336,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for addToMetadataList method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} metadataUpdater User adress which is going to have Metadata Updater permission * @param {Contract} nftContract optional contract instance @@ -355,7 +355,7 @@ export class Nft extends SmartContract { /** * Add Metadata Updater permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} metadataUpdater User adress which is going to have Metadata Updater permission * @return {Promise} trxReceipt @@ -389,7 +389,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for removeFromMetadataList method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} metadataUpdater Address of the user to be revoked Metadata updater Permission * @param {Contract} nftContract optional contract instance @@ -412,7 +412,7 @@ export class Nft extends SmartContract { /** * Remove Metadata Updater permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} metadataUpdater Address of the user to be revoked Metadata updater Permission * @return {Promise} trxReceipt @@ -453,7 +453,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for addTo725StoreList method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} storeUpdater User adress which is going to have Store Updater permission * @param {Contract} nftContract optional contract instance @@ -472,7 +472,7 @@ export class Nft extends SmartContract { /** * Add Store Updater permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} storeUpdater User adress which is going to have Store Updater permission * @return {Promise} trxReceipt @@ -506,7 +506,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for removeFrom725StoreList method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} storeUpdater Address of the user to be revoked Store Updater Permission * @param {Contract} nftContract optional contract instance @@ -525,7 +525,7 @@ export class Nft extends SmartContract { /** * Remove Store Updater permission - only Manager can succeed - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Manager adress * @param {String} storeUpdater Address of the user to be revoked Store Updater Permission * @return {Promise} trxReceipt @@ -565,7 +565,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for cleanPermissions method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @param {Contract} nftContract optional contract instance * @return {Promise} @@ -581,11 +581,11 @@ export class Nft extends SmartContract { } /** - * This function allows to remove all ROLES at erc721 level: Managers, ERC20Deployer, MetadataUpdater, StoreUpdater + * This function allows to remove all ROLES at NFT level: Managers, ERC20Deployer, MetadataUpdater, StoreUpdater * Even NFT Owner has to readd himself as Manager * Permissions at erc20 level stay. * Only NFT Owner can call it. - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address NFT Owner adress * @return {Promise} trxReceipt */ @@ -614,7 +614,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for transfer NFT method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} nftOwner Current NFT Owner adress * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager * @param {Number} tokenId The id of the token to be transfered @@ -641,8 +641,8 @@ export class Nft extends SmartContract { /** * Transfers the NFT - * will clean all permissions both on erc721 and erc20 level. - * @param {String} nftAddress erc721 contract adress + * will clean all permissions both on NFT and erc20 level. + * @param {String} nftAddress NFT contract address * @param {String} nftOwner Current NFT Owner adress * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager * @param {Number} tokenId The id of the token to be transfered @@ -684,7 +684,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for safeTransfer NFT method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} nftOwner Current NFT Owner adress * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager * @param {Number} tokenId The id of the token to be transfered @@ -711,8 +711,8 @@ export class Nft extends SmartContract { /** * safeTransferNFT Used for transferring the NFT, can be used by an approved relayer - * will clean all permissions both on erc721 and erc20 level. - * @param {String} nftAddress erc721 contract adress + * will clean all permissions both on NFT and erc20 level. + * @param {String} nftAddress NFT contract address * @param {String} nftOwner Current NFT Owner adress * @param {String} nftReceiver User which will receive the NFT, will also be set as Manager * @param {Number} tokenId The id of the token to be transfered @@ -755,7 +755,7 @@ export class Nft extends SmartContract { // TODO: Finish this description /** * Estimate gas cost for setMetadata method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} metadataUpdater metadataUpdater address * @param {Number} metadataState User which will receive the NFT, will also be set as Manager * @param {String} metadataDecryptorUrl @@ -792,8 +792,8 @@ export class Nft extends SmartContract { /** * safeTransferNFT Used for transferring the NFT, can be used by an approved relayer - * will clean all permissions both on erc721 and erc20 level. - * @param {String} nftAddress erc721 contract adress + * will clean all permissions both on NFT and erc20 level. + * @param {String} nftAddress NFT contract address * @param {String} address Caller address NFT Owner adress * @return {Promise} trxReceipt */ @@ -845,7 +845,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for setMetadata method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} metadataUpdater metadataUpdater address * @param {MetaDataAndTokenURI} metadataAndTokenURI metaDataAndTokenURI object * @param {Contract} nftContract optional contract instance @@ -871,7 +871,7 @@ export class Nft extends SmartContract { /** * Helper function to improve UX sets both MetaData & TokenURI in one tx - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address Caller address * @param {MetadataAndTokenURI} metadataAndTokenURI metaDataAndTokenURI object * @return {Promise} trxReceipt @@ -907,7 +907,7 @@ export class Nft extends SmartContract { /** * Estimate gas cost for setMetadataState method - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} nftOwner Current NFT Owner adress * @param {Number} metadataState new metadata state * @param {Contract} nftContract optional contract instance @@ -930,7 +930,7 @@ export class Nft extends SmartContract { /** * setMetadataState Used for updating the metadata State - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address Caller address => metadata updater * @param {Number} metadataState new metadata state * @return {Promise} trxReceipt @@ -963,7 +963,7 @@ export class Nft extends SmartContract { } /** Estimate gas cost for setTokenURI method - * @param nftAddress erc721 contract adress + * @param nftAddress NFT contract address * @param address user adress * @param data input data for TokenURI * @return {Promise} transaction receipt @@ -979,7 +979,7 @@ export class Nft extends SmartContract { } /** set TokenURI on an nft - * @param nftAddress erc721 contract adress + * @param nftAddress NFT contract address * @param address user adress * @param data input data for TokenURI * @return {Promise} transaction receipt @@ -1001,7 +1001,7 @@ export class Nft extends SmartContract { } /** Get Owner - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @return {Promise} string */ public async getNftOwner(nftAddress: string): Promise { @@ -1011,7 +1011,7 @@ export class Nft extends SmartContract { } /** Get users NFT Permissions - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address user adress * @return {Promise} */ @@ -1022,7 +1022,7 @@ export class Nft extends SmartContract { } /** Get users Metadata, return Metadata details - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @return {Promise} */ public async getMetadata(nftAddress: string): Promise { @@ -1031,7 +1031,7 @@ export class Nft extends SmartContract { } /** Get users ERC20Deployer role - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} address user adress * @return {Promise} */ @@ -1042,7 +1042,7 @@ export class Nft extends SmartContract { } /** Gets data at a given `key` - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} key the key which value to retrieve * @return {Promise} The data stored at the key */ @@ -1053,7 +1053,7 @@ export class Nft extends SmartContract { } /** Gets data at a given `key` - * @param {String} nftAddress erc721 contract adress + * @param {String} nftAddress NFT contract address * @param {String} id * @return {Promise} The data stored at the key */ diff --git a/src/utils/DdoHelpers.ts b/src/utils/DdoHelpers.ts index 78bdbadd..bf2743ce 100644 --- a/src/utils/DdoHelpers.ts +++ b/src/utils/DdoHelpers.ts @@ -2,9 +2,9 @@ import sha256 from 'crypto-js/sha256' import Web3 from 'web3' import { LoggerInstance } from '.' -export function generateDid(erc721Address: string, chainId: number): string { - erc721Address = Web3.utils.toChecksumAddress(erc721Address) - const checksum = sha256(erc721Address + chainId.toString(10)) +export function generateDid(nftAddress: string, chainId: number): string { + nftAddress = Web3.utils.toChecksumAddress(nftAddress) + const checksum = sha256(nftAddress + chainId.toString(10)) return `did:op:${checksum.toString()}` } diff --git a/test/TestContractHandler.ts b/test/TestContractHandler.ts index 6c5d58af..dc3fae5d 100644 --- a/test/TestContractHandler.ts +++ b/test/TestContractHandler.ts @@ -50,13 +50,13 @@ export interface Addresses { opfCommunityFeeCollectorAddress: string poolTemplateAddress: string erc20TemplateAddress: string - erc721TemplateAddress: string + nftTemplateAddress: string oceanAddress: string routerAddress: string sideStakingAddress: string fixedRateAddress: string dispenserAddress: string - erc721FactoryAddress: string + nftFactoryAddress: string daiAddress: string usdcAddress: string } @@ -98,8 +98,8 @@ export const deployContracts = async (web3: Web3, owner: string): Promise { } const tx = await Factory.createNftWithErc20(publisherAccount, nftParams, erc20Params) - const erc721Address = tx.events.NFTCreated.returnValues[0] + const nftAddress = tx.events.NFTCreated.returnValues[0] const datatokenAddress = tx.events.TokenCreated.returnValues[0] // create the files encrypted string @@ -105,16 +105,16 @@ describe('Simple Publish & consume test', async () => { ddo.services[0].files = await providerResponse ddo.services[0].datatokenAddress = datatokenAddress // update ddo and set the right did - ddo.nftAddress = erc721Address + ddo.nftAddress = nftAddress const chain = await web3.eth.getChainId() ddo.id = - 'did:op:' + SHA256(web3.utils.toChecksumAddress(erc721Address) + chain.toString(10)) + 'did:op:' + SHA256(web3.utils.toChecksumAddress(nftAddress) + chain.toString(10)) providerResponse = await ProviderInstance.encrypt(ddo, providerUrl) const encryptedResponse = await providerResponse const metadataHash = getHash(JSON.stringify(ddo)) await nft.setMetadata( - erc721Address, + nftAddress, publisherAccount, 0, providerUrl, diff --git a/test/unit/factories/NftFactory.test.ts b/test/unit/factories/NftFactory.test.ts index bf62acbb..03110445 100644 --- a/test/unit/factories/NftFactory.test.ts +++ b/test/unit/factories/NftFactory.test.ts @@ -73,7 +73,7 @@ describe('Nft Factory test', () => { }) it('should initiate NFTFactory instance', async () => { - nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) }) it('#getOwner - should return actual owner', async () => { @@ -84,7 +84,7 @@ describe('Nft Factory test', () => { it('#getNFTTemplate - should return NFT template struct', async () => { const nftTemplate = await nftFactory.getNFTTemplate(1) assert(nftTemplate.isActive === true) - assert(nftTemplate.templateAddress === contracts.erc721TemplateAddress) + assert(nftTemplate.templateAddress === contracts.nftTemplateAddress) }) it('#getTokenTemplate - should return Token template struct', async () => { @@ -131,7 +131,7 @@ describe('Nft Factory test', () => { const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.daiAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: nftOwner, marketFeeCollector: nftOwner, poolTemplateAddress: contracts.poolTemplateAddress, @@ -156,7 +156,7 @@ describe('Nft Factory test', () => { web3, nftOwner, contracts.daiAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, poolParams.vestingAmount ) @@ -246,7 +246,7 @@ describe('Nft Factory test', () => { // user1 approves NFTFactory to move his DATA_TOKEN_AMOUNT await dtContract.methods - .approve(contracts.erc721FactoryAddress, DATA_TOKEN_AMOUNT) + .approve(contracts.nftFactoryAddress, DATA_TOKEN_AMOUNT) .send({ from: user1 }) // we reuse another DT created in a previous test @@ -257,7 +257,7 @@ describe('Nft Factory test', () => { await dtContract2.methods.mint(user1, DATA_TOKEN_AMOUNT).send({ from: nftOwner }) // user1 approves NFTFactory to move his DATA_TOKEN_AMOUNT await dtContract2.methods - .approve(contracts.erc721FactoryAddress, DATA_TOKEN_AMOUNT) + .approve(contracts.nftFactoryAddress, DATA_TOKEN_AMOUNT) .send({ from: user1 }) // we check user1 has enought DTs @@ -325,17 +325,17 @@ describe('Nft Factory test', () => { assert((await nftFactory.checkNFT(nftAddress)) === nftAddress) }) - it('#addNFTTemplate - should add a new erc721 token template', async () => { + it('#addNFTTemplate - should add a new NFT token template', async () => { const currentNFTTemplateCount = await nftFactory.getCurrentNFTTemplateCount() - await nftFactory.addNFTTemplate(factoryOwner, contracts.erc721TemplateAddress) + await nftFactory.addNFTTemplate(factoryOwner, contracts.nftTemplateAddress) expect( (await nftFactory.getCurrentNFTTemplateCount()) === currentNFTTemplateCount + 1 ) }) - it('#disableNFTTemplate - should disable an erc721 token template', async () => { + it('#disableNFTTemplate - should disable an NFT token template', async () => { const currentNFTTemplateCount = await nftFactory.getCurrentNFTTemplateCount() let nftTemplate = await nftFactory.getNFTTemplate(currentNFTTemplateCount) @@ -347,7 +347,7 @@ describe('Nft Factory test', () => { assert(nftTemplate.isActive === false) }) - it('#reactivateNFTTemplate - should reactivate an erc721 previously disabled token template', async () => { + it('#reactivateNFTTemplate - should reactivate an NFT previously disabled token template', async () => { const currentNFTTemplateCount = await nftFactory.getCurrentNFTTemplateCount() let nftTemplate = await nftFactory.getNFTTemplate(currentNFTTemplateCount) diff --git a/test/unit/pools/Router.test.ts b/test/unit/pools/Router.test.ts index 8a297a05..30501412 100644 --- a/test/unit/pools/Router.test.ts +++ b/test/unit/pools/Router.test.ts @@ -82,7 +82,7 @@ describe('Router unit test', () => { web3, factoryOwner, contracts.daiAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, web3.utils.toWei('10000') ) }) @@ -98,7 +98,7 @@ describe('Router unit test', () => { it('#getNFTFactory - should return NFT Factory address', async () => { const factory = await router.getNFTFactory() - assert(factory === contracts.erc721FactoryAddress) + assert(factory === contracts.nftFactoryAddress) }) it('#isOceanTokens - should return true if in oceanTokens list', async () => { @@ -138,7 +138,7 @@ describe('Router unit test', () => { const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.daiAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: factoryOwner, marketFeeCollector: factoryOwner, poolTemplateAddress: contracts.poolTemplateAddress, @@ -151,7 +151,7 @@ describe('Router unit test', () => { swapFeeMarketRunner: FEE } - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const txReceipt = await nftFactory.createNftErc20WithPool( factoryOwner, NFT_DATA, diff --git a/test/unit/pools/balancer/Pool.test.ts b/test/unit/pools/balancer/Pool.test.ts index c3bbe2f4..07e657b1 100644 --- a/test/unit/pools/balancer/Pool.test.ts +++ b/test/unit/pools/balancer/Pool.test.ts @@ -73,7 +73,7 @@ describe('Pool unit test', () => { web3, factoryOwner, contracts.daiAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, '2000' ) @@ -83,7 +83,7 @@ describe('Pool unit test', () => { web3, contracts.daiAddress, factoryOwner, - contracts.erc721FactoryAddress + contracts.nftFactoryAddress ) ) >= 2000 ) @@ -92,7 +92,7 @@ describe('Pool unit test', () => { web3, factoryOwner, contracts.usdcAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, '10000' ) @@ -102,7 +102,7 @@ describe('Pool unit test', () => { web3, contracts.usdcAddress, factoryOwner, - contracts.erc721FactoryAddress + contracts.nftFactoryAddress ) ) >= 10000 ) @@ -115,7 +115,7 @@ describe('Pool unit test', () => { const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.daiAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: factoryOwner, marketFeeCollector: factoryOwner, poolTemplateAddress: contracts.poolTemplateAddress, @@ -128,7 +128,7 @@ describe('Pool unit test', () => { swapFeeMarketRunner: '0.001' } - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3, 8996) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3, 8996) const txReceipt = await nftFactory.createNftErc20WithPool( factoryOwner, @@ -510,7 +510,7 @@ describe('Pool unit test', () => { const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.usdcAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: factoryOwner, marketFeeCollector: factoryOwner, poolTemplateAddress: contracts.poolTemplateAddress, @@ -523,7 +523,7 @@ describe('Pool unit test', () => { swapFeeMarketRunner: '0.001' } - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3, 8996) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3, 8996) const txReceipt = await nftFactory.createNftErc20WithPool( factoryOwner, diff --git a/test/unit/pools/dispenser/Dispenser.test.ts b/test/unit/pools/dispenser/Dispenser.test.ts index 173a3be4..10e132bb 100644 --- a/test/unit/pools/dispenser/Dispenser.test.ts +++ b/test/unit/pools/dispenser/Dispenser.test.ts @@ -64,7 +64,7 @@ describe('Dispenser flow', () => { }) it('#createNftwithErc - should create an NFT and a Datatoken ', async () => { - nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const txReceipt = await nftFactory.createNftWithErc20( factoryOwner, diff --git a/test/unit/pools/fixedRate/FixedRateExchange.test.ts b/test/unit/pools/fixedRate/FixedRateExchange.test.ts index cbaa4181..cf6d0aeb 100644 --- a/test/unit/pools/fixedRate/FixedRateExchange.test.ts +++ b/test/unit/pools/fixedRate/FixedRateExchange.test.ts @@ -71,7 +71,7 @@ describe('Fixed Rate unit test', () => { // CREATE AN Exchange // we prepare transaction parameters objects - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const freParams: FreCreationParams = { fixedRateAddress: contracts.fixedRateAddress, @@ -380,7 +380,7 @@ describe('Fixed Rate unit test', () => { // CREATE AN Exchange // we prepare transaction parameters objects - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const freParams: FreCreationParams = { fixedRateAddress: contracts.fixedRateAddress, diff --git a/test/unit/pools/ssContracts/SideStaking.test.ts b/test/unit/pools/ssContracts/SideStaking.test.ts index 687df98d..e39763e3 100644 --- a/test/unit/pools/ssContracts/SideStaking.test.ts +++ b/test/unit/pools/ssContracts/SideStaking.test.ts @@ -96,7 +96,7 @@ describe('SideStaking unit test', () => { web3, factoryOwner, contracts.daiAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, BASE_TOKEN_LIQUIDITY.toString() ) @@ -106,7 +106,7 @@ describe('SideStaking unit test', () => { web3, contracts.daiAddress, factoryOwner, - contracts.erc721FactoryAddress + contracts.nftFactoryAddress ) ) >= BASE_TOKEN_LIQUIDITY ) @@ -115,7 +115,7 @@ describe('SideStaking unit test', () => { web3, factoryOwner, contracts.usdcAddress, - contracts.erc721FactoryAddress, + contracts.nftFactoryAddress, BASE_TOKEN_LIQUIDITY.toString() ) @@ -125,7 +125,7 @@ describe('SideStaking unit test', () => { web3, contracts.usdcAddress, factoryOwner, - contracts.erc721FactoryAddress + contracts.nftFactoryAddress ) ) >= BASE_TOKEN_LIQUIDITY ) @@ -135,12 +135,12 @@ describe('SideStaking unit test', () => { it('#create a pool', async () => { // CREATE A POOL // we prepare transaction parameters objects - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.daiAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: factoryOwner, marketFeeCollector: factoryOwner, poolTemplateAddress: contracts.poolTemplateAddress, @@ -349,12 +349,12 @@ describe('SideStaking unit test', () => { it('#create a pool', async () => { // CREATE A POOL // we prepare transaction parameters objects - const nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3) + const nftFactory = new NftFactory(contracts.nftFactoryAddress, web3) const poolParams: PoolCreationParams = { ssContract: contracts.sideStakingAddress, baseTokenAddress: contracts.usdcAddress, - baseTokenSender: contracts.erc721FactoryAddress, + baseTokenSender: contracts.nftFactoryAddress, publisherAddress: factoryOwner, marketFeeCollector: factoryOwner, poolTemplateAddress: contracts.poolTemplateAddress, diff --git a/test/unit/tokens/Datatoken.test.ts b/test/unit/tokens/Datatoken.test.ts index 226b87da..bcfecfdd 100644 --- a/test/unit/tokens/Datatoken.test.ts +++ b/test/unit/tokens/Datatoken.test.ts @@ -65,7 +65,7 @@ describe('Datatoken', () => { }) it('should initialize NFTFactory instance and create a new NFT', async () => { - nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3, 8996) + nftFactory = new NftFactory(contracts.nftFactoryAddress, web3, 8996) nftAddress = await nftFactory.createNFT(nftOwner, nftData) nftDatatoken = new Nft(web3, 8996) @@ -541,9 +541,9 @@ describe('Datatoken', () => { ) }) - it('#getERC721Address - should succeed to get the parent ERC721 address', async () => { + it('#getNFTAddress - should succeed to get the parent NFT address', async () => { const address = await datatoken.getNFTAddress(datatokenAddress) - assert(address, 'Not able to get the parent ERC721 address') + assert(address, 'Not able to get the parent NFT address') }) it('#setData - should set a value into 725Y standard, if Caller has ERC20Deployer permission', async () => { diff --git a/test/unit/tokens/Nft.test.ts b/test/unit/tokens/Nft.test.ts index 4fd1b9ec..1040c46a 100644 --- a/test/unit/tokens/Nft.test.ts +++ b/test/unit/tokens/Nft.test.ts @@ -39,7 +39,7 @@ describe('NFT', () => { }) it('should initialize NFTFactory instance and create a new NFT', async () => { - nftFactory = new NftFactory(contracts.erc721FactoryAddress, web3, 8996) + nftFactory = new NftFactory(contracts.nftFactoryAddress, web3, 8996) nftAddress = await nftFactory.createNFT(nftOwner, nftData) nftDatatoken = new Nft(web3, 8996)