Commit 36e32e38 authored by Mark Tyneway's avatar Mark Tyneway

Revert "Revert "Revert "Downgrade Solidity to 0.8.14"""

This reverts commit badef5a93892ddd8d8977792804240c715357b03.
parent ace70e1c
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.19;
import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol";
...@@ -70,14 +70,17 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -70,14 +70,17 @@ contract EAS is IEAS, Semver, EIP712Verifier {
error NotPayable(); error NotPayable();
error WrongSchema(); error WrongSchema();
// The global schema registry.
ISchemaRegistry private constant _schemaRegistry = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY);
// The global mapping between attestations and their UIDs. // The global mapping between attestations and their UIDs.
mapping(bytes32 => Attestation) private _db; mapping(bytes32 uid => Attestation attestation) private _db;
// The global mapping between data and their timestamps. // The global mapping between data and their timestamps.
mapping(bytes32 => uint64) private _timestamps; mapping(bytes32 data => uint64 timestamp) private _timestamps;
// The global mapping between data and their revocation timestamps. // The global mapping between data and their revocation timestamps.
mapping(address => mapping(bytes32 => uint64)) private _revocationsOffchain; mapping(address revoker => mapping(bytes32 data => uint64 timestamp)) private _revocationsOffchain;
// Upgrade forward-compatibility storage gap // Upgrade forward-compatibility storage gap
uint256[MAX_GAP - 3] private __gap; uint256[MAX_GAP - 3] private __gap;
...@@ -91,7 +94,7 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -91,7 +94,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
* @inheritdoc IEAS * @inheritdoc IEAS
*/ */
function getSchemaRegistry() external pure returns (ISchemaRegistry) { function getSchemaRegistry() external pure returns (ISchemaRegistry) {
return ISchemaRegistry(Predeploys.SCHEMA_REGISTRY); return _schemaRegistry;
} }
/** /**
...@@ -458,9 +461,7 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -458,9 +461,7 @@ 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( SchemaRecord memory schemaRecord = _schemaRegistry.getSchema(schema);
schema
);
if (schemaRecord.uid == EMPTY_UID) { if (schemaRecord.uid == EMPTY_UID) {
revert InvalidSchema(); revert InvalidSchema();
} }
...@@ -557,9 +558,7 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -557,9 +558,7 @@ 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( SchemaRecord memory schemaRecord = _schemaRegistry.getSchema(schema);
schema
);
if (schemaRecord.uid == EMPTY_UID) { if (schemaRecord.uid == EMPTY_UID) {
revert InvalidSchema(); revert InvalidSchema();
} }
...@@ -817,7 +816,7 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -817,7 +816,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
bytes32 data, bytes32 data,
uint64 time uint64 time
) private { ) private {
mapping(bytes32 => uint64) storage revocations = _revocationsOffchain[revoker]; mapping(bytes32 data => uint64 timestamp) storage revocations = _revocationsOffchain[revoker];
if (revocations[data] != 0) { if (revocations[data] != 0) {
revert AlreadyRevokedOffchain(); revert AlreadyRevokedOffchain();
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.19;
import { Semver } from "../universal/Semver.sol"; import { Semver } from "../universal/Semver.sol";
...@@ -17,7 +17,7 @@ contract SchemaRegistry is ISchemaRegistry, Semver { ...@@ -17,7 +17,7 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
error AlreadyExists(); error AlreadyExists();
// The global mapping between schema records and their IDs. // The global mapping between schema records and their IDs.
mapping(bytes32 => SchemaRecord) private _registry; mapping(bytes32 uid => SchemaRecord schemaRecord) private _registry;
// Upgrade forward-compatibility storage gap // Upgrade forward-compatibility storage gap
uint256[MAX_GAP - 1] private __gap; uint256[MAX_GAP - 1] private __gap;
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.19;
import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.19;
import { Semver } from "../../universal/Semver.sol"; import { Semver } from "../../universal/Semver.sol";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment