Skip to content

Commit

Permalink
Setters for L1 gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Carranza Velez committed Mar 25, 2022
1 parent c2ff46a commit 69626a9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion contracts/gateway/L1GraphTokenGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 69626a9

Please sign in to comment.