Skip to content

Commit bdc4644

Browse files
committed
Update uniswap address / Support properties where staking later becomes 0
1 parent 5b0fc7d commit bdc4644

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

src/cap/calculate.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ test('calculate geometric mean(If not staked, convert to 1000000000000000000)',
2424
'0xhogehoge': bignumber('10000000000000000000000'),
2525
'0xhugahuga': bignumber('20000000000000000000000'),
2626
'0xkayokayo': bignumber('30000000000000000000000'),
27+
'0xqwerqwer': bignumber('0'),
2728
}
2829
const res = calculateGeometricMean(map, [
2930
'0xhogehoge',

src/cap/calculate.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export const calculateGeometricMean = (
88
): BigNumber => {
99
const values = authinticatedProperties.map((property) => {
1010
const value = valueMap[property]
11-
const tmp = typeof value === 'undefined' ? '1000000000000000000' : value
11+
const tmp =
12+
typeof value === 'undefined' || value.equals(0)
13+
? '1000000000000000000'
14+
: value
1215
return bignumber(tmp)
1316
})
1417
return values.length === 0

src/cap/uniswap.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test('get dev balance(arbitrum-one).', async (t) => {
5252

5353
test('get dev balance(polygon-mainnet).', async (t) => {
5454
const balanceOfFuncArbiOne = async (address: string): Promise<BigNumber> => {
55-
if (address == '0x2314e3B36e8Da5b4E0B591adb18B3E806f0C6Af5') {
55+
if (address == '0x4a2752F465EB31653B0D81dF79719c17226801FE') {
5656
return BigNumber.from(200)
5757
}
5858
return BigNumber.from(0)
@@ -100,7 +100,7 @@ test('get weth balance(arbitrum-one).', async (t) => {
100100

101101
test('get weth balance(polygon-mainnet).', async (t) => {
102102
const balanceOfFuncArbiOne = async (address: string): Promise<BigNumber> => {
103-
if (address == '0x2314e3B36e8Da5b4E0B591adb18B3E806f0C6Af5') {
103+
if (address == '0x4a2752F465EB31653B0D81dF79719c17226801FE') {
104104
return BigNumber.from(400)
105105
}
106106
return BigNumber.from(0)

src/common/contract/uniswap-lp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('get the uniswap lp address(arbitrum-rinkeby).', async (t) => {
1414

1515
test('get the uniswap lp address(polygon-mainnet).', async (t) => {
1616
const address = await getUniswapLpAddress('polygon-mainnet')
17-
t.is(address, '0x2314e3B36e8Da5b4E0B591adb18B3E806f0C6Af5')
17+
t.is(address, '0x4a2752F465EB31653B0D81dF79719c17226801FE')
1818
})
1919

2020
test('get the uniswap lp address(polygon-mumbai).', async (t) => {

src/common/contract/uniswap-lp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const getUniswapLpAddress = (network: NetworkName): string => {
66
: network === 'arbitrum-rinkeby'
77
? ''
88
: network === 'polygon-mainnet'
9-
? '0x2314e3B36e8Da5b4E0B591adb18B3E806f0C6Af5'
9+
? '0x4a2752F465EB31653B0D81dF79719c17226801FE'
1010
: network === 'polygon-mumbai'
1111
? ''
1212
: ''

0 commit comments

Comments
 (0)