Skip to content

Commit 3315a8d

Browse files
Merge pull request #2299 from keep-network/fix-lp-rewards-staking
Fix creating the wrapped token of the LPRewards Store in the LPRewardsToWrappedTokenCache address of the wrapped token instead of the web3 contract instance. In case the web3 provider has changed. This PR also fixes the No "from" address... error on staking in LPRewards.
2 parents d01698a + 0f18998 commit 3315a8d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

solidity/dashboard/src/services/liquidity-rewards.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { add } from "../utils/arithmetics.utils"
1212
/** @typedef {import("web3").default} Web3 */
1313
/** @typedef {LiquidityRewards} LiquidityRewards */
1414

15-
// lp contract address -> wrapped ERC20 token as web3 contract instance
15+
// lp contract address -> wrapped ERC20 token as address
1616
const LPRewardsToWrappedTokenCache = {}
1717
const WEEKS_IN_YEAR = 52
1818

@@ -214,11 +214,14 @@ export class LiquidityRewardsFactory {
214214
.call()
215215
LPRewardsToWrappedTokenCache[
216216
lpRewardsContractAddress
217-
] = createERC20Contract(web3, wrappedTokenAddress)
217+
] = wrappedTokenAddress
218218
}
219219

220-
const wrappedTokenContract =
220+
const wrappedTokenContract = createERC20Contract(
221+
web3,
221222
LPRewardsToWrappedTokenCache[lpRewardsContractAddress]
223+
)
224+
222225
const PoolStrategy = LiquidityRewardsPoolStrategy[pool]
223226

224227
return new PoolStrategy(wrappedTokenContract, LPRewardsContract, web3)

0 commit comments

Comments
 (0)