Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Commit

Permalink
Update Signscript with field names
Browse files Browse the repository at this point in the history
  • Loading branch information
Somnath B committed Sep 20, 2022
1 parent fd29af6 commit 38128f3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 8 deletions.
49 changes: 47 additions & 2 deletions abi/contracts/SimpleEmployment.sol/SimpleEmployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@
"name": "LogPaymentMade",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "payee",
"type": "address"
}
],
"name": "LogPaymentWithdrawn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -109,6 +128,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "availableToWithdraw",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -335,9 +367,9 @@
"type": "uint128"
},
{
"internalType": "uint128",
"internalType": "uint120",
"name": "timeStamp",
"type": "uint128"
"type": "uint120"
}
],
"stateMutability": "view",
Expand Down Expand Up @@ -525,5 +557,18 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "withdrawPayment",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
13 changes: 7 additions & 6 deletions contracts/SimpleEmployment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,13 @@ contract SimpleEmployment {
function contractDataHash(uint256 signingDate_) public view returns (bytes32){
return keccak256(abi.encodePacked(
"ChainPact - I hereby sign the following ",
pactData.employee,
pactData.employer,
pactData.payScheduleDays,
pactData.payAmount,
signingDate_,
address(this)));
"For this pact named ", pactData.pactName,
"Employee ", pactData.employee,
"Employer ", pactData.employer,
"Pay Schedule in days ", pactData.payScheduleDays,
"payAmount in native ", pactData.payAmount,
"Signing DateTime ", signingDate_,
"Address of this contract ", address(this)));
}

function recoverContractSigner(bytes memory signature, uint256 signingDate_) public view returns (address){
Expand Down

0 comments on commit 38128f3

Please sign in to comment.