-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved new contracts to v2, naming changes
- Loading branch information
Showing
7 changed files
with
137 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.16; | ||
|
||
library ServiceAgreementErrorsV2 { | ||
error WrongScoreFunctionId( | ||
bytes32 agreementId, | ||
uint16 epoch, | ||
uint8 agreementScoreFunctionId, | ||
uint8 expectedScoreFunctionId, | ||
uint256 timeNow | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.16; | ||
|
||
library ServiceAgreementStructsV2 { | ||
struct CommitSubmission { | ||
uint72 identityId; | ||
uint72 prevIdentityId; | ||
uint72 nextIdentityId; | ||
uint40 score; | ||
} | ||
|
||
struct ServiceAgreementInputArgs { | ||
address assetCreator; | ||
address assetContract; | ||
uint256 tokenId; | ||
bytes keyword; | ||
uint8 hashFunctionId; | ||
uint16 epochsNumber; | ||
uint96 tokenAmount; | ||
uint8 scoreFunctionId; | ||
} | ||
|
||
struct ServiceAgreement { | ||
uint256 startTime; | ||
uint16 epochsNumber; | ||
uint128 epochLength; | ||
uint96 tokenAmount; | ||
uint8 scoreFunctionId; | ||
uint8 proofWindowOffsetPerc; | ||
// epoch => headCommitId | ||
mapping(uint16 => bytes32) epochSubmissionHeads; | ||
// epoch => number of nodes received rewards | ||
mapping(uint16 => uint32) rewardedNodesNumber; | ||
} | ||
|
||
struct ExtendedServiceAgreement { | ||
uint256 startTime; | ||
uint16 epochsNumber; | ||
uint128 epochLength; | ||
uint96 tokenAmount; | ||
uint96 updateTokenAmount; | ||
uint8 scoreFunctionId; | ||
uint8 proofWindowOffsetPerc; | ||
// keccak256(epoch + stateIndex) => headCommitId | ||
mapping(bytes32 => bytes32) epochSubmissionHeads; | ||
// epoch => number of nodes received rewards | ||
mapping(uint16 => uint32) rewardedNodesNumber; | ||
} | ||
|
||
struct CommitInputArgs { | ||
address assetContract; | ||
uint256 tokenId; | ||
bytes keyword; | ||
uint8 hashFunctionId; | ||
uint16 epoch; | ||
uint72 closestNode; | ||
uint72 leftNeighborhoodEdge; | ||
uint72 rightNeighborhoodEdge; | ||
} | ||
|
||
struct ProofInputArgs { | ||
address assetContract; | ||
uint256 tokenId; | ||
bytes keyword; | ||
uint8 hashFunctionId; | ||
uint16 epoch; | ||
bytes32[] proof; | ||
bytes32 chunkHash; | ||
} | ||
} |