mirror of
https://github.com/vacp2p/minimal-swap-poc.git
synced 2026-01-08 21:08:10 -05:00
Import ERC20PresetMinterPauser for migrations
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.4.22 <0.8.0;
|
||||
pragma solidity =0.6.12;
|
||||
import "@openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol";
|
||||
|
||||
contract Migrations {
|
||||
address public owner = msg.sender;
|
||||
address public owner;
|
||||
uint public last_completed_migration;
|
||||
|
||||
modifier restricted() {
|
||||
require(
|
||||
msg.sender == owner,
|
||||
"This function is restricted to the contract's owner"
|
||||
);
|
||||
_;
|
||||
if (msg.sender == owner) _;
|
||||
}
|
||||
|
||||
constructor() public {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
function setCompleted(uint completed) public restricted {
|
||||
last_completed_migration = completed;
|
||||
}
|
||||
|
||||
function upgrade(address new_address) public restricted {
|
||||
Migrations upgraded = Migrations(new_address);
|
||||
upgraded.setCompleted(last_completed_migration);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user