@raac/rpc 1.0.2-beta.3 → 1.0.2-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{RPCLibrary.ts → RPCLibrary.js} +7 -121
- package/artifacts/core/collectors/FeeCollector.sol/FeeCollector.dbg.json +4 -0
- package/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +1743 -0
- package/artifacts/core/collectors/Treasury.sol/Treasury.dbg.json +4 -0
- package/artifacts/core/collectors/Treasury.sol/Treasury.json +481 -0
- package/artifacts/core/governance/boost/BoostController.sol/BoostController.dbg.json +4 -0
- package/artifacts/core/governance/boost/BoostController.sol/BoostController.json +905 -0
- package/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.dbg.json +4 -0
- package/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +1398 -0
- package/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.dbg.json +4 -0
- package/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +1435 -0
- package/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.dbg.json +4 -0
- package/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +1471 -0
- package/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.dbg.json +4 -0
- package/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +1471 -0
- package/artifacts/core/governance/proposals/Governance.sol/Governance.dbg.json +4 -0
- package/artifacts/core/governance/proposals/Governance.sol/Governance.json +1242 -0
- package/artifacts/core/governance/proposals/TimelockController.sol/TimelockController.dbg.json +4 -0
- package/artifacts/core/governance/proposals/TimelockController.sol/TimelockController.json +988 -0
- package/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.dbg.json +4 -0
- package/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json +1443 -0
- package/artifacts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.sol/RAACReleaseOrchestrator.dbg.json +4 -0
- package/artifacts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.sol/RAACReleaseOrchestrator.json +860 -0
- package/artifacts/core/oracles/BaseChainlinkFunctionsOracle.sol/BaseChainlinkFunctionsOracle.dbg.json +4 -0
- package/artifacts/core/oracles/BaseChainlinkFunctionsOracle.sol/BaseChainlinkFunctionsOracle.json +264 -0
- package/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.dbg.json +4 -0
- package/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json +279 -0
- package/artifacts/core/oracles/RAACHousePriceOracle.sol/RAACHousePriceOracle.dbg.json +4 -0
- package/artifacts/core/oracles/RAACHousePriceOracle.sol/RAACHousePriceOracle.json +335 -0
- package/artifacts/core/oracles/RAACPrimeRateOracle.sol/RAACPrimeRateOracle.dbg.json +4 -0
- package/artifacts/core/oracles/RAACPrimeRateOracle.sol/RAACPrimeRateOracle.json +350 -0
- package/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.dbg.json +4 -0
- package/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +2760 -0
- package/artifacts/core/pools/StabilityPool/NFTLiquidator.sol/NFTLiquidator.dbg.json +4 -0
- package/artifacts/core/pools/StabilityPool/NFTLiquidator.sol/NFTLiquidator.json +485 -0
- package/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.dbg.json +4 -0
- package/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +1146 -0
- package/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.dbg.json +4 -0
- package/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json +285 -0
- package/artifacts/core/tokens/DEToken.sol/DEToken.dbg.json +4 -0
- package/artifacts/core/tokens/DEToken.sol/DEToken.json +858 -0
- package/artifacts/core/tokens/DebtToken.sol/DebtToken.dbg.json +4 -0
- package/artifacts/core/tokens/DebtToken.sol/DebtToken.json +953 -0
- package/artifacts/core/tokens/IndexToken.sol/IndexToken.dbg.json +4 -0
- package/artifacts/core/tokens/IndexToken.sol/IndexToken.json +770 -0
- package/artifacts/core/tokens/LPToken.sol/LPToken.dbg.json +4 -0
- package/artifacts/core/tokens/LPToken.sol/LPToken.json +507 -0
- package/artifacts/core/tokens/RAACNFT.sol/RAACNFT.dbg.json +4 -0
- package/artifacts/core/tokens/RAACNFT.sol/RAACNFT.json +1472 -0
- package/artifacts/core/tokens/RAACToken.sol/RAACToken.dbg.json +4 -0
- package/artifacts/core/tokens/RAACToken.sol/RAACToken.json +832 -0
- package/artifacts/core/tokens/RToken.sol/RToken.dbg.json +4 -0
- package/artifacts/core/tokens/RToken.sol/RToken.json +1205 -0
- package/artifacts/core/tokens/veRAACToken.sol/veRAACToken.dbg.json +4 -0
- package/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +1616 -0
- package/artifacts/interfaces/IERC20.sol/IERC20.dbg.json +4 -0
- package/artifacts/interfaces/IERC20.sol/IERC20.json +194 -0
- package/artifacts/interfaces/IHousePrices.sol/IHousePrices.dbg.json +4 -0
- package/artifacts/interfaces/IHousePrices.sol/IHousePrices.json +30 -0
- package/artifacts/interfaces/INFTLiquidator.sol/INFTLiquidator.dbg.json +4 -0
- package/artifacts/interfaces/INFTLiquidator.sol/INFTLiquidator.json +86 -0
- package/artifacts/interfaces/IPoolManager.sol/IPoolManager.dbg.json +4 -0
- package/artifacts/interfaces/IPoolManager.sol/IPoolManager.json +57 -0
- package/artifacts/interfaces/IReserveAllocationLibraryMock.sol/IReserveAllocationLibraryMock.dbg.json +4 -0
- package/artifacts/interfaces/IReserveAllocationLibraryMock.sol/IReserveAllocationLibraryMock.json +246 -0
- package/artifacts/interfaces/IUSDC.sol/IUSDC.dbg.json +4 -0
- package/artifacts/interfaces/IUSDC.sol/IUSDC.json +194 -0
- package/artifacts/interfaces/IveRAACDistributor.sol/IveRAACDistributor.dbg.json +4 -0
- package/artifacts/interfaces/IveRAACDistributor.sol/IveRAACDistributor.json +100 -0
- package/artifacts/interfaces/core/collectors/IBaseCollector.sol/IBaseCollector.dbg.json +4 -0
- package/artifacts/interfaces/core/collectors/IBaseCollector.sol/IBaseCollector.json +45 -0
- package/artifacts/interfaces/core/collectors/IFeeCollector.sol/IFeeCollector.dbg.json +4 -0
- package/artifacts/interfaces/core/collectors/IFeeCollector.sol/IFeeCollector.json +922 -0
- package/artifacts/interfaces/core/collectors/ITreasury.sol/ITreasury.dbg.json +4 -0
- package/artifacts/interfaces/core/collectors/ITreasury.sol/ITreasury.json +214 -0
- package/artifacts/interfaces/core/governance/IBoostController.sol/IBoostController.dbg.json +4 -0
- package/artifacts/interfaces/core/governance/IBoostController.sol/IBoostController.json +378 -0
- package/artifacts/interfaces/core/governance/gauges/IGauge.sol/IGauge.dbg.json +4 -0
- package/artifacts/interfaces/core/governance/gauges/IGauge.sol/IGauge.json +394 -0
- package/artifacts/interfaces/core/governance/gauges/IGaugeController.sol/IGaugeController.dbg.json +4 -0
- package/artifacts/interfaces/core/governance/gauges/IGaugeController.sol/IGaugeController.json +577 -0
- package/artifacts/interfaces/core/governance/proposals/IGovernance.sol/IGovernance.dbg.json +4 -0
- package/artifacts/interfaces/core/governance/proposals/IGovernance.sol/IGovernance.json +1134 -0
- package/artifacts/interfaces/core/governance/proposals/ITimelockController.sol/ITimelockController.dbg.json +4 -0
- package/artifacts/interfaces/core/governance/proposals/ITimelockController.sol/ITimelockController.json +612 -0
- package/artifacts/interfaces/core/minters/RAACMinter/IRAACMinter.sol/IRAACMinter.dbg.json +4 -0
- package/artifacts/interfaces/core/minters/RAACMinter/IRAACMinter.sol/IRAACMinter.json +542 -0
- package/artifacts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator.sol/IReleaseOrchestrator.dbg.json +4 -0
- package/artifacts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator.sol/IReleaseOrchestrator.json +358 -0
- package/artifacts/interfaces/core/oracles/IBaseVRFv2Consumer.sol/IBaseVRFv2Consumer.dbg.json +4 -0
- package/artifacts/interfaces/core/oracles/IBaseVRFv2Consumer.sol/IBaseVRFv2Consumer.json +102 -0
- package/artifacts/interfaces/core/oracles/IRAACHousePrices.sol/IRAACHousePrices.dbg.json +4 -0
- package/artifacts/interfaces/core/oracles/IRAACHousePrices.sol/IRAACHousePrices.json +193 -0
- package/artifacts/interfaces/core/pools/ILiquidityPool.sol/ILiquidityPool.dbg.json +4 -0
- package/artifacts/interfaces/core/pools/ILiquidityPool.sol/ILiquidityPool.json +310 -0
- package/artifacts/interfaces/core/pools/LendingPool/ILendingPool.sol/ILendingPool.dbg.json +4 -0
- package/artifacts/interfaces/core/pools/LendingPool/ILendingPool.sol/ILendingPool.json +1500 -0
- package/artifacts/interfaces/core/pools/StabilityPool/IStabilityPool.sol/IStabilityPool.dbg.json +4 -0
- package/artifacts/interfaces/core/pools/StabilityPool/IStabilityPool.sol/IStabilityPool.json +622 -0
- package/artifacts/interfaces/core/tokens/IDEToken.sol/IDEToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IDEToken.sol/IDEToken.json +333 -0
- package/artifacts/interfaces/core/tokens/IDebtToken.sol/IDebtToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IDebtToken.sol/IDebtToken.json +507 -0
- package/artifacts/interfaces/core/tokens/IIndexToken.sol/IIndexToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IIndexToken.sol/IIndexToken.json +299 -0
- package/artifacts/interfaces/core/tokens/IRAACNFT.sol/IRAACNFT.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IRAACNFT.sol/IRAACNFT.json +816 -0
- package/artifacts/interfaces/core/tokens/IRAACToken.sol/IRAACToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IRAACToken.sol/IRAACToken.json +567 -0
- package/artifacts/interfaces/core/tokens/IRToken.sol/IRToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IRToken.sol/IRToken.json +641 -0
- package/artifacts/interfaces/core/tokens/IveRAACToken.sol/IveRAACToken.dbg.json +4 -0
- package/artifacts/interfaces/core/tokens/IveRAACToken.sol/IveRAACToken.json +560 -0
- package/artifacts/interfaces/core/vaults/IBaseVault.sol/IBaseVault.dbg.json +4 -0
- package/artifacts/interfaces/core/vaults/IBaseVault.sol/IBaseVault.json +185 -0
- package/artifacts/interfaces/curve/ICurveCrvUSDVault.sol/ICurveCrvUSDVault.dbg.json +4 -0
- package/artifacts/interfaces/curve/ICurveCrvUSDVault.sol/ICurveCrvUSDVault.json +250 -0
- package/artifacts/interfaces/zeno/IAuction.sol/IAuction.dbg.json +4 -0
- package/artifacts/interfaces/zeno/IAuction.sol/IAuction.json +162 -0
- package/artifacts/interfaces/zeno/IZENO.sol/IZENO.dbg.json +4 -0
- package/artifacts/interfaces/zeno/IZENO.sol/IZENO.json +321 -0
- package/artifacts/libraries/governance/BoostCalculator.sol/BoostCalculator.dbg.json +4 -0
- package/artifacts/libraries/governance/BoostCalculator.sol/BoostCalculator.json +51 -0
- package/artifacts/libraries/governance/Checkpoints.sol/Checkpoints.dbg.json +4 -0
- package/artifacts/libraries/governance/Checkpoints.sol/Checkpoints.json +69 -0
- package/artifacts/libraries/governance/LockManager.sol/LockManager.dbg.json +4 -0
- package/artifacts/libraries/governance/LockManager.sol/LockManager.json +123 -0
- package/artifacts/libraries/governance/PowerCheckpoint.sol/PowerCheckpoint.dbg.json +4 -0
- package/artifacts/libraries/governance/PowerCheckpoint.sol/PowerCheckpoint.json +70 -0
- package/artifacts/libraries/governance/RAACVoting.sol/RAACVoting.dbg.json +4 -0
- package/artifacts/libraries/governance/RAACVoting.sol/RAACVoting.json +102 -0
- package/artifacts/libraries/governance/VotingPowerLib.sol/VotingPowerLib.dbg.json +4 -0
- package/artifacts/libraries/governance/VotingPowerLib.sol/VotingPowerLib.json +76 -0
- package/artifacts/libraries/math/PercentageMath.sol/PercentageMath.dbg.json +4 -0
- package/artifacts/libraries/math/PercentageMath.sol/PercentageMath.json +10 -0
- package/artifacts/libraries/math/TimeWeightedAverage.sol/TimeWeightedAverage.dbg.json +4 -0
- package/artifacts/libraries/math/TimeWeightedAverage.sol/TimeWeightedAverage.json +142 -0
- package/artifacts/libraries/math/WadRayMath.sol/WadRayMath.dbg.json +4 -0
- package/artifacts/libraries/math/WadRayMath.sol/WadRayMath.json +10 -0
- package/artifacts/libraries/pools/DataTypes.sol/DataTypes.dbg.json +4 -0
- package/artifacts/libraries/pools/DataTypes.sol/DataTypes.json +10 -0
- package/artifacts/libraries/pools/ReserveLibrary.sol/ReserveLibrary.dbg.json +4 -0
- package/artifacts/libraries/pools/ReserveLibrary.sol/ReserveLibrary.json +153 -0
- package/artifacts/libraries/utils/StringUtils.sol/StringUtils.dbg.json +4 -0
- package/artifacts/libraries/utils/StringUtils.sol/StringUtils.json +16 -0
- package/artifacts/mocks/core/collectors/MockTreasury.sol/MockTreasury.dbg.json +4 -0
- package/artifacts/mocks/core/collectors/MockTreasury.sol/MockTreasury.json +255 -0
- package/artifacts/mocks/core/governance/gauges/MockBaseGauge.sol/MockBaseGauge.dbg.json +4 -0
- package/artifacts/mocks/core/governance/gauges/MockBaseGauge.sol/MockBaseGauge.json +1522 -0
- package/artifacts/mocks/core/governance/gauges/MockGaugeController.sol/MockGaugeController.dbg.json +4 -0
- package/artifacts/mocks/core/governance/gauges/MockGaugeController.sol/MockGaugeController.json +49 -0
- package/artifacts/mocks/core/governance/proposals/TimelockTestTarget.sol/TimelockTestTarget.dbg.json +4 -0
- package/artifacts/mocks/core/governance/proposals/TimelockTestTarget.sol/TimelockTestTarget.json +112 -0
- package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/IFunctionsRouter.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/IFunctionsRouter.json +50 -0
- package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/MockFunctionsRouter.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/MockFunctionsRouter.json +69 -0
- package/artifacts/mocks/core/oracles/MockOracle.sol/MockOracle.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/MockOracle.sol/MockOracle.json +63 -0
- package/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json +774 -0
- package/artifacts/mocks/core/oracles/TestRAACHousePriceOracle.sol/TestRAACHousePriceOracle.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/TestRAACHousePriceOracle.sol/TestRAACHousePriceOracle.json +358 -0
- package/artifacts/mocks/core/oracles/TestRAACPrimeRateOracle.sol/TestRAACPrimeRateOracle.dbg.json +4 -0
- package/artifacts/mocks/core/oracles/TestRAACPrimeRateOracle.sol/TestRAACPrimeRateOracle.json +373 -0
- package/artifacts/mocks/core/pools/MockLendingPool.sol/MockLendingPool.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockLendingPool.sol/MockLendingPool.json +241 -0
- package/artifacts/mocks/core/pools/MockLendingPoolCollector.sol/MockLendingPoolCollector.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockLendingPoolCollector.sol/MockLendingPoolCollector.json +288 -0
- package/artifacts/mocks/core/pools/MockLendingPoolDebtToken.sol/MockLendingPoolDebtToken.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockLendingPoolDebtToken.sol/MockLendingPoolDebtToken.json +1522 -0
- package/artifacts/mocks/core/pools/MockLiquidityPool.sol/MockLiquidityPool.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockLiquidityPool.sol/MockLiquidityPool.json +1019 -0
- package/artifacts/mocks/core/pools/MockPool.sol/MockPool.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockPool.sol/MockPool.json +93 -0
- package/artifacts/mocks/core/pools/MockStabilityPool.sol/MockStabilityPool.dbg.json +4 -0
- package/artifacts/mocks/core/pools/MockStabilityPool.sol/MockStabilityPool.json +126 -0
- package/artifacts/mocks/core/primitives/MockContract.sol/MockContract.dbg.json +4 -0
- package/artifacts/mocks/core/primitives/MockContract.sol/MockContract.json +37 -0
- package/artifacts/mocks/core/primitives/MockContractWithConfig.sol/MockContractWithConfig.dbg.json +4 -0
- package/artifacts/mocks/core/primitives/MockContractWithConfig.sol/MockContractWithConfig.json +52 -0
- package/artifacts/mocks/core/primitives/MockDistributableContract.sol/MockDistributableContract.dbg.json +4 -0
- package/artifacts/mocks/core/primitives/MockDistributableContract.sol/MockDistributableContract.json +73 -0
- package/artifacts/mocks/core/primitives/RAACHousePricesMock.sol/RAACHousePricesMock.dbg.json +4 -0
- package/artifacts/mocks/core/primitives/RAACHousePricesMock.sol/RAACHousePricesMock.json +67 -0
- package/artifacts/mocks/core/tokens/ERC20Mock.sol/ERC20Mock.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/ERC20Mock.sol/ERC20Mock.json +353 -0
- package/artifacts/mocks/core/tokens/ERC721Mock.sol/ERC721Mock.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/ERC721Mock.sol/ERC721Mock.json +491 -0
- package/artifacts/mocks/core/tokens/MockCollectableUnderlying.sol/MockCollectableUnderlying.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/MockCollectableUnderlying.sol/MockCollectableUnderlying.json +568 -0
- package/artifacts/mocks/core/tokens/MockFeeCollectorToken.sol/MockFeeCollectorToken.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/MockFeeCollectorToken.sol/MockFeeCollectorToken.json +515 -0
- package/artifacts/mocks/core/tokens/MockToken.sol/MockToken.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/MockToken.sol/MockToken.json +426 -0
- package/artifacts/mocks/core/tokens/MockUSDC.sol/MockUSDC.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/MockUSDC.sol/MockUSDC.json +348 -0
- package/artifacts/mocks/core/tokens/MockVeToken.sol/MockVeToken.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/MockVeToken.sol/MockVeToken.json +905 -0
- package/artifacts/mocks/core/tokens/RAACMockERC20.sol/RAACMockERC20.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/RAACMockERC20.sol/RAACMockERC20.json +422 -0
- package/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.dbg.json +4 -0
- package/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.json +479 -0
- package/artifacts/mocks/core/vaults/MockVault.sol/MockVault.dbg.json +4 -0
- package/artifacts/mocks/core/vaults/MockVault.sol/MockVault.json +672 -0
- package/artifacts/mocks/libraries/MockStringUtils.sol/MockStringUtils.dbg.json +4 -0
- package/artifacts/mocks/libraries/MockStringUtils.sol/MockStringUtils.json +35 -0
- package/artifacts/mocks/libraries/governance/BoostCalculatorMock.sol/BoostCalculatorMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/BoostCalculatorMock.sol/BoostCalculatorMock.json +431 -0
- package/artifacts/mocks/libraries/governance/CheckpointsMock.sol/CheckpointsMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/CheckpointsMock.sol/CheckpointsMock.json +144 -0
- package/artifacts/mocks/libraries/governance/LockManagerMock.sol/LockManagerMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/LockManagerMock.sol/LockManagerMock.json +237 -0
- package/artifacts/mocks/libraries/governance/PowerCheckpointMock.sol/PowerCheckpointMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/PowerCheckpointMock.sol/PowerCheckpointMock.json +221 -0
- package/artifacts/mocks/libraries/governance/RAACVotingMock.sol/RAACVotingMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/RAACVotingMock.sol/RAACVotingMock.json +95 -0
- package/artifacts/mocks/libraries/governance/VotingPowerMock.sol/VotingPowerMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/governance/VotingPowerMock.sol/VotingPowerMock.json +442 -0
- package/artifacts/mocks/libraries/math/TimeWeightedAverageMock.sol/TimeWeightedAverageMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/math/TimeWeightedAverageMock.sol/TimeWeightedAverageMock.json +309 -0
- package/artifacts/mocks/libraries/math/WadRayMathMock.sol/WadRayMathMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/math/WadRayMathMock.sol/WadRayMathMock.json +188 -0
- package/artifacts/mocks/libraries/pools/ReserveLibraryMock.sol/ReserveLibraryMock.dbg.json +4 -0
- package/artifacts/mocks/libraries/pools/ReserveLibraryMock.sol/ReserveLibraryMock.json +339 -0
- package/artifacts/mocks/tests/MaliciousDeposit.sol/MaliciousDeposit.dbg.json +4 -0
- package/artifacts/mocks/tests/MaliciousDeposit.sol/MaliciousDeposit.json +52 -0
- package/artifacts/mocks/tests/MaliciousWithdraw.sol/MaliciousWithdraw.dbg.json +4 -0
- package/artifacts/mocks/tests/MaliciousWithdraw.sol/MaliciousWithdraw.json +52 -0
- package/artifacts/mocks/tests/VeRAACFuzzHelper.sol/VeRAACFuzzHelper.dbg.json +4 -0
- package/artifacts/mocks/tests/VeRAACFuzzHelper.sol/VeRAACFuzzHelper.json +88 -0
- package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/IVMTimeControl.dbg.json +4 -0
- package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/IVMTimeControl.json +24 -0
- package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/VotingPowerFuzzHelper.dbg.json +4 -0
- package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/VotingPowerFuzzHelper.json +129 -0
- package/artifacts/zeno/Auction.sol/Auction.dbg.json +4 -0
- package/artifacts/zeno/Auction.sol/Auction.json +393 -0
- package/artifacts/zeno/AuctionFactory.sol/AuctionFactory.dbg.json +4 -0
- package/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +307 -0
- package/artifacts/zeno/ZENO.sol/ZENO.dbg.json +4 -0
- package/artifacts/zeno/ZENO.sol/ZENO.json +620 -0
- package/artifacts/zeno/ZENOFactory.sol/ZENOFactory.dbg.json +4 -0
- package/artifacts/zeno/ZENOFactory.sol/ZENOFactory.json +275 -0
- package/assets/{getAsset.ts → getAsset.js} +6 -6
- package/assets/{getAssets.ts → getAssets.js} +2 -3
- package/assets/{getSupply.ts → getSupply.js} +5 -7
- package/configs/chains/index.js +13 -0
- package/configs/index.js +17 -0
- package/contracts/feeCollector/{claimRewardFromPool.ts → claimRewardFromPool.js} +4 -10
- package/contracts/{getContract.ts → getContract.js} +5 -6
- package/contracts/{getContractAddress.ts → getContractAddress.js} +4 -6
- package/contracts/housePrices/{getLatestPrice.ts → getLatestPrice.js} +6 -8
- package/contracts/housePrices/{setOracle.ts → setOracle.js} +6 -8
- package/contracts/indexToken/{getNextRandomNFT.ts → getNextRandomNFT.js} +5 -7
- package/contracts/indexToken/{redeemNFT.ts → redeemNFT.js} +5 -7
- package/contracts/zeno/{createAuction.ts → createAuction.js} +14 -16
- package/contracts/zeno/{createZeno.ts → createZeno.js} +8 -10
- package/contracts/zeno/{getAuctions.ts → getAuctions.js} +5 -7
- package/contracts/zeno/{getZenos.ts → getZenos.js} +5 -7
- package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +1743 -0
- package/dist/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json +1443 -0
- package/dist/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json +279 -0
- package/dist/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +2760 -0
- package/dist/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +1146 -0
- package/dist/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json +285 -0
- package/dist/artifacts/core/tokens/DEToken.sol/DEToken.json +858 -0
- package/dist/artifacts/core/tokens/IndexToken.sol/IndexToken.json +770 -0
- package/dist/artifacts/core/tokens/RAACNFT.sol/RAACNFT.json +1472 -0
- package/dist/artifacts/core/tokens/RAACToken.sol/RAACToken.json +832 -0
- package/dist/artifacts/core/tokens/RToken.sol/RToken.json +1205 -0
- package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +1616 -0
- package/dist/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json +774 -0
- package/dist/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.json +479 -0
- package/dist/artifacts/zeno/Auction.sol/Auction.json +393 -0
- package/dist/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +307 -0
- package/dist/artifacts/zeno/Zeno.sol/Zeno.json +620 -0
- package/dist/artifacts/zeno/ZenoFactory.sol/ZenoFactory.json +275 -0
- package/methods/commons/{checkAllowance.ts → checkAllowance.js} +10 -12
- package/methods/commons/{estimateGasPrice.ts → estimateGasPrice.js} +5 -7
- package/minter/{get.ts → get.js} +6 -8
- package/minter/{getApy.ts → getApy.js} +5 -7
- package/minter/{tick.ts → tick.js} +5 -7
- package/nfts/{getAllTokens.ts → getAllTokens.js} +7 -9
- package/nfts/{getBaseUri.ts → getBaseUri.js} +5 -7
- package/nfts/{getHousePrice.ts → getHousePrice.js} +6 -8
- package/nfts/{getMintFeePercentage.ts → getMintFeePercentage.js} +4 -6
- package/nfts/{getMintPrice.ts → getMintPrice.js} +7 -9
- package/nfts/{getTokenURI.ts → getTokenURI.js} +7 -9
- package/nfts/{getTokensByOwner.ts → getTokensByOwner.js} +8 -10
- package/nfts/{getTotalPropertiesCount.ts → getTotalPropertiesCount.js} +5 -7
- package/nfts/{mint.ts → mint.js} +7 -9
- package/nfts/{setBaseUri.ts → setBaseUri.js} +4 -6
- package/nfts/{totalNFTSupply.ts → totalNFTSupply.js} +4 -6
- package/package.json +1 -1
- package/pools/lendingPool/{borrowFromLendingPool.ts → borrowFromLendingPool.js} +8 -10
- package/pools/lendingPool/{borrowFromLendingPoolWithInsurance.ts → borrowFromLendingPoolWithInsurance.js} +8 -10
- package/pools/lendingPool/{calculateInsuranceFee.ts → calculateInsuranceFee.js} +9 -11
- package/pools/lendingPool/{claimReward.ts → claimReward.js} +5 -7
- package/pools/lendingPool/{closeLiquidation.ts → closeLiquidation.js} +7 -9
- package/pools/lendingPool/{depositNFTToLendingPool.ts → depositNFTToLendingPool.js} +6 -8
- package/pools/lendingPool/{depositToLendingPool.ts → depositToLendingPool.js} +6 -8
- package/pools/lendingPool/{getAllUserData.ts → getAllUserData.js} +7 -14
- package/pools/lendingPool/{getEligibleUserDeposits.ts → getEligibleUserDeposits.js} +7 -9
- package/pools/lendingPool/{getHealthFactor.ts → getHealthFactor.js} +8 -10
- package/pools/lendingPool/{getHousePrice.ts → getHousePrice.js} +6 -8
- package/pools/lendingPool/{getLendingPoolInfo.ts → getLendingPoolInfo.js} +23 -31
- package/pools/lendingPool/{getLendingPoolTotalLiquidity.ts → getLendingPoolTotalLiquidity.js} +7 -10
- package/pools/lendingPool/{getPendingReward.ts → getPendingReward.js} +7 -9
- package/pools/lendingPool/{getPositionDebt.ts → getPositionDebt.js} +8 -10
- package/pools/lendingPool/{getPositionScaledDebt.ts → getPositionScaledDebt.js} +8 -10
- package/pools/lendingPool/{getPositionView.ts → getPositionView.js} +9 -11
- package/pools/lendingPool/{getPositionsScaledDebt.ts → getPositionsScaledDebt.js} +7 -9
- package/pools/lendingPool/{getRawUserDepositsInLendingPool.ts → getRawUserDepositsInLendingPool.js} +7 -9
- package/pools/lendingPool/{getUserCollateralValue.ts → getUserCollateralValue.js} +7 -9
- package/pools/lendingPool/{initializeLiquidation.ts → initializeLiquidation.js} +8 -10
- package/pools/lendingPool/{repayToLendingPool.ts → repayToLendingPool.js} +8 -10
- package/pools/lendingPool/{withdrawFromLendingPool.ts → withdrawFromLendingPool.js} +9 -10
- package/pools/lendingPool/{withdrawNFTFromLendingPool.ts → withdrawNFTFromLendingPool.js} +7 -9
- package/pools/stabilityPool/{calculateRAACRewards.ts → calculateRAACRewards.js} +6 -9
- package/pools/stabilityPool/configs/chains/index.js +17 -0
- package/pools/stabilityPool/configs/index.js +43 -0
- package/pools/stabilityPool/{depositNFTToStabilityPool.ts → depositNFTToStabilityPool.js} +6 -9
- package/pools/stabilityPool/{depositToStabilityPool.ts → depositToStabilityPool.js} +6 -8
- package/pools/stabilityPool/{getRawUserDepositsInStabilityPool.ts → getRawUserDepositsInStabilityPool.js} +7 -9
- package/pools/stabilityPool/{getStabilityPoolInfo.ts → getStabilityPoolInfo.js} +10 -12
- package/pools/stabilityPool/{getStabilityPoolTotalDeposits.ts → getStabilityPoolTotalDeposits.js} +6 -8
- package/pools/stabilityPool/methods/commons/estimateGasPrice.js +28 -0
- package/pools/stabilityPool/pools/stabilityPool/withdrawFromStabilityPool.js +34 -0
- package/pools/stabilityPool/utils/artifacts.js +74 -0
- package/pools/stabilityPool/utils/contracts.js +82 -0
- package/pools/stabilityPool/{withdrawFromStabilityPool.ts → withdrawFromStabilityPool.js} +6 -8
- package/ts-to-js.sh +42 -0
- package/utils/{artifacts.ts → artifacts.js} +1 -4
- package/utils/{contracts.ts → contracts.js} +16 -18
- package/wallet/assets/{approveAsset.ts → approveAsset.js} +7 -8
- package/wallet/assets/{burnAsset.ts → burnAsset.js} +7 -9
- package/wallet/assets/{getAllowance.ts → getAllowance.js} +9 -10
- package/wallet/assets/{getAsset.ts → getAsset.js} +6 -7
- package/wallet/assets/{getAssets.ts → getAssets.js} +5 -7
- package/wallet/assets/{getBalance.ts → getBalance.js} +8 -9
- package/wallet/assets/{mintAsset.ts → mintAsset.js} +8 -9
- package/wallet/assets/{transferAsset.ts → transferAsset.js} +10 -11
- package/configs/chains/index.ts +0 -17
- package/configs/index.ts +0 -51
- /package/configs/chains/{chain.d.ts → chain.d.js} +0 -0
- /package/configs/{createConfig.ts → createConfig.js} +0 -0
- /package/contracts/crvUSDToken/{getBalance.ts → getBalance.js} +0 -0
- /package/contracts/crvUSDToken/{getTotalSupply.ts → getTotalSupply.js} +0 -0
- /package/contracts/rcrvUSDToken/{getBalance.ts → getBalance.js} +0 -0
- /package/contracts/rcrvUSDToken/{getTotalSupply.ts → getTotalSupply.js} +0 -0
- /package/{custom-types.d.ts → custom-types.d.js} +0 -0
- /package/{index.ts → index.js} +0 -0
- /package/methods/{approveToken.ts → approveToken.js} +0 -0
- /package/methods/{getAssetBalance.ts → getAssetBalance.js} +0 -0
- /package/methods/{getAssetsBalance.ts → getAssetsBalance.js} +0 -0
- /package/pools/liquidityPool/{getLiquidityPoolInfo.ts → getLiquidityPoolInfo.js} +0 -0
- /package/scripts/{index.ts → index.js} +0 -0
- /package/tests/{test.ts → test.js} +0 -0
- /package/utils/{chain.ts → chain.js} +0 -0
- /package/utils/{config.ts → config.js} +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { RAACHousePrices } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
// checked
|
|
8
6
|
async function getHousePrice(
|
|
9
|
-
chainId
|
|
10
|
-
tokenId
|
|
11
|
-
signer
|
|
7
|
+
chainId,
|
|
8
|
+
tokenId,
|
|
9
|
+
signer
|
|
12
10
|
) {
|
|
13
11
|
console.log(chainId, tokenId, signer);
|
|
14
12
|
if (!signer) {
|
|
@@ -19,7 +17,7 @@ async function getHousePrice(
|
|
|
19
17
|
const raacHousePricesAddress = getContractAddress(
|
|
20
18
|
chainId,
|
|
21
19
|
"raachouseprices"
|
|
22
|
-
)
|
|
20
|
+
);
|
|
23
21
|
const raacHousePricesABI = getABI("raachouseprices");
|
|
24
22
|
|
|
25
23
|
const raacHousePricesContract = new ethers.Contract(
|
|
@@ -37,7 +35,7 @@ async function getHousePrice(
|
|
|
37
35
|
)} ETH`
|
|
38
36
|
);
|
|
39
37
|
return housePrice;
|
|
40
|
-
} catch (error
|
|
38
|
+
} catch (error) {
|
|
41
39
|
console.error(`Error getting house price for token ID ${tokenId}:`, error);
|
|
42
40
|
throw new Error(`Failed to get house price: ${error.message}`);
|
|
43
41
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { ethers, Provider } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains";
|
|
5
|
-
import { LendingPool, ReserveLibrary } from "../../typechain-types";
|
|
6
|
-
import { RawData, Reserve } from "../../custom-types";
|
|
7
4
|
|
|
8
5
|
// checked
|
|
9
6
|
async function getLendingPoolInfo(
|
|
10
|
-
chainId
|
|
11
|
-
address
|
|
12
|
-
provider
|
|
7
|
+
chainId,
|
|
8
|
+
address,
|
|
9
|
+
provider
|
|
13
10
|
) {
|
|
14
11
|
try {
|
|
15
12
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -18,10 +15,10 @@ async function getLendingPoolInfo(
|
|
|
18
15
|
lendingPoolAddress,
|
|
19
16
|
abi,
|
|
20
17
|
provider
|
|
21
|
-
)
|
|
18
|
+
);
|
|
22
19
|
|
|
23
20
|
const handleError =
|
|
24
|
-
(operation
|
|
21
|
+
(operation, returnType) => (error) => {
|
|
25
22
|
if (error.code === "BAD_DATA") {
|
|
26
23
|
console.log(
|
|
27
24
|
`BAD_DATA from ${operation} - Pool empty?`,
|
|
@@ -40,12 +37,8 @@ async function getLendingPoolInfo(
|
|
|
40
37
|
liquidationThreshold,
|
|
41
38
|
healthFactorLiquidationThreshold,
|
|
42
39
|
] = await Promise.all([
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
),
|
|
46
|
-
(lendingPoolContract.rateData() as Promise<RawData>).catch(
|
|
47
|
-
handleError("rateData")
|
|
48
|
-
),
|
|
40
|
+
lendingPoolContract.reserve().catch(handleError("reserve")),
|
|
41
|
+
lendingPoolContract.rateData().catch(handleError("rateData")),
|
|
49
42
|
lendingPoolContract
|
|
50
43
|
.getNormalizedIncome()
|
|
51
44
|
.catch(handleError("getNormalizedIncome", 0n)),
|
|
@@ -63,10 +56,10 @@ async function getLendingPoolInfo(
|
|
|
63
56
|
console.log(reserve);
|
|
64
57
|
|
|
65
58
|
// Extract data from reserve
|
|
66
|
-
const totalLiquidity
|
|
67
|
-
const totalUsage
|
|
68
|
-
const liquidityIndex
|
|
69
|
-
const usageIndex
|
|
59
|
+
const totalLiquidity = reserve?.totalLiquidity ?? 0n;
|
|
60
|
+
const totalUsage = reserve?.totalUsage ?? 0n;
|
|
61
|
+
const liquidityIndex = reserve?.liquidityIndex ?? 0n;
|
|
62
|
+
const usageIndex = reserve?.usageIndex ?? 0n;
|
|
70
63
|
|
|
71
64
|
// Compute utilization
|
|
72
65
|
let utilization = 0n;
|
|
@@ -75,18 +68,17 @@ async function getLendingPoolInfo(
|
|
|
75
68
|
}
|
|
76
69
|
|
|
77
70
|
// Extract rate data
|
|
78
|
-
const currentLiquidityRate
|
|
79
|
-
const currentUsageRate
|
|
80
|
-
const primeRate
|
|
81
|
-
const baseRate
|
|
82
|
-
const optimalRate
|
|
83
|
-
const maxRate
|
|
84
|
-
const optimalUtilizationRate
|
|
85
|
-
|
|
86
|
-
const protocolFeeRate: bigint = rateData?.protocolFeeRate ?? 0n;
|
|
71
|
+
const currentLiquidityRate = rateData?.currentLiquidityRate ?? 0n;
|
|
72
|
+
const currentUsageRate = rateData?.currentUsageRate ?? 0n;
|
|
73
|
+
const primeRate = rateData?.primeRate ?? 0n;
|
|
74
|
+
const baseRate = rateData?.baseRate ?? 0n;
|
|
75
|
+
const optimalRate = rateData?.optimalRate ?? 0n;
|
|
76
|
+
const maxRate = rateData?.maxRate ?? 0n;
|
|
77
|
+
const optimalUtilizationRate = rateData?.optimalUtilizationRate ?? 0n;
|
|
78
|
+
const protocolFeeRate = rateData?.protocolFeeRate ?? 0n;
|
|
87
79
|
|
|
88
80
|
// Compute APY
|
|
89
|
-
let apy
|
|
81
|
+
let apy;
|
|
90
82
|
if (utilization <= optimalUtilizationRate && optimalUtilizationRate > 0) {
|
|
91
83
|
const rateSlope = primeRate - baseRate;
|
|
92
84
|
const rateIncrease = (utilization * rateSlope) / optimalUtilizationRate;
|
|
@@ -103,7 +95,7 @@ async function getLendingPoolInfo(
|
|
|
103
95
|
let userRedeemable = 0n;
|
|
104
96
|
if (address) {
|
|
105
97
|
// Fetch user's scaled RToken balance
|
|
106
|
-
const rTokenAddress = reserve?.reserveRTokenAddress
|
|
98
|
+
const rTokenAddress = reserve?.reserveRTokenAddress;
|
|
107
99
|
const rTokenABI = getABI("rtoken");
|
|
108
100
|
const rTokenContract = new ethers.Contract(
|
|
109
101
|
rTokenAddress,
|
|
@@ -148,7 +140,7 @@ async function getLendingPoolInfo(
|
|
|
148
140
|
};
|
|
149
141
|
|
|
150
142
|
return result;
|
|
151
|
-
} catch (error
|
|
143
|
+
} catch (error) {
|
|
152
144
|
console.error("Error fetching lending pool info:", error);
|
|
153
145
|
throw error;
|
|
154
146
|
}
|
package/pools/lendingPool/{getLendingPoolTotalLiquidity.ts → getLendingPoolTotalLiquidity.js}
RENAMED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
|
-
import { Reserve } from "../../custom-types";
|
|
7
4
|
|
|
8
5
|
// The lending pool reserve contains the total liquidity of the lending pool. see getLendingPooInfo.ts
|
|
9
6
|
// @deprecated
|
|
10
7
|
async function getLendingPoolTotalLiquidity(
|
|
11
|
-
chainId
|
|
12
|
-
provider
|
|
8
|
+
chainId,
|
|
9
|
+
provider
|
|
13
10
|
) {
|
|
14
11
|
try {
|
|
15
12
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -18,12 +15,12 @@ async function getLendingPoolTotalLiquidity(
|
|
|
18
15
|
lendingPoolAddress,
|
|
19
16
|
abi,
|
|
20
17
|
provider
|
|
21
|
-
)
|
|
18
|
+
);
|
|
22
19
|
|
|
23
|
-
const reserve =
|
|
20
|
+
const reserve = await lendingPoolContract.reserve();
|
|
24
21
|
const totalLiquidity = reserve.totalLiquidity;
|
|
25
22
|
return totalLiquidity;
|
|
26
|
-
} catch (error
|
|
23
|
+
} catch (error) {
|
|
27
24
|
console.error("Error fetching total liquidity:", error);
|
|
28
25
|
throw error;
|
|
29
26
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function getPendingReward(
|
|
8
|
-
chainId
|
|
9
|
-
address
|
|
10
|
-
provider
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
provider
|
|
11
9
|
) {
|
|
12
10
|
try {
|
|
13
11
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -16,14 +14,14 @@ async function getPendingReward(
|
|
|
16
14
|
lendingPoolAddress,
|
|
17
15
|
lendingPoolABI,
|
|
18
16
|
provider
|
|
19
|
-
)
|
|
17
|
+
);
|
|
20
18
|
|
|
21
19
|
const reward = await lendingPoolContract.getPendingReward(address);
|
|
22
20
|
|
|
23
21
|
console.log(`Pending reward: ${ethers.formatEther(reward)}`);
|
|
24
22
|
|
|
25
23
|
return reward;
|
|
26
|
-
} catch (error
|
|
24
|
+
} catch (error) {
|
|
27
25
|
console.error("Error in getPendingReward:", error);
|
|
28
26
|
throw error;
|
|
29
27
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* @description Get the raw debt of the user on a NFT. Equivant to the original amount borrowed on NFT.
|
|
@@ -12,10 +10,10 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The raw debt of the user on a NFT
|
|
13
11
|
*/
|
|
14
12
|
async function getPositionDebt(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
tokenId
|
|
18
|
-
provider
|
|
13
|
+
chainId,
|
|
14
|
+
address,
|
|
15
|
+
tokenId,
|
|
16
|
+
provider
|
|
19
17
|
) {
|
|
20
18
|
try {
|
|
21
19
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -24,14 +22,14 @@ async function getPositionDebt(
|
|
|
24
22
|
lendingPoolAddress,
|
|
25
23
|
lendingPoolABI,
|
|
26
24
|
provider
|
|
27
|
-
)
|
|
25
|
+
);
|
|
28
26
|
|
|
29
27
|
const reward = await lendingPoolContract.getPositionDebt(address, tokenId);
|
|
30
28
|
|
|
31
29
|
console.log(`getPositionDebt result: ${ethers.formatEther(reward)}`);
|
|
32
30
|
|
|
33
31
|
return reward;
|
|
34
|
-
} catch (error
|
|
32
|
+
} catch (error) {
|
|
35
33
|
console.error("Error in getPositionDebt:", error);
|
|
36
34
|
throw error;
|
|
37
35
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* @description Get the scaled debt of the user on a NFT (contains the accured interest)
|
|
@@ -12,10 +10,10 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The debt of the user on a NFT with the accured interest
|
|
13
11
|
*/
|
|
14
12
|
async function getPositionScaledDebt(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
tokenId
|
|
18
|
-
provider
|
|
13
|
+
chainId,
|
|
14
|
+
address,
|
|
15
|
+
tokenId,
|
|
16
|
+
provider
|
|
19
17
|
) {
|
|
20
18
|
try {
|
|
21
19
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -24,7 +22,7 @@ async function getPositionScaledDebt(
|
|
|
24
22
|
lendingPoolAddress,
|
|
25
23
|
lendingPoolABI,
|
|
26
24
|
provider
|
|
27
|
-
)
|
|
25
|
+
);
|
|
28
26
|
|
|
29
27
|
const reward = await lendingPoolContract.getPositionScaledDebt(
|
|
30
28
|
address,
|
|
@@ -34,7 +32,7 @@ async function getPositionScaledDebt(
|
|
|
34
32
|
console.log(`getPositionScaledDebt result: ${ethers.formatEther(reward)}`);
|
|
35
33
|
|
|
36
34
|
return reward;
|
|
37
|
-
} catch (error
|
|
35
|
+
} catch (error) {
|
|
38
36
|
console.error("Error in getPositionScaledDebt:", error);
|
|
39
37
|
throw error;
|
|
40
38
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { ILendingPool, LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
export function transformPositionView(
|
|
8
|
-
positionView
|
|
6
|
+
positionView
|
|
9
7
|
) {
|
|
10
8
|
return {
|
|
11
9
|
rawDebtBalance: ethers.formatEther(positionView?.[0] || 0n),
|
|
@@ -25,10 +23,10 @@ export function transformPositionView(
|
|
|
25
23
|
* @returns All information about a NFT position
|
|
26
24
|
*/
|
|
27
25
|
async function getPositionView(
|
|
28
|
-
chainId
|
|
29
|
-
address
|
|
30
|
-
tokenId
|
|
31
|
-
provider
|
|
26
|
+
chainId,
|
|
27
|
+
address,
|
|
28
|
+
tokenId,
|
|
29
|
+
provider
|
|
32
30
|
) {
|
|
33
31
|
try {
|
|
34
32
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -37,13 +35,13 @@ async function getPositionView(
|
|
|
37
35
|
lendingPoolAddress,
|
|
38
36
|
lendingPoolABI,
|
|
39
37
|
provider
|
|
40
|
-
)
|
|
38
|
+
);
|
|
41
39
|
|
|
42
40
|
const res = await lendingPoolContract.getPositionView(address, tokenId);
|
|
43
41
|
console.log(`getPositionView result: ${res}`);
|
|
44
42
|
|
|
45
43
|
return transformPositionView(res);
|
|
46
|
-
} catch (error
|
|
44
|
+
} catch (error) {
|
|
47
45
|
console.error("Error in getPositionView:", error);
|
|
48
46
|
throw error;
|
|
49
47
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* @description Get the sum of all the scaled debts of a user over all NFTs
|
|
@@ -12,9 +10,9 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The debt of the user
|
|
13
11
|
*/
|
|
14
12
|
async function getPositionsScaledDebt(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
provider
|
|
13
|
+
chainId,
|
|
14
|
+
address,
|
|
15
|
+
provider
|
|
18
16
|
) {
|
|
19
17
|
try {
|
|
20
18
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -23,14 +21,14 @@ async function getPositionsScaledDebt(
|
|
|
23
21
|
lendingPoolAddress,
|
|
24
22
|
lendingPoolABI,
|
|
25
23
|
provider
|
|
26
|
-
)
|
|
24
|
+
);
|
|
27
25
|
|
|
28
26
|
const reward = await lendingPoolContract.getPositionsScaledDebt(address);
|
|
29
27
|
|
|
30
28
|
console.log(`getPositionsScaledDebt result: ${ethers.formatEther(reward)}`);
|
|
31
29
|
|
|
32
30
|
return reward;
|
|
33
|
-
} catch (error
|
|
31
|
+
} catch (error) {
|
|
34
32
|
console.error("Error in getPositionsScaledDebt:", error);
|
|
35
33
|
throw error;
|
|
36
34
|
}
|
package/pools/lendingPool/{getRawUserDepositsInLendingPool.ts → getRawUserDepositsInLendingPool.js}
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
// Get the amount of RToken RAW deposit in the lending pool, without the accured interest
|
|
8
6
|
async function getRawUserDepositsInLendingPool(
|
|
9
|
-
chainId
|
|
10
|
-
address
|
|
11
|
-
provider
|
|
7
|
+
chainId,
|
|
8
|
+
address,
|
|
9
|
+
provider
|
|
12
10
|
) {
|
|
13
11
|
try {
|
|
14
12
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -17,14 +15,14 @@ async function getRawUserDepositsInLendingPool(
|
|
|
17
15
|
lendingPoolAddress,
|
|
18
16
|
lendingPoolABI,
|
|
19
17
|
provider
|
|
20
|
-
)
|
|
18
|
+
);
|
|
21
19
|
|
|
22
20
|
const value = await lendingPoolContract.getUserDeposits(address);
|
|
23
21
|
|
|
24
22
|
console.log(`User deposits in lending pool: ${ethers.formatEther(value)}`);
|
|
25
23
|
|
|
26
24
|
return value;
|
|
27
|
-
} catch (error
|
|
25
|
+
} catch (error) {
|
|
28
26
|
console.error("Error in getRawUserDepositsInLendingPool:", error);
|
|
29
27
|
throw error;
|
|
30
28
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* @description Sum of the prices of all the NFTS
|
|
@@ -12,9 +10,9 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The total value of the collateral
|
|
13
11
|
*/
|
|
14
12
|
async function getUserCollateralValue(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
provider
|
|
13
|
+
chainId,
|
|
14
|
+
address,
|
|
15
|
+
provider
|
|
18
16
|
) {
|
|
19
17
|
try {
|
|
20
18
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -23,14 +21,14 @@ async function getUserCollateralValue(
|
|
|
23
21
|
lendingPoolAddress,
|
|
24
22
|
lendingPoolABI,
|
|
25
23
|
provider
|
|
26
|
-
)
|
|
24
|
+
);
|
|
27
25
|
|
|
28
26
|
const reward = await lendingPoolContract.getUserCollateralValue(address);
|
|
29
27
|
|
|
30
28
|
console.log(`getUserCollateralValue result: ${ethers.formatEther(reward)}`);
|
|
31
29
|
|
|
32
30
|
return reward;
|
|
33
|
-
} catch (error
|
|
31
|
+
} catch (error) {
|
|
34
32
|
console.error("Error in getUserCollateralValue:", error);
|
|
35
33
|
throw error;
|
|
36
34
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* @description Get the sum of all the scaled debts of a user over all NFTs
|
|
@@ -12,10 +10,10 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The debt of the user
|
|
13
11
|
*/
|
|
14
12
|
async function initializeLiquidation(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
tokenId
|
|
18
|
-
signer
|
|
13
|
+
chainId,
|
|
14
|
+
address,
|
|
15
|
+
tokenId,
|
|
16
|
+
signer
|
|
19
17
|
) {
|
|
20
18
|
try {
|
|
21
19
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -24,7 +22,7 @@ async function initializeLiquidation(
|
|
|
24
22
|
lendingPoolAddress,
|
|
25
23
|
lendingPoolABI,
|
|
26
24
|
signer
|
|
27
|
-
)
|
|
25
|
+
);
|
|
28
26
|
|
|
29
27
|
const tx = await lendingPoolContract.initiateLiquidation(address, tokenId);
|
|
30
28
|
await tx.wait();
|
|
@@ -32,7 +30,7 @@ async function initializeLiquidation(
|
|
|
32
30
|
console.log(`initializeLiquidation result: ${tx.hash}`);
|
|
33
31
|
|
|
34
32
|
return tx;
|
|
35
|
-
} catch (error
|
|
33
|
+
} catch (error) {
|
|
36
34
|
console.error("Error in initializeLiquidation:", error);
|
|
37
35
|
throw error;
|
|
38
36
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function repayToLendingPool(
|
|
8
|
-
chainId
|
|
9
|
-
tokenId
|
|
10
|
-
amount
|
|
11
|
-
signer
|
|
6
|
+
chainId,
|
|
7
|
+
tokenId,
|
|
8
|
+
amount,
|
|
9
|
+
signer
|
|
12
10
|
) {
|
|
13
11
|
try {
|
|
14
12
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -17,7 +15,7 @@ async function repayToLendingPool(
|
|
|
17
15
|
lendingPoolAddress,
|
|
18
16
|
lendingPoolABI,
|
|
19
17
|
signer
|
|
20
|
-
)
|
|
18
|
+
);
|
|
21
19
|
|
|
22
20
|
const amountInWei = ethers.parseEther(amount.toString());
|
|
23
21
|
console.log("Repaying amount in wei:", amountInWei.toString());
|
|
@@ -29,7 +27,7 @@ async function repayToLendingPool(
|
|
|
29
27
|
console.log(`Transaction hash: ${receipt?.hash}`);
|
|
30
28
|
|
|
31
29
|
return receipt;
|
|
32
|
-
} catch (error
|
|
30
|
+
} catch (error) {
|
|
33
31
|
console.error("Error in repayToLendingPool:", error);
|
|
34
32
|
throw error;
|
|
35
33
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
4
|
import estimateGasPrice from "../../methods/commons/estimateGasPrice";
|
|
5
|
-
|
|
6
|
-
import { ERC20, LendingPool } from "../../typechain-types";
|
|
5
|
+
|
|
7
6
|
async function withdrawFromLendingPool(
|
|
8
|
-
chainId
|
|
9
|
-
amount
|
|
10
|
-
signer
|
|
7
|
+
chainId,
|
|
8
|
+
amount,
|
|
9
|
+
signer
|
|
11
10
|
) {
|
|
12
11
|
try {
|
|
13
12
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -19,12 +18,12 @@ async function withdrawFromLendingPool(
|
|
|
19
18
|
lendingPoolAddress,
|
|
20
19
|
lendingPoolABI,
|
|
21
20
|
signer
|
|
22
|
-
)
|
|
21
|
+
);
|
|
23
22
|
const rTokenContract = new ethers.Contract(
|
|
24
23
|
rtokenAddress,
|
|
25
24
|
assetABI,
|
|
26
25
|
signer
|
|
27
|
-
)
|
|
26
|
+
);
|
|
28
27
|
|
|
29
28
|
const amountInWei = ethers.parseEther(amount.toString());
|
|
30
29
|
const { maxFeePerGas } = await estimateGasPrice(signer);
|
|
@@ -59,7 +58,7 @@ async function withdrawFromLendingPool(
|
|
|
59
58
|
console.log(`Transaction hash: ${receipt?.hash}`);
|
|
60
59
|
|
|
61
60
|
return receipt;
|
|
62
|
-
} catch (error
|
|
61
|
+
} catch (error) {
|
|
63
62
|
console.error("Error in withdrawFromLendingPool:", error);
|
|
64
63
|
throw error;
|
|
65
64
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { ethers
|
|
2
|
-
import
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains/index";
|
|
5
|
-
import { LendingPool } from "../../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function withdrawNFTFromLendingPool(
|
|
8
|
-
chainId
|
|
9
|
-
tokenId
|
|
10
|
-
signer
|
|
6
|
+
chainId,
|
|
7
|
+
tokenId,
|
|
8
|
+
signer
|
|
11
9
|
) {
|
|
12
10
|
if (!signer) {
|
|
13
11
|
throw new Error("Wallet not connected");
|
|
@@ -21,14 +19,14 @@ async function withdrawNFTFromLendingPool(
|
|
|
21
19
|
lendingPoolAddress,
|
|
22
20
|
lendingPoolABI,
|
|
23
21
|
signer
|
|
24
|
-
)
|
|
22
|
+
);
|
|
25
23
|
|
|
26
24
|
const tx = await lendingPoolContract.withdrawNFT(tokenId);
|
|
27
25
|
await tx.wait();
|
|
28
26
|
|
|
29
27
|
console.log(`Withdrawn NFT with token ID ${tokenId} from lending pool`);
|
|
30
28
|
return tx;
|
|
31
|
-
} catch (error
|
|
29
|
+
} catch (error) {
|
|
32
30
|
console.error("Error withdrawing NFT from lending pool:", error);
|
|
33
31
|
throw new Error(
|
|
34
32
|
`Failed to withdraw NFT from lending pool: ${error.message}`
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import estimateGasPrice from "../../methods/commons/estimateGasPrice";
|
|
5
|
-
import { ChainId } from "../../configs/chains/index";
|
|
6
|
-
import { StabilityPool } from "../../typechain-types";
|
|
7
4
|
|
|
8
5
|
async function calculateRAACRewards(
|
|
9
|
-
chainId
|
|
10
|
-
address
|
|
11
|
-
signer
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
signer
|
|
12
9
|
) {
|
|
13
10
|
if (!signer) {
|
|
14
11
|
throw new Error("Wallet not connected");
|
|
@@ -22,13 +19,13 @@ async function calculateRAACRewards(
|
|
|
22
19
|
stabilityPoolAddress,
|
|
23
20
|
stabilityPoolABI,
|
|
24
21
|
signer
|
|
25
|
-
)
|
|
22
|
+
);
|
|
26
23
|
|
|
27
24
|
const calculateRAACRewards =
|
|
28
25
|
await stabilityPoolContract.calculateRaacRewards(address);
|
|
29
26
|
|
|
30
27
|
return ethers.formatEther(calculateRAACRewards);
|
|
31
|
-
} catch (error
|
|
28
|
+
} catch (error) {
|
|
32
29
|
throw new Error(`Error calculating RAAC rewards: ${error.message}`);
|
|
33
30
|
}
|
|
34
31
|
}
|