mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fixes (#1273)
* fixes * fix test * fix swap * fix test * fix test * more fixes * fixes * change swapMarketFee from wei to decimal * fix
This commit is contained in:
parent
5152bc2164
commit
3c315eb49d
@ -6,7 +6,7 @@ export interface FreCreationParams {
|
|||||||
baseTokenDecimals: number
|
baseTokenDecimals: number
|
||||||
datatokenDecimals: number
|
datatokenDecimals: number
|
||||||
fixedRate: string
|
fixedRate: string
|
||||||
marketFee: number
|
marketFee: string
|
||||||
withMint?: boolean // add FixedPriced contract as minter if withMint == true
|
withMint?: boolean // add FixedPriced contract as minter if withMint == true
|
||||||
allowedConsumer?: string // only account that consume the exhchange
|
allowedConsumer?: string // only account that consume the exhchange
|
||||||
}
|
}
|
||||||
@ -18,3 +18,10 @@ export interface FreOrderParams {
|
|||||||
swapMarketFee: string
|
swapMarketFee: string
|
||||||
marketFeeAddress: string
|
marketFeeAddress: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PriceAndFees {
|
||||||
|
baseTokenAmount: string
|
||||||
|
baseTokenAmountBeforeFee: string
|
||||||
|
oceanFeeAmount: string
|
||||||
|
marketFeeAmount: string
|
||||||
|
}
|
||||||
|
@ -10,8 +10,8 @@ export interface PoolCreationParams {
|
|||||||
vestingAmount: string
|
vestingAmount: string
|
||||||
vestedBlocks: number
|
vestedBlocks: number
|
||||||
initialBaseTokenLiquidity: string
|
initialBaseTokenLiquidity: string
|
||||||
swapFeeLiquidityProvider: number
|
swapFeeLiquidityProvider: string
|
||||||
swapFeeMarketRunner: number
|
swapFeeMarketRunner: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CurrentFees {
|
export interface CurrentFees {
|
||||||
|
@ -12,6 +12,7 @@ import {
|
|||||||
setContractDefaults
|
setContractDefaults
|
||||||
} from '../../utils'
|
} from '../../utils'
|
||||||
import { Config } from '../../models/index.js'
|
import { Config } from '../../models/index.js'
|
||||||
|
import { PriceAndFees } from '../..'
|
||||||
|
|
||||||
export interface FixedPriceExchange {
|
export interface FixedPriceExchange {
|
||||||
active: boolean
|
active: boolean
|
||||||
@ -554,15 +555,15 @@ export class FixedRateExchange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getBTNeeded - returns amount in baseToken that user will pay for datatokenAmount
|
* calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens
|
||||||
* @param {String} exchangeId ExchangeId
|
* @param {String} exchangeId ExchangeId
|
||||||
* @param {Number} datatokenAmount Amount of datatokens user wants to buy
|
* @param {string} datatokenAmount Amount of datatokens user wants to buy
|
||||||
* @return {Promise<string>} Amount of baseToken needed for buying
|
* @return {Promise<PriceAndFees>} how many base tokens are needed and fees
|
||||||
*/
|
*/
|
||||||
public async getAmountBTIn(
|
public async calcBaseInGivenOutDT(
|
||||||
exchangeId: string,
|
exchangeId: string,
|
||||||
datatokenAmount: string
|
datatokenAmount: string
|
||||||
): Promise<string> {
|
): Promise<PriceAndFees> {
|
||||||
const result = await this.contract.methods
|
const result = await this.contract.methods
|
||||||
.calcBaseInGivenOutDT(
|
.calcBaseInGivenOutDT(
|
||||||
exchangeId,
|
exchangeId,
|
||||||
@ -575,12 +576,33 @@ export class FixedRateExchange {
|
|||||||
)
|
)
|
||||||
.call()
|
.call()
|
||||||
|
|
||||||
return await this.unitsToAmount(
|
const priceAndFees = {
|
||||||
|
baseTokenAmount: await this.unitsToAmount(
|
||||||
(
|
(
|
||||||
await this.getExchange(exchangeId)
|
await this.getExchange(exchangeId)
|
||||||
).baseToken,
|
).baseToken,
|
||||||
result.baseTokenAmount
|
result.baseTokenAmount
|
||||||
|
),
|
||||||
|
baseTokenAmountBeforeFee: await this.unitsToAmount(
|
||||||
|
(
|
||||||
|
await this.getExchange(exchangeId)
|
||||||
|
).baseToken,
|
||||||
|
result.baseTokenAmountBeforeFee
|
||||||
|
),
|
||||||
|
marketFeeAmount: await this.unitsToAmount(
|
||||||
|
(
|
||||||
|
await this.getExchange(exchangeId)
|
||||||
|
).baseToken,
|
||||||
|
result.marketFeeAmount
|
||||||
|
),
|
||||||
|
oceanFeeAmount: await this.unitsToAmount(
|
||||||
|
(
|
||||||
|
await this.getExchange(exchangeId)
|
||||||
|
).baseToken,
|
||||||
|
result.oceanFeeAmount
|
||||||
)
|
)
|
||||||
|
} as PriceAndFees
|
||||||
|
return priceAndFees
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,8 @@ import {
|
|||||||
LoggerInstance,
|
LoggerInstance,
|
||||||
getFairGasPrice,
|
getFairGasPrice,
|
||||||
setContractDefaults,
|
setContractDefaults,
|
||||||
configHelperNetworks
|
configHelperNetworks,
|
||||||
|
getFreOrderParams
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
import { FreOrderParams, FreCreationParams, ProviderFees } from '../@types'
|
import { FreOrderParams, FreCreationParams, ProviderFees } from '../@types'
|
||||||
import { Nft } from './NFT'
|
import { Nft } from './NFT'
|
||||||
@ -1033,16 +1034,18 @@ export class Datatoken {
|
|||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const dtContract = new this.web3.eth.Contract(this.datatokensEnterpriseAbi, dtAddress)
|
const dtContract = new this.web3.eth.Contract(this.datatokensEnterpriseAbi, dtAddress)
|
||||||
try {
|
try {
|
||||||
|
const freContractParams = getFreOrderParams(freParams)
|
||||||
|
|
||||||
const estGas = await this.estGasBuyFromFreAndOrder(
|
const estGas = await this.estGasBuyFromFreAndOrder(
|
||||||
dtAddress,
|
dtAddress,
|
||||||
address,
|
address,
|
||||||
orderParams,
|
orderParams,
|
||||||
freParams,
|
freContractParams,
|
||||||
dtContract
|
dtContract
|
||||||
)
|
)
|
||||||
|
|
||||||
const trxReceipt = await dtContract.methods
|
const trxReceipt = await dtContract.methods
|
||||||
.buyFromFreAndOrder(orderParams, freParams)
|
.buyFromFreAndOrder(orderParams, freContractParams)
|
||||||
.send({
|
.send({
|
||||||
from: address,
|
from: address,
|
||||||
gas: estGas + 1,
|
gas: estGas + 1,
|
||||||
|
@ -2,7 +2,12 @@ import Web3 from 'web3'
|
|||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import { Contract } from 'web3-eth-contract'
|
import { Contract } from 'web3-eth-contract'
|
||||||
import { generateDtName } from './DatatokenName'
|
import { generateDtName } from './DatatokenName'
|
||||||
import { Erc20CreateParams, FreCreationParams, PoolCreationParams } from '../@types'
|
import {
|
||||||
|
Erc20CreateParams,
|
||||||
|
FreCreationParams,
|
||||||
|
FreOrderParams,
|
||||||
|
PoolCreationParams
|
||||||
|
} from '../@types'
|
||||||
import { Config } from '../models'
|
import { Config } from '../models'
|
||||||
import { minAbi } from './minAbi'
|
import { minAbi } from './minAbi'
|
||||||
import LoggerInstance from './Logger'
|
import LoggerInstance from './Logger'
|
||||||
@ -49,6 +54,16 @@ export function getErcCreationParams(ercParams: Erc20CreateParams): any {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getFreOrderParams(freParams: FreOrderParams): any {
|
||||||
|
return {
|
||||||
|
exchangeContract: freParams.exchangeContract,
|
||||||
|
exchangeId: freParams.exchangeId,
|
||||||
|
maxBaseTokenAmount: freParams.maxBaseTokenAmount,
|
||||||
|
swapMarketFee: Web3.utils.toWei(freParams.swapMarketFee),
|
||||||
|
marketFeeAddress: freParams.marketFeeAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getFreCreationParams(freParams: FreCreationParams): any {
|
export function getFreCreationParams(freParams: FreCreationParams): any {
|
||||||
if (!freParams.allowedConsumer)
|
if (!freParams.allowedConsumer)
|
||||||
freParams.allowedConsumer = '0x0000000000000000000000000000000000000000'
|
freParams.allowedConsumer = '0x0000000000000000000000000000000000000000'
|
||||||
@ -66,7 +81,7 @@ export function getFreCreationParams(freParams: FreCreationParams): any {
|
|||||||
freParams.baseTokenDecimals,
|
freParams.baseTokenDecimals,
|
||||||
freParams.datatokenDecimals,
|
freParams.datatokenDecimals,
|
||||||
freParams.fixedRate,
|
freParams.fixedRate,
|
||||||
freParams.marketFee,
|
Web3.utils.toWei(freParams.marketFee),
|
||||||
withMint
|
withMint
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -89,7 +104,10 @@ export function getPoolCreationParams(poolParams: PoolCreationParams): any {
|
|||||||
poolParams.vestedBlocks,
|
poolParams.vestedBlocks,
|
||||||
Web3.utils.toWei(poolParams.initialBaseTokenLiquidity)
|
Web3.utils.toWei(poolParams.initialBaseTokenLiquidity)
|
||||||
],
|
],
|
||||||
swapFees: [poolParams.swapFeeLiquidityProvider, poolParams.swapFeeMarketRunner]
|
swapFees: [
|
||||||
|
Web3.utils.toWei(poolParams.swapFeeLiquidityProvider),
|
||||||
|
Web3.utils.toWei(poolParams.swapFeeMarketRunner)
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function unitsToAmount(
|
export async function unitsToAmount(
|
||||||
|
@ -116,8 +116,8 @@ describe('Publish tests', async () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
const bundleNFT = await factory.createNftErc20WithPool(
|
const bundleNFT = await factory.createNftErc20WithPool(
|
||||||
accounts[0],
|
accounts[0],
|
||||||
@ -192,7 +192,7 @@ describe('Publish tests', async () => {
|
|||||||
baseTokenDecimals: 18,
|
baseTokenDecimals: 18,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: '1',
|
fixedRate: '1',
|
||||||
marketFee: 1e15,
|
marketFee: '0',
|
||||||
allowedConsumer: accounts[0],
|
allowedConsumer: accounts[0],
|
||||||
withMint: false
|
withMint: false
|
||||||
}
|
}
|
||||||
|
@ -229,8 +229,8 @@ describe('Nft Factory test', () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const txReceipt = await nftFactory.createNftErc20WithPool(
|
const txReceipt = await nftFactory.createNftErc20WithPool(
|
||||||
@ -275,7 +275,7 @@ describe('Nft Factory test', () => {
|
|||||||
baseTokenDecimals: 18,
|
baseTokenDecimals: 18,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: '1',
|
fixedRate: '1',
|
||||||
marketFee: 1e15,
|
marketFee: '0.001',
|
||||||
allowedConsumer: contracts.accounts[0],
|
allowedConsumer: contracts.accounts[0],
|
||||||
withMint: false
|
withMint: false
|
||||||
}
|
}
|
||||||
|
@ -208,8 +208,8 @@ describe('Router unit test', () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const nftFactory = new NftFactory(
|
const nftFactory = new NftFactory(
|
||||||
@ -261,8 +261,8 @@ describe('Router unit test', () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const txReceipt2 = await nftFactory.createNftErc20WithPool(
|
const txReceipt2 = await nftFactory.createNftErc20WithPool(
|
||||||
|
@ -160,8 +160,8 @@ describe('Pool unit test', () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: 2500000,
|
vestedBlocks: 2500000,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const nftFactory = new NftFactory(
|
const nftFactory = new NftFactory(
|
||||||
@ -606,8 +606,8 @@ describe('Pool unit test', () => {
|
|||||||
initialBaseTokenLiquidity: web3.utils.fromWei(
|
initialBaseTokenLiquidity: web3.utils.fromWei(
|
||||||
await amountToUnits(web3, contracts.usdcAddress, '2000')
|
await amountToUnits(web3, contracts.usdcAddress, '2000')
|
||||||
),
|
),
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const nftFactory = new NftFactory(
|
const nftFactory = new NftFactory(
|
||||||
|
@ -122,7 +122,7 @@ describe('Fixed Rate unit test', () => {
|
|||||||
baseTokenDecimals: 18,
|
baseTokenDecimals: 18,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: web3.utils.toWei('1'),
|
fixedRate: web3.utils.toWei('1'),
|
||||||
marketFee: 1e15,
|
marketFee: '0.001',
|
||||||
allowedConsumer: ADDRESS_ZERO,
|
allowedConsumer: ADDRESS_ZERO,
|
||||||
withMint: false
|
withMint: false
|
||||||
}
|
}
|
||||||
@ -225,9 +225,13 @@ describe('Fixed Rate unit test', () => {
|
|||||||
// no baseToken at the beginning
|
// no baseToken at the beginning
|
||||||
expect(await fixedRate.getBTSupply(exchangeId)).to.equal('0')
|
expect(await fixedRate.getBTSupply(exchangeId)).to.equal('0')
|
||||||
})
|
})
|
||||||
it('#getAmountBTIn - should get bt amount in for a specific dt amount', async () => {
|
it('#calcBaseInGivenOutDT - should get bt amount in for a specific dt amount', async () => {
|
||||||
// 100.2 DAI for 100 DT (0.1% market fee and 0.1% ocean fee)
|
// 100.2 DAI for 100 DT (0.1% market fee and 0.1% ocean fee)
|
||||||
expect(await fixedRate.getAmountBTIn(exchangeId, '100')).to.equal('100.2')
|
expect(
|
||||||
|
await (
|
||||||
|
await fixedRate.calcBaseInGivenOutDT(exchangeId, '100')
|
||||||
|
).baseTokenAmount
|
||||||
|
).to.equal('100.2')
|
||||||
})
|
})
|
||||||
it('#getAmountBTOut - should get bt amount out for a specific dt amount', async () => {
|
it('#getAmountBTOut - should get bt amount out for a specific dt amount', async () => {
|
||||||
// 99.8 DAI for 100 DT (0.1% market fee and 0.1% ocean fee)
|
// 99.8 DAI for 100 DT (0.1% market fee and 0.1% ocean fee)
|
||||||
@ -450,7 +454,7 @@ describe('Fixed Rate unit test', () => {
|
|||||||
baseTokenDecimals: 6,
|
baseTokenDecimals: 6,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: web3.utils.toWei('1'),
|
fixedRate: web3.utils.toWei('1'),
|
||||||
marketFee: 1e15,
|
marketFee: '0.001',
|
||||||
allowedConsumer: ADDRESS_ZERO,
|
allowedConsumer: ADDRESS_ZERO,
|
||||||
withMint: false
|
withMint: false
|
||||||
}
|
}
|
||||||
@ -557,9 +561,13 @@ describe('Fixed Rate unit test', () => {
|
|||||||
// no baseToken at the beginning
|
// no baseToken at the beginning
|
||||||
expect(await fixedRate.getBTSupply(exchangeId)).to.equal('0')
|
expect(await fixedRate.getBTSupply(exchangeId)).to.equal('0')
|
||||||
})
|
})
|
||||||
it('#getAmountBTIn - should get bt amount in for a specific dt amount', async () => {
|
it('#calcBaseInGivenOutDT - should get bt amount in for a specific dt amount', async () => {
|
||||||
// 100.2 USDC for 100 DT (0.1% market fee and 0.1% ocean fee)
|
// 100.2 USDC for 100 DT (0.1% market fee and 0.1% ocean fee)
|
||||||
expect(await fixedRate.getAmountBTIn(exchangeId, '100')).to.equal('100.2')
|
expect(
|
||||||
|
await (
|
||||||
|
await fixedRate.calcBaseInGivenOutDT(exchangeId, '100')
|
||||||
|
).baseTokenAmount
|
||||||
|
).to.equal('100.2')
|
||||||
})
|
})
|
||||||
it('#getAmountBTOut - should get bt amount out for a specific dt amount', async () => {
|
it('#getAmountBTOut - should get bt amount out for a specific dt amount', async () => {
|
||||||
// 99.8 USDC for 100 DT (0.1% market fee and 0.1% ocean fee)
|
// 99.8 USDC for 100 DT (0.1% market fee and 0.1% ocean fee)
|
||||||
|
@ -173,8 +173,8 @@ describe('SideStaking unit test', () => {
|
|||||||
vestingAmount: '10000',
|
vestingAmount: '10000',
|
||||||
vestedBlocks: vestedBlocks,
|
vestedBlocks: vestedBlocks,
|
||||||
initialBaseTokenLiquidity: '2000',
|
initialBaseTokenLiquidity: '2000',
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const txReceipt = await nftFactory.createNftErc20WithPool(
|
const txReceipt = await nftFactory.createNftErc20WithPool(
|
||||||
@ -425,8 +425,8 @@ describe('SideStaking unit test', () => {
|
|||||||
initialBaseTokenLiquidity: web3.utils.fromWei(
|
initialBaseTokenLiquidity: web3.utils.fromWei(
|
||||||
await amountToUnits(web3, contracts.usdcAddress, '2000')
|
await amountToUnits(web3, contracts.usdcAddress, '2000')
|
||||||
),
|
),
|
||||||
swapFeeLiquidityProvider: 1e15,
|
swapFeeLiquidityProvider: '0.001',
|
||||||
swapFeeMarketRunner: 1e15
|
swapFeeMarketRunner: '0.001'
|
||||||
}
|
}
|
||||||
|
|
||||||
const txReceipt = await nftFactory.createNftErc20WithPool(
|
const txReceipt = await nftFactory.createNftErc20WithPool(
|
||||||
|
@ -166,7 +166,7 @@ describe('Datatoken', () => {
|
|||||||
baseTokenDecimals: 18,
|
baseTokenDecimals: 18,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: web3.utils.toWei('1'),
|
fixedRate: web3.utils.toWei('1'),
|
||||||
marketFee: 1e15
|
marketFee: '0'
|
||||||
}
|
}
|
||||||
const fre = await datatoken.createFixedRate(datatokenAddress, nftOwner, freParams)
|
const fre = await datatoken.createFixedRate(datatokenAddress, nftOwner, freParams)
|
||||||
assert(fre !== null)
|
assert(fre !== null)
|
||||||
@ -184,7 +184,7 @@ describe('Datatoken', () => {
|
|||||||
baseTokenDecimals: 18,
|
baseTokenDecimals: 18,
|
||||||
datatokenDecimals: 18,
|
datatokenDecimals: 18,
|
||||||
fixedRate: web3.utils.toWei('1'),
|
fixedRate: web3.utils.toWei('1'),
|
||||||
marketFee: 1e15
|
marketFee: '0'
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await datatoken.createFixedRate(datatokenAddress, user3, freParams)
|
await datatoken.createFixedRate(datatokenAddress, user3, freParams)
|
||||||
@ -426,7 +426,6 @@ describe('Datatoken', () => {
|
|||||||
const providerData = JSON.stringify({ timeout: 0 })
|
const providerData = JSON.stringify({ timeout: 0 })
|
||||||
const providerFeeToken = ZERO_ADDRESS
|
const providerFeeToken = ZERO_ADDRESS
|
||||||
const providerFeeAmount = '0'
|
const providerFeeAmount = '0'
|
||||||
const dtAmount = web3.utils.toWei('1')
|
|
||||||
const message = web3.utils.soliditySha3(
|
const message = web3.utils.soliditySha3(
|
||||||
{ t: 'bytes', v: web3.utils.toHex(web3.utils.asciiToHex(providerData)) },
|
{ t: 'bytes', v: web3.utils.toHex(web3.utils.asciiToHex(providerData)) },
|
||||||
{ t: 'address', v: user3 },
|
{ t: 'address', v: user3 },
|
||||||
@ -455,7 +454,7 @@ describe('Datatoken', () => {
|
|||||||
exchangeContract: fixedRateAddress,
|
exchangeContract: fixedRateAddress,
|
||||||
exchangeId: exchangeId,
|
exchangeId: exchangeId,
|
||||||
maxBaseTokenAmount: '1',
|
maxBaseTokenAmount: '1',
|
||||||
swapMarketFee: web3.utils.toWei('0.1'),
|
swapMarketFee: '0.1',
|
||||||
marketFeeAddress: '0x0000000000000000000000000000000000000000'
|
marketFeeAddress: '0x0000000000000000000000000000000000000000'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user