-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRentForSupport.sol
37 lines (31 loc) · 1.77 KB
/
RentForSupport.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
33
34
35
36
37
pragma solidity ^0.4.16;
/// @title renting from a different account then the controller
contract RentForSupport {
/// interface-id for supportInterface-check
bytes4 public constant ID = 0xbf89d2ac;
/// rents a device, which means it will change the state by setting the sender as controller.
/// @param id the deviceid
/// @param secondsToRent the time of rental in seconds
/// @param token the address of the token to pay (See token-addreesses for details)
/// @param controller the user which should be allowed to control the device.
/// @param rentedFrom the start time for this rental
function rentFor(bytes32 id, uint32 secondsToRent, address token, address controller, uint64 rentedFrom) public payable;
/// rents a device, which means it will change the state by setting the sender as controller.
/// @param id the deviceid
/// @param secondsToRent the time of rental in seconds
/// @param token the address of the token to pay (See token-addreesses for details)
/// @param controller the user which should be allowed to control the device.
function rentForNow(bytes32 id, uint32 secondsToRent, address token, address controller) public payable {
rentFor( id, secondsToRent, token, controller, uint64(now));
}
/// cancels a booking
/// @param id device id
/// @param start the timestamp when the booking should start
function removeBooking(bytes32 id, uint start) public;
/// checks if a booking is possible
/// @param user the booking user
/// @param id device id
/// @param start the timestamp when the booking should start
/// @param secondsToRent the duration to book
function canBeRented(bytes32 id, address user,uint64 start, uint32 secondsToRent) public view returns (bool);
}