mirror of
https://github.com/luxfi/onchain-id.git
synced 2026-10-30 15:23:49 +00:00
OpenZeppelin v5 requires explicit owner in Ownable constructor. Required for solc 0.8.31 + OZ v5 build (see partner/contracts foundry.toml). 2 files: IdFactory, ImplementationAuthority.
35 lines
1.1 KiB
Solidity
35 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: GPL-3.0
|
|
|
|
pragma solidity ^0.8.17;
|
|
|
|
import "../interface/IImplementationAuthority.sol";
|
|
import "@openzeppelin/contracts/access/Ownable.sol";
|
|
|
|
contract ImplementationAuthority is IImplementationAuthority, Ownable {
|
|
|
|
// the address of implementation of ONCHAINID
|
|
address internal _implementation;
|
|
|
|
constructor(address implementation) Ownable(msg.sender) {
|
|
require(implementation != address(0), "invalid argument - zero address");
|
|
_implementation = implementation;
|
|
emit UpdatedImplementation(implementation);
|
|
}
|
|
|
|
/**
|
|
* @dev See {IImplementationAuthority-updateImplementation}.
|
|
*/
|
|
function updateImplementation(address _newImplementation) external override onlyOwner {
|
|
require(_newImplementation != address(0), "invalid argument - zero address");
|
|
_implementation = _newImplementation;
|
|
emit UpdatedImplementation(_newImplementation);
|
|
}
|
|
|
|
/**
|
|
* @dev See {IImplementationAuthority-getImplementation}.
|
|
*/
|
|
function getImplementation() external override view returns(address) {
|
|
return _implementation;
|
|
}
|
|
}
|