@@ -40,14 +40,16 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
4040 * @param _beneficiary Address of the safe beneficiary
4141 * @param _safeId Id of the safe
4242 * @param _claimType Type of the claim
43- * @param _signalingPeriod Signaling time window
43+ * @param _signalingPeriod The time window in seconds within which the creator wants to signal the safe in response to a claim on the safe
44+ * @param _DDay The timestamp in unix epoch milliseconds after which the beneficiary can directly claim the safe
4445 * @param _metaEvidence URL of the metaevidence
4546 */
4647 function createSafe (
4748 address _beneficiary ,
4849 string memory _safeId ,
4950 Types.ClaimType _claimType ,
5051 uint256 _signalingPeriod ,
52+ uint256 _DDay ,
5153 string calldata _metaEvidence
5254 ) external payable returns (bool ) {
5355 return
@@ -56,6 +58,7 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
5658 _safeId,
5759 _claimType,
5860 _signalingPeriod,
61+ _DDay,
5962 _metaEvidence
6063 );
6164 }
@@ -65,14 +68,16 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
6568 * @param _creator Address of the safe creator
6669 * @param _safeId Id of the safe
6770 * @param _claimType Type of the claim
68- * @param _signalingPeriod Signaling time window
71+ * @param _signalingPeriod TThe time window in seconds within which the creator wants to signal the safe in response to a claim on the safe
72+ * @param _DDay The timestamp in unix epoch milliseconds after which the beneficiary can directly claim the safe
6973 * @param _metaEvidence URL of the metaevidence
7074 */
7175 function syncSafe (
7276 address _creator ,
7377 string memory _safeId ,
7478 Types.ClaimType _claimType ,
7579 uint256 _signalingPeriod ,
80+ uint256 _DDay ,
7681 string calldata _metaEvidence
7782 ) external payable returns (bool ) {
7883 return
@@ -81,6 +86,7 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
8186 _safeId,
8287 _claimType,
8388 _signalingPeriod,
89+ _DDay,
8490 _metaEvidence
8591 );
8692 }
@@ -130,8 +136,18 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
130136
131137 safe.claimsCount += 1 ;
132138 safes[_safeId] = safe;
133- }
139+ } else if (safe.claimType == Types.ClaimType.DDayBased) {
140+ Types.DDayBasedClaimData memory data = Types.DDayBasedClaimData (
141+ safe.currentOwner,
142+ safe.beneficiary,
143+ safe.dDay
144+ );
145+
146+ _createDDayBasedClaim (_safeId, data);
134147
148+ safe.claimsCount += 1 ;
149+ safes[_safeId] = safe;
150+ }
135151 return true ;
136152 }
137153
@@ -190,17 +206,20 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
190206 /**
191207 * @notice Get the status of a claim
192208 * @param _safeId Id of the safe
193- * @param _disputeID Id of the claim
209+ * @param _claimId Id of the claim
194210 */
195- function getClaimStatus (string memory _safeId , uint256 _disputeID )
211+ function getClaimStatus (string memory _safeId , uint256 _claimId )
196212 external
197213 view
198214 returns (Types.ClaimStatus status )
199215 {
200216 Types.Safe memory safe = safes[_safeId];
201217
202- if (safe.claimType == Types.ClaimType.ArbitrationBased) {
203- Types.Claim memory claim = claims[_disputeID];
218+ if (
219+ safe.claimType == Types.ClaimType.ArbitrationBased ||
220+ safe.claimType == Types.ClaimType.DDayBased
221+ ) {
222+ Types.Claim memory claim = claims[_claimId];
204223
205224 return claim.status;
206225 } else if (safe.claimType == Types.ClaimType.SignalBased) {
@@ -267,4 +286,16 @@ contract SafientMain is Safes, Claims, Guardians, IArbitrable {
267286 function claimRewards (uint256 _funds ) external returns (bool ) {
268287 return _claimRewards (_funds);
269288 }
289+
290+ /**
291+ * @notice Update the D-Day
292+ * @param _safeId Id of the safe
293+ * @param _DDay The timestamp in unix epoch milliseconds after which the beneficiary can directly claim the safe
294+ */
295+ function updateDDay (string memory _safeId , uint256 _DDay )
296+ external
297+ returns (bool )
298+ {
299+ return _updateDDay (_safeId, _DDay);
300+ }
270301}
0 commit comments