Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWoodard committed Sep 2, 2023
1 parent 0801fe8 commit a0acb43
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion earn/src/components/boost/CollectFeesWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import TokenIcon from 'shared/lib/components/common/TokenIcon';
import { Text, Display } from 'shared/lib/components/common/Typography';
import { ALOE_II_BOOST_NFT_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { GREY_700, GREY_800 } from 'shared/lib/data/constants/Colors';
import { Q32 } from 'shared/lib/data/constants/Values';
import { GNFormat } from 'shared/lib/data/GoodNumber';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
Expand Down Expand Up @@ -73,7 +74,7 @@ export default function CollectFeesWidget(props: CollectFeesWidgetProps) {
address: ALOE_II_BOOST_NFT_ADDRESS[activeChain.id],
abi: boostNftAbi,
functionName: 'modify',
args: [ethers.BigNumber.from(cardInfo.nftTokenId || 0), 1, modifyData, oracleSeed ?? 0],
args: [ethers.BigNumber.from(cardInfo.nftTokenId || 0), 1, modifyData, oracleSeed ?? Q32],
chainId: activeChain.id,
enabled: !JSBI.equal(cardInfo?.position.liquidity, JSBI.BigInt(0)) && !!oracleSeed,
});
Expand Down
3 changes: 2 additions & 1 deletion earn/src/components/boost/ImportBoostWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
UNISWAP_NONFUNGIBLE_POSITION_MANAGER_ADDRESS,
} from 'shared/lib/data/constants/ChainSpecific';
import { GREY_800 } from 'shared/lib/data/constants/Colors';
import { Q32 } from 'shared/lib/data/constants/Values';
import { GN, GNFormat } from 'shared/lib/data/GoodNumber';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
Expand Down Expand Up @@ -335,7 +336,7 @@ export default function ImportBoostWidget(props: ImportBoostWidgetProps) {
address: ALOE_II_BOOST_NFT_ADDRESS[activeChain.id],
abi: boostNftAbi,
functionName: 'mint',
args: [cardInfo.uniswapPool, initializationData ?? '0x', oracleSeed ?? 0],
args: [cardInfo.uniswapPool, initializationData ?? '0x', oracleSeed ?? Q32],
overrides: { value: ante.toBigNumber().add(1) },
chainId: activeChain.id,
enabled: enableHooks && shouldMint && !!oracleSeed && !!ante,
Expand Down
3 changes: 2 additions & 1 deletion earn/src/components/borrow/modal/BorrowModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Modal from 'shared/lib/components/common/Modal';
import { Display, Text } from 'shared/lib/components/common/Typography';
import { ALOE_II_FACTORY_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { ALOE_II_SIMPLE_MANAGER_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { Q32 } from 'shared/lib/data/constants/Values';
import { GN, GNFormat } from 'shared/lib/data/GoodNumber';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
Expand Down Expand Up @@ -114,7 +115,7 @@ function BorrowButton(props: BorrowButtonProps) {
address: marginAccount.address,
abi: borrowerABI,
functionName: 'modify',
args: [ALOE_II_SIMPLE_MANAGER_ADDRESS[activeChain.id], encodedData as `0x${string}`, oracleSeed ?? 0],
args: [ALOE_II_SIMPLE_MANAGER_ADDRESS[activeChain.id], encodedData as `0x${string}`, oracleSeed ?? Q32],
overrides: { value: shouldProvideAnte ? ante.recklessAdd(1).toBigNumber() : undefined },
enabled: !!userAddress && borrowAmount.isGtZero() && !isUnhealthy && !notEnoughSupply && !!oracleSeed,
chainId: activeChain.id,
Expand Down
3 changes: 2 additions & 1 deletion earn/src/components/borrow/modal/RemoveCollateralModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { BaseMaxButton } from 'shared/lib/components/common/Input';
import Modal from 'shared/lib/components/common/Modal';
import { Text } from 'shared/lib/components/common/Typography';
import { ALOE_II_SIMPLE_MANAGER_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { Q32 } from 'shared/lib/data/constants/Values';
import { GN, GNFormat } from 'shared/lib/data/GoodNumber';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
Expand Down Expand Up @@ -96,7 +97,7 @@ function RemoveCollateralButton(props: RemoveCollateralButtonProps) {
address: marginAccount.address,
abi: borrowerABI,
functionName: 'modify',
args: [ALOE_II_SIMPLE_MANAGER_ADDRESS[activeChain.id], encodedData as `0x${string}`, oracleSeed ?? 0],
args: [ALOE_II_SIMPLE_MANAGER_ADDRESS[activeChain.id], encodedData as `0x${string}`, oracleSeed ?? Q32],
enabled: !!userAddress && collateralAmount.isGtZero() && collateralAmount.lte(userBalance) && !!oracleSeed,
chainId: activeChain.id,
});
Expand Down
3 changes: 2 additions & 1 deletion earn/src/components/borrow/modal/WithdrawUniswapNFTModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Modal from 'shared/lib/components/common/Modal';
import { Display, Text } from 'shared/lib/components/common/Typography';
import { ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { GREY_700 } from 'shared/lib/data/constants/Colors';
import { Q32 } from 'shared/lib/data/constants/Values';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
import { computeOracleSeed } from 'shared/lib/data/OracleSeed';
Expand Down Expand Up @@ -125,7 +126,7 @@ function WithdrawUniswapNFTButton(props: WithdrawUniswapNFTButtonProps) {
address: marginAccount.address,
abi: borrowerABI,
functionName: 'modify',
args: [ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS[activeChain.id], encodedData, oracleSeed ?? 0],
args: [ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS[activeChain.id], encodedData, oracleSeed ?? Q32],
enabled: !!oracleSeed,
chainId: activeChain.id,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS,
} from 'shared/lib/data/constants/ChainSpecific';
import { GREY_700 } from 'shared/lib/data/constants/Colors';
import { Q32 } from 'shared/lib/data/constants/Values';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useEffectOnce from 'shared/lib/data/hooks/UseEffectOnce';
import { computeOracleSeed } from 'shared/lib/data/OracleSeed';
Expand Down Expand Up @@ -216,7 +217,7 @@ function AddUniswapNFTAsCollateralButton(props: AddUniswapNFTAsCollateralButtonP
address: marginAccount.address,
abi: borrowerABI,
functionName: 'modify',
args: [ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS[activeChain.id], encodedData, oracleSeed ?? 0],
args: [ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS[activeChain.id], encodedData, oracleSeed ?? Q32],
enabled: getApprovedData === ALOE_II_UNISWAP_NFT_MANAGER_ADDRESS[activeChain.id] && !!oracleSeed,
chainId: activeChain.id,
});
Expand Down
3 changes: 2 additions & 1 deletion earn/src/pages/boost/ManageBoostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AppPage from 'shared/lib/components/common/AppPage';
import { FilledGradientButton } from 'shared/lib/components/common/Buttons';
import { Text } from 'shared/lib/components/common/Typography';
import { ALOE_II_BOOST_NFT_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { Q32 } from 'shared/lib/data/constants/Values';
import { GN } from 'shared/lib/data/GoodNumber';
import { useChainDependentState } from 'shared/lib/data/hooks/UseChainDependentState';
import useSafeState from 'shared/lib/data/hooks/UseSafeState';
Expand Down Expand Up @@ -176,7 +177,7 @@ export default function ManageBoostPage() {
address: ALOE_II_BOOST_NFT_ADDRESS[activeChain.id],
abi: boostNftAbi,
functionName: 'modify',
args: [ethers.BigNumber.from(nftTokenId || 0), 2, modifyData, oracleSeed ?? 0],
args: [ethers.BigNumber.from(nftTokenId || 0), 2, modifyData, oracleSeed ?? Q32],
chainId: activeChain.id,
enabled:
nftTokenId !== undefined &&
Expand Down

0 comments on commit a0acb43

Please sign in to comment.