Skip to content

Commit

Permalink
Merge pull request #34 from safient/hotfix/contract-33/timestamp-fix
Browse files Browse the repository at this point in the history
Returning Block Timestamp for claims
  • Loading branch information
yathishram authored Feb 23, 2022
2 parents fd1c956 + b2db33f commit bd60640
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
18 changes: 7 additions & 11 deletions contracts/components/Claims.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ contract Claims {
event Dispute(
IArbitrator indexed _arbitrator,
uint256 indexed _disputeID,
uint256 _metaEvidenceID,
uint256 _evidenceGroupID
uint256 _metaEvidenceID
);

event CreateClaim(
address indexed createdBy,
string indexed safeId,
uint256 indexed id
uint256 indexed id,
uint256 timeStamp
);

/**
Expand Down Expand Up @@ -181,8 +180,7 @@ contract Claims {
emit Dispute(
data.arbitrator,
disputeID,
data.metaEvidenceId,
evidenceGroupID
data.metaEvidenceId
);

claims[disputeID] = Types.Claim({
Expand All @@ -195,9 +193,7 @@ contract Claims {
});

claimsCount += 1;

emit CreateClaim(msg.sender, _safeId, disputeID);

emit CreateClaim(_safeId,disputeID, block.timestamp);
if (bytes(_evidence).length != 0) {
_submitEvidence(disputeID, _evidence, data.arbitrator);
}
Expand Down Expand Up @@ -225,7 +221,7 @@ contract Claims {
status: Types.ClaimStatus.Active
});

emit CreateClaim(msg.sender, _safeId, claimsCount);
emit CreateClaim(_safeId, claimsCount, block.timestamp);
}

/**
Expand Down Expand Up @@ -259,7 +255,7 @@ contract Claims {
});
}

emit CreateClaim(msg.sender, _safeId, claimsCount);
emit CreateClaim(_safeId,claimsCount, block.timestamp);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safient/contracts",
"version": "0.1.13-alpha",
"version": "0.1.14-alpha",
"description": "JavaScript SDK to manage and interact with the safe claims on Safient protocol.",
"keywords": [
"Web3",
Expand Down
2 changes: 1 addition & 1 deletion src/abis/SafientMain.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"abi":[{"inputs":[{"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"createdBy","type":"address"},{"indexed":true,"internalType":"string","name":"safeId","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"CreateClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"createdBy","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"uint256","name":"metaEvidenceId","type":"uint256"}],"name":"CreateSafe","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_disputeID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_metaEvidenceID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_evidenceGroupID","type":"uint256"}],"name":"Dispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_evidenceGroupID","type":"uint256"},{"indexed":true,"internalType":"address","name":"_party","type":"address"},{"indexed":false,"internalType":"string","name":"_evidence","type":"string"}],"name":"Evidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_metaEvidenceID","type":"uint256"},{"indexed":false,"internalType":"string","name":"_evidence","type":"string"}],"name":"MetaEvidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_disputeID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_ruling","type":"uint256"}],"name":"Ruling","type":"event"},{"inputs":[],"name":"arbitrator","outputs":[{"internalType":"contract IArbitrator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_funds","type":"uint256"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claims","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"claimedBy","type":"address"},{"internalType":"enum Types.ClaimType","name":"claimType","type":"uint8"},{"internalType":"uint256","name":"metaEvidenceId","type":"uint256"},{"internalType":"uint256","name":"evidenceGroupId","type":"uint256"},{"internalType":"enum Types.ClaimStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"string","name":"_evidence","type":"string"}],"name":"createClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"enum Types.ClaimType","name":"_claimType","type":"uint8"},{"internalType":"uint256","name":"_signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"_DDay","type":"uint256"},{"internalType":"string","name":"_metaEvidence","type":"string"}],"name":"createSafe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"depositFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"evidenceGroupID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"uint256","name":"_claimId","type":"uint256"}],"name":"getClaimStatus","outputs":[{"internalType":"enum Types.ClaimStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_message","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"components":[{"internalType":"bytes32","name":"secretHash","type":"bytes32"},{"internalType":"address","name":"guardianAddress","type":"address"}],"internalType":"struct Types.RecoveryProof[]","name":"_guardianproof","type":"tuple[]"},{"internalType":"string[]","name":"_secrets","type":"string[]"},{"internalType":"string","name":"_safeId","type":"string"}],"name":"guardianProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardianRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metaEvidenceID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeID","type":"uint256"},{"internalType":"uint256","name":"_ruling","type":"uint256"}],"name":"rule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rulingOptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"safes","outputs":[{"internalType":"string","name":"id","type":"string"},{"internalType":"address","name":"createdBy","type":"address"},{"internalType":"address","name":"currentOwner","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"endSignalTime","type":"uint256"},{"internalType":"uint256","name":"latestSignalTime","type":"uint256"},{"internalType":"uint256","name":"dDay","type":"uint256"},{"internalType":"enum Types.ClaimType","name":"claimType","type":"uint8"},{"internalType":"uint256","name":"metaEvidenceId","type":"uint256"},{"internalType":"uint256","name":"claimsCount","type":"uint256"},{"internalType":"uint256","name":"funds","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"safesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"sendSignal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeID","type":"uint256"},{"internalType":"string","name":"_evidence","type":"string"}],"name":"submitEvidence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"enum Types.ClaimType","name":"_claimType","type":"uint8"},{"internalType":"uint256","name":"_signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"_DDay","type":"uint256"},{"internalType":"string","name":"_metaEvidence","type":"string"}],"name":"syncSafe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"uint256","name":"_DDay","type":"uint256"}],"name":"updateDDay","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"withdrawFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]}
{"abi":[{"inputs":[{"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"safeId","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timeStamp","type":"uint256"}],"name":"CreateClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"createdBy","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"uint256","name":"metaEvidenceId","type":"uint256"}],"name":"CreateSafe","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_disputeID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_metaEvidenceID","type":"uint256"}],"name":"Dispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_evidenceGroupID","type":"uint256"},{"indexed":true,"internalType":"address","name":"_party","type":"address"},{"indexed":false,"internalType":"string","name":"_evidence","type":"string"}],"name":"Evidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_metaEvidenceID","type":"uint256"},{"indexed":false,"internalType":"string","name":"_evidence","type":"string"}],"name":"MetaEvidence","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"},{"indexed":true,"internalType":"uint256","name":"_disputeID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_ruling","type":"uint256"}],"name":"Ruling","type":"event"},{"inputs":[],"name":"arbitrator","outputs":[{"internalType":"contract IArbitrator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_funds","type":"uint256"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claims","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"claimedBy","type":"address"},{"internalType":"enum Types.ClaimType","name":"claimType","type":"uint8"},{"internalType":"uint256","name":"metaEvidenceId","type":"uint256"},{"internalType":"uint256","name":"evidenceGroupId","type":"uint256"},{"internalType":"enum Types.ClaimStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"string","name":"_evidence","type":"string"}],"name":"createClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"enum Types.ClaimType","name":"_claimType","type":"uint8"},{"internalType":"uint256","name":"_signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"_DDay","type":"uint256"},{"internalType":"string","name":"_metaEvidence","type":"string"}],"name":"createSafe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"depositFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"evidenceGroupID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"uint256","name":"_claimId","type":"uint256"}],"name":"getClaimStatus","outputs":[{"internalType":"enum Types.ClaimStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_message","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"components":[{"internalType":"bytes32","name":"secretHash","type":"bytes32"},{"internalType":"address","name":"guardianAddress","type":"address"}],"internalType":"struct Types.RecoveryProof[]","name":"_guardianproof","type":"tuple[]"},{"internalType":"string[]","name":"_secrets","type":"string[]"},{"internalType":"string","name":"_safeId","type":"string"}],"name":"guardianProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardianRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metaEvidenceID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeID","type":"uint256"},{"internalType":"uint256","name":"_ruling","type":"uint256"}],"name":"rule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rulingOptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"safes","outputs":[{"internalType":"string","name":"id","type":"string"},{"internalType":"address","name":"createdBy","type":"address"},{"internalType":"address","name":"currentOwner","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"endSignalTime","type":"uint256"},{"internalType":"uint256","name":"latestSignalTime","type":"uint256"},{"internalType":"uint256","name":"dDay","type":"uint256"},{"internalType":"enum Types.ClaimType","name":"claimType","type":"uint8"},{"internalType":"uint256","name":"metaEvidenceId","type":"uint256"},{"internalType":"uint256","name":"claimsCount","type":"uint256"},{"internalType":"uint256","name":"funds","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"safesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"sendSignal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeID","type":"uint256"},{"internalType":"string","name":"_evidence","type":"string"}],"name":"submitEvidence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"enum Types.ClaimType","name":"_claimType","type":"uint8"},{"internalType":"uint256","name":"_signalingPeriod","type":"uint256"},{"internalType":"uint256","name":"_DDay","type":"uint256"},{"internalType":"string","name":"_metaEvidence","type":"string"}],"name":"syncSafe","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"},{"internalType":"uint256","name":"_DDay","type":"uint256"}],"name":"updateDDay","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_safeId","type":"string"}],"name":"withdrawFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]}
4 changes: 2 additions & 2 deletions src/utils/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kovan": {
"chainId": 42,
"addresses": {
"AutoAppealableArbitrator": "0x823E2b7623aD287819674548f43F8965F38B2626",
"SafientMain": "0x8C2FA3dE952f5A1c463af0Fb42a9A812D3Ffe9e3"
"AutoAppealableArbitrator": "0xf54D6b97749ECD28F9EbF836Ed9cE0C387a2f0A1",
"SafientMain": "0xF88915c8762aB973b64086221cDFd20Ec104F732"
}
},
"ropsten": {
Expand Down
Loading

0 comments on commit bd60640

Please sign in to comment.