mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
refactor pool and erc creation params
This commit is contained in:
parent
ae84833053
commit
0ecc973e08
@ -24,6 +24,7 @@ describe('Router unit test', () => {
|
|||||||
const RATE = '1'
|
const RATE = '1'
|
||||||
const FEE = '0.001'
|
const FEE = '0.001'
|
||||||
const FEE_ZERO = '0'
|
const FEE_ZERO = '0'
|
||||||
|
const DAI_AMOUNT = web3.utils.toWei('2')
|
||||||
|
|
||||||
const NFT_DATA: NftCreateData = {
|
const NFT_DATA: NftCreateData = {
|
||||||
name: NFT_NAME,
|
name: NFT_NAME,
|
||||||
@ -92,17 +93,9 @@ describe('Router unit test', () => {
|
|||||||
contracts.daiAddress
|
contracts.daiAddress
|
||||||
)
|
)
|
||||||
|
|
||||||
await daiContract.methods
|
await daiContract.methods.transfer(user1, DAI_AMOUNT).send({ from: factoryOwner })
|
||||||
.transfer(user1, web3.utils.toWei('2'))
|
|
||||||
.send({ from: factoryOwner })
|
|
||||||
|
|
||||||
await approve(
|
await approve(web3, user1, contracts.daiAddress, contracts.routerAddress, DAI_AMOUNT)
|
||||||
web3,
|
|
||||||
user1,
|
|
||||||
contracts.daiAddress,
|
|
||||||
contracts.routerAddress,
|
|
||||||
web3.utils.toWei('2')
|
|
||||||
)
|
|
||||||
|
|
||||||
// CREATE A FIRST POOL
|
// CREATE A FIRST POOL
|
||||||
const ercParams: Erc20CreateParams = {
|
const ercParams: Erc20CreateParams = {
|
||||||
@ -143,48 +136,13 @@ describe('Router unit test', () => {
|
|||||||
|
|
||||||
const erc20TokenAddress = txReceipt.events.TokenCreated.returnValues.newTokenAddress
|
const erc20TokenAddress = txReceipt.events.TokenCreated.returnValues.newTokenAddress
|
||||||
const pool1 = txReceipt.events.NewPool.returnValues.poolAddress
|
const pool1 = txReceipt.events.NewPool.returnValues.poolAddress
|
||||||
|
|
||||||
// CREATE A SECOND POOL
|
// CREATE A SECOND POOL
|
||||||
|
|
||||||
const nftData2: NftCreateData = {
|
|
||||||
name: '72120Bundle2',
|
|
||||||
symbol: '72Bundle2',
|
|
||||||
templateIndex: 1,
|
|
||||||
tokenURI: 'https://oceanprotocol.com/nft2/'
|
|
||||||
}
|
|
||||||
|
|
||||||
const ercParams2: Erc20CreateParams = {
|
|
||||||
templateIndex: 1,
|
|
||||||
minter: factoryOwner,
|
|
||||||
paymentCollector: user2,
|
|
||||||
mpFeeAddress: factoryOwner,
|
|
||||||
feeToken: ZERO_ADDRESS,
|
|
||||||
cap: '1000000',
|
|
||||||
feeAmount: FEE_ZERO,
|
|
||||||
name: 'ERC20B12',
|
|
||||||
symbol: 'ERC20DT1Symbol2'
|
|
||||||
}
|
|
||||||
|
|
||||||
const poolParams2: PoolCreationParams = {
|
|
||||||
ssContract: contracts.sideStakingAddress,
|
|
||||||
baseTokenAddress: contracts.daiAddress,
|
|
||||||
baseTokenSender: contracts.erc721FactoryAddress,
|
|
||||||
publisherAddress: factoryOwner,
|
|
||||||
marketFeeCollector: factoryOwner,
|
|
||||||
poolTemplateAddress: contracts.poolTemplateAddress,
|
|
||||||
rate: RATE,
|
|
||||||
baseTokenDecimals: 18,
|
|
||||||
vestingAmount: '10000',
|
|
||||||
vestedBlocks: 2500000,
|
|
||||||
initialBaseTokenLiquidity: '2000',
|
|
||||||
swapFeeLiquidityProvider: FEE,
|
|
||||||
swapFeeMarketRunner: FEE
|
|
||||||
}
|
|
||||||
|
|
||||||
const txReceipt2 = await nftFactory.createNftErc20WithPool(
|
const txReceipt2 = await nftFactory.createNftErc20WithPool(
|
||||||
factoryOwner,
|
factoryOwner,
|
||||||
nftData2,
|
NFT_DATA,
|
||||||
ercParams2,
|
ercParams,
|
||||||
poolParams2
|
poolParams
|
||||||
)
|
)
|
||||||
|
|
||||||
const erc20Token2Address = txReceipt2.events.TokenCreated.returnValues.newTokenAddress
|
const erc20Token2Address = txReceipt2.events.TokenCreated.returnValues.newTokenAddress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user