Contract Source Code:
File 1 of 3 : IMasterAware.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IMasterAware { function changeMasterAddress(address masterAddress) external; function changeDependentContractAddress() external; }
File 2 of 3 : IMCR.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IMCR { function updateMCRInternal(bool forceUpdate) external; function getMCR() external view returns (uint); function mcr() external view returns (uint80); function desiredMCR() external view returns (uint80); function lastUpdateTime() external view returns (uint32); function maxMCRIncrement() external view returns (uint16); function gearingFactor() external view returns (uint24); function minUpdateTime() external view returns (uint16); }
File 3 of 3 : DisposableMCR.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.18; import "../../interfaces/IMasterAware.sol"; import "../../interfaces/IMCR.sol"; contract DisposableMCR is IMCR { uint80 public mcr; uint80 public desiredMCR; uint32 public lastUpdateTime; uint16 public maxMCRIncrement; uint24 public gearingFactor; uint16 public minUpdateTime; constructor( uint80 _mcr, uint80 _desiredMCR, uint32 _lastUpdateTime, uint16 _maxMCRIncrement, uint24 _gearingFactor, uint16 _minUpdateTime ) { require(_lastUpdateTime < block.timestamp, "_lastUpdateTime is in the future"); // values mcr = _mcr; desiredMCR = _desiredMCR; lastUpdateTime = _lastUpdateTime; // parameters maxMCRIncrement = _maxMCRIncrement; gearingFactor = _gearingFactor; minUpdateTime = _minUpdateTime; currentMcrAddress = address(this); } function getMCR() external pure returns (uint) { revert("MCRMockMCRAndFakeMaster: Unexpected getLatestAddress() call"); } function updateMCRInternal(bool) external pure { revert("MCRMockMCRAndFakeMaster: Unexpected updateMCRInternal() call"); } /* fake master functions */ address internal currentMcrAddress = address(this); function getLatestAddress(bytes2) external view returns (address) { return currentMcrAddress; } // update from fake master (this contract) to the real one and trigger initialization function initializeNextMcr(IMasterAware mcrContract, address newMasterAddress) external { currentMcrAddress = address(mcrContract); mcrContract.changeDependentContractAddress(); mcrContract.changeMasterAddress(newMasterAddress); mcrContract.changeDependentContractAddress(); } /* end fake master functions */ }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.