-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated interfaces * Lint & format
- Loading branch information
Showing
7 changed files
with
298 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,64 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import "../Arbitrator.sol"; | ||
|
||
/** | ||
* @title Platform ID Interface | ||
* @author TalentLayer Team <[email protected]> | Website: https://talentlayer.org | Twitter: @talentlayer | ||
*/ | ||
interface ITalentLayerEscrow { | ||
// Enum declarations | ||
enum PaymentType { | ||
Release, | ||
Reimburse | ||
} | ||
enum ArbitrationFeePaymentType { | ||
Pay, | ||
Reimburse | ||
} | ||
enum Party { | ||
Sender, | ||
Receiver | ||
} | ||
enum Status { | ||
NoDispute, // no dispute has arisen about the transaction | ||
WaitingSender, // receiver has paid arbitration fee, while sender still has to do it | ||
WaitingReceiver, // sender has paid arbitration fee, while receiver still has to do it | ||
DisputeCreated, // both parties have paid the arbitration fee and a dispute has been created | ||
Resolved // the transaction is solved (either no dispute has ever arisen or the dispute has been resolved) | ||
} | ||
|
||
// Struct declarations | ||
struct Transaction { | ||
uint256 id; | ||
address sender; | ||
address receiver; | ||
address token; | ||
uint256 amount; | ||
uint256 releasedAmount; | ||
uint256 serviceId; | ||
uint256 proposalId; | ||
uint16 protocolEscrowFeeRate; | ||
uint16 originServiceFeeRate; | ||
uint16 originValidatedProposalFeeRate; | ||
Arbitrator arbitrator; | ||
Status status; | ||
uint256 disputeId; | ||
uint256 senderFee; | ||
uint256 receiverFee; | ||
uint256 lastInteraction; | ||
Status status; | ||
// Arbitrator arbitrator; | ||
bytes arbitratorExtraData; | ||
uint256 arbitrationFeeTimeout; | ||
} | ||
|
||
enum Status { | ||
NoDispute, // no dispute has arisen about the transaction | ||
WaitingSender, // receiver has paid arbitration fee, while sender still has to do it | ||
WaitingReceiver, // sender has paid arbitration fee, while receiver still has to do it | ||
DisputeCreated, // both parties have paid the arbitration fee and a dispute has been created | ||
Resolved // the transaction is solved (either no dispute has ever arisen or the dispute has been resolved) | ||
} | ||
// Function declarations | ||
function initialize( | ||
address _talentLayerServiceAddress, | ||
address _talentLayerIDAddress, | ||
address _talentLayerPlatformIDAddress, | ||
address _protocolWallet | ||
) external; | ||
|
||
function getClaimableFeeBalance(address _token) external view returns (uint256 balance); | ||
|
||
|
@@ -42,32 +68,83 @@ interface ITalentLayerEscrow { | |
|
||
function updateProtocolWallet(address payable _protocolWallet) external; | ||
|
||
function pause() external; | ||
|
||
function unpause() external; | ||
|
||
function createTransaction( | ||
uint256 _serviceId, | ||
uint256 _proposalId, | ||
string memory _metaEvidence, | ||
string memory originDataUri | ||
string memory _originDataUri | ||
) external payable returns (uint256); | ||
|
||
function release(uint256 _transactionId, uint256 _amount) external; | ||
function release(uint256 _profileId, uint256 _transactionId, uint256 _amount) external; | ||
|
||
function reimburse(uint256 _transactionId, uint256 _amount) external; | ||
|
||
function claim(uint256 _platformId, address _tokenAddress) external; | ||
|
||
function claimAll(uint256 _platformId) external; | ||
function reimburse(uint256 _profileId, uint256 _transactionId, uint256 _amount) external; | ||
|
||
function payArbitrationFeeBySender(uint256 _transactionId) external payable; | ||
|
||
function payArbitrationFeeByReceiver(uint256 _transactionId) external payable; | ||
|
||
function timeOutBySender(uint256 _transactionId) external; | ||
|
||
function timeOutByReceiver(uint256 _transactionId) external; | ||
function arbitrationFeeTimeout(uint256 _transactionId) external; | ||
|
||
function submitEvidence(uint256 _transactionId, string memory _evidence) external; | ||
function submitEvidence(uint256 _profileId, uint256 _transactionId, string memory _evidence) external; | ||
|
||
function appeal(uint256 _transactionId) external payable; | ||
|
||
// Platform functions | ||
function claim(uint256 _platformId, address _tokenAddress) external; | ||
|
||
// Arbitrator functions | ||
function rule(uint256 _disputeID, uint256 _ruling) external; | ||
|
||
// Event declarations | ||
event Payment( | ||
uint256 _transactionId, | ||
PaymentType _paymentType, | ||
address _token, | ||
uint256 _amount, | ||
uint256 _serviceId, | ||
uint256 _proposalId | ||
); | ||
event PaymentCompleted(uint256 _serviceId); | ||
event ProtocolEscrowFeeRateUpdated(uint16 _protocolEscrowFeeRate); | ||
event FeesClaimed(uint256 _platformId, address indexed _token, uint256 _amount); | ||
event OriginServiceFeeRateReleased( | ||
uint256 _platformId, | ||
uint256 _serviceId, | ||
address indexed _token, | ||
uint256 _amount | ||
); | ||
event OriginValidatedProposalFeeRateReleased( | ||
uint256 _platformId, | ||
uint256 _serviceId, | ||
address indexed _token, | ||
uint256 _amount | ||
); | ||
event HasToPayFee(uint256 indexed _transactionId, Party _party); | ||
event ArbitrationFeePayment( | ||
uint256 indexed _transactionId, | ||
ArbitrationFeePaymentType _paymentType, | ||
Party _party, | ||
uint256 _amount | ||
); | ||
event RulingExecuted(uint256 indexed _transactionId, uint256 _ruling); | ||
event TransactionCreated( | ||
uint256 _transactionId, | ||
uint256 _senderId, | ||
uint256 _receiverId, | ||
address _token, | ||
uint256 _amount, | ||
uint256 _serviceId, | ||
uint256 _proposalId, | ||
uint16 _protocolEscrowFeeRate, | ||
uint16 _originServiceFeeRate, | ||
uint16 _originValidatedProposalFeeRate, | ||
Arbitrator _arbitrator, | ||
bytes _arbitratorExtraData, | ||
uint256 _arbitrationFeeTimeout | ||
); | ||
event EvidenceSubmitted(uint256 indexed _transactionId, uint256 indexed _partyId, string _evidenceUri); | ||
} |
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 |
---|---|---|
|
@@ -6,20 +6,48 @@ pragma solidity ^0.8.9; | |
* @author TalentLayer Team <[email protected]> | Website: https://talentlayer.org | Twitter: @talentlayer | ||
*/ | ||
interface ITalentLayerID { | ||
// Enum declarations | ||
enum MintStatus { | ||
ON_PAUSE, | ||
ONLY_WHITELIST, | ||
PUBLIC | ||
} | ||
|
||
// Struct declarations | ||
struct Profile { | ||
uint256 id; | ||
string handle; | ||
uint256 platformId; | ||
string dataUri; | ||
} | ||
|
||
function balanceOf(address _user) external view returns (uint256); | ||
// Function declarations | ||
// View functions | ||
function ownerOf(uint256 _tokenId) external view returns (address); | ||
|
||
function totalSupply() external view returns (uint256); | ||
|
||
function getOriginatorPlatformIdByAddress(address _address) external view returns (uint256); | ||
|
||
function isValid(uint256 _profileId) external view; | ||
|
||
function isDelegate(uint256 _profileId, address _address) external view returns (bool); | ||
|
||
function isOwnerOrDelegate(uint256 _profileId, address _address) external view returns (bool); | ||
|
||
function ownersOf(uint256 _tokenId1, uint256 _tokenId2) external view returns (address, address); | ||
|
||
function isWhitelisted( | ||
address _address, | ||
string memory _handle, | ||
bytes32[] memory _proof | ||
) external view returns (bool); | ||
|
||
function getHandlePrice(string calldata _handle) external view returns (uint256); | ||
|
||
function tokenURI(uint256 tokenId) external view returns (string memory); | ||
|
||
// User functions | ||
function mint(uint256 _platformId, string calldata _handle) external payable returns (uint256); | ||
|
||
function mintForAddress( | ||
|
@@ -28,31 +56,46 @@ interface ITalentLayerID { | |
string calldata _handle | ||
) external payable returns (uint256); | ||
|
||
function updateProfileData(uint256 _tokenId, string memory _newCid) external; | ||
|
||
function freeMint(uint256 _platformId, address _userAddress, string calldata _handle) external returns (uint256); | ||
|
||
function isValid(uint256 _tokenId) external view; | ||
|
||
function whitelistMint( | ||
uint256 _platformId, | ||
string calldata _handle, | ||
bytes32[] calldata _proof | ||
) external payable returns (uint256); | ||
|
||
function ownerOf(uint256 _tokenId) external view returns (address); | ||
function updateProfileData(uint256 _profileId, string memory _newCid) external; | ||
|
||
function ownersOf(uint256 _tokenId1, uint256 _tokenId2) external view returns (address, address); | ||
function addDelegate(uint256 _profileId, address _delegate) external; | ||
|
||
function getOriginatorPlatformIdByAddress(address _address) external view returns (uint256); | ||
function removeDelegate(uint256 _profileId, address _delegate) external; | ||
|
||
function setHasActivity(uint256 _profileId) external; | ||
|
||
// Owner functions | ||
function updateMintFee(uint256 _mintFee) external; | ||
|
||
function isDelegate(uint256 _tokenId, address _address) external view returns (bool); | ||
function withdraw() external; | ||
|
||
function isOwnerOrDelegate(uint256 _tokenId, address _address) external view returns (bool); | ||
function freeMint(uint256 _platformId, address _userAddress, string calldata _handle) external returns (uint256); | ||
|
||
function ids(address _user) external view returns (uint256); | ||
function setWhitelistMerkleRoot(bytes32 root) external; | ||
|
||
function setHasActivity(uint256 _profileId) external; | ||
function updateMintStatus(MintStatus _mintStatus) external; | ||
|
||
function updateShortHandlesMaxPrice(uint256 _shortHandlesMaxPrice) external; | ||
|
||
function setIsServiceContract(address _address, bool _isServiceContract) external; | ||
|
||
// Event declarations | ||
event Mint(address indexed user, uint256 profileId, string handle, uint256 platformId, uint256 fee); | ||
event CidUpdated(uint256 indexed profileId, string newCid); | ||
event MintFeeUpdated(uint256 mintFee); | ||
event DelegateAdded(uint256 profileId, address delegate); | ||
event DelegateRemoved(uint256 profileId, address delegate); | ||
event MintStatusUpdated(MintStatus mintStatus); | ||
event ShortHandlesMaxPriceUpdated(uint256 price); | ||
|
||
event Mint(address indexed _user, uint256 _tokenId, string _handle); | ||
// Error declarations | ||
error HandleLengthInvalid(); | ||
error HandleContainsInvalidCharacters(); | ||
error HandleFirstCharInvalid(); | ||
} |
Oops, something went wrong.