r4bbit
77d77b8017
chore(certora): add rule that MPs are minted at 1-to-1 ratio
...
Closes #27
2024-10-18 13:56:15 +02:00
Andrea Franz
7799fde5b2
feature(XPToken): upgrade to Ownable2Step
2024-10-18 13:55:46 +02:00
Ricardo Guilherme Schmidt
2ee6eb8065
test(RewardsStreamerMP): ensure bonusMP and maxMP are decreased
2024-10-16 14:55:59 +02:00
r4bbit
8de2f2ae0b
test(RewardsStreamerMP): ensure bonusMP and maxMP are decreased
...
correctly at unstake
This commit adds some tests to check that, if a user (partically)
unstakes their funds, their initial and bonus MP get decreased
proportionally, as well as their max mp.
Closes #46
2024-10-16 14:55:59 +02:00
r4bbit
b79deb70f5
chore(certora): add accountMPGreaterEqualsAccountBalance invariant
...
Closes #26
2024-10-16 14:01:51 +02:00
r4bbit
59f2566c78
refactor(RewardStreamerMP): keep track of maxMP instead of
...
`potentialMP`
This commit changes the mechanics to ensure there are no more MP
generated that what's allowed as per max limiting.
Previously we've kept track of `potentialMP` which would decrease as
more MP are generated.
This made verifying certain rules on certora hard and/or impossible.
So we decided to track `maxMP` instead, which only decreases when users
unstake.
This commit also introduces a rule that ensures any accounts MP never
exceed their max mp.
Closes #44
2024-10-16 12:44:47 +02:00
r4bbit
3eb4aa830e
chore(certora): add sumOfBalancesIsTotalStaked invariant
...
Closes #24
2024-10-14 12:04:52 +02:00
Andrea Franz
0b3768d259
chore: remove linter warning and errors
2024-10-14 11:58:28 +02:00
Andrea Franz
43536a4dca
feat(XPNFTToken): add NFTMetadataGeneratorURL
2024-10-14 11:58:28 +02:00
Andrea Franz
9253b0bd55
test(XPNFTToken): add tests to NFTMetadataGeneratorSVG
2024-10-14 11:58:28 +02:00
Andrea Franz
b5517a2828
test(XPNFTToken): add tests
2024-10-14 11:58:28 +02:00
Andrea Franz
e4e8c7c505
chore(XPNFTToken): add INFTMetadataGenerator with Base and SVG generator
2024-10-14 11:58:28 +02:00
Andrea Franz
7352f8837a
feat(XPNFTToken): add XPNFTMetadataGenerator
2024-10-14 11:58:28 +02:00
Andrea Franz
7ed87fada9
feat(XPNFTToken): add base XPNFTToken
2024-10-14 11:58:28 +02:00
Andrea Franz
74522424e6
chore: update gas reports
2024-10-11 16:56:03 +02:00
Andrea Franz
966093e575
chore(XPToken): rename local variables to use the suffix share instead of contribution
2024-10-11 16:56:03 +02:00
Andrea Franz
b9c34ec48e
chore(XPToken): use share instead of contribution in IXPProvider function names
2024-10-11 16:56:03 +02:00
Andrea Franz
478174a356
chore(XPToken): add certora base config
2024-10-11 16:56:03 +02:00
Andrea Franz
117fc2300e
test(XPToken): add tests
2024-10-11 16:56:03 +02:00
Andrea Franz
0a5563e387
chore(XPToken): use XP Contribution for providers functions
2024-10-11 16:56:03 +02:00
Andrea Franz
4b787d478f
chore: update libs
2024-10-11 16:56:03 +02:00
Andrea Franz
f816755340
feat(XPToken): add base XPToken with IXPProvider interface
2024-10-11 16:56:03 +02:00
r4bbit
286bfd2ff4
test: add tests for reaching MP limit
...
Closes #4
2024-10-09 11:45:33 +02:00
r4bbit
0af58f90fb
fix: improve precision loss when unstaking and add testso
...
This commit changes the calculation for when MPs are reduced globally
and for the user that is unstaking.
Instead of getting an `amountRatio` first and using that the
multiplication, we're now applying the `SCALE_FACTOR` to both, the
numerator and denominator to maintain the ratio while increasing
precision.
2024-10-09 11:41:48 +02:00
r4bbit
a48a050bd8
test: add lockup tests
...
Closes #3
2024-10-09 11:41:48 +02:00
r4bbit
47440677a8
test: add dedicated tests for smaller scenarios
2024-10-09 11:36:05 +02:00
r4bbit
24c3469cd1
chore: make linter and formatter happy
2024-09-25 10:23:46 +02:00
Andrea Franz
532c90f1c2
chore: fix repo name in package.json ( #6 )
2024-09-25 10:15:39 +02:00
Andrea Franz
4ef75621a3
import foundry template ( #1 )
2024-09-25 09:39:14 +02:00
Andrea Franz
197262ba79
re-enable and fix all tests on user attributes
2024-09-18 12:36:58 +02:00
Andrea Franz
36ef21361c
fix tests
2024-09-18 12:26:48 +02:00
Andrea Franz
a19b122d4f
fix rewards calculation with MPs
2024-09-18 11:41:17 +02:00
Andrea Franz
9f8a808e07
add test file for RewardsStreamerMP
2024-09-16 13:43:39 +02:00
Andrea Franz
d9ddfddaab
reorder function and introduce updateGlobalState that updates both reward index and global MP
2024-09-16 13:38:37 +02:00
Andrea Franz
2aab9a8b8b
remove calculation of totalMP and userMP in the user calculations. They are already updated in updateGlobalMP.
2024-09-16 13:00:55 +02:00
Andrea Franz
c74a2e936c
set user.lockUntil to 0 if there's no locking period (in case there was before)
2024-09-16 13:00:28 +02:00
Andrea Franz
f543722bdf
set lastMPUpdatedTime in the constructor to the current block's timestamp
2024-09-16 12:59:58 +02:00
Andrea Franz
d021a617e2
fix updateUserMP
2024-09-16 12:42:24 +02:00
Andrea Franz
6bebb16c6f
improve updateGlobalMP
2024-09-16 12:41:52 +02:00
Andrea Franz
4a4549dec9
change updateUserRewards to use staked tokens and MPs with the same weight
2024-09-16 12:40:41 +02:00
Andrea Franz
4eeec95c9f
move getter functions
2024-09-16 12:40:04 +02:00
Andrea Franz
54ddaa71f2
change updateRewardIndex to count staked tokens and MP with the same weight
2024-09-16 12:38:38 +02:00
Andrea Franz
90250c9ebc
fix unstake function
2024-09-16 12:38:05 +02:00
Andrea Franz
e9ea8102e1
fix calculation in stake function
2024-09-16 12:37:30 +02:00
Andrea Franz
912d0bd100
add tests on reward index after staking and unstaking
2024-09-13 16:36:23 +02:00
Andrea Franz
99776251c9
update accountedRewards when rewards are distributed
2024-09-13 16:36:05 +02:00
Andrea Franz
be5cdb42b6
add Rewards Streamer with Multiplier Points
2024-09-11 15:56:32 +02:00
Andrea Franz
43088c4551
update README
2024-09-11 15:55:20 +02:00
Andrea Franz
6ee5259fb5
update names to use RewardsStreamer
2024-09-11 15:52:59 +02:00
Andrea Franz
d146e822c2
remove MP from main contract
2024-09-11 15:41:52 +02:00