// SPDX-License-Identifier: MIT
// This line specifies the license under which the code is released.
// Specifies the version of Solidity that the contract is compatible with
pragma solidity >=0.4.22 <0.9.0;
// The contract definition begins here
contract Migrations {
// State variables declaration
// Address of the contract owner
address public owner = msg.sender;
// Variable to store the last completed migration
uint public last_completed_migration;
// Modifier to restrict access to certain functions
modifier restricted() {
// Ensures that only the contract owner can execute the function
require(
msg.sender == owner,
"This function is restricted to the contract's owner"
);
_; // This indicates that the rest of the function's code should execute
}
// Function to set the completed migration
function setCompleted(uint completed) public restricted {
// Update the last completed migration with the provided value
last_completed_migration = completed;
}
}