Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to interfaces for FederatedAttestations and Escrow #9655

Merged
merged 3 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions packages/protocol/contracts/identity/interfaces/IEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ interface IEscrow {
address paymentId,
uint256 minAttestations
) external returns (bool);

function transferWithTrustedIssuers(
bytes32 identifier,
address token,
uint256 value,
uint256 expirySeconds,
address paymentId,
uint256 minAttestations,
address[] calldata trustedIssuers
) external returns (bool);
function withdraw(address paymentID, uint8 v, bytes32 r, bytes32 s) external returns (bool);

function revoke(address paymentID) external returns (bool);

// view functions
function getReceivedPaymentIds(bytes32 identifier) external view returns (address[] memory);

function getSentPaymentIds(address sender) external view returns (address[] memory);
function getTrustedIssuersPerPayment(address paymentId) external view returns (address[] memory);
function getDefaultTrustedIssuers() external view returns (address[] memory);

// onlyOwner functions
function addDefaultTrustedIssuer(address trustedIssuer) external;
function removeDefaultTrustedIssuer(address trustedIssuer, uint256 index) external;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
pragma solidity ^0.5.13;

// TODO ASv2 add external, view, and only owner function sigs
// separated into these three groups for clarity
interface IFederatedAttestations {
function lookupAttestations(bytes32, address[] calldata)
function registerAttestationAsIssuer(
bytes32 identifier,
address issuer,
address account,
uint64 issuedOn
) external;
function registerAttestation(
bytes32 identifier,
address issuer,
address account,
address signer,
uint64 issuedOn,
uint8 v,
bytes32 r,
bytes32 s
) external;
function revokeAttestation(bytes32 identifier, address issuer, address account) external;
function batchRevokeAttestations(
address issuer,
bytes32[] calldata identifiers,
address[] calldata accounts
) external;

// view functions
function lookupAttestations(bytes32 identifier, address[] calldata trustedIssuers)
external
view
returns (
Expand All @@ -13,4 +35,26 @@ interface IFederatedAttestations {
uint64[] memory,
uint64[] memory
);
function lookupIdentifiers(address account, address[] calldata trustedIssuers)
external
view
returns (uint256[] memory, bytes32[] memory);

function validateAttestationSig(
bytes32 identifier,
address issuer,
address account,
address signer,
uint64 issuedOn,
uint8 v,
bytes32 r,
bytes32 s
) external view;
function getUniqueAttestationHash(
bytes32 identifier,
address issuer,
address account,
address signer,
uint64 issuedOn
) external pure returns (bytes32);
}
Copy link
Contributor Author

@isabellewei isabellewei Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why, but it seems like pure functions are not included in interfaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also not sure, though there is one in ICeloVersionedContract.sol, maybe it makes sense for us to include the getAttestationHash function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, no harm in adding :)