@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
|
-
import { Contract, ethers, Provider
|
|
2
|
-
import
|
|
1
|
+
import { Contract, ethers, Provider } from "ethers";
|
|
2
|
+
import getContractAddress from "../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../configs/chains/index";
|
|
5
|
-
import { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
5
|
// This is the total price: includes the mint price and the mint fee
|
|
8
6
|
async function getMintPrice(
|
|
9
|
-
chainId
|
|
10
|
-
tokenId
|
|
11
|
-
provider
|
|
7
|
+
chainId,
|
|
8
|
+
tokenId,
|
|
9
|
+
provider
|
|
12
10
|
) {
|
|
13
11
|
if (!provider) {
|
|
14
12
|
throw new Error("Wallet not connected");
|
|
@@ -22,7 +20,7 @@ async function getMintPrice(
|
|
|
22
20
|
raacNFTAddress,
|
|
23
21
|
raacNFTABI,
|
|
24
22
|
provider
|
|
25
|
-
)
|
|
23
|
+
);
|
|
26
24
|
|
|
27
25
|
const price = await raacNFTContract.getMintPrice(tokenId);
|
|
28
26
|
const token = await raacNFTContract.token();
|
|
@@ -37,7 +35,7 @@ async function getMintPrice(
|
|
|
37
35
|
|
|
38
36
|
console.log(`Retrieved house price for ${tokenId}: ${formattedValue}`);
|
|
39
37
|
return { price, decimals };
|
|
40
|
-
} catch (error
|
|
38
|
+
} catch (error) {
|
|
41
39
|
console.error("Error retrieving mint price for " + tokenId, error);
|
|
42
40
|
throw new Error(`Failed retrieve mint price: ${error.message}`);
|
|
43
41
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { ethers, Provider
|
|
2
|
-
import
|
|
1
|
+
import { ethers, Provider } from "ethers";
|
|
2
|
+
import getContractAddress from "../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../configs/chains/index";
|
|
5
|
-
import { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function getTokenURI(
|
|
8
|
-
chainId
|
|
9
|
-
tokenId
|
|
10
|
-
provider
|
|
6
|
+
chainId,
|
|
7
|
+
tokenId,
|
|
8
|
+
provider
|
|
11
9
|
) {
|
|
12
10
|
if (!provider) {
|
|
13
11
|
throw new Error("Wallet not connected");
|
|
@@ -21,12 +19,12 @@ async function getTokenURI(
|
|
|
21
19
|
raacNFTAddress,
|
|
22
20
|
raacNFTABI,
|
|
23
21
|
provider
|
|
24
|
-
)
|
|
22
|
+
);
|
|
25
23
|
|
|
26
24
|
const uri = await raacNFTContract.tokenURI(tokenId);
|
|
27
25
|
console.log(`Retrieved token URI: ${uri}`);
|
|
28
26
|
return uri;
|
|
29
|
-
} catch (error
|
|
27
|
+
} catch (error) {
|
|
30
28
|
console.error("Error getting token URI:", error);
|
|
31
29
|
throw new Error(`Failed to get token URI: ${error.message}`);
|
|
32
30
|
}
|
|
@@ -1,14 +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/index";
|
|
5
|
-
import { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function getTokensByOwner(
|
|
8
|
-
chainId
|
|
9
|
-
address
|
|
10
|
-
provider
|
|
11
|
-
pagination
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
provider,
|
|
9
|
+
pagination
|
|
12
10
|
) {
|
|
13
11
|
try {
|
|
14
12
|
const raacNFTAddress = getContractAddress(chainId, "raacnft");
|
|
@@ -18,14 +16,14 @@ async function getTokensByOwner(
|
|
|
18
16
|
raacNFTAddress,
|
|
19
17
|
raacNFTABI,
|
|
20
18
|
provider
|
|
21
|
-
)
|
|
19
|
+
);
|
|
22
20
|
const balance = await raacNFTContract.balanceOf(address);
|
|
23
21
|
|
|
24
22
|
if (balance === 0n) {
|
|
25
23
|
return { address, tokens: [] };
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
let tokens
|
|
26
|
+
let tokens = [];
|
|
29
27
|
if (pagination) {
|
|
30
28
|
const offset = pagination?.offset || 0;
|
|
31
29
|
const limit = pagination?.limit || 10;
|
|
@@ -42,7 +40,7 @@ async function getTokensByOwner(
|
|
|
42
40
|
|
|
43
41
|
// toString()
|
|
44
42
|
return { address, tokens: tokens.map((token) => token.toString()) };
|
|
45
|
-
} catch (error
|
|
43
|
+
} catch (error) {
|
|
46
44
|
console.error("Error getting owned NFTs:", error);
|
|
47
45
|
throw new Error(`Failed to get owned NFTs: ${error.message}`);
|
|
48
46
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ethers, Provider
|
|
2
|
-
import
|
|
1
|
+
import { ethers, Provider } from "ethers";
|
|
2
|
+
import getContractAddress from "../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../configs/chains/index";
|
|
5
|
-
import { RAACHousePrices, RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
|
-
async function getTotalPropertiesCount(chainId
|
|
5
|
+
async function getTotalPropertiesCount(chainId, provider) {
|
|
8
6
|
if (!provider) {
|
|
9
7
|
throw new Error("Wallet not connected");
|
|
10
8
|
}
|
|
@@ -16,13 +14,13 @@ async function getTotalPropertiesCount(chainId: ChainId, provider: Provider) {
|
|
|
16
14
|
raacHousePrices,
|
|
17
15
|
raacHousePricesABI,
|
|
18
16
|
provider
|
|
19
|
-
)
|
|
17
|
+
);
|
|
20
18
|
|
|
21
19
|
const count = await raacHousePricesContract.count();
|
|
22
20
|
|
|
23
21
|
console.log(`Retrieved total properties count: ${count}`);
|
|
24
22
|
return count;
|
|
25
|
-
} catch (error
|
|
23
|
+
} catch (error) {
|
|
26
24
|
console.error("Error retrieving total houses count:", error);
|
|
27
25
|
throw new Error(
|
|
28
26
|
`Failed to retrieve the number of houses: ${error.message}`
|
package/nfts/{mint.ts → mint.js}
RENAMED
|
@@ -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 { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
5
|
async function mint(
|
|
8
|
-
chainId
|
|
9
|
-
tokenId
|
|
10
|
-
amount
|
|
11
|
-
signer
|
|
6
|
+
chainId,
|
|
7
|
+
tokenId,
|
|
8
|
+
amount,
|
|
9
|
+
signer
|
|
12
10
|
) {
|
|
13
11
|
if (!signer) {
|
|
14
12
|
throw new Error("Wallet not connected");
|
|
@@ -22,7 +20,7 @@ async function mint(
|
|
|
22
20
|
raacNFTAddress,
|
|
23
21
|
raacNFTABI,
|
|
24
22
|
signer
|
|
25
|
-
)
|
|
23
|
+
);
|
|
26
24
|
const tx = await raacNFTContract.mint(
|
|
27
25
|
tokenId,
|
|
28
26
|
ethers.parseEther(amount.toString())
|
|
@@ -33,7 +31,7 @@ async function mint(
|
|
|
33
31
|
`Minted RAAC NFT with token ID ${tokenId} for ${amount} tokens`
|
|
34
32
|
);
|
|
35
33
|
return tx;
|
|
36
|
-
} catch (error
|
|
34
|
+
} catch (error) {
|
|
37
35
|
console.error("Error minting RAAC NFT:", error);
|
|
38
36
|
throw new Error(`Failed to mint RAAC NFT: ${error.message}`);
|
|
39
37
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
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 { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
|
-
async function setBaseUri(chainId
|
|
5
|
+
async function setBaseUri(chainId, newUri, signer) {
|
|
8
6
|
if (!signer) {
|
|
9
7
|
throw new Error("Wallet not connected");
|
|
10
8
|
}
|
|
@@ -17,14 +15,14 @@ async function setBaseUri(chainId: ChainId, newUri: string, signer: Signer) {
|
|
|
17
15
|
raacNFTAddress,
|
|
18
16
|
raacNFTABI,
|
|
19
17
|
signer
|
|
20
|
-
)
|
|
18
|
+
);
|
|
21
19
|
|
|
22
20
|
const tx = await raacNFTContract.setBaseUri(newUri);
|
|
23
21
|
await tx.wait();
|
|
24
22
|
|
|
25
23
|
console.log(`Set new base URI: ${newUri}`);
|
|
26
24
|
return tx;
|
|
27
|
-
} catch (error
|
|
25
|
+
} catch (error) {
|
|
28
26
|
console.error("Error setting base URI:", error);
|
|
29
27
|
throw new Error(`Failed to set base URI: ${error.message}`);
|
|
30
28
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
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/index";
|
|
5
|
-
import { RAACNFT } from "../typechain-types";
|
|
6
4
|
|
|
7
|
-
async function totalNFTSupply(chainId
|
|
5
|
+
async function totalNFTSupply(chainId, provider) {
|
|
8
6
|
try {
|
|
9
7
|
const raacNFTAddress = getContractAddress(chainId, "raacnft");
|
|
10
8
|
const raacNFTABI = getABI("raacnft");
|
|
@@ -13,11 +11,11 @@ async function totalNFTSupply(chainId: ChainId, provider: Provider) {
|
|
|
13
11
|
raacNFTAddress,
|
|
14
12
|
raacNFTABI,
|
|
15
13
|
provider
|
|
16
|
-
)
|
|
14
|
+
);
|
|
17
15
|
|
|
18
16
|
const batchSize = await raacNFTContract.totalSupply();
|
|
19
17
|
return batchSize.toString();
|
|
20
|
-
} catch (error
|
|
18
|
+
} catch (error) {
|
|
21
19
|
console.error("Error getting current batch size:", error);
|
|
22
20
|
throw new Error(`Failed to get current batch size: ${error.message}`);
|
|
23
21
|
}
|
package/package.json
CHANGED
|
@@ -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 borrowFromLendingPool(
|
|
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 borrowFromLendingPool(
|
|
|
17
15
|
lendingPoolAddress,
|
|
18
16
|
lendingPoolABI,
|
|
19
17
|
signer
|
|
20
|
-
)
|
|
18
|
+
);
|
|
21
19
|
|
|
22
20
|
const amountInWei = ethers.parseEther(amount);
|
|
23
21
|
console.log("Borrowing amount in wei:", amountInWei.toString());
|
|
@@ -32,7 +30,7 @@ async function borrowFromLendingPool(
|
|
|
32
30
|
console.log(`Transaction hash: ${receipt?.hash}`);
|
|
33
31
|
|
|
34
32
|
return receipt;
|
|
35
|
-
} catch (error
|
|
33
|
+
} catch (error) {
|
|
36
34
|
console.error("Error in borrowFromLendingPool:", error);
|
|
37
35
|
throw error;
|
|
38
36
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
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
|
import checkAllowance from "../../methods/commons/checkAllowance";
|
|
7
5
|
import approveAsset from "../../wallet/assets/approveAsset";
|
|
8
6
|
|
|
9
7
|
async function borrowFromLendingPoolWithInsurance(
|
|
10
|
-
chainId
|
|
11
|
-
tokenId
|
|
12
|
-
amount
|
|
13
|
-
signer
|
|
8
|
+
chainId,
|
|
9
|
+
tokenId,
|
|
10
|
+
amount,
|
|
11
|
+
signer
|
|
14
12
|
) {
|
|
15
13
|
try {
|
|
16
14
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -19,7 +17,7 @@ async function borrowFromLendingPoolWithInsurance(
|
|
|
19
17
|
lendingPoolAddress,
|
|
20
18
|
lendingPoolABI,
|
|
21
19
|
signer
|
|
22
|
-
)
|
|
20
|
+
);
|
|
23
21
|
|
|
24
22
|
const feeCollectorAddress = getContractAddress(chainId, "feecollector");
|
|
25
23
|
const userAddress = await signer.getAddress();
|
|
@@ -71,7 +69,7 @@ async function borrowFromLendingPoolWithInsurance(
|
|
|
71
69
|
console.log(`Transaction hash: ${receipt?.hash}`);
|
|
72
70
|
|
|
73
71
|
return receipt;
|
|
74
|
-
} catch (error
|
|
72
|
+
} catch (error) {
|
|
75
73
|
console.error("Error in borrowFromLendingPoolWithInsurance:", error);
|
|
76
74
|
throw error;
|
|
77
75
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
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 calculateInsuranceFee(
|
|
8
|
-
chainId
|
|
9
|
-
address
|
|
10
|
-
tokenId
|
|
11
|
-
amount
|
|
12
|
-
provider
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
tokenId,
|
|
9
|
+
amount,
|
|
10
|
+
provider
|
|
13
11
|
) {
|
|
14
12
|
try {
|
|
15
13
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -18,7 +16,7 @@ async function calculateInsuranceFee(
|
|
|
18
16
|
lendingPoolAddress,
|
|
19
17
|
lendingPoolABI,
|
|
20
18
|
provider
|
|
21
|
-
)
|
|
19
|
+
);
|
|
22
20
|
|
|
23
21
|
const amountInWei = ethers.parseEther(amount);
|
|
24
22
|
|
|
@@ -29,7 +27,7 @@ async function calculateInsuranceFee(
|
|
|
29
27
|
);
|
|
30
28
|
|
|
31
29
|
return ethers.formatEther(insuranceFee);
|
|
32
|
-
} catch (error
|
|
30
|
+
} catch (error) {
|
|
33
31
|
console.error("Error in calculateInsuranceFee:", error);
|
|
34
32
|
throw error;
|
|
35
33
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
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
|
-
async function claimReward(chainId
|
|
5
|
+
async function claimReward(chainId, signer) {
|
|
8
6
|
try {
|
|
9
7
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
10
8
|
const lendingPoolABI = getABI("lendingpool");
|
|
@@ -12,7 +10,7 @@ async function claimReward(chainId: ChainId, signer: Signer) {
|
|
|
12
10
|
lendingPoolAddress,
|
|
13
11
|
lendingPoolABI,
|
|
14
12
|
signer
|
|
15
|
-
)
|
|
13
|
+
);
|
|
16
14
|
|
|
17
15
|
const tx = await lendingPoolContract.claimReward();
|
|
18
16
|
const receipt = await tx.wait();
|
|
@@ -21,7 +19,7 @@ async function claimReward(chainId: ChainId, signer: Signer) {
|
|
|
21
19
|
console.log(`Transaction hash: ${receipt?.hash}`);
|
|
22
20
|
|
|
23
21
|
return receipt;
|
|
24
|
-
} catch (error
|
|
22
|
+
} catch (error) {
|
|
25
23
|
console.error("Error in claimReward:", error);
|
|
26
24
|
throw error;
|
|
27
25
|
}
|
|
@@ -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 Close the liqudation after the debt has been paid
|
|
@@ -12,9 +10,9 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns
|
|
13
11
|
*/
|
|
14
12
|
async function closeLiquidation(
|
|
15
|
-
chainId
|
|
16
|
-
tokenId
|
|
17
|
-
signer
|
|
13
|
+
chainId,
|
|
14
|
+
tokenId,
|
|
15
|
+
signer
|
|
18
16
|
) {
|
|
19
17
|
try {
|
|
20
18
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -23,7 +21,7 @@ async function closeLiquidation(
|
|
|
23
21
|
lendingPoolAddress,
|
|
24
22
|
lendingPoolABI,
|
|
25
23
|
signer
|
|
26
|
-
)
|
|
24
|
+
);
|
|
27
25
|
|
|
28
26
|
const tx = await lendingPoolContract.closeLiquidation(tokenId);
|
|
29
27
|
await tx.wait();
|
|
@@ -31,7 +29,7 @@ async function closeLiquidation(
|
|
|
31
29
|
console.log(`closeLiquidation result: ${tx.hash}`);
|
|
32
30
|
|
|
33
31
|
return tx;
|
|
34
|
-
} catch (error
|
|
32
|
+
} catch (error) {
|
|
35
33
|
console.error("Error in closeLiquidation:", error);
|
|
36
34
|
throw error;
|
|
37
35
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
4
|
import estimateGasPrice from "../../methods/commons/estimateGasPrice";
|
|
5
|
-
import { ChainId } from "../../configs/chains";
|
|
6
|
-
import { LendingPool } from "../../typechain-types";
|
|
7
5
|
|
|
8
6
|
//checked
|
|
9
7
|
async function depositNFTToLendingPool(
|
|
10
|
-
chainId
|
|
11
|
-
tokenId
|
|
12
|
-
signer
|
|
8
|
+
chainId,
|
|
9
|
+
tokenId,
|
|
10
|
+
signer
|
|
13
11
|
) {
|
|
14
12
|
if (!signer) {
|
|
15
13
|
throw new Error("Wallet not connected");
|
|
@@ -25,7 +23,7 @@ async function depositNFTToLendingPool(
|
|
|
25
23
|
lendingPoolAddress,
|
|
26
24
|
lendingPoolABI,
|
|
27
25
|
signer
|
|
28
|
-
)
|
|
26
|
+
);
|
|
29
27
|
const nftContract = new ethers.Contract(nftAddress, nftABI, signer);
|
|
30
28
|
|
|
31
29
|
const { maxFeePerGas } = await estimateGasPrice(signer);
|
|
@@ -60,7 +58,7 @@ async function depositNFTToLendingPool(
|
|
|
60
58
|
receipt?.hash
|
|
61
59
|
);
|
|
62
60
|
return receipt;
|
|
63
|
-
} catch (error
|
|
61
|
+
} catch (error) {
|
|
64
62
|
console.error(`NFT Deposit to Lending Pool error:`, error);
|
|
65
63
|
throw new Error(`NFT Deposit to Lending Pool failed: ${error.message}`);
|
|
66
64
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import getContractAddress from "../../contracts/getContractAddress";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
4
|
import estimateGasPrice from "../../methods/commons/estimateGasPrice";
|
|
5
|
-
import { ChainId } from "../../configs/chains";
|
|
6
|
-
import { LendingPool } from "../../typechain-types";
|
|
7
5
|
|
|
8
6
|
// checked
|
|
9
7
|
async function depositToLendingPool(
|
|
10
|
-
chainId
|
|
11
|
-
amount
|
|
12
|
-
signer
|
|
8
|
+
chainId,
|
|
9
|
+
amount,
|
|
10
|
+
signer
|
|
13
11
|
) {
|
|
14
12
|
if (!signer) {
|
|
15
13
|
throw new Error("Wallet not connected");
|
|
@@ -23,7 +21,7 @@ async function depositToLendingPool(
|
|
|
23
21
|
lendingPoolAddress,
|
|
24
22
|
lendingPoolABI,
|
|
25
23
|
signer
|
|
26
|
-
)
|
|
24
|
+
);
|
|
27
25
|
|
|
28
26
|
const amountInWei = ethers.parseEther(amount);
|
|
29
27
|
const { maxFeePerGas } = await estimateGasPrice(signer);
|
|
@@ -43,7 +41,7 @@ async function depositToLendingPool(
|
|
|
43
41
|
receipt?.hash
|
|
44
42
|
);
|
|
45
43
|
return receipt;
|
|
46
|
-
} catch (error
|
|
44
|
+
} catch (error) {
|
|
47
45
|
console.error(`Lending Pool Deposit error:`, error);
|
|
48
46
|
throw new Error(`Lending Pool Deposit failed: ${error.message}`);
|
|
49
47
|
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { ethers, Provider } from "ethers";
|
|
2
2
|
import { getContractAddress } from "../../utils/contracts";
|
|
3
3
|
import { getABI } from "../../utils/artifacts";
|
|
4
|
-
import { ChainId } from "../../configs/chains";
|
|
5
|
-
import {
|
|
6
|
-
ILendingPool,
|
|
7
|
-
LendingPool,
|
|
8
|
-
ReserveLibrary,
|
|
9
|
-
} from "../../typechain-types";
|
|
10
|
-
import { RawData, Reserve } from "../../custom-types";
|
|
11
4
|
import { transformPositionView } from "./getPositionView";
|
|
12
5
|
|
|
13
6
|
// checked
|
|
14
7
|
async function getAllUserData(
|
|
15
|
-
chainId
|
|
16
|
-
address
|
|
17
|
-
provider
|
|
8
|
+
chainId,
|
|
9
|
+
address,
|
|
10
|
+
provider
|
|
18
11
|
) {
|
|
19
12
|
try {
|
|
20
13
|
const lendingPoolAddress = getContractAddress(chainId, "lendingpool");
|
|
@@ -23,22 +16,22 @@ async function getAllUserData(
|
|
|
23
16
|
lendingPoolAddress,
|
|
24
17
|
abi,
|
|
25
18
|
provider
|
|
26
|
-
)
|
|
19
|
+
);
|
|
27
20
|
|
|
28
21
|
const data = await lendingPoolContract.getAllUserData(address);
|
|
29
22
|
|
|
30
23
|
// ILendingPool.UserDataView
|
|
31
24
|
const formattedData = {
|
|
32
|
-
nftTokenIds: (data[0] || []).map((id
|
|
25
|
+
nftTokenIds: (data[0] || []).map((id) => id.toString()),
|
|
33
26
|
scaledDebtBalance: ethers.formatEther(data[1] || 0n),
|
|
34
27
|
userCollateralValue: ethers.formatEther(data[2] || 0n),
|
|
35
28
|
positions: (
|
|
36
|
-
(data[3] || [])
|
|
29
|
+
(data[3] || [])
|
|
37
30
|
).map((e) => transformPositionView(e)),
|
|
38
31
|
};
|
|
39
32
|
|
|
40
33
|
return formattedData;
|
|
41
|
-
} catch (error
|
|
34
|
+
} catch (error) {
|
|
42
35
|
console.error("Error fetching lending pool info:", error);
|
|
43
36
|
throw error;
|
|
44
37
|
}
|
|
@@ -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 Total amount of RToken + DEToken = total crvUSD they put in the system so far. How much they have contributed to the system.
|
|
@@ -12,9 +10,9 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns
|
|
13
11
|
*/
|
|
14
12
|
async function getEligibleUserDeposits(
|
|
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 getEligibleUserDeposits(
|
|
|
23
21
|
lendingPoolAddress,
|
|
24
22
|
lendingPoolABI,
|
|
25
23
|
provider
|
|
26
|
-
)
|
|
24
|
+
);
|
|
27
25
|
|
|
28
26
|
const value = await lendingPoolContract.getEligibleUserDeposits(address);
|
|
29
27
|
|
|
30
28
|
console.log(`Eligible user deposits: ${ethers.formatEther(value)}`);
|
|
31
29
|
|
|
32
30
|
return value;
|
|
33
|
-
} catch (error
|
|
31
|
+
} catch (error) {
|
|
34
32
|
console.error("Error in getEligibleUserDeposits:", 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 health factor of a NFT position -> factor < 1 : undercollateralized.
|
|
@@ -12,10 +10,10 @@ import { LendingPool } from "../../typechain-types";
|
|
|
12
10
|
* @returns The health factor of a position (0, inf)
|
|
13
11
|
*/
|
|
14
12
|
async function getHealthFactor(
|
|
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 getHealthFactor(
|
|
|
24
22
|
lendingPoolAddress,
|
|
25
23
|
lendingPoolABI,
|
|
26
24
|
provider
|
|
27
|
-
)
|
|
25
|
+
);
|
|
28
26
|
|
|
29
27
|
const value = await lendingPoolContract.calculateHealthFactor(
|
|
30
28
|
address,
|
|
@@ -34,7 +32,7 @@ async function getHealthFactor(
|
|
|
34
32
|
console.log(`getHealthFactor result: ${value}`);
|
|
35
33
|
|
|
36
34
|
return value;
|
|
37
|
-
} catch (error
|
|
35
|
+
} catch (error) {
|
|
38
36
|
console.error("Error in getHealthFactor:", error);
|
|
39
37
|
throw error;
|
|
40
38
|
}
|