@bancor/contracts-solidity
Advanced tools
Comparing version 0.6.20 to 0.6.21
@@ -0,1 +1,10 @@ | ||
### 0.6.21 | ||
LiquidityPoolV1Converter | ||
* Fixed an issue that caused recentAverageRate to return 0/0 for new converters | ||
LiquidityProtection | ||
* Fixed an issue in removeLiquidityReturn that returned the wrong amount | ||
* Added support for max rate deviation | ||
### 0.6.20 | ||
@@ -2,0 +11,0 @@ General |
{ | ||
"name": "@bancor/contracts-solidity", | ||
"version": "0.6.20", | ||
"version": "0.6.21", | ||
"description": "The solidity version of the Bancor smart contracts is composed of many different components that work together to create the Bancor Network deployment.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -90,2 +90,3 @@ const { expect } = require('chai'); | ||
let contractRegistry; | ||
let converterRegistry; | ||
let bancorNetwork; | ||
@@ -96,3 +97,2 @@ let baseToken; | ||
let poolToken; | ||
let converterRegistry; | ||
let converter; | ||
@@ -107,7 +107,8 @@ let liquidityProtectionStore; | ||
converterRegistry = await ConverterRegistry.new(contractRegistry.address); | ||
converterRegistryData = await ConverterRegistryData.new(contractRegistry.address); | ||
bancorNetwork = await BancorNetwork.new(contractRegistry.address); | ||
const converterRegistryData = await ConverterRegistryData.new(contractRegistry.address); | ||
const liquidityPoolV1ConverterFactory = await LiquidityPoolV1ConverterFactory.new(); | ||
converterFactory = await ConverterFactory.new(); | ||
const converterFactory = await ConverterFactory.new(); | ||
await converterFactory.registerTypedConverterFactory(liquidityPoolV1ConverterFactory.address); | ||
@@ -137,3 +138,3 @@ | ||
poolToken = await DSToken.at(poolTokenAddress); | ||
const converterAddress = await poolToken.owner() | ||
const converterAddress = await poolToken.owner(); | ||
converter = await LiquidityPoolV1Converter.at(converterAddress); | ||
@@ -152,2 +153,3 @@ await converter.acceptOwnership(); | ||
await liquidityProtection.setSystemNetworkTokenLimits(-1, FULL_PPM); | ||
await liquidityProtection.setAverageRateMaxDeviation(FULL_PPM); | ||
}); | ||
@@ -169,3 +171,3 @@ | ||
else if (config.increaseRate && !config.generateFee && numOfDays < 100) { | ||
test = (actual, expected) => condOrAlmostEqual(actual.lt(expected), actual, expected, '0.0000000000000001'); | ||
test = (actual, expected) => condOrAlmostEqual(actual.lt(expected), actual, expected, '0.00000000000000002'); | ||
} | ||
@@ -198,5 +200,4 @@ else if (config.increaseRate && !config.generateFee && numOfDays >= 100) { | ||
const rateN = await converter.reserveBalance(networkToken.address); | ||
const rateD = await converter.reserveBalance(baseToken.address); | ||
const actual = await liquidityProtection.removeLiquidityReturn(0, FULL_PPM, rateN, rateD, timestamp); | ||
await converter.setTime(timestamp); | ||
const actual = await liquidityProtection.removeLiquidityReturn(0, FULL_PPM, timestamp); | ||
const error = test(actual[0], amounts[2]); | ||
@@ -217,3 +218,3 @@ expect(error).to.be.empty(error); | ||
if (!config.increaseRate && !config.generateFee) { | ||
test = (actual, expected) => condOrAlmostEqual(actual.eq(expected), actual, expected, '0.00000000000001'); | ||
test = (actual, expected) => condOrAlmostEqual(actual.eq(expected), actual, expected, '0.000000000000002'); | ||
} | ||
@@ -224,6 +225,6 @@ else if (!config.increaseRate && config.generateFee) { | ||
else if (config.increaseRate && !config.generateFee && numOfDays < 100) { | ||
test = (actual, expected) => condOrAlmostEqual(actual.lt(expected), actual, expected, '0.00000000000000001'); | ||
test = (actual, expected) => condOrAlmostEqual(actual.lt(expected), actual, expected, '0.0'); | ||
} | ||
else if (config.increaseRate && !config.generateFee && numOfDays >= 100) { | ||
test = (actual, expected) => condOrAlmostEqual(actual.eq(expected), actual, expected, '0.0000001'); | ||
test = (actual, expected) => condOrAlmostEqual(actual.eq(expected), actual, expected, '0.000000002'); | ||
} | ||
@@ -253,5 +254,4 @@ else { | ||
const rateN = await converter.reserveBalance(baseToken.address); | ||
const rateD = await converter.reserveBalance(networkToken.address); | ||
const actual = await liquidityProtection.removeLiquidityReturn(1, FULL_PPM, rateN, rateD, timestamp); | ||
await converter.setTime(timestamp); | ||
const actual = await liquidityProtection.removeLiquidityReturn(1, FULL_PPM, timestamp); | ||
const error = test(actual[0], amounts[3]); | ||
@@ -258,0 +258,0 @@ expect(error).to.be.empty(error); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1699653
246
11706