forked from nunofernandes-plight/uport-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProxy.sol
24 lines (21 loc) · 834 Bytes
/
Proxy.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
// The core proxy facade
// - is owned by a user or implementation contract
// - only forwards transactions for its owner
import "Owned.sol";
contract Proxy is Owned {
event Forwarded (
address indexed destination,
uint value,
bytes data
);
function forward(address destination, uint value, bytes data) onlyOwner {
// If a contract tries to CALL or CREATE a contract with either
// (i) insufficient balance, or (ii) stack depth already at maximum (1024),
// the sub-execution and transfer do not occur at all, no gas gets consumed, and 0 is added to the stack.
// see: https://github.com/ethereum/wiki/wiki/Subtleties#exceptional-conditions
if (!destination.call.value(value)(data)) {
throw;
}
Forwarded(destination, value, data);
}
}