tests/solidity: add contract to test every opcode (#19283)

Fixes #18210
This commit is contained in:
Lucas Hendren
2019-09-26 04:30:33 -04:00
committed by Felix Lange
parent 0568e81701
commit 62391ddbeb
7 changed files with 503 additions and 0 deletions

View File

@ -0,0 +1,23 @@
pragma solidity >=0.4.21 <0.6.0;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
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);
}
}