solidity/test/compilationTests/gnosis/Migrations.sol

24 lines
498 B
Solidity
Raw Normal View History

2018-10-24 12:52:11 +00:00
pragma solidity >=0.0;
2017-07-12 13:46:33 +00:00
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
2020-06-23 12:14:24 +00:00
constructor() {
2017-07-12 13:46:33 +00:00
owner = msg.sender;
}
2018-07-04 17:20:51 +00:00
function setCompleted(uint completed) public restricted {
2017-07-12 13:46:33 +00:00
last_completed_migration = completed;
}
2018-07-04 17:20:51 +00:00
function upgrade(address new_address) public restricted {
2017-07-12 13:46:33 +00:00
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}