Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0132fd1d
Commit
0132fd1d
authored
Jul 18, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint: fix
parent
122d3f14
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
55 deletions
+147
-55
.eslintignore
packages/contracts-bedrock/.eslintignore
+0
-2
EAS.sol
packages/contracts-bedrock/contracts/EAS/EAS.sol
+68
-21
IEAS.sol
packages/contracts-bedrock/contracts/EAS/IEAS.sol
+23
-7
ISchemaRegistry.sol
packages/contracts-bedrock/contracts/EAS/ISchemaRegistry.sol
+5
-1
SchemaRegistry.sol
packages/contracts-bedrock/contracts/EAS/SchemaRegistry.sol
+9
-2
EIP712Verifier.sol
...contracts-bedrock/contracts/EAS/eip712/EIP712Verifier.sol
+14
-4
ISchemaResolver.sol
...tracts-bedrock/contracts/EAS/resolver/ISchemaResolver.sol
+8
-8
SchemaResolver.sol
...ntracts-bedrock/contracts/EAS/resolver/SchemaResolver.sol
+20
-10
No files found.
packages/contracts-bedrock/.eslintignore
View file @
0132fd1d
...
@@ -6,6 +6,4 @@ lib
...
@@ -6,6 +6,4 @@ lib
artifacts
artifacts
forge-artifacts
forge-artifacts
cache
cache
typechain
coverage*
deployments
deployments
packages/contracts-bedrock/contracts/EAS/EAS.sol
View file @
0132fd1d
...
@@ -85,8 +85,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -85,8 +85,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
/**
/**
* @dev Creates a new EAS instance.
* @dev Creates a new EAS instance.
*/
*/
constructor() Semver(1, 0, 0) EIP712Verifier("EAS", "1.0.0") {
constructor() Semver(1, 0, 0) EIP712Verifier("EAS", "1.0.0") {}
}
/**
/**
* @inheritdoc IEAS
* @inheritdoc IEAS
...
@@ -108,21 +107,30 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -108,21 +107,30 @@ contract EAS is IEAS, Semver, EIP712Verifier {
/**
/**
* @inheritdoc IEAS
* @inheritdoc IEAS
*/
*/
function attestByDelegation(
function attestByDelegation(DelegatedAttestationRequest calldata delegatedRequest)
DelegatedAttestationRequest calldata delegatedRequest
external
) external payable returns (bytes32) {
payable
returns (bytes32)
{
_verifyAttest(delegatedRequest);
_verifyAttest(delegatedRequest);
AttestationRequestData[] memory data = new AttestationRequestData[](1);
AttestationRequestData[] memory data = new AttestationRequestData[](1);
data[0] = delegatedRequest.data;
data[0] = delegatedRequest.data;
return _attest(delegatedRequest.schema, data, delegatedRequest.attester, msg.value, true).uids[0];
return
_attest(delegatedRequest.schema, data, delegatedRequest.attester, msg.value, true).uids[
0
];
}
}
/**
/**
* @inheritdoc IEAS
* @inheritdoc IEAS
*/
*/
function multiAttest(MultiAttestationRequest[] calldata multiRequests) external payable returns (bytes32[] memory) {
function multiAttest(MultiAttestationRequest[] calldata multiRequests)
external
payable
returns (bytes32[] memory)
{
// Since a multi-attest call is going to make multiple attestations for multiple schemas, we'd need to collect
// Since a multi-attest call is going to make multiple attestations for multiple schemas, we'd need to collect
// all the returned UIDs into a single list.
// all the returned UIDs into a single list.
bytes32[][] memory totalUids = new bytes32[][](multiRequests.length);
bytes32[][] memory totalUids = new bytes32[][](multiRequests.length);
...
@@ -132,7 +140,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -132,7 +140,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// possible to send too much ETH anyway.
// possible to send too much ETH anyway.
uint availableValue = msg.value;
uint
256
availableValue = msg.value;
for (uint256 i = 0; i < multiRequests.length; i = uncheckedInc(i)) {
for (uint256 i = 0; i < multiRequests.length; i = uncheckedInc(i)) {
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
...
@@ -182,7 +190,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -182,7 +190,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// possible to send too much ETH anyway.
// possible to send too much ETH anyway.
uint availableValue = msg.value;
uint
256
availableValue = msg.value;
for (uint256 i = 0; i < multiDelegatedRequests.length; i = uncheckedInc(i)) {
for (uint256 i = 0; i < multiDelegatedRequests.length; i = uncheckedInc(i)) {
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
...
@@ -193,7 +201,8 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -193,7 +201,8 @@ contract EAS is IEAS, Semver, EIP712Verifier {
last = i == multiDelegatedRequests.length - 1;
last = i == multiDelegatedRequests.length - 1;
}
}
MultiDelegatedAttestationRequest calldata multiDelegatedRequest = multiDelegatedRequests[i];
MultiDelegatedAttestationRequest
calldata multiDelegatedRequest = multiDelegatedRequests[i];
AttestationRequestData[] calldata data = multiDelegatedRequest.data;
AttestationRequestData[] calldata data = multiDelegatedRequest.data;
// Ensure that no inputs are missing.
// Ensure that no inputs are missing.
...
@@ -249,7 +258,10 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -249,7 +258,10 @@ contract EAS is IEAS, Semver, EIP712Verifier {
/**
/**
* @inheritdoc IEAS
* @inheritdoc IEAS
*/
*/
function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest) external payable {
function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest)
external
payable
{
_verifyRevoke(delegatedRequest);
_verifyRevoke(delegatedRequest);
RevocationRequestData[] memory data = new RevocationRequestData[](1);
RevocationRequestData[] memory data = new RevocationRequestData[](1);
...
@@ -266,7 +278,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -266,7 +278,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// possible to send too much ETH anyway.
// possible to send too much ETH anyway.
uint availableValue = msg.value;
uint
256
availableValue = msg.value;
for (uint256 i = 0; i < multiRequests.length; i = uncheckedInc(i)) {
for (uint256 i = 0; i < multiRequests.length; i = uncheckedInc(i)) {
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
...
@@ -280,7 +292,13 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -280,7 +292,13 @@ contract EAS is IEAS, Semver, EIP712Verifier {
MultiRevocationRequest calldata multiRequest = multiRequests[i];
MultiRevocationRequest calldata multiRequest = multiRequests[i];
// Ensure to deduct the ETH that was forwarded to the resolver during the processing of this batch.
// Ensure to deduct the ETH that was forwarded to the resolver during the processing of this batch.
availableValue -= _revoke(multiRequest.schema, multiRequest.data, msg.sender, availableValue, last);
availableValue -= _revoke(
multiRequest.schema,
multiRequest.data,
msg.sender,
availableValue,
last
);
}
}
}
}
...
@@ -294,7 +312,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -294,7 +312,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
// possible to send too much ETH anyway.
// possible to send too much ETH anyway.
uint availableValue = msg.value;
uint
256
availableValue = msg.value;
for (uint256 i = 0; i < multiDelegatedRequests.length; i = uncheckedInc(i)) {
for (uint256 i = 0; i < multiDelegatedRequests.length; i = uncheckedInc(i)) {
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
// The last batch is handled slightly differently: if the total available ETH wasn't spent in full and there
...
@@ -305,7 +323,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -305,7 +323,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
last = i == multiDelegatedRequests.length - 1;
last = i == multiDelegatedRequests.length - 1;
}
}
MultiDelegatedRevocationRequest memory multiDelegatedRequest = multiDelegatedRequests[i];
MultiDelegatedRevocationRequest memory multiDelegatedRequest = multiDelegatedRequests[
i
];
RevocationRequestData[] memory data = multiDelegatedRequest.data;
RevocationRequestData[] memory data = multiDelegatedRequest.data;
// Ensure that no inputs are missing.
// Ensure that no inputs are missing.
...
@@ -438,7 +458,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -438,7 +458,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
res.uids = new bytes32[](length);
res.uids = new bytes32[](length);
// Ensure that we aren't attempting to attest to a non-existing schema.
// Ensure that we aren't attempting to attest to a non-existing schema.
SchemaRecord memory schemaRecord = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY).getSchema(schema);
SchemaRecord memory schemaRecord = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY).getSchema(
schema
);
if (schemaRecord.uid == EMPTY_UID) {
if (schemaRecord.uid == EMPTY_UID) {
revert InvalidSchema();
revert InvalidSchema();
}
}
...
@@ -504,7 +526,14 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -504,7 +526,14 @@ contract EAS is IEAS, Semver, EIP712Verifier {
emit Attested(request.recipient, attester, uid, schema);
emit Attested(request.recipient, attester, uid, schema);
}
}
res.usedValue = _resolveAttestations(schemaRecord, attestations, values, false, availableValue, last);
res.usedValue = _resolveAttestations(
schemaRecord,
attestations,
values,
false,
availableValue,
last
);
return res;
return res;
}
}
...
@@ -528,7 +557,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -528,7 +557,9 @@ contract EAS is IEAS, Semver, EIP712Verifier {
bool last
bool last
) private returns (uint256) {
) private returns (uint256) {
// Ensure that a non-existing schema ID wasn't passed by accident.
// Ensure that a non-existing schema ID wasn't passed by accident.
SchemaRecord memory schemaRecord = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY).getSchema(schema);
SchemaRecord memory schemaRecord = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY).getSchema(
schema
);
if (schemaRecord.uid == EMPTY_UID) {
if (schemaRecord.uid == EMPTY_UID) {
revert InvalidSchema();
revert InvalidSchema();
}
}
...
@@ -660,7 +691,15 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -660,7 +691,15 @@ contract EAS is IEAS, Semver, EIP712Verifier {
) private returns (uint256) {
) private returns (uint256) {
uint256 length = attestations.length;
uint256 length = attestations.length;
if (length == 1) {
if (length == 1) {
return _resolveAttestation(schemaRecord, attestations[0], values[0], isRevocation, availableValue, last);
return
_resolveAttestation(
schemaRecord,
attestations[0],
values[0],
isRevocation,
availableValue,
last
);
}
}
ISchemaResolver resolver = schemaRecord.resolver;
ISchemaResolver resolver = schemaRecord.resolver;
...
@@ -773,7 +812,11 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -773,7 +812,11 @@ contract EAS is IEAS, Semver, EIP712Verifier {
* @param data The data to timestamp.
* @param data The data to timestamp.
* @param time The timestamp.
* @param time The timestamp.
*/
*/
function _revokeOffchain(address revoker, bytes32 data, uint64 time) private {
function _revokeOffchain(
address revoker,
bytes32 data,
uint64 time
) private {
mapping(bytes32 => uint64) storage revocations = _revocationsOffchain[revoker];
mapping(bytes32 => uint64) storage revocations = _revocationsOffchain[revoker];
if (revocations[data] != 0) {
if (revocations[data] != 0) {
...
@@ -801,7 +844,11 @@ contract EAS is IEAS, Semver, EIP712Verifier {
...
@@ -801,7 +844,11 @@ contract EAS is IEAS, Semver, EIP712Verifier {
*
*
* @return A merged and flatten list of all the UIDs.
* @return A merged and flatten list of all the UIDs.
*/
*/
function _mergeUIDs(bytes32[][] memory uidLists, uint256 uidsCount) private pure returns (bytes32[] memory) {
function _mergeUIDs(bytes32[][] memory uidLists, uint256 uidsCount)
private
pure
returns (bytes32[] memory)
{
bytes32[] memory uids = new bytes32[](uidsCount);
bytes32[] memory uids = new bytes32[](uidsCount);
uint256 currentIndex = 0;
uint256 currentIndex = 0;
...
...
packages/contracts-bedrock/contracts/EAS/IEAS.sol
View file @
0132fd1d
...
@@ -108,7 +108,12 @@ interface IEAS {
...
@@ -108,7 +108,12 @@ interface IEAS {
* @param uid The UID the revoked attestation.
* @param uid The UID the revoked attestation.
* @param schema The UID of the schema.
* @param schema The UID of the schema.
*/
*/
event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schema);
event Attested(
address indexed recipient,
address indexed attester,
bytes32 uid,
bytes32 indexed schema
);
/**
/**
* @dev Emitted when an attestation has been revoked.
* @dev Emitted when an attestation has been revoked.
...
@@ -118,7 +123,12 @@ interface IEAS {
...
@@ -118,7 +123,12 @@ interface IEAS {
* @param schema The UID of the schema.
* @param schema The UID of the schema.
* @param uid The UID the revoked attestation.
* @param uid The UID the revoked attestation.
*/
*/
event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schema);
event Revoked(
address indexed recipient,
address indexed attester,
bytes32 uid,
bytes32 indexed schema
);
/**
/**
* @dev Emitted when a data has been timestamped.
* @dev Emitted when a data has been timestamped.
...
@@ -194,9 +204,10 @@ interface IEAS {
...
@@ -194,9 +204,10 @@ interface IEAS {
*
*
* @return The UID of the new attestation.
* @return The UID of the new attestation.
*/
*/
function attestByDelegation(
function attestByDelegation(DelegatedAttestationRequest calldata delegatedRequest)
DelegatedAttestationRequest calldata delegatedRequest
external
) external payable returns (bytes32);
payable
returns (bytes32);
/**
/**
* @dev Attests to multiple schemas.
* @dev Attests to multiple schemas.
...
@@ -239,7 +250,10 @@ interface IEAS {
...
@@ -239,7 +250,10 @@ interface IEAS {
*
*
* @return The UIDs of the new attestations.
* @return The UIDs of the new attestations.
*/
*/
function multiAttest(MultiAttestationRequest[] calldata multiRequests) external payable returns (bytes32[] memory);
function multiAttest(MultiAttestationRequest[] calldata multiRequests)
external
payable
returns (bytes32[] memory);
/**
/**
* @dev Attests to multiple schemas using via provided EIP712 signatures.
* @dev Attests to multiple schemas using via provided EIP712 signatures.
...
@@ -324,7 +338,9 @@ interface IEAS {
...
@@ -324,7 +338,9 @@ interface IEAS {
*
*
* @param delegatedRequest The arguments of the delegated revocation request.
* @param delegatedRequest The arguments of the delegated revocation request.
*/
*/
function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest) external payable;
function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest)
external
payable;
/**
/**
* @dev Revokes existing attestations to multiple schemas.
* @dev Revokes existing attestations to multiple schemas.
...
...
packages/contracts-bedrock/contracts/EAS/ISchemaRegistry.sol
View file @
0132fd1d
...
@@ -34,7 +34,11 @@ interface ISchemaRegistry {
...
@@ -34,7 +34,11 @@ interface ISchemaRegistry {
*
*
* @return The UID of the new schema.
* @return The UID of the new schema.
*/
*/
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32);
function register(
string calldata schema,
ISchemaResolver resolver,
bool revocable
) external returns (bytes32);
/**
/**
* @dev Returns an existing schema by UID
* @dev Returns an existing schema by UID
...
...
packages/contracts-bedrock/contracts/EAS/SchemaRegistry.sol
View file @
0132fd1d
...
@@ -30,7 +30,11 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
...
@@ -30,7 +30,11 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
/**
/**
* @inheritdoc ISchemaRegistry
* @inheritdoc ISchemaRegistry
*/
*/
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) {
function register(
string calldata schema,
ISchemaResolver resolver,
bool revocable
) external returns (bytes32) {
SchemaRecord memory schemaRecord = SchemaRecord({
SchemaRecord memory schemaRecord = SchemaRecord({
uid: EMPTY_UID,
uid: EMPTY_UID,
schema: schema,
schema: schema,
...
@@ -66,6 +70,9 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
...
@@ -66,6 +70,9 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
* @return schema UID.
* @return schema UID.
*/
*/
function _getUID(SchemaRecord memory schemaRecord) private pure returns (bytes32) {
function _getUID(SchemaRecord memory schemaRecord) private pure returns (bytes32) {
return keccak256(abi.encodePacked(schemaRecord.schema, schemaRecord.resolver, schemaRecord.revocable));
return
keccak256(
abi.encodePacked(schemaRecord.schema, schemaRecord.resolver, schemaRecord.revocable)
);
}
}
}
}
packages/contracts-bedrock/contracts/EAS/eip712/EIP712Verifier.sol
View file @
0132fd1d
...
@@ -14,18 +14,26 @@ import {
...
@@ -14,18 +14,26 @@ import {
RevocationRequestData
RevocationRequestData
} from "../IEAS.sol";
} from "../IEAS.sol";
import { EIP712Signature, InvalidSignature, MAX_GAP, stringToBytes32, bytes32ToString } from "../Common.sol";
import {
EIP712Signature,
InvalidSignature,
MAX_GAP,
stringToBytes32,
bytes32ToString
} from "../Common.sol";
/// @title EIP712
/// @title EIP712
/// @notice The EIP712 typed signatures verifier for EAS delegated attestations.
/// @notice The EIP712 typed signatures verifier for EAS delegated attestations.
abstract contract EIP712Verifier is EIP712 {
abstract contract EIP712Verifier is EIP712 {
// The hash of the data type used to relay calls to the attest function. It's the value of
// The hash of the data type used to relay calls to the attest function. It's the value of
// keccak256("Attest(bytes32 schema,address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 nonce)").
// keccak256("Attest(bytes32 schema,address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 nonce)").
bytes32 private constant ATTEST_TYPEHASH = 0xdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de61;
bytes32 private constant ATTEST_TYPEHASH =
0xdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de61;
// The hash of the data type used to relay calls to the revoke function. It's the value of
// The hash of the data type used to relay calls to the revoke function. It's the value of
// keccak256("Revoke(bytes32 schema,bytes32 uid,uint256 nonce)").
// keccak256("Revoke(bytes32 schema,bytes32 uid,uint256 nonce)").
bytes32 private constant REVOKE_TYPEHASH = 0xa98d02348410c9c76735e0d0bb1396f4015ac2bb9615f9c2611d19d7a8a99650;
bytes32 private constant REVOKE_TYPEHASH =
0xa98d02348410c9c76735e0d0bb1396f4015ac2bb9615f9c2611d19d7a8a99650;
// The user readable name of the signing domain.
// The user readable name of the signing domain.
bytes32 private immutable _name;
bytes32 private immutable _name;
...
@@ -132,7 +140,9 @@ abstract contract EIP712Verifier is EIP712 {
...
@@ -132,7 +140,9 @@ abstract contract EIP712Verifier is EIP712 {
nonce = _nonces[request.revoker]++;
nonce = _nonces[request.revoker]++;
}
}
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(REVOKE_TYPEHASH, request.schema, data.uid, nonce)));
bytes32 digest = _hashTypedDataV4(
keccak256(abi.encode(REVOKE_TYPEHASH, request.schema, data.uid, nonce))
);
if (ECDSA.recover(digest, signature.v, signature.r, signature.s) != request.revoker) {
if (ECDSA.recover(digest, signature.v, signature.r, signature.s) != request.revoker) {
revert InvalidSignature();
revert InvalidSignature();
...
...
packages/contracts-bedrock/contracts/EAS/resolver/ISchemaResolver.sol
View file @
0132fd1d
...
@@ -29,10 +29,10 @@ interface ISchemaResolver {
...
@@ -29,10 +29,10 @@ interface ISchemaResolver {
*
*
* @return Whether all the attestations are valid.
* @return Whether all the attestations are valid.
*/
*/
function multiAttest(
function multiAttest(
Attestation[] calldata attestations, uint256[] calldata values)
Attestation[] calldata attestations,
external
uint256[] calldata values
payable
) external payable
returns (bool);
returns (bool);
/**
/**
* @dev Processes an attestation revocation and verifies if it can be revoked.
* @dev Processes an attestation revocation and verifies if it can be revoked.
...
@@ -51,8 +51,8 @@ interface ISchemaResolver {
...
@@ -51,8 +51,8 @@ interface ISchemaResolver {
*
*
* @return Whether the attestations can be revoked.
* @return Whether the attestations can be revoked.
*/
*/
function multiRevoke(
function multiRevoke(
Attestation[] calldata attestations, uint256[] calldata values)
Attestation[] calldata attestations,
external
uint256[] calldata values
payable
) external payable
returns (bool);
returns (bool);
}
}
packages/contracts-bedrock/contracts/EAS/resolver/SchemaResolver.sol
View file @
0132fd1d
...
@@ -67,10 +67,12 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
...
@@ -67,10 +67,12 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
/**
/**
* @inheritdoc ISchemaResolver
* @inheritdoc ISchemaResolver
*/
*/
function multiAttest(
function multiAttest(Attestation[] calldata attestations, uint256[] calldata values)
Attestation[] calldata attestations,
external
uint256[] calldata values
payable
) external payable onlyEAS returns (bool) {
onlyEAS
returns (bool)
{
uint256 length = attestations.length;
uint256 length = attestations.length;
// We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
// We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
...
@@ -110,10 +112,12 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
...
@@ -110,10 +112,12 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
/**
/**
* @inheritdoc ISchemaResolver
* @inheritdoc ISchemaResolver
*/
*/
function multiRevoke(
function multiRevoke(Attestation[] calldata attestations, uint256[] calldata values)
Attestation[] calldata attestations,
external
uint256[] calldata values
payable
) external payable onlyEAS returns (bool) {
onlyEAS
returns (bool)
{
uint256 length = attestations.length;
uint256 length = attestations.length;
// We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
// We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
...
@@ -154,7 +158,10 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
...
@@ -154,7 +158,10 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
*
*
* @return Whether the attestation is valid.
* @return Whether the attestation is valid.
*/
*/
function onAttest(Attestation calldata attestation, uint256 value) internal virtual returns (bool);
function onAttest(Attestation calldata attestation, uint256 value)
internal
virtual
returns (bool);
/**
/**
* @dev Processes an attestation revocation and verifies if it can be revoked.
* @dev Processes an attestation revocation and verifies if it can be revoked.
...
@@ -167,7 +174,10 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
...
@@ -167,7 +174,10 @@ abstract contract SchemaResolver is ISchemaResolver, Semver {
*
*
* @return Whether the attestation can be revoked.
* @return Whether the attestation can be revoked.
*/
*/
function onRevoke(Attestation calldata attestation, uint256 value) internal virtual returns (bool);
function onRevoke(Attestation calldata attestation, uint256 value)
internal
virtual
returns (bool);
/**
/**
* @dev Ensures that only the EAS contract can make this call.
* @dev Ensures that only the EAS contract can make this call.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment