contracts icon indicating copy to clipboard operation
contracts copied to clipboard

Arbitrum bridge + rewards distribution

Open pcarranzav opened this issue 3 years ago • 3 comments
trafficstars

Motivation

Based on discussions that have been going on in the past few months (see this Forum discussion), it seems that there is interest in the community for scaling through a Layer 2 network. Conversations between core dev teams point towards an Arbitrum Graph devnet as the most viable first step in this direction.

This devnet would require, among other things, a way to bridge GRT from L1 into L2 and back. This bridge should be the canonical way to send GRT into Arbitrum, but it should be extensible to support any protocol-specific behavior that may be necessary, both for the initial devnet deployment and the eventual "mainnet” release. This GIP covers the specification of such bridge.

GIPs for discussions in the forum:

  • https://forum.thegraph.com/t/gip-0031-arbitrum-grt-bridge/3305
  • https://forum.thegraph.com/t/gip-0034-the-graph-arbitrum-devnet-with-a-new-rewards-issuance-and-distribution-mechanism/3418

Changes

  • We add the following contracts L1GraphTokenGateway, BridgeEscrow, L2GraphTokenGateway and L2GraphToken
  • Deployment commands in the CLI are updated to include an L2 deployment
  • Configuration and address book entries for Arbitrum are added as well.
  • L1Reservoir and L2Reservoir are introduced, changing the RewardsManager to pull. rewards from them instead of minting.

(Edited to add the changes from #556 and #571 as these were merged on top of this PR)

pcarranzav avatar Mar 24 '22 13:03 pcarranzav

Codecov Report

Merging #552 (df5599f) into dev (7c6e27d) will increase coverage by 1.61%. The diff coverage is 99.72%.

:exclamation: Current head df5599f differs from pull request most recent head b99d31f. Consider uploading reports for the commit b99d31f to get more accurate results

@@            Coverage Diff             @@
##              dev     #552      +/-   ##
==========================================
+ Coverage   90.35%   91.96%   +1.61%     
==========================================
  Files          35       44       +9     
  Lines        1762     2092     +330     
  Branches      296      361      +65     
==========================================
+ Hits         1592     1924     +332     
+ Misses        170      168       -2     
Flag Coverage Δ
unittests 91.96% <99.72%> (+1.61%) :arrow_up:

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

Impacted Files Coverage Δ
contracts/tests/ReservoirMock.sol 66.66% <66.66%> (ø)
contracts/gateway/BridgeEscrow.sol 100.00% <100.00%> (ø)
contracts/gateway/GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/gateway/L1GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/governance/Managed.sol 100.00% <100.00%> (+1.92%) :arrow_up:
contracts/l2/gateway/L2GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/l2/reservoir/L2Reservoir.sol 100.00% <100.00%> (ø)
contracts/l2/token/GraphTokenUpgradeable.sol 100.00% <100.00%> (ø)
contracts/l2/token/L2GraphToken.sol 100.00% <100.00%> (ø)
contracts/reservoir/L1Reservoir.sol 100.00% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Mar 24 '22 13:03 codecov[bot]

I've deployed this to a new deployment on Rinkeby and I'm working on some CLI commands to configure the new contracts and interact with them, but doing this in a separate PR, see #556

pcarranzav avatar Apr 05 '22 15:04 pcarranzav

Socket Security Report

👍 No new dependency issues detected in pull request

Socket.dev scan summary
Issue Status
Did you mean? ✅ no new possible package typos
Install scripts ✅ no new install scripts
Telemetry ✅ no new telemetry
Troll package ✅ no new troll packages
Malware ✅ no new malware
Native code ✅ no new native modules

Powered by socket.dev

socket-security[bot] avatar Jul 27 '22 22:07 socket-security[bot]

Superseded by #699 so closing

pcarranzav avatar Dec 21 '22 14:12 pcarranzav