NexusMutual / smart-contracts

GNU General Public License v3.0
170 stars 62 forks source link

feat(NexusViewer): add pool manager NXM locked for MV timestamp #1280

Open mixplore opened 1 week ago

mixplore commented 1 week ago

Description

Alternative for UI multicall https://github.com/NexusMutual/frontend-next/pull/1049 to support https://github.com/NexusMutual/frontend-next/issues/1044.

The advantage of this approach would be saving an on chain call on the UI, the disadvantage being this implies a smart contract deployment + not sure about how computationally heavy the added logic is. The UI approach is faster in terms of going live with the fix, but I don't think this is an urgent issue so we can decide based on the other criteria.

Testing

NexusViewer implementation address: 0x6874ABAf1c8a1694b08066e5bB38487D680fa38d NexusViewer implementation ABI:

[{"type":"constructor","payable":false,"inputs":[{"type":"address","name":"_master"},{"type":"address","name":"_stakingViewer"},{"type":"address","name":"_assessmentViewer"},{"type":"address","name":"_nxm"}]},{"type":"error","name":"RevertedWithoutReason","inputs":[{"type":"uint256","name":"index"}]},{"type":"function","name":"assessmentViewer","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]},{"type":"function","name":"getClaimableNXM","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"member"},{"type":"uint256[]","name":"tokenIds"}],"outputs":[{"type":"tuple","components":[{"type":"uint256","name":"governanceRewards"},{"type":"uint256","name":"assessmentRewards"},{"type":"uint256","name":"assessmentStake"},{"type":"uint256","name":"stakingPoolTotalRewards"},{"type":"uint256","name":"stakingPoolTotalExpiredStake"},{"type":"uint256","name":"stakingPoolManagerIsNXMLockedForMV"},{"type":"uint256","name":"managerTotalRewards"},{"type":"uint256","name":"legacyPooledStakeRewards"},{"type":"uint256","name":"legacyPooledStakeDeposits"},{"type":"uint256","name":"legacyClaimAssessmentTokens"},{"type":"uint256","name":"legacyCoverNoteDeposits"}]}]},{"type":"function","name":"getStakedNXM","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"member"},{"type":"uint256[]","name":"tokenIds"}],"outputs":[{"type":"tuple","components":[{"type":"uint256","name":"stakingPoolTotalActiveStake"},{"type":"uint256","name":"assessmentStake"},{"type":"uint256","name":"assessmentStakeLockupExpiry"},{"type":"uint256","name":"assessmentRewards"}]}]},{"type":"function","name":"master","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]},{"type":"function","name":"multicall","constant":false,"payable":false,"inputs":[{"type":"bytes[]","name":"data"}],"outputs":[{"type":"bytes[]","name":"results"}]},{"type":"function","name":"nxm","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]},{"type":"function","name":"stakingViewer","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]}]

OR

Checklist