-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCube.sol
More file actions
32 lines (25 loc) · 737 Bytes
/
Cube.sol
File metadata and controls
32 lines (25 loc) · 737 Bytes
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
pragma solidity ^0.4.11;
import './Cubic.sol';
contract Cube {
address public destination;
Cubic public cubicContract;
uint public unlockedAfter;
uint public id;
function Cube(address _destination, uint _unlockedAfter, Cubic _cubicContract) payable {
destination = _destination;
unlockedAfter = _unlockedAfter;
cubicContract = _cubicContract;
}
function() payable {
require(msg.value == 0);
}
function setId(uint _id) external {
require(msg.sender == address(cubicContract));
id = _id;
}
function deliver() external {
assert(block.number > unlockedAfter);
cubicContract.forgetCube(this);
selfdestruct(destination);
}
}