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

[WIP] Horizon Staking #967

Merged
merged 18 commits into from
May 17, 2024
Merged

[WIP] Horizon Staking #967

merged 18 commits into from
May 17, 2024

Conversation

pcarranzav
Copy link
Member

No description provided.

Copy link

openzeppelin-code bot commented Apr 10, 2024

[WIP] Horizon Staking

Generated at commit: 4db24c1dc242bcd9c484f5d78ab4bc06a809a16f

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
4
0
15
43
64
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@tmigone tmigone changed the title [WIP/Experimental] Horizon Staking [WIP] Horizon Staking Apr 12, 2024
Copy link

socket-security bot commented Apr 13, 2024

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

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] environment 0 20.3 kB nicolo-ribaudo
npm/@changesets/[email protected] filesystem 0 177 kB changesets-release-bot
npm/@changesets/[email protected] None 0 151 kB changesets-release-bot
npm/@changesets/[email protected] None 0 9.82 kB changesets-release-bot
npm/@changesets/[email protected] environment, filesystem, shell 0 123 kB changesets-release-bot
npm/@changesets/[email protected] filesystem 0 41.3 kB changesets-release-bot
npm/@changesets/[email protected] None 0 8.24 kB changesets-release-bot
npm/@changesets/[email protected] None 0 26 kB changesets-release-bot
npm/@changesets/[email protected] None 0 22.8 kB changesets-release-bot
npm/@changesets/[email protected] None 0 5.98 kB changesets-release-bot
npm/@changesets/[email protected] filesystem 0 70.8 kB changesets-release-bot
npm/@changesets/[email protected] None 0 9.81 kB changesets-release-bot
npm/@changesets/[email protected] None 0 18.8 kB changesets-release-bot
npm/@changesets/[email protected] filesystem 0 23.1 kB changesets-release-bot
npm/@changesets/[email protected] filesystem 0 30.4 kB changesets-release-bot
npm/@changesets/[email protected] None 0 22.1 kB changesets-release-bot
npm/@changesets/[email protected] filesystem 0 14.6 kB changesets-release-bot
npm/@commitlint/[email protected] None 0 30.6 kB escapedcat
npm/@commitlint/[email protected] None 0 18.8 kB escapedcat
npm/@commitlint/[email protected] None 0 12.2 kB escapedcat
npm/@commitlint/[email protected] None 0 13.7 kB escapedcat
npm/@commitlint/[email protected] None 0 3.97 kB escapedcat
npm/@commitlint/[email protected] None 0 13.2 kB escapedcat
npm/@commitlint/[email protected] None +1 103 kB escapedcat
npm/@commitlint/[email protected] None 0 14.7 kB escapedcat
npm/@commitlint/[email protected] environment, filesystem +1 71.7 kB escapedcat
npm/@commitlint/[email protected] None 0 2.81 kB escapedcat
npm/@commitlint/[email protected] None 0 4.57 kB escapedcat
npm/@commitlint/[email protected] filesystem 0 12.4 kB escapedcat
npm/@commitlint/[email protected] None 0 12.4 kB escapedcat
npm/@commitlint/[email protected] None 0 86.5 kB escapedcat
npm/@commitlint/[email protected] None 0 2.79 kB escapedcat
npm/@commitlint/[email protected] None 0 3.98 kB escapedcat
npm/@commitlint/[email protected] None 0 27.2 kB escapedcat
npm/@manypkg/[email protected] environment, filesystem +1 159 kB manypkg-release-bot
npm/@manypkg/[email protected] environment, filesystem +1 52.8 kB manypkg-release-bot
npm/@types/[email protected] None 0 96.1 kB types
npm/@types/[email protected] None 0 760 kB types
npm/@types/[email protected] None 0 5.81 kB types
npm/[email protected] eval 0 1.03 MB esp
npm/[email protected] environment 0 26.1 kB jonschlinkert
npm/[email protected] None 0 13.5 kB ljharb
npm/[email protected] None 0 2.15 kB stevemao
npm/[email protected] None 0 18.7 kB ljharb
npm/[email protected] None 0 20.2 kB ljharb
npm/[email protected] None 0 2.34 kB sindresorhus
npm/[email protected] None 0 20.4 kB ljharb
npm/[email protected] None 0 3.06 kB zkochan
npm/[email protected] None 0 15.1 kB tecfu
npm/[email protected] None 0 22.1 kB ljharb
npm/[email protected] None 0 6.33 kB sindresorhus
npm/[email protected] None 0 8.86 kB sindresorhus
npm/[email protected] None 0 7.45 kB sindresorhus
npm/[email protected] environment +1 36.3 kB sindresorhus
npm/[email protected] filesystem 0 74.8 kB runk
npm/[email protected] environment 0 26.1 kB sibiraj-s
npm/[email protected] None 0 14.9 kB bcoe
npm/[email protected] None 0 4.76 kB stevemao
npm/[email protected] filesystem 0 13.7 kB oss-bot
npm/[email protected] filesystem 0 16.1 kB oss-bot
npm/[email protected] None +1 521 kB oss-bot
npm/[email protected] None 0 12.6 kB codex-
npm/[email protected] filesystem 0 78.5 kB d-fischer
npm/[email protected] None 0 550 kB david
npm/[email protected] None 0 668 kB david
npm/[email protected] None 0 538 kB david
npm/[email protected] None 0 693 kB david
npm/[email protected] None 0 11.5 kB sindresorhus
npm/[email protected] None +1 6.55 kB sindresorhus
npm/[email protected] None 0 2.94 kB sindresorhus
npm/[email protected] None 0 30.9 kB ljharb
npm/[email protected] None 0 12.9 kB ljharb
npm/[email protected] None 0 9.68 kB sindresorhus
npm/[email protected] None 0 9.61 kB sindresorhus
npm/[email protected] environment 0 189 kB jonschlinkert
npm/[email protected] None 0 2.38 MB ljharb
npm/[email protected] None 0 11.8 kB ljharb
npm/[email protected] None 0 12.3 kB ljharb
npm/[email protected] None 0 13.9 kB ljharb
npm/[email protected] None 0 11 kB ljharb
npm/[email protected] None 0 40.4 kB ljharb
npm/[email protected] None 0 6.61 kB vilic
npm/[email protected] environment, filesystem, shell 0 27 kB mrkmg
npm/[email protected] filesystem 0 96.7 kB mrmlnc
npm/[email protected] None 0 16.4 kB jonschlinkert
npm/[email protected] Transitive: filesystem +1 18.8 kB sindresorhus
npm/[email protected] filesystem 0 26.4 kB bluelovers
npm/[email protected] filesystem 0 124 kB ryanzim
npm/[email protected] None 0 31.4 kB ljharb
npm/[email protected] None 0 25.5 kB ljharb
npm/[email protected] eval 0 41.6 kB ljharb
npm/[email protected] None 0 14.3 kB ljharb
npm/[email protected] shell +1 38.5 kB oss-bot
npm/[email protected] environment, filesystem 0 5.86 kB sindresorhus
npm/[email protected] None 0 7.7 kB ljharb
npm/[email protected] None 0 237 kB orling
npm/[email protected] None 0 5.14 kB sindresorhus
npm/[email protected] None 0 10.9 kB ljharb
npm/[email protected] None 0 8.77 kB ljharb
npm/[email protected] None 0 25.8 kB nlf
npm/[email protected] None 0 8.4 kB safebyte
npm/[email protected] environment, filesystem, shell 0 6.44 kB typicode
npm/[email protected] Transitive: filesystem, unsafe +1 9.51 kB sindresorhus
npm/[email protected] None 0 4.4 kB sindresorhus
npm/[email protected] None 0 9.3 kB isaacs
npm/[email protected] None 0 4.05 kB qix
npm/[email protected] None 0 9.62 kB jonschlinkert
npm/[email protected] None 0 2.82 kB sindresorhus
npm/[email protected] None 0 2.62 kB sindresorhus
npm/[email protected] None 0 3.86 kB zkochan
npm/[email protected] None 0 2.95 kB sindresorhus
npm/[email protected] None 0 7.96 kB jonschlinkert
npm/[email protected] eval Transitive: environment, filesystem +1 408 kB vitaly
npm/[email protected] None 0 0 B
npm/[email protected] filesystem +1 13.9 kB sindresorhus
npm/[email protected] None 0 21.9 kB jdalton
npm/[email protected] None 0 7.35 kB jdalton
npm/[email protected] None 0 17.7 kB jdalton
npm/[email protected] None 0 54.2 kB jdalton
npm/[email protected] None 0 17.7 kB jdalton
npm/[email protected] None 0 21.5 kB jdalton
npm/[email protected] None 0 25 kB jdalton
npm/[email protected] None 0 11.4 kB jdalton
npm/[email protected] None 0 9.49 kB sindresorhus
npm/[email protected] None +2 133 kB sindresorhus
npm/[email protected] None 0 2.97 kB thejameskyle
npm/[email protected] None 0 8.53 kB vdemedes
npm/[email protected] None +1 52.3 kB gar
npm/[email protected] None 0 26.5 kB ljharb
npm/[email protected] None 0 3.06 kB sindresorhus
npm/[email protected] None 0 35.1 kB cspotcode
npm/[email protected] None 0 5.81 kB sindresorhus
npm/[email protected] None 0 7.49 kB sindresorhus
npm/[email protected] None 0 4.37 kB sindresorhus
npm/[email protected] None 0 7.23 kB sindresorhus
npm/[email protected] None +1 16.4 kB sindresorhus
npm/[email protected] None 0 5.06 kB zkochan
npm/[email protected] None 0 8.37 kB feross
npm/[email protected] None 0 7.47 kB sindresorhus
npm/[email protected] filesystem +2 99 kB sindresorhus
npm/[email protected] None 0 3.2 kB zkochan
npm/[email protected] None 0 3.6 kB sindresorhus
npm/[email protected] None 0 3.93 kB bcoe
npm/[email protected] filesystem, unsafe 0 5.82 kB sindresorhus
npm/[email protected] None 0 4.34 kB sindresorhus
npm/[email protected] None 0 9.44 kB matteo.collina
npm/[email protected] None 0 4.22 kB bcoe
npm/[email protected] None 0 14.7 kB ljharb
npm/[email protected] None 0 2.56 kB kevva
npm/[email protected] Transitive: environment, filesystem +2 338 kB tecfu
npm/[email protected] Transitive: environment, filesystem, shell +3 41.7 kB thejameskyle
npm/[email protected] None 0 34.8 kB alexei
npm/[email protected] None 0 556 kB david
npm/[email protected] None 0 14.4 kB matteo.collina
npm/[email protected] None 0 5.16 kB sindresorhus
npm/[email protected] None 0 4.03 kB sindresorhus
npm/[email protected] None 0 3 kB sindresorhus
npm/[email protected] None 0 3.31 kB sindresorhus
npm/[email protected] None 0 7.04 kB sindresorhus
npm/[email protected] environment, shell 0 64.4 kB sindresorhus
npm/[email protected] None 0 6.27 kB sindresorhus
npm/[email protected] None 0 12.5 kB dominictarr
npm/[email protected] filesystem 0 26 kB raszi
npm/[email protected] None 0 22.9 kB jonschlinkert
npm/[email protected] None 0 3.85 kB sindresorhus
npm/[email protected] environment, filesystem 0 49.7 kB tecfu
npm/[email protected] None 0 16.6 kB kemitchell
npm/[email protected] None 0 4.04 kB nexdrew
npm/[email protected] None 0 4.19 kB zkochan
npm/[email protected] None 0 9.5 kB sindresorhus
npm/[email protected] filesystem 0 11 kB oss-bot
npm/[email protected] environment, filesystem 0 292 kB oss-bot

