From 69626a96e7b30d9f14570ff3dfe08630e23e9a1a Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Fri, 25 Mar 2022 17:15:48 -0300 Subject: [PATCH] Setters for L1 gateway --- contracts/gateway/L1GraphTokenGateway.sol | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/contracts/gateway/L1GraphTokenGateway.sol b/contracts/gateway/L1GraphTokenGateway.sol index e5e0b507d..1c1cbd519 100644 --- a/contracts/gateway/L1GraphTokenGateway.sol +++ b/contracts/gateway/L1GraphTokenGateway.sol @@ -24,7 +24,6 @@ import "../governance/Managed.sol"; contract L1GraphTokenGateway is GraphUpgradeable, Pausable, Managed, L1ArbitrumMessenger, ITokenGateway, ReentrancyGuardUpgradeable { using SafeMath for uint256; - // TODO add functions to properly manage all these address public l2GRT; address public inbox; address public l1Router; @@ -46,6 +45,10 @@ contract L1GraphTokenGateway is GraphUpgradeable, Pausable, Managed, L1ArbitrumM uint256 _amount ); + event ArbitrumAddressesSet(address _inbox, address _l1Router); + event L2TokenAddressSet(address _l2GRT); + event L2CounterpartAddressSet(address _l2Counterpart); + /** * @dev Allows a function to be called only by the gateway's L2 counterpart. */ @@ -79,6 +82,22 @@ contract L1GraphTokenGateway is GraphUpgradeable, Pausable, Managed, L1ArbitrumM _paused = true; } + function setArbitrumAddresses(address _inbox, address _l1Router) external onlyGovernor { + inbox = _inbox; + l1Router = _l1Router; + emit ArbitrumAddressesSet(_inbox, _l1Router); + } + + function setL2TokenAddress(address _l2GRT) external onlyGovernor { + l2GRT = _l2GRT; + emit L2TokenAddressSet(_l2GRT); + } + + function setL2CounterpartAddress(address _l2Counterpart) external onlyGovernor { + l2Counterpart = _l2Counterpart; + emit L2CounterpartAddressSet(_l2Counterpart); + } + /** * @notice Creates and sends a retryable ticket to transfer GRT to L2 using the Arbitrum Inbox. * The tokens are escrowed by the gateway until they are withdrawn back to L1.