|
|
@@ -1,19 +1,12 @@
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
pragma solidity >=0.4.22 <0.9.0;
|
|
|
|
|
|
-contract Migrations {
|
|
|
- address public owner = msg.sender;
|
|
|
- uint public last_completed_migration;
|
|
|
+import "@openzeppelin/contracts/access/Ownable.sol";
|
|
|
|
|
|
- modifier restricted() {
|
|
|
- require(
|
|
|
- msg.sender == owner,
|
|
|
- "This function is restricted to the contract's owner"
|
|
|
- );
|
|
|
- _;
|
|
|
- }
|
|
|
+contract Migrations is Ownable {
|
|
|
+ uint public last_completed_migration;
|
|
|
|
|
|
- function setCompleted(uint completed) public restricted {
|
|
|
+ function setCompleted(uint completed) public onlyOwner {
|
|
|
last_completed_migration = completed;
|
|
|
}
|
|
|
-}
|
|
|
+}
|