diff --git a/components/ffAssetOverview/ffAssetOverview.js b/components/ffAssetOverview/ffAssetOverview.js index ea8193d..3c1e861 100644 --- a/components/ffAssetOverview/ffAssetOverview.js +++ b/components/ffAssetOverview/ffAssetOverview.js @@ -8,8 +8,8 @@ import classes from './ffAssetOverview.module.css'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -17,8 +17,8 @@ function BalanceIcon(props) { function StakedIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -40,7 +40,7 @@ export default function ffAssetOverview({ asset }) {
- +
{ asset ? asset.name : '' } ${ formatCurrency(asset ? asset.price : 0) } diff --git a/components/ffAssets/ffAssetsTable.js b/components/ffAssets/ffAssetsTable.js index eaae478..620472a 100644 --- a/components/ffAssets/ffAssetsTable.js +++ b/components/ffAssets/ffAssetsTable.js @@ -290,7 +290,7 @@ export default function EnhancedTable({ assets }) {
- + + ); } diff --git a/components/ffClaimAll/ffClaimAllTable.js b/components/ffClaimAll/ffClaimAllTable.js index 0ddcc94..cc140c9 100644 --- a/components/ffClaimAll/ffClaimAllTable.js +++ b/components/ffClaimAll/ffClaimAllTable.js @@ -301,7 +301,7 @@ export default function EnhancedTable({ claimable, crv, ibEUR, rKP3R }) { { row?.type === 'Fixed Forex' && } { - row?.type !== 'Fixed Forex' && + row?.type !== 'Fixed Forex' && }
diff --git a/components/ffDashboardAssetOverview/ffDashboardOverview.js b/components/ffDashboardAssetOverview/ffDashboardOverview.js index 242d314..2ef6e1a 100644 --- a/components/ffDashboardAssetOverview/ffDashboardOverview.js +++ b/components/ffDashboardAssetOverview/ffDashboardOverview.js @@ -13,8 +13,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -22,8 +22,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -31,8 +31,8 @@ function VestedBalanceIcon(props) { function IbBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffDashboardClaimAll/ffDashboardClaimAll.js b/components/ffDashboardClaimAll/ffDashboardClaimAll.js index 52043f8..6ef4cac 100644 --- a/components/ffDashboardClaimAll/ffDashboardClaimAll.js +++ b/components/ffDashboardClaimAll/ffDashboardClaimAll.js @@ -10,8 +10,8 @@ import { FIXED_FOREX_UPDATED, FIXED_FOREX_CLAIM_ALL, FIXED_FOREX_ALL_CLAIMED, ER function NoRewardsIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffDashboardClaimAll/ffDashboardClaimAllTable.js b/components/ffDashboardClaimAll/ffDashboardClaimAllTable.js index ce44edf..94f3dea 100644 --- a/components/ffDashboardClaimAll/ffDashboardClaimAllTable.js +++ b/components/ffDashboardClaimAll/ffDashboardClaimAllTable.js @@ -298,7 +298,7 @@ export default function EnhancedTable({ claimable, crv, ibEUR, rKP3R }) { { row?.type === 'Fixed Forex' && } { - row?.type !== 'Fixed Forex' && + row?.type !== 'Fixed Forex' && } diff --git a/components/ffDashboardMintOverview/ffDashboardMintOverview.js b/components/ffDashboardMintOverview/ffDashboardMintOverview.js index e489542..45135db 100644 --- a/components/ffDashboardMintOverview/ffDashboardMintOverview.js +++ b/components/ffDashboardMintOverview/ffDashboardMintOverview.js @@ -13,8 +13,8 @@ import { LEND_UPDATED } from '../../stores/constants'; function SuppliedIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -23,8 +23,8 @@ function SuppliedIcon(props) { function BorrowedIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -32,8 +32,8 @@ function BorrowedIcon(props) { function LimitIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffDashboardOverview/ffDashboardOverview.js b/components/ffDashboardOverview/ffDashboardOverview.js index 4b5e78c..6b98a04 100644 --- a/components/ffDashboardOverview/ffDashboardOverview.js +++ b/components/ffDashboardOverview/ffDashboardOverview.js @@ -13,8 +13,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -22,8 +22,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -31,8 +31,8 @@ function VestedBalanceIcon(props) { function IbBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffDashboardVoteOverview/ffDashboardVoteOverview.js b/components/ffDashboardVoteOverview/ffDashboardVoteOverview.js index f03f149..7fd1365 100644 --- a/components/ffDashboardVoteOverview/ffDashboardVoteOverview.js +++ b/components/ffDashboardVoteOverview/ffDashboardVoteOverview.js @@ -14,8 +14,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function MyVotesIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -23,8 +23,8 @@ function MyVotesIcon(props) { function TotalVotesIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffGauges/ffGaugesTable.js b/components/ffGauges/ffGaugesTable.js index ada0e92..6ce98b2 100644 --- a/components/ffGauges/ffGaugesTable.js +++ b/components/ffGauges/ffGaugesTable.js @@ -294,7 +294,7 @@ export default function EnhancedTable({ gauges, setParentSliderValues, defaultVo
- +
{ row?.gauge?.coin0?.symbol } - { row?.gauge?.coin1?.symbol } @@ -307,7 +307,7 @@ export default function EnhancedTable({ gauges, setParentSliderValues, defaultVo - { formatCurrency(row?.gauge?.userGaugeBalance) } { row.symbol } + { formatCurrency(row?.gauge?.userGaugeBalance) } { row.symbolAlt } $ { formatCurrency(0.00) } diff --git a/components/ffMintOverview/ffOverview.js b/components/ffMintOverview/ffOverview.js index af9ed1b..adf2cc4 100644 --- a/components/ffMintOverview/ffOverview.js +++ b/components/ffMintOverview/ffOverview.js @@ -15,8 +15,8 @@ import { LEND_UPDATED } from '../../stores/constants'; function BorrowedIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -24,8 +24,8 @@ function BorrowedIcon(props) { function LimitIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffOptions/ffOptionsTable.js b/components/ffOptions/ffOptionsTable.js index 7d07df5..0bd6576 100644 --- a/components/ffOptions/ffOptionsTable.js +++ b/components/ffOptions/ffOptionsTable.js @@ -14,8 +14,8 @@ import { FIXED_FOREX_REDEEM_OPTION, FIXED_FOREX_OPTION_REDEEMED, ERROR, FIXED_FO function NoneIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffOptionsOverview/ffStakeOverview.js b/components/ffOptionsOverview/ffStakeOverview.js index 04d7c6c..00756e4 100644 --- a/components/ffOptionsOverview/ffStakeOverview.js +++ b/components/ffOptionsOverview/ffStakeOverview.js @@ -12,8 +12,8 @@ import { FIXED_FOREX_UPDATED, FIXED_FOREX_CLAIM_RKP3R, FIXED_FOREX_RKP3R_CLAIMED function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -21,8 +21,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffOverview/ffOverview.js b/components/ffOverview/ffOverview.js index 6684a60..30bc2a8 100644 --- a/components/ffOverview/ffOverview.js +++ b/components/ffOverview/ffOverview.js @@ -13,8 +13,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -22,8 +22,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -31,8 +31,8 @@ function VestedBalanceIcon(props) { function IbBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffStakeOverview/ffStakeOverview.js b/components/ffStakeOverview/ffStakeOverview.js index 4d4f8cb..90fa4dc 100644 --- a/components/ffStakeOverview/ffStakeOverview.js +++ b/components/ffStakeOverview/ffStakeOverview.js @@ -16,8 +16,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -25,8 +25,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -34,8 +34,8 @@ function VestedBalanceIcon(props) { function IbBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffSwap/setup.js b/components/ffSwap/setup.js index 679be09..ec03c9e 100644 --- a/components/ffSwap/setup.js +++ b/components/ffSwap/setup.js @@ -57,9 +57,10 @@ function Setup({ theme, handleNext }) { const [ toAssetOptions, setToAssetOptions ] = useState([]) const populateReceiveList = (localFromAsset, force) => { - const storeAssets = stores.fixedForexStore.getStore('assets') + const _storeAssets = stores.fixedForexStore.getStore('assets') const storeSwapAssets = stores.fixedForexStore.getStore('swapFromAssets') + const storeAssets = _storeAssets.filter(e => !e.shouldUseNewABI).filter(e => e.gauge.address !== '0x38039dD47636154273b287F74C432Cac83Da97e2') if(storeAssets.length > 0 && (toAssetValue == null || force)) { let tav = '' if(localFromAsset) { @@ -99,9 +100,11 @@ function Setup({ theme, handleNext }) { } const ffUpdated = () => { - const storeAssets = stores.fixedForexStore.getStore('assets') + const _storeAssets = stores.fixedForexStore.getStore('assets') const storeSwapAssets = stores.fixedForexStore.getStore('swapFromAssets') const storeBreaker = stores.fixedForexStore.getStore('breaker') + const storeAssets = _storeAssets.filter(e => !e.shouldUseNewABI).filter(e => e.gauge.address !== '0x38039dD47636154273b287F74C432Cac83Da97e2') + let excludeMim = storeSwapAssets.filter((a) => { return a.symbol !== 'MIM' }) diff --git a/components/ffUniV3Rewards/ffUniV3RewardsTable.js b/components/ffUniV3Rewards/ffUniV3RewardsTable.js index 1222b18..970a017 100644 --- a/components/ffUniV3Rewards/ffUniV3RewardsTable.js +++ b/components/ffUniV3Rewards/ffUniV3RewardsTable.js @@ -18,8 +18,8 @@ import { formatCurrency } from '../../utils'; function NoneIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffUniV3Tokens/ffUniV3TokensTable.js b/components/ffUniV3Tokens/ffUniV3TokensTable.js index 49c0ea2..bd4920c 100644 --- a/components/ffUniV3Tokens/ffUniV3TokensTable.js +++ b/components/ffUniV3Tokens/ffUniV3TokensTable.js @@ -18,8 +18,8 @@ import { formatCurrency } from '../../utils'; function NoneIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffVestOverview/ffOverview.js b/components/ffVestOverview/ffOverview.js index a4b578d..dd15c2f 100644 --- a/components/ffVestOverview/ffOverview.js +++ b/components/ffVestOverview/ffOverview.js @@ -14,8 +14,8 @@ import { FIXED_FOREX_UPDATED } from '../../stores/constants'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -23,8 +23,8 @@ function BalanceIcon(props) { function VestedBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -32,8 +32,8 @@ function VestedBalanceIcon(props) { function IbBalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/ffVoteOverview/ffVoteOverview.js b/components/ffVoteOverview/ffVoteOverview.js index c6d4d66..b81613c 100644 --- a/components/ffVoteOverview/ffVoteOverview.js +++ b/components/ffVoteOverview/ffVoteOverview.js @@ -16,8 +16,8 @@ import GaugeVotesPie from './gaugeVotePie' function MyVotesIcon(props) { const { color, className } = props; return ( - - + + ); } @@ -25,8 +25,8 @@ function MyVotesIcon(props) { function TotalVotesIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/header/header.js b/components/header/header.js index 5dd536a..99c1443 100644 --- a/components/header/header.js +++ b/components/header/header.js @@ -26,8 +26,8 @@ import AboutModal from './aboutModal'; function WrongNetworkIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/components/navigation/navigation.js b/components/navigation/navigation.js index 0b5d77c..6c866ff 100644 --- a/components/navigation/navigation.js +++ b/components/navigation/navigation.js @@ -152,10 +152,10 @@ function Navigation(props) { 'Liquidity Providing' )}
- {renderSubNav( + {/* {renderSubNav( 'Curve + Convex + Yearn', 'home', - )} + )} */} {renderSubNav( 'Uniswap', 'staking', diff --git a/components/welcomeHeader/welcomeHeader.js b/components/welcomeHeader/welcomeHeader.js index 6cd3569..0dd2ebe 100644 --- a/components/welcomeHeader/welcomeHeader.js +++ b/components/welcomeHeader/welcomeHeader.js @@ -25,8 +25,8 @@ import HelpIcon from '@material-ui/icons/Help'; function WrongNetworkIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/dashboard/index.js b/pages/dashboard/index.js index 6ac8935..ac96c1a 100644 --- a/pages/dashboard/index.js +++ b/pages/dashboard/index.js @@ -19,8 +19,8 @@ import { formatAddress } from '../../utils'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/gauges/index.js b/pages/gauges/index.js index a9133f0..928a62e 100644 --- a/pages/gauges/index.js +++ b/pages/gauges/index.js @@ -16,8 +16,8 @@ import classes from './gauges.module.css'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/mint/index.js b/pages/mint/index.js index d7e4c07..57d7381 100644 --- a/pages/mint/index.js +++ b/pages/mint/index.js @@ -25,8 +25,8 @@ import LendAllAssetRow from '../../components/lendAllAssetRow'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/options/index.js b/pages/options/index.js index 24c696e..6599598 100644 --- a/pages/options/index.js +++ b/pages/options/index.js @@ -16,8 +16,8 @@ import classes from './options.module.css'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/rewards/index.js b/pages/rewards/index.js index ddaf3e9..474a50a 100644 --- a/pages/rewards/index.js +++ b/pages/rewards/index.js @@ -15,8 +15,8 @@ import Unlock from '../../components/unlock'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/staking/index.js b/pages/staking/index.js index a211705..0713770 100644 --- a/pages/staking/index.js +++ b/pages/staking/index.js @@ -16,7 +16,7 @@ import classes from './staking.module.css'; function UniswapIcon(props) { const { color, className } = props; return ( - + + + + + + + + + + + + + + ); +} + function Swap({ changeTheme }) { const accountStore = stores.accountStore.getStore('account'); diff --git a/pages/vest/index.js b/pages/vest/index.js index c92e920..145626f 100644 --- a/pages/vest/index.js +++ b/pages/vest/index.js @@ -18,8 +18,8 @@ import Unlock from '../../components/unlock'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/vote/index.js b/pages/vote/index.js index 9e53fed..2dc32ac 100644 --- a/pages/vote/index.js +++ b/pages/vote/index.js @@ -17,8 +17,8 @@ import { formatCurrency } from '../../utils'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/pages/withdraw/index.js b/pages/withdraw/index.js index c3ff5b2..8ad9046 100644 --- a/pages/withdraw/index.js +++ b/pages/withdraw/index.js @@ -15,8 +15,8 @@ import Unlock from '../../components/unlock'; function BalanceIcon(props) { const { color, className } = props; return ( - - + + ); } diff --git a/stores/abis/abis.js b/stores/abis/abis.js index 4665275..cc1b6bc 100644 --- a/stores/abis/abis.js +++ b/stores/abis/abis.js @@ -34,13 +34,19 @@ import { yearnVaultABI } from './yearnVaultABI' import { ibAMMABI } from './ibAMMABI' import { ibAMMV2ABI } from './ibAMMV2ABI' import { ibAMMV3ABI } from './ibAMMV3ABI' +import { ibsmtusdc } from './ibsmtusdc.abi' +import { ibsmtusdcPool } from './ibsmtusdcPool.abi' +import { lensABI } from './lens.abi' export default { erc20ABI: erc20ABI, ibEURABI: ibEURABI, + lensABI: lensABI, sushiLPABI: sushiLPABI, veIBFFABI: veIBFFABI, faucetABI: faucetABI, + ibsmtusdc: ibsmtusdc, + ibsmtusdcPool: ibsmtusdcPool, distributionABI: distributionABI, gaugeProxyABI: gaugeProxyABI, gaugeABI: gaugeABI, diff --git a/stores/abis/ibsmtusdc.abi.js b/stores/abis/ibsmtusdc.abi.js new file mode 100644 index 0000000..b569a13 --- /dev/null +++ b/stores/abis/ibsmtusdc.abi.js @@ -0,0 +1,3 @@ +export const ibsmtusdc = [ + {"name":"Deposit","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Withdraw","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateLiquidityLimit","inputs":[{"name":"user","type":"address","indexed":true},{"name":"original_balance","type":"uint256","indexed":false},{"name":"original_supply","type":"uint256","indexed":false},{"name":"working_balance","type":"uint256","indexed":false},{"name":"working_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"CommitOwnership","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"ApplyOwnership","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"Transfer","inputs":[{"name":"_from","type":"address","indexed":true},{"name":"_to","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"name":"_owner","type":"address","indexed":true},{"name":"_spender","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"}],"outputs":[],"gas":4221717},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_addr","type":"address"}],"outputs":[],"gas":4221717},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_addr","type":"address"},{"name":"_claim_rewards","type":"bool"}],"outputs":[],"gas":4221717},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"}],"outputs":[],"gas":4221322},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"},{"name":"_claim_rewards","type":"bool"}],"outputs":[],"gas":4221322},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[],"outputs":[],"gas":1374701},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"}],"outputs":[],"gas":1374701},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"},{"name":"_receiver","type":"address"}],"outputs":[],"gas":1374701},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":8330946},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":8293026},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":39241},{"stateMutability":"nonpayable","type":"function","name":"permit","inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_deadline","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"outputs":[{"name":"","type":"bool"}],"gas":102311},{"stateMutability":"nonpayable","type":"function","name":"increaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_added_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":41801},{"stateMutability":"nonpayable","type":"function","name":"decreaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_subtracted_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":41827},{"stateMutability":"nonpayable","type":"function","name":"user_checkpoint","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":2767499},{"stateMutability":"nonpayable","type":"function","name":"set_rewards_receiver","inputs":[{"name":"_receiver","type":"address"}],"outputs":[],"gas":35820},{"stateMutability":"nonpayable","type":"function","name":"kick","inputs":[{"name":"addr","type":"address"}],"outputs":[],"gas":2781198},{"stateMutability":"nonpayable","type":"function","name":"deposit_reward_token","inputs":[{"name":"_reward_token","type":"address"},{"name":"_amount","type":"uint256"}],"outputs":[],"gas":1492175},{"stateMutability":"nonpayable","type":"function","name":"add_reward","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[],"gas":115333},{"stateMutability":"nonpayable","type":"function","name":"set_reward_distributor","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[],"gas":43078},{"stateMutability":"nonpayable","type":"function","name":"set_killed","inputs":[{"name":"_is_killed","type":"bool"}],"outputs":[],"gas":40381},{"stateMutability":"view","type":"function","name":"claimed_reward","inputs":[{"name":"_addr","type":"address"},{"name":"_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3502},{"stateMutability":"view","type":"function","name":"claimable_reward","inputs":[{"name":"_user","type":"address"},{"name":"_reward_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":20471},{"stateMutability":"nonpayable","type":"function","name":"claimable_tokens","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":2683603},{"stateMutability":"view","type":"function","name":"integrate_checkpoint","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":5172},{"stateMutability":"view","type":"function","name":"future_epoch_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3066},{"stateMutability":"view","type":"function","name":"inflation_rate","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3120},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":1020},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":6677},{"stateMutability":"nonpayable","type":"function","name":"initialize","inputs":[{"name":"_lp_token","type":"address"}],"outputs":[],"gas":412936},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3476},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3240},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3802},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":13589},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":13619},{"stateMutability":"view","type":"function","name":"DOMAIN_SEPARATOR","inputs":[],"outputs":[{"name":"","type":"bytes32"}],"gas":3360},{"stateMutability":"view","type":"function","name":"nonces","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3656},{"stateMutability":"view","type":"function","name":"factory","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":3420},{"stateMutability":"view","type":"function","name":"lp_token","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":3450},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":3480},{"stateMutability":"view","type":"function","name":"reward_count","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3510},{"stateMutability":"view","type":"function","name":"reward_data","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"token","type":"address"},{"name":"distributor","type":"address"},{"name":"period_finish","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"last_update","type":"uint256"},{"name":"integral","type":"uint256"}]}],"gas":14427},{"stateMutability":"view","type":"function","name":"rewards_receiver","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"address"}],"gas":3836},{"stateMutability":"view","type":"function","name":"reward_integral_for","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":4132},{"stateMutability":"view","type":"function","name":"working_balances","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3896},{"stateMutability":"view","type":"function","name":"working_supply","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3660},{"stateMutability":"view","type":"function","name":"integrate_inv_supply_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3956},{"stateMutability":"view","type":"function","name":"integrate_checkpoint_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3986},{"stateMutability":"view","type":"function","name":"integrate_fraction","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":4016},{"stateMutability":"view","type":"function","name":"period","inputs":[],"outputs":[{"name":"","type":"int128"}],"gas":3780},{"stateMutability":"view","type":"function","name":"reward_tokens","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}],"gas":3855},{"stateMutability":"view","type":"function","name":"period_timestamp","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3885},{"stateMutability":"view","type":"function","name":"integrate_inv_supply","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3915} +]; \ No newline at end of file diff --git a/stores/abis/ibsmtusdcPool.abi.js b/stores/abis/ibsmtusdcPool.abi.js new file mode 100644 index 0000000..3a46818 --- /dev/null +++ b/stores/abis/ibsmtusdcPool.abi.js @@ -0,0 +1,3 @@ +export const ibsmtusdcPool = [ + {"name":"TokenExchange","inputs":[{"name":"buyer","type":"address","indexed":true},{"name":"sold_id","type":"uint256","indexed":false},{"name":"tokens_sold","type":"uint256","indexed":false},{"name":"bought_id","type":"uint256","indexed":false},{"name":"tokens_bought","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"AddLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[2]","indexed":false},{"name":"fee","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[2]","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidityOne","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amount","type":"uint256","indexed":false},{"name":"coin_index","type":"uint256","indexed":false},{"name":"coin_amount","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"CommitNewParameters","inputs":[{"name":"deadline","type":"uint256","indexed":true},{"name":"admin_fee","type":"uint256","indexed":false},{"name":"mid_fee","type":"uint256","indexed":false},{"name":"out_fee","type":"uint256","indexed":false},{"name":"fee_gamma","type":"uint256","indexed":false},{"name":"allowed_extra_profit","type":"uint256","indexed":false},{"name":"adjustment_step","type":"uint256","indexed":false},{"name":"ma_half_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewParameters","inputs":[{"name":"admin_fee","type":"uint256","indexed":false},{"name":"mid_fee","type":"uint256","indexed":false},{"name":"out_fee","type":"uint256","indexed":false},{"name":"fee_gamma","type":"uint256","indexed":false},{"name":"allowed_extra_profit","type":"uint256","indexed":false},{"name":"adjustment_step","type":"uint256","indexed":false},{"name":"ma_half_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RampAgamma","inputs":[{"name":"initial_A","type":"uint256","indexed":false},{"name":"future_A","type":"uint256","indexed":false},{"name":"initial_gamma","type":"uint256","indexed":false},{"name":"future_gamma","type":"uint256","indexed":false},{"name":"initial_time","type":"uint256","indexed":false},{"name":"future_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"StopRampA","inputs":[{"name":"current_A","type":"uint256","indexed":false},{"name":"current_gamma","type":"uint256","indexed":false},{"name":"time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"ClaimAdminFee","inputs":[{"name":"admin","type":"address","indexed":true},{"name":"tokens","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_weth","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"},{"name":"use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"},{"name":"use_eth","type":"bool"},{"name":"receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange_underlying","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange_underlying","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"},{"name":"receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"exchange_extended","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"},{"name":"use_eth","type":"bool"},{"name":"sender","type":"address"},{"name":"receiver","type":"address"},{"name":"cb","type":"bytes32"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"amounts","type":"uint256[2]"},{"name":"min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"amounts","type":"uint256[2]"},{"name":"min_mint_amount","type":"uint256"},{"name":"use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"amounts","type":"uint256[2]"},{"name":"min_mint_amount","type":"uint256"},{"name":"use_eth","type":"bool"},{"name":"receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"min_amounts","type":"uint256[2]"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"min_amounts","type":"uint256[2]"},{"name":"use_eth","type":"bool"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"min_amounts","type":"uint256[2]"},{"name":"use_eth","type":"bool"},{"name":"receiver","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"min_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"min_amount","type":"uint256"},{"name":"use_eth","type":"bool"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"min_amount","type":"uint256"},{"name":"use_eth","type":"bool"},{"name":"receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"claim_admin_fees","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"ramp_A_gamma","inputs":[{"name":"future_A","type":"uint256"},{"name":"future_gamma","type":"uint256"},{"name":"future_time","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"stop_ramp_A_gamma","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"commit_new_parameters","inputs":[{"name":"_new_mid_fee","type":"uint256"},{"name":"_new_out_fee","type":"uint256"},{"name":"_new_admin_fee","type":"uint256"},{"name":"_new_fee_gamma","type":"uint256"},{"name":"_new_allowed_extra_profit","type":"uint256"},{"name":"_new_adjustment_step","type":"uint256"},{"name":"_new_ma_half_time","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"apply_new_parameters","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"revert_new_parameters","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"amounts","type":"uint256[2]"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"calc_withdraw_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"lp_price","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"A","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"price_oracle","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"initialize","inputs":[{"name":"A","type":"uint256"},{"name":"gamma","type":"uint256"},{"name":"mid_fee","type":"uint256"},{"name":"out_fee","type":"uint256"},{"name":"allowed_extra_profit","type":"uint256"},{"name":"fee_gamma","type":"uint256"},{"name":"adjustment_step","type":"uint256"},{"name":"admin_fee","type":"uint256"},{"name":"ma_half_time","type":"uint256"},{"name":"initial_price","type":"uint256"},{"name":"_token","type":"address"},{"name":"_coins","type":"address[2]"},{"name":"_precisions","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"token","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"coins","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"price_scale","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"last_prices","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"last_prices_timestamp","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"initial_A_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_A_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"initial_A_gamma_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_A_gamma_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"allowed_extra_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_allowed_extra_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"fee_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_fee_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"adjustment_step","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_adjustment_step","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"ma_half_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_ma_half_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"mid_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"out_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_mid_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_out_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"balances","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"D","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"factory","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"xcp_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"xcp_profit_a","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"admin_actions_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}]} +] \ No newline at end of file diff --git a/stores/abis/lens.abi.js b/stores/abis/lens.abi.js new file mode 100644 index 0000000..f39c185 --- /dev/null +++ b/stores/abis/lens.abi.js @@ -0,0 +1 @@ +export const lensABI = [{"inputs":[{"internalType":"address","name":"_managementListAddress","type":"address"},{"internalType":"address","name":"_usdcAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAliasAddress","type":"address"}],"name":"TokenAliasAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"TokenAliasRemoved","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"tokenAliasAddress","type":"address"}],"name":"addTokenAlias","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"tokenAliasAddress","type":"address"}],"internalType":"struct Oracle.TokenAlias[]","name":"_tokenAliases","type":"tuple[]"}],"name":"addTokenAliases","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"calculations","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getNormalizedValueUsdc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"priceUsdc","type":"uint256"}],"name":"getNormalizedValueUsdc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"getPriceUsdcRecommended","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managementList","outputs":[{"internalType":"contract ManagementList","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"removeTokenAlias","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"calculationAddresses","type":"address[]"}],"name":"setCalculations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenAliases","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdcAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] \ No newline at end of file diff --git a/stores/constants/constants.js b/stores/constants/constants.js index 3d1d574..2289fcb 100644 --- a/stores/constants/constants.js +++ b/stores/constants/constants.js @@ -48,6 +48,70 @@ export const IBKRW_CONVEX_GAUGE_ADDRESS = '0x8F18C0AF0d7d511E8Bdc6B3c64926B04EDf export const IBKRW_YEARN_GAUGE_ADDRESS = '0x528D50dC9a333f01544177a924893FA1F5b9F748' export const IBKRW_CONVEX_PID = 47 +// kp3r + Eth +export const KP3RETH_ORACLE = '0x86BBD9ac8B9B44C95FFc6BAAe58E25033B7548AA' +export const KP3RETH_ADDRESS = '0x4647B6D835f3B393C7A955df51EEfcf0db961606' +export const KP3RETH_GAUGE_ADDRESS = '0x6d3328F0333f6FB0B2FaC87cF5a0FFa7e77beB60' +export const KP3RETH_POOL_ADDRESS = '0x21410232b484136404911780bc32756d5d1a9fa9' +export const KP3RETH_YEARN_GAUGE_ADDRESS = '' +export const KP3RETH_CONVEX_GAUGE_ADDRESS = '0x0c2da920E577960f39991030CfBdd4cF0a0CfEBD' +export const KP3RETH_CONVEX_PID = 90 + + +// ibAUD + USDC +export const IBAUDUSDC_ORACLE = '0x86BBD9ac8B9B44C95FFc6BAAe58E25033B7548AA' +export const IBAUDUSDC_ADDRESS = '0x54c8Ecf46A81496eEB0608BD3353388b5D7a2a33' +export const IBAUDUSDC_GAUGE_ADDRESS = '0x1779AEB087C5BdBe48749ab03575f5f25D1DEeaF' +export const IBAUDUSDC_POOL_ADDRESS = '0x5b692073f141c31384fae55856cfb6cbffe91e60' +export const IBAUDUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBAUDUSDC_CONVEX_GAUGE_ADDRESS = '0xbAFC4FAeB733C18411886A04679F11877D8629b1' +export const IBAUDUSDC_CONVEX_PID = 84 + +// ibCHF + USDC +export const IBCHFUSDC_ORACLE = '0x1b3E95E8ECF7A7caB6c4De1b344F94865aBD12d5' +export const IBCHFUSDC_ADDRESS = '0x08ceA8E5B4551722dEB97113C139Dd83C26c5398' +export const IBCHFUSDC_GAUGE_ADDRESS = '0x36C66bC294fEf4e94B3e40A1801d0AB0085Fe96e' +export const IBCHFUSDC_POOL_ADDRESS = '0x6df0d77f0496ce44e72d695943950d8641fca5cf' +export const IBCHFUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBCHFUSDC_CONVEX_GAUGE_ADDRESS = '0x9BEc26bDd9702F4e0e4de853dd65Ec75F90b1F2e' +export const IBCHFUSDC_CONVEX_PID = 85 + +// ibEUR + USDC +export const IBEURUSDC_ORACLE = '0x00e5c0774A5F065c285068170b20393925C84BF3' +export const IBEURUSDC_ADDRESS = '0x8682Fbf0CbF312C891532BA9F1A91e44f81ad7DF' +export const IBEURUSDC_GAUGE_ADDRESS = '0xE1D520B1263D6Be5678568BD699c84F7f9086023' +export const IBEURUSDC_POOL_ADDRESS = '0x1570af3df649fc74872c5b8f280a162a3bdd4eb6' +export const IBEURUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBEURUSDC_CONVEX_GAUGE_ADDRESS = '0xAab7202D93B5633eB7FB3b80873C817B240F6F44' +export const IBEURUSDC_CONVEX_PID = 86 + +// ibGBP + USDC +export const IBGBPUSDC_ORACLE = '0xecaB2C76f1A8359A06fAB5fA0CEea51280A97eCF' +export const IBGBPUSDC_ADDRESS = '0x22CF19EB64226e0E1A79c69b345b31466fD273A7' +export const IBGBPUSDC_GAUGE_ADDRESS = '0x1Ba86c33509013c937344f6e231DA2E63ea45197' +export const IBGBPUSDC_POOL_ADDRESS = '0xacce4fe9ce2a6fe9af83e7cf321a3ff7675e0ab6' +export const IBGBPUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBGBPUSDC_CONVEX_GAUGE_ADDRESS = '0x8C87E32000ADD1a7D7D69a1AE180C415AF769361' +export const IBGBPUSDC_CONVEX_PID = 87 + +// ibJPY + USDC +export const IBJPYUSDC_ORACLE = '0x215F34af6557A6598DbdA9aa11cc556F5AE264B1' +export const IBJPYUSDC_ADDRESS = '0x127091edE112aEd7Bae281747771b3150Bb047bB' +export const IBJPYUSDC_GAUGE_ADDRESS = '0x3A748A2F4765BDFB119Cb7143b884Db7594a68c3' +export const IBJPYUSDC_POOL_ADDRESS = '0xEB0265938c1190Ab4E3E1f6583bC956dF47C0F93' +export const IBJPYUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBJPYUSDC_CONVEX_GAUGE_ADDRESS = '0x58563C872c791196d0eA17c4E53e77fa1d381D4c' +export const IBJPYUSDC_CONVEX_PID = 88 + +// ibKRW + USDC +export const IBKRWUSDC_ORACLE = '0x3c9f5385c288cE438Ed55620938A4B967c080101' +export const IBKRWUSDC_ADDRESS = '0x80CAcCdBD3f07BbdB558DB4a9e146D099933D677' +export const IBKRWUSDC_GAUGE_ADDRESS = '0xb6d7C2bda5a907832d4556AE5f7bA800FF084C2a' +export const IBKRWUSDC_POOL_ADDRESS = '0xef04f337fcb2ea220b6e8db5edbe2d774837581c' +export const IBKRWUSDC_YEARN_GAUGE_ADDRESS = '' +export const IBKRWUSDC_CONVEX_GAUGE_ADDRESS = '0x1900249c7a90D27b246032792004FF0E092Ac2cE' +export const IBKRWUSDC_CONVEX_PID = 89 + export const IBEUR_ADDRESS = '0x96E61422b6A9bA0e068B6c5ADd4fFaBC6a4aae27' // -> EUR export const IBEUR_GAUGE_ADDRESS = '0x99fb76F75501039089AAC8f20f487bf84E51d76F' // -> EUR Gauge export const IBEUR_POOL_ADDRESS = '0x19b080FE1ffA0553469D20Ca36219F17Fcf03859' // -> EUR Pool diff --git a/stores/fixedForexStore.js b/stores/fixedForexStore.js index d52e24e..d657735 100644 --- a/stores/fixedForexStore.js +++ b/stores/fixedForexStore.js @@ -1,10 +1,56 @@ -import async from "async"; import { MAX_UINT256, ZERO_ADDRESS, CURVE_FI_STATS_API, - FF_FEE_DISTRIBUTION_LOOKUP_ADDRESS, - FF_MULTICALL_ADDRESS, + KP3RETH_ORACLE, + KP3RETH_ADDRESS, + KP3RETH_GAUGE_ADDRESS, + KP3RETH_POOL_ADDRESS, + KP3RETH_YEARN_GAUGE_ADDRESS, + KP3RETH_CONVEX_GAUGE_ADDRESS, + KP3RETH_CONVEX_PID, + IBAUDUSDC_ORACLE, + IBAUDUSDC_ADDRESS, + IBAUDUSDC_GAUGE_ADDRESS, + IBAUDUSDC_POOL_ADDRESS, + IBAUDUSDC_YEARN_GAUGE_ADDRESS, + IBAUDUSDC_CONVEX_GAUGE_ADDRESS, + IBAUDUSDC_CONVEX_PID, + IBCHFUSDC_ORACLE, + IBCHFUSDC_ADDRESS, + IBCHFUSDC_GAUGE_ADDRESS, + IBCHFUSDC_POOL_ADDRESS, + IBCHFUSDC_YEARN_GAUGE_ADDRESS, + IBCHFUSDC_CONVEX_GAUGE_ADDRESS, + IBCHFUSDC_CONVEX_PID, + IBEURUSDC_ORACLE, + IBEURUSDC_ADDRESS, + IBEURUSDC_GAUGE_ADDRESS, + IBEURUSDC_POOL_ADDRESS, + IBEURUSDC_YEARN_GAUGE_ADDRESS, + IBEURUSDC_CONVEX_GAUGE_ADDRESS, + IBEURUSDC_CONVEX_PID, + IBGBPUSDC_ORACLE, + IBGBPUSDC_ADDRESS, + IBGBPUSDC_GAUGE_ADDRESS, + IBGBPUSDC_POOL_ADDRESS, + IBGBPUSDC_YEARN_GAUGE_ADDRESS, + IBGBPUSDC_CONVEX_GAUGE_ADDRESS, + IBGBPUSDC_CONVEX_PID, + IBJPYUSDC_ORACLE, + IBJPYUSDC_ADDRESS, + IBJPYUSDC_GAUGE_ADDRESS, + IBJPYUSDC_POOL_ADDRESS, + IBJPYUSDC_YEARN_GAUGE_ADDRESS, + IBJPYUSDC_CONVEX_GAUGE_ADDRESS, + IBJPYUSDC_CONVEX_PID, + IBKRWUSDC_ORACLE, + IBKRWUSDC_ADDRESS, + IBKRWUSDC_GAUGE_ADDRESS, + IBKRWUSDC_POOL_ADDRESS, + IBKRWUSDC_YEARN_GAUGE_ADDRESS, + IBKRWUSDC_CONVEX_GAUGE_ADDRESS, + IBKRWUSDC_CONVEX_PID, IBKRW_ADDRESS, IBKRW_GAUGE_ADDRESS, IBKRW_POOL_ADDRESS, @@ -17,14 +63,12 @@ import { IBEUR_CONVEX_GAUGE_ADDRESS, IBEUR_YEARN_GAUGE_ADDRESS, IBEUR_CONVEX_PID, - IBEUR_AG_ADDRESS, IBEUR_AG_GAUGE_ADDRESS, IBEUR_AG_POOL_ADDRESS, IBEUR_AG_CONVEX_GAUGE_ADDRESS, IBEUR_AG_YEARN_GAUGE_ADDRESS, IBEUR_AG_CONVEX_PID, - IBCHF_ADDRESS, IBCHF_GAUGE_ADDRESS, IBCHF_POOL_ADDRESS, @@ -53,11 +97,7 @@ import { IBFF_ADDRESS, VEIBFF_ADDRESS, FF_FAUCET_ADDRESS, - FF_DISTRIBUTION_ADDRESS, GAUGE_PROXY_ADDRESS, - FF_VEIBFF_DISTRIBUTION_ADDRESS, - FF_FEE_CLAIM_DISTRIBUTION_ADDRESS, - FF_BOOST_DELEGATE_ADDRESS, FF_KP3R_ADDRESS, FF_VEKP3R_ADDRESS, FF_VECLAIM_ADDRESS, @@ -72,7 +112,6 @@ import { CREAM_PRICE_ORACLE_ADDRESS, FF_STAKING_REWARDS_V3_ADDRESS, FF_UNSIWAP_POSITIONS_MANAGER_ADDRESS, - FF_CONVEX_CLAIM_ZAP, FF_CURVE_GAUGE_CONTROLLER, FF_CONVEX_POOL_MANAGEMENT_ADDRESS, @@ -90,7 +129,6 @@ import { CONFIGURE_FIXED_FOREX, FIXED_FOREX_CONFIGURED, GET_FIXED_FOREX_BALANCES, - FIXED_FOREX_BALANCES_RETURNED, FIXED_FOREX_CLAIM_VESTING_REWARD, FIXED_FOREX_VESTING_REWARD_CLAIMED, FIXED_FOREX_CLAIM_STAKING_REWARD, @@ -124,7 +162,6 @@ import { FIXED_FOREX_DEPOSIT_CURVE, FIXED_FOREX_CURVE_DEPOSITED, FIXED_FOREX_WITHDRAW_CURVE, - FIXED_FOREX_CURVE_WITHDRAWN, FIXED_FOREX_APPROVE_STAKE_CURVE, FIXED_FOREX_STAKE_CURVE_APPROVED, FIXED_FOREX_STAKE_CURVE, @@ -133,15 +170,12 @@ import { FIXED_FOREX_CURVE_UNSTAKED, FIXED_FOREX_APPROVE_STAKE_CONVEX, FIXED_FOREX_APPROVE_STAKE_YEARN, - FIXED_FOREX_STAKE_CONVEX_APPROVED, FIXED_FOREX_STAKE_YEARN_APPROVED, FIXED_FOREX_STAKE_CONVEX, FIXED_FOREX_STAKE_YEARN, - FIXED_FOREX_CONVEX_STAKED, FIXED_FOREX_YEARN_STAKED, FIXED_FOREX_UNSTAKE_CONVEX, FIXED_FOREX_UNSTAKE_YEARN, - FIXED_FOREX_CONVEX_UNSTAKED, FIXED_FOREX_YEARN_UNSTAKED, FIXED_FOREX_CLAIM_DISTRIBUTION_REWARD, FIXED_FOREX_DISTRIBUTION_REWARD_CLAIMED, @@ -156,7 +190,6 @@ import { FIXED_FOREX_CLAIM_ALL, FIXED_FOREX_ALL_CLAIMED, FIXED_FOREX_CLAIM_CURVE_RKP3R_REWARDS, - FIXED_FOREX_CURVE_RKP3R_REWARD_CLAIMED, FIXED_FOREX_CLAIM_RKP3R, FIXED_FOREX_RKP3R_CLAIMED, FIXED_FOREX_REDEEM_OPTION, @@ -166,7 +199,6 @@ import { FIXED_FOREX_WITHDRAW_OLD, FIXED_FOREX_OLD_WITHDRAWN, FIXED_FOREX_APPROVE_DEPOSIT_UNI, - FIXED_FOREX_DEPOSIT_UNI_APPROVED, FIXED_FOREX_DEPOSIT_UNI, FIXED_FOREX_UNI_DEPOSITED, FIXED_FOREX_WITHDRAW_UNI, @@ -181,11 +213,10 @@ import { import { Pool, tickToPrice } from "@uniswap/v3-sdk"; import { Token } from "@uniswap/sdk-core"; -import * as moment from "moment"; import stores from "./"; import abis from "./abis"; -import { bnDec, bnToFixed, multiplyBnToFixed, sumArray } from "../utils"; +import { bnToFixed, sumArray } from "../utils"; import BigNumber from "bignumber.js"; const fetch = require("node-fetch"); @@ -522,8 +553,213 @@ class Store { _getAssets = (web3) => { const assets = [ + { + address: KP3RETH_ADDRESS, + logoAddress: KP3RETH_ADDRESS, + symbolAlt: "WETH+KP3R", + symbol: "ETH+KP3R", + shouldUseNewABI: true, + decimals: 18, + name: "Curve kp3reth pool", + oracleAddress: KP3RETH_ORACLE, + gauge: { + address: KP3RETH_GAUGE_ADDRESS, + poolAddress: KP3RETH_POOL_ADDRESS, + }, + yearn: { + address: KP3RETH_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: KP3RETH_CONVEX_GAUGE_ADDRESS, + pid: KP3RETH_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBAUDUSDC_ADDRESS, + logoAddress: IBAUDUSDC_ADDRESS, + symbolAlt: "ibAUD+USDC", + symbol: "ibAUD", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibaudusdc pool", + oracleAddress: IBAUDUSDC_ORACLE, + gauge: { + address: IBAUDUSDC_GAUGE_ADDRESS, + poolAddress: IBAUDUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBAUDUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBAUDUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBAUDUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBCHFUSDC_ADDRESS, + logoAddress: IBCHFUSDC_ADDRESS, + symbolAlt: "ibCHF+USDC", + symbol: "ibCHF", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibchfusdc pool", + oracleAddress: IBCHFUSDC_ORACLE, + gauge: { + address: IBCHFUSDC_GAUGE_ADDRESS, + poolAddress: IBCHFUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBCHFUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBCHFUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBCHFUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBEURUSDC_ADDRESS, + logoAddress: IBEURUSDC_ADDRESS, + symbolAlt: "ibEUR+USDC", + symbol: "ibEUR", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibeurusdc pool", + oracleAddress: IBEURUSDC_ORACLE, + gauge: { + address: IBEURUSDC_GAUGE_ADDRESS, + poolAddress: IBEURUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBEURUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBEURUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBEURUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBGBPUSDC_ADDRESS, + logoAddress: IBGBPUSDC_ADDRESS, + symbolAlt: "ibGBP+USDC", + symbol: "ibGBP", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibgbpusdc pool", + oracleAddress: IBGBPUSDC_ORACLE, + gauge: { + address: IBGBPUSDC_GAUGE_ADDRESS, + poolAddress: IBGBPUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBGBPUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBGBPUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBGBPUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBJPYUSDC_ADDRESS, + logoAddress: IBJPYUSDC_ADDRESS, + symbolAlt: "ibJPY+USDC", + symbol: "ibJPY", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibjpyusdc pool", + oracleAddress: IBJPYUSDC_ORACLE, + gauge: { + address: IBJPYUSDC_GAUGE_ADDRESS, + poolAddress: IBJPYUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBJPYUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBJPYUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBJPYUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, + { + address: IBKRWUSDC_ADDRESS, + logoAddress: IBKRWUSDC_ADDRESS, + symbolAlt: "ibKRW+USDC", + symbol: "ibKRW", + shouldUseNewABI: true, + decimals: 18, + name: "Curve ibkrwusdc pool", + oracleAddress: IBKRWUSDC_ORACLE, + gauge: { + address: IBKRWUSDC_GAUGE_ADDRESS, + poolAddress: IBKRWUSDC_POOL_ADDRESS, + }, + yearn: { + address: IBKRWUSDC_YEARN_GAUGE_ADDRESS, + }, + convex: { + address: IBKRWUSDC_CONVEX_GAUGE_ADDRESS, + pid: IBKRWUSDC_CONVEX_PID, + rewards: [{ + poolAddress: "0x21034ccc4f8D07d0cF8998Fdd4c45e426540dEc1", //rKP3R Reward Pool + address: FF_RKP3R_ADDRESS, + decimals: 18, + symbol: "rKP3R", + name: "Redeemable Keep3r", + }, + ], + }, + }, { address: IBEUR_ADDRESS, + logoAddress: IBEUR_POOL_ADDRESS, + symbolAlt: "ibEUR+sEUR", symbol: "ibEUR", decimals: 18, name: "Iron Bank EUR", @@ -551,6 +787,8 @@ class Store { }, { address: IBKRW_ADDRESS, + logoAddress: IBKRW_POOL_ADDRESS, + symbolAlt: "ibKRW+sKRW", symbol: "ibKRW", decimals: 18, name: "Iron Bank KRW", @@ -578,6 +816,8 @@ class Store { }, { address: IBGBP_ADDRESS, + logoAddress: IBGBP_POOL_ADDRESS, + symbolAlt: "ibGBP+sGBP", symbol: "ibGBP", decimals: 18, name: "Iron Bank GBP", @@ -605,6 +845,8 @@ class Store { }, { address: IBCHF_ADDRESS, + logoAddress: IBCHF_POOL_ADDRESS, + symbolAlt: "ibCHF+sCHF", symbol: "ibCHF", decimals: 18, name: "Iron Bank CHF", @@ -632,6 +874,8 @@ class Store { }, { address: IBAUD_ADDRESS, + logoAddress: IBAUD_POOL_ADDRESS, + symbolAlt: "ibAUD+sAUD", symbol: "ibAUD", decimals: 18, name: "Iron Bank AUD", @@ -659,6 +903,8 @@ class Store { }, { address: IBJPY_ADDRESS, + logoAddress: IBJPY_POOL_ADDRESS, + symbolAlt: "ibJPY+sJPY", symbol: "ibJPY", decimals: 18, name: "Iron Bank JPY", @@ -686,6 +932,8 @@ class Store { }, { address: IBEUR_AG_ADDRESS, + logoAddress: IBEUR_POOL_ADDRESS, + symbolAlt: "ibEUR+agEUR", symbol: "ibEUR", decimals: 18, name: "Iron Bank EUR", @@ -913,9 +1161,7 @@ class Store { try { const gaugeProxyContract = new web3.eth.Contract(abis.gaugeProxyABI, GAUGE_PROXY_ADDRESS); const priceOracleContract = new web3.eth.Contract(abis.creamPriceOracleABI, CREAM_PRICE_ORACLE_ADDRESS); - const [totalGaugeVotes] = await Promise.all([gaugeProxyContract.methods.totalWeight().call()]); - const convexCVXContract = new web3.eth.Contract(abis.convexCVXABI, FF_CVX_ADDRESS); const [convexReductionPerCliff, convexTotalSupply, convexMaxSupply, convexTotalCliffs] = await Promise.all([ convexCVXContract.methods.reductionPerCliff().call(), @@ -925,19 +1171,16 @@ class Store { ]); let gaugeControllerContract = new web3.eth.Contract(abis.curveGaugeControllerABI, FF_CURVE_GAUGE_CONTROLLER); - let curveFiBaseAPY = []; try { const url = `${CURVE_FI_STATS_API}api/getFactoryAPYs?version=2`; const apysResult = await fetch(url); const apysJSON = await apysResult.json(); curveFiBaseAPY = apysJSON.data.poolDetails.filter((pool) => { - return [IBGBP_POOL_ADDRESS, IBJPY_POOL_ADDRESS, IBKRW_POOL_ADDRESS, IBAUD_POOL_ADDRESS, IBCHF_POOL_ADDRESS, IBEUR_POOL_ADDRESS, IBEUR_AG_POOL_ADDRESS].includes( - pool.poolAddress, - ); + return [IBAUDUSDC_POOL_ADDRESS, IBCHFUSDC_POOL_ADDRESS, IBEURUSDC_POOL_ADDRESS, IBGBPUSDC_POOL_ADDRESS, IBJPYUSDC_POOL_ADDRESS, IBKRWUSDC_POOL_ADDRESS, IBGBP_POOL_ADDRESS, IBJPY_POOL_ADDRESS, IBKRW_POOL_ADDRESS, IBAUD_POOL_ADDRESS, IBCHF_POOL_ADDRESS, IBEUR_POOL_ADDRESS, IBEUR_AG_POOL_ADDRESS].includes(pool.poolAddress); }); } catch (ex) { - console.log(ex); + console.warn(ex); } let yearnNetworkAPY = []; try { @@ -956,11 +1199,11 @@ class Store { ].includes(vault.address); }); } catch (ex) { - console.log(ex); + console.warn(ex); } + const assetsBalances = await Promise.all( assets.map(async (asset) => { - let balanceOf, userGaugeBalance, userGaugeEarned, @@ -999,66 +1242,132 @@ class Store { coin1, convexRewardCallsResponse, swapAllowanceV2, - swapAllowanceV3 + swapAllowanceV3, + poolBalances0, + poolBalances1 + + poolBalances = [] + let _poolContract = new web3.eth.Contract(abis.poolABI, asset.gauge.poolAddress); + if (asset.shouldUseNewABI) { + const assetContract = new web3.eth.Contract(abis.erc20ABI, asset.address); + const gaugeContract = new web3.eth.Contract(abis.ibsmtusdc, asset.gauge.address); + const poolContract = new web3.eth.Contract(abis.ibsmtusdcPool, asset.gauge.poolAddress); + const tokenContract = new web3.eth.Contract(abis.erc20ABI, asset.address); + _poolContract = tokenContract; - const assetContract = new web3.eth.Contract(abis.erc20ABI, asset.address); - const gaugeContract = new web3.eth.Contract(abis.gaugeABI, asset.gauge.address); - const poolContract = new web3.eth.Contract(abis.poolABI, asset.gauge.poolAddress); + [ + balanceOf, + userGaugeBalance, + userGaugeEarned, + userRKP3REarned, + poolBalances0, + poolBalances1, + userPoolBalance, + poolSymbol, + virtualPrice, + poolGaugeAllowance, + coins0, + coins1, + gaugeVotes, + userGaugeVotes, + price, + curveInflationRate, + curveWorkingSupply, + curveGaugeWeight, + curveTotalWeight, + curveRewardData, + swapAllowanceV2, + swapAllowanceV3 + ] = await Promise.all([ + assetContract.methods.balanceOf(account.address).call(), + gaugeContract.methods.balanceOf(account.address).call(), + + // gaugeContract.methods.claimable_tokens(account.address).call(), + gaugeContract.methods.claimable_reward(account.address, FF_RKP3R_ADDRESS).call(), + + gaugeContract.methods.claimable_reward(account.address, FF_RKP3R_ADDRESS).call(), + poolContract.methods.balances(0).call(), + poolContract.methods.balances(1).call(), + tokenContract.methods.balanceOf(account.address).call(), + tokenContract.methods.symbol().call(), + poolContract.methods.get_virtual_price().call(), + tokenContract.methods.allowance(account.address, asset.gauge.address).call(), + poolContract.methods.coins(0).call(), + poolContract.methods.coins(1).call(), + gaugeProxyContract.methods.weights(asset.gauge.poolAddress).call(), + gaugeProxyContract.methods.votes(account.address, asset.gauge.poolAddress).call(), + priceOracleContract.methods.getUnderlyingPrice(asset.oracleAddress).call(), + gaugeContract.methods.inflation_rate().call(), + gaugeContract.methods.working_supply().call(), + gaugeControllerContract.methods.get_gauge_weight(asset.gauge.address).call(), + gaugeControllerContract.methods.get_total_weight().call(), + gaugeContract.methods.reward_data(FF_RKP3R_ADDRESS).call(), + assetContract.methods.allowance(account.address, FF_IBAMM_V2_ADDRESS).call(), + assetContract.methods.allowance(account.address, FF_IBAMM_V3_ADDRESS).call(), + ]); + poolBalances[0] = poolBalances0 + poolBalances[1] = poolBalances1 + if (asset.address === KP3RETH_ADDRESS) { + price = 0 + } + } else { + const assetContract = new web3.eth.Contract(abis.erc20ABI, asset.address); + const gaugeContract = new web3.eth.Contract(abis.gaugeABI, asset.gauge.address); + const poolContract = new web3.eth.Contract(abis.poolABI, asset.gauge.poolAddress); - [ - balanceOf, - userGaugeBalance, - userGaugeEarned, - userRKP3REarned, - poolBalances, - userPoolBalance, - poolSymbol, - virtualPrice, - poolGaugeAllowance, - coins0, - coins1, - gaugeVotes, - userGaugeVotes, - price, - curveInflationRate, - curveWorkingSupply, - curveGaugeWeight, - curveTotalWeight, - curveRewardData, - swapAllowanceV2, - swapAllowanceV3 - ] = await Promise.all([ - assetContract.methods.balanceOf(account.address).call(), - gaugeContract.methods.balanceOf(account.address).call(), - gaugeContract.methods.claimable_tokens(account.address).call(), - gaugeContract.methods.claimable_reward(account.address, FF_RKP3R_ADDRESS).call(), - poolContract.methods.get_balances().call(), - poolContract.methods.balanceOf(account.address).call(), - poolContract.methods.symbol().call(), - poolContract.methods.get_virtual_price().call(), - poolContract.methods.allowance(account.address, asset.gauge.address).call(), - poolContract.methods.coins(0).call(), - poolContract.methods.coins(1).call(), - gaugeProxyContract.methods.weights(asset.gauge.poolAddress).call(), - gaugeProxyContract.methods.votes(account.address, asset.gauge.poolAddress).call(), - priceOracleContract.methods.getUnderlyingPrice(asset.oracleAddress).call(), - gaugeContract.methods.inflation_rate().call(), - gaugeContract.methods.working_supply().call(), - gaugeControllerContract.methods.get_gauge_weight(asset.gauge.address).call(), - gaugeControllerContract.methods.get_total_weight().call(), - gaugeContract.methods.reward_data(FF_RKP3R_ADDRESS).call(), - assetContract.methods.allowance(account.address, FF_IBAMM_V2_ADDRESS).call(), - assetContract.methods.allowance(account.address, FF_IBAMM_V3_ADDRESS).call(), - ]); + [ + balanceOf, + userGaugeBalance, + userGaugeEarned, + userRKP3REarned, + poolBalances, + userPoolBalance, + poolSymbol, + virtualPrice, + poolGaugeAllowance, + coins0, + coins1, + gaugeVotes, + userGaugeVotes, + price, + curveInflationRate, + curveWorkingSupply, + curveGaugeWeight, + curveTotalWeight, + curveRewardData, + swapAllowanceV2, + swapAllowanceV3 + ] = await Promise.all([ + assetContract.methods.balanceOf(account.address).call(), + gaugeContract.methods.balanceOf(account.address).call(), + gaugeContract.methods.claimable_tokens(account.address).call(), + gaugeContract.methods.claimable_reward(account.address, FF_RKP3R_ADDRESS).call(), + poolContract.methods.get_balances().call(), + poolContract.methods.balanceOf(account.address).call(), + poolContract.methods.symbol().call(), + poolContract.methods.get_virtual_price().call(), + poolContract.methods.allowance(account.address, asset.gauge.address).call(), + poolContract.methods.coins(0).call(), + poolContract.methods.coins(1).call(), + gaugeProxyContract.methods.weights(asset.gauge.poolAddress).call(), + gaugeProxyContract.methods.votes(account.address, asset.gauge.poolAddress).call(), + priceOracleContract.methods.getUnderlyingPrice(asset.oracleAddress).call(), + gaugeContract.methods.inflation_rate().call(), + gaugeContract.methods.working_supply().call(), + gaugeControllerContract.methods.get_gauge_weight(asset.gauge.address).call(), + gaugeControllerContract.methods.get_total_weight().call(), + gaugeContract.methods.reward_data(FF_RKP3R_ADDRESS).call(), + assetContract.methods.allowance(account.address, FF_IBAMM_V2_ADDRESS).call(), + assetContract.methods.allowance(account.address, FF_IBAMM_V3_ADDRESS).call(), + ]); + } // get coin asset info const coin0Contract = new web3.eth.Contract(abis.erc20ABI, coins0); const coin1Contract = new web3.eth.Contract(abis.erc20ABI, coins1); - - [coin0Symbol, coin0Decimals, coin0Balance, coin0GaugeAllowance, coin1Symbol, coin1Decimals, coin1Balance, coin1GaugeAllowance] = - await Promise.all([ + [coin0Symbol, coin0Decimals, coin0Balance, coin0GaugeAllowance, coin1Symbol, coin1Decimals, coin1Balance, coin1GaugeAllowance] = await Promise.all([ coin0Contract.methods.symbol().call(), coin0Contract.methods.decimals().call(), coin0Contract.methods.balanceOf(account.address).call(), @@ -1068,11 +1377,10 @@ class Store { coin1Contract.methods.decimals().call(), coin1Contract.methods.balanceOf(account.address).call(), coin1Contract.methods.allowance(account.address, asset.gauge.poolAddress).call(), - ]); + ]); let intCoin0Decimasls = parseInt(coin0Decimals); let intCoin1Decimasls = parseInt(coin1Decimals); - coin0 = { address: coins0, symbol: coin0Symbol, @@ -1081,7 +1389,6 @@ class Store { poolBalance: BigNumber(poolBalances[0]).div(10 ** intCoin0Decimasls).toFixed(intCoin0Decimasls), gaugeAllowance: BigNumber(coin0GaugeAllowance).div(10 ** intCoin0Decimasls).toFixed(intCoin0Decimasls), }; - coin1 = { address: coins1, symbol: coin1Symbol, @@ -1091,37 +1398,26 @@ class Store { gaugeAllowance: BigNumber(coin1GaugeAllowance).div(10 ** intCoin1Decimasls).toFixed(intCoin1Decimasls), }; - if(asset.convex.address && asset.convex.address !== '') { + if (asset.convex.address && asset.convex.address !== '') { const convexGaugeContract = new web3.eth.Contract(abis.convexBaseRewardPoolABI, asset.convex.address); - - [ - convexBalanceOf, - convexEarned, - poolConvexAllowance, - ] = await Promise.all([ + [convexBalanceOf, convexEarned, poolConvexAllowance] = await Promise.all([ convexGaugeContract.methods.balanceOf(account.address).call(), convexGaugeContract.methods.earned(account.address).call(), - poolContract.methods.allowance(account.address, FF_CONVEX_POOL_MANAGEMENT_ADDRESS).call(), + _poolContract.methods.allowance(account.address, FF_CONVEX_POOL_MANAGEMENT_ADDRESS).call(), ]); const convexRewardContract = new web3.eth.Contract(abis.convexVirtualBalanceRewardPoolABI, asset.convex.rewards[0].poolAddress); convexRewardCallsResponse = await convexRewardContract.methods.earned(account.address).call(); } - - if(asset.yearn.address && asset.yearn.address !== '') { + if (asset.yearn.address && asset.yearn.address !== '') { const yearnVaultContract = new web3.eth.Contract(abis.yearnVaultABI, asset.yearn.address); - [ - userVaultBalance, - yearnPoolSymbol, - yearnBalanceOf, - poolYearnAllowance, - ] = await Promise.all([ + [userVaultBalance, yearnPoolSymbol, yearnBalanceOf, poolYearnAllowance,] = await Promise.all([ yearnVaultContract.methods.balanceOf(account.address).call(), yearnVaultContract.methods.symbol().call(), yearnVaultContract.methods.balanceOf(account.address).call(), - poolContract.methods.allowance(account.address, asset.yearn.address).call(), + _poolContract.methods.allowance(account.address, asset.yearn.address).call(), ]); } @@ -1276,7 +1572,7 @@ class Store { this.setStore({ assets }); this.emitter.emit(FIXED_FOREX_UPDATED); } catch (ex) { - console.log(ex); + console.error(ex); } };