Skip to content

Commit

Permalink
Set CoreProperties upgradeable
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanProgrammer committed Apr 5, 2024
1 parent 67283a1 commit 27a351a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
14 changes: 10 additions & 4 deletions contracts/L1/CorePropertiesL1.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

contract CorePropertiesL1 is Ownable {
contract CorePropertiesL1 is UUPSUpgradeable, OwnableUpgradeable {
address public arbitrumGateway;
address public treasuryAddress;

Expand All @@ -12,12 +13,15 @@ contract CorePropertiesL1 is Ownable {

mapping(address => uint256) private _fees;

constructor(
function __CorePropertiesL1_init(
address arbitrumGateway_,
address treasuryAddress_,
address lZEnpointAddress_,
uint256 destinationChainId_
) {
) external initializer {
__Ownable_init();
__UUPSUpgradeable_init();

arbitrumGateway = arbitrumGateway_;
treasuryAddress = treasuryAddress_;
lZEnpointAddress = lZEnpointAddress_;
Expand Down Expand Up @@ -49,4 +53,6 @@ contract CorePropertiesL1 is Ownable {
function getDeployParams() external view returns (address, address) {
return (arbitrumGateway, lZEnpointAddress);
}

function _authorizeUpgrade(address) internal override onlyOwner {}
}
20 changes: 18 additions & 2 deletions contracts/L2/CorePropertiesL2.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

contract CorePropertiesL2 is Ownable {
contract CorePropertiesL2 is UUPSUpgradeable, OwnableUpgradeable {
address public lZEnpointAddress;
address public lZGatewayAddress;
uint16 public l1ChainId;

function __CorePropertiesL2_init(
address lZEnpointAddress_,
address lZGatewayAddress_,
uint16 l1ChainId_
) external initializer {
__Ownable_init();
__UUPSUpgradeable_init();

lZEnpointAddress = lZEnpointAddress_;
lZGatewayAddress = lZGatewayAddress_;
l1ChainId = l1ChainId_;
}

function setDeployParams(
address lZEnpointAddress_,
address lZGatewayAddress_,
Expand All @@ -21,4 +35,6 @@ contract CorePropertiesL2 is Ownable {
function getDeployParams() external view returns (address, address, uint16) {
return (lZEnpointAddress, lZGatewayAddress, l1ChainId);
}

function _authorizeUpgrade(address) internal override onlyOwner {}
}

0 comments on commit 27a351a

Please sign in to comment.