🚮 Removed packages: npm/@aws-sdk/[email protected], npm/@aws-sdk/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@cspotcode/[email protected], npm/@eslint-community/[email protected], npm/@eslint-community/[email protected], npm/@fastify/[email protected], npm/@humanwhocodes/[email protected], npm/@humanwhocodes/[email protected], npm/@humanwhocodes/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@smithy/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@ungap/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Apr 13, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@pcarranzav pcarranzav marked this pull request as ready for review May 17, 2024 14:35
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (2585495) to head (4db24c1).

Additional details and impacted files
@@           Coverage Diff            @@
##           horizon     #967   +/-   ##
========================================
  Coverage    92.70%   92.70%           
========================================
  Files           46       46           
  Lines         2370     2370           
  Branches       426      426           
========================================
  Hits          2197     2197           
  Misses         173      173           
Flag Coverage Δ
unittests 92.70% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +507 to +510
return
serviceProviders[serviceProvider].tokensStaked -
serviceProviders[serviceProvider].tokensProvisioned -
serviceProviders[serviceProvider].__DEPRECATED_tokensLocked;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return
serviceProviders[serviceProvider].tokensStaked -
serviceProviders[serviceProvider].tokensProvisioned -
serviceProviders[serviceProvider].__DEPRECATED_tokensLocked;
return
serviceProviders[serviceProvider].tokensStaked -
serviceProviders[serviceProvider].tokensProvisioned -
serviceProviders[serviceProvider].__DEPRECATED_tokensLocked -
serviceProviders[serviceProvider].__DEPRECATED_tokensAllocated;

I think we need to also deduct tokensAllocated to prevent service providers from "double dipping" the stake.

@tmigone tmigone merged commit a94a455 into horizon May 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants