// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "./SecurityLayer.sol"; contract MainDataRelay is Owner { uint public latest_version =0; mapping(uint=>address) version_history; function UpdateVersion(address _abcContractAddress) public isOwner{ version_history[latest_version] = _abcContractAddress; latest_version++; } function getLatestVersion() public view returns(address ret) { return version_history[latest_version-1]; } function getContractByVersionNumber(uint version) public view returns(address ret) { if(version>=latest_version) return version_history[latest_version-1]; return version_history[version]; } function getVersionNumber() public view returns(uint ret) { // if(latest_version>0) // return latest_version-1; return latest_version; } }