-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathFirefly.sol
61 lines (55 loc) · 1.41 KB
/
Firefly.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.0 <0.9.0;
import "./IBatchPin.sol";
contract Firefly is IBatchPin {
function pinBatchData(bytes calldata data) public override {
bytes32 uuids;
bytes32 batchHash;
string memory payloadRef;
bytes32[] memory contexts;
(uuids, batchHash, payloadRef, contexts) = abi.decode(
data,
(bytes32, bytes32, string, bytes32[])
);
emit BatchPin(
tx.origin,
block.timestamp,
"firefly:contract_invoke_pin",
uuids,
batchHash,
payloadRef,
contexts
);
}
function pinBatch(
bytes32 uuids,
bytes32 batchHash,
string memory payloadRef,
bytes32[] memory contexts
) public override {
emit BatchPin(
tx.origin,
block.timestamp,
"firefly:batch_pin",
uuids,
batchHash,
payloadRef,
contexts
);
}
function networkAction(string memory action, string memory payload) public {
bytes32[] memory contexts;
emit BatchPin(
tx.origin,
block.timestamp,
action,
0,
0,
payload,
contexts
);
}
function networkVersion() public pure returns (uint8) {
return 2;
}
}