mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
change erc721FactoryAddress to nftFactoryAddress
This commit is contained in:
parent
ea5dd11c93
commit
b371069d0f
@ -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
|
||||
|
@ -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,
|
||||
|
@ -56,7 +56,7 @@ export interface Addresses {
|
||||
sideStakingAddress: string
|
||||
fixedRateAddress: string
|
||||
dispenserAddress: string
|
||||
erc721FactoryAddress: string
|
||||
nftFactoryAddress: string
|
||||
daiAddress: string
|
||||
usdcAddress: string
|
||||
}
|
||||
@ -171,7 +171,7 @@ export const deployContracts = async (web3: Web3, owner: string): Promise<Addres
|
||||
))
|
||||
|
||||
// deploy ERC721 factory
|
||||
addresses.erc721FactoryAddress =
|
||||
addresses.nftFactoryAddress =
|
||||
configAddresses.ERC721Factory ||
|
||||
(await estimateGasAndDeployContract(
|
||||
web3,
|
||||
@ -215,7 +215,7 @@ export const deployContracts = async (web3: Web3, owner: string): Promise<Addres
|
||||
)
|
||||
|
||||
await RouterContract.methods
|
||||
.addFactory(addresses.erc721FactoryAddress)
|
||||
.addFactory(addresses.nftFactoryAddress)
|
||||
.send({ from: owner })
|
||||
await RouterContract.methods
|
||||
.addFixedRateContract(addresses.fixedRateAddress)
|
||||
|
@ -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 () => {
|
||||
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user