Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: node management, endorsing and gm #30

Merged
merged 25 commits into from
Nov 22, 2024
Merged

feat: node management, endorsing and gm #30

merged 25 commits into from
Nov 22, 2024

Conversation

roisindowling
Copy link
Contributor

Upgrade X2EarnApps to Version 2

Added Vechain Node XApp Endorsement feature.

Changes 🚀

  • Upgraded Contract(s):
    • X2EarnApps.sol to version 2

Storage Changes 📦

  • EndorsementUpgradeable.sol:
    • Added _unendorsedApps to store the list of apps pending endorsement.
    • Added _unendorsedAppsIndex to store mapping from app ID to index in the _unendorsedApps array.
    • Added _appEndorsers to store the mapping of each app ID to an array of node IDs that have endorsed it.
    • Added _nodeEnodorsmentScore to score the endorsement score for each node level.
    • Added _appGracePeriodStart to store the grace period elapsed by the app since endorsed.
    • Added _nodeToEndorsedApp to store the mapping of a node ID to the app it currently endorses.
    • Added _gracePeriodDuration to store the grace period threshold for no endorsement in blocks.
    • Added _endorsementScoreThreshold to store the endorsement score threshold for an app to be eligible for voting.
    • Added _appScores to store the score of each app.
    • Added _appSecurity to store the security score of each app.
    • Added _nodeManagementContract to store the node management contract address.
    • Added _veBetterPassport to store the VeBetterPassport contract address.
  • EndorsementUpgradeable.sol:
    • Added _creators to store a mapping of addresses that have a creators NFT and can manage interactions with Node holders for a specifc XApp.
    • Added _creatorApps to store the number of apps created by a creator.
    • Added _x2EarnCreatorContract to store the address of the X2Earn Creators contract.
  • VoteEligibilityUpgradeable.sol:
    • Added _blackList to store a record blacklisted X2Earn appIds.

New Features 🚀

  • Added EndorsementUpgradeable.sol module which makes up all X2EarnApps endorsement logic and functions (see docs for more info).
  • Replaced appApp() with submitApp().
  • Added getter isBlacklisted() to check if XApp is blacklisted.
  • Added removeAppCreator(), appCreators(), isAppCreator() and creatorApps() to manage and get info on X2Earn app creators.

Bug Fixes 🐛

    • Added libraries AdministrationUtils.sol, EndorsementUtils.sol, AppStorageUtils.sol and VoteEligibilityUtils.sol to store some of the logic for the X2EarnApps contracts modules to reduce contract size.

@roisindowling roisindowling requested a review from a team as a code owner November 19, 2024 09:14
@roisindowling roisindowling marked this pull request as draft November 19, 2024 09:14
Copy link

socket-security bot commented Nov 19, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@ampproject/[email protected] None +1 248 kB jridgewell
npm/@babel/[email protected] None 0 33.2 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 66.4 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] environment, filesystem, unsafe +2 2.7 MB nicolo-ribaudo
npm/@babel/[email protected] None 0 543 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None +1 122 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 63.7 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 161 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 31.8 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 48.3 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 11.8 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] None 0 863 kB existentialism, hzoo, jlhwung, ...1 more
npm/@babel/[email protected] Transitive: environment +1 2.62 MB nicolo-ribaudo
npm/@babel/[email protected] None +1 712 kB nicolo-ribaudo
npm/@istanbuljs/[email protected] environment, filesystem Transitive: eval +2 310 kB coreyfarrell
npm/@istanbuljs/[email protected] None 0 17.2 kB coreyfarrell
npm/[email protected] None 0 8.33 kB jakxz
npm/[email protected] None 0 8.42 kB substack
npm/[email protected] environment, filesystem 0 64.2 kB ai
npm/[email protected] filesystem 0 10.1 kB coreyfarrell
npm/[email protected] None 0 2.14 MB ai, beneb, caniuse-lite
npm/[email protected] None 0 4.79 kB substack
npm/[email protected] filesystem 0 11.4 kB thlorenz
npm/[email protected] filesystem +1 7.25 kB sindresorhus
npm/[email protected] None 0 152 kB kilianvalkhof
npm/[email protected] None 0 9.86 kB bjy
npm/[email protected] filesystem +1 16.8 kB sindresorhus
npm/[email protected] None 0 4.95 kB feross
npm/[email protected] None 0 28.9 kB loganfsmyth
npm/[email protected] filesystem 0 6.01 kB coreyfarrell
npm/[email protected] filesystem +1 74 kB sindresorhus
npm/[email protected] None 0 13.1 kB webreflection
npm/[email protected] None 0 7.96 kB jonschlinkert
npm/[email protected] None 0 34.4 kB oss-bot
npm/[email protected] unsafe 0 17.9 kB coreyfarrell
npm/[email protected] None +1 168 kB oss-bot
npm/[email protected] environment, filesystem 0 16.1 kB isaacs
npm/[email protected] filesystem +2 54.6 kB oss-bot
npm/[email protected] filesystem 0 34.1 kB oss-bot
npm/[email protected] None 0 294 kB oss-bot
npm/[email protected] None 0 15.1 kB lydell
npm/[email protected] None 0 31.7 kB mathias
npm/[email protected] None 0 235 kB jordanbtucker
npm/[email protected] None 0 12.1 kB jdalton
npm/[email protected] environment 0 9.22 kB coreyfarrell
npm/[email protected] None 0 35.7 kB chicoxyzzy
npm/[email protected] environment, filesystem, unsafe +15 404 kB bcoe
npm/[email protected] environment, shell 0 9.18 kB coreyfarrell
npm/[email protected] None 0 4.75 kB sindresorhus
npm/[email protected] None 0 8.29 kB coreyfarrell
npm/[email protected] None 0 10.9 kB novemberborn
npm/[email protected] environment, filesystem, shell, unsafe +1 43.5 kB coreyfarrell
npm/[email protected] None 0 23.6 kB coreyfarrell
npm/[email protected] environment, filesystem, shell 0 14.8 kB ai
npm/[email protected] filesystem 0 12.8 kB isaacs

View full report↗︎

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 97.74011% with 16 lines in your changes missing coverage. Please review.

Project coverage is 93.90%. Comparing base (f0287fb) to head (650d853).

Files with missing lines Patch % Lines
contracts/GalaxyMember.sol 95.74% 6 Missing ⚠️
...s/x-2-earn-apps/modules/EndorsementUpgradeable.sol 97.63% 3 Missing ⚠️
contracts/VoterRewards.sol 93.93% 2 Missing ⚠️
contracts/X2EarnApps.sol 95.23% 2 Missing ⚠️
contracts/X2EarnCreator.sol 96.07% 2 Missing ⚠️
...ts/x-2-earn-apps/libraries/AdministrationUtils.sol 98.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   96.79%   93.90%   -2.90%     
==========================================
  Files          48       55       +7     
  Lines        3437     3463      +26     
  Branches      474      774     +300     
==========================================
- Hits         3327     3252      -75     
- Misses        109      211     +102     
+ Partials        1        0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@roisindowling roisindowling marked this pull request as ready for review November 19, 2024 10:15
@Agilulfo1820 Agilulfo1820 merged commit 9a8ed13 into main Nov 22, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants