Skip to content

Commit

Permalink
tests/solidity: add contract to test every opcode (#19283)
Browse files Browse the repository at this point in the history
Fixes #18210
  • Loading branch information
lhendre authored and fjl committed Sep 26, 2019
1 parent 0568e81 commit 62391dd
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/solidity/bytecode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tests/solidity/contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -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);
}
}
Loading

0 comments on commit 62391dd

Please sign in to comment.