forked from Synthetixio/synthetix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEscrowChecker.sol
29 lines (22 loc) · 926 Bytes
/
EscrowChecker.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
pragma solidity ^0.5.16;
interface ISynthetixEscrow {
function numVestingEntries(address account) external view returns (uint);
function getVestingScheduleEntry(address account, uint index) external view returns (uint[2] memory);
}
// https://docs.synthetix.io/contracts/source/contracts/escrowchecker
contract EscrowChecker {
ISynthetixEscrow public synthetix_escrow;
constructor(ISynthetixEscrow _esc) public {
synthetix_escrow = _esc;
}
function checkAccountSchedule(address account) public view returns (uint[16] memory) {
uint[16] memory _result;
uint schedules = synthetix_escrow.numVestingEntries(account);
for (uint i = 0; i < schedules; i++) {
uint[2] memory pair = synthetix_escrow.getVestingScheduleEntry(account, i);
_result[i * 2] = pair[0];
_result[i * 2 + 1] = pair[1];
}
return _result;
}
}