Commit f822fb90 authored by lbeder's avatar lbeder Committed by Mark Tyneway

Fetch SchemaRegistry from the predeploys

parent d29e1929
...@@ -5,6 +5,7 @@ pragma solidity 0.8.19; ...@@ -5,6 +5,7 @@ pragma solidity 0.8.19;
import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { Semver } from "../universal/Semver.sol"; import { Semver } from "../universal/Semver.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
import { EIP712Verifier } from "./eip712/EIP712Verifier.sol"; import { EIP712Verifier } from "./eip712/EIP712Verifier.sol";
...@@ -70,7 +71,7 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -70,7 +71,7 @@ contract EAS is IEAS, Semver, EIP712Verifier {
error WrongSchema(); error WrongSchema();
// The global schema registry. // The global schema registry.
ISchemaRegistry private immutable _schemaRegistry; ISchemaRegistry private immutable _schemaRegistry = ISchemaRegistry(Predeploys.SCHEMA_REGISTRY);
// The global mapping between attestations and their UIDs. // The global mapping between attestations and their UIDs.
mapping(bytes32 uid => Attestation attestation) private _db; mapping(bytes32 uid => Attestation attestation) private _db;
...@@ -86,15 +87,8 @@ contract EAS is IEAS, Semver, EIP712Verifier { ...@@ -86,15 +87,8 @@ contract EAS is IEAS, Semver, EIP712Verifier {
/** /**
* @dev Creates a new EAS instance. * @dev Creates a new EAS instance.
*
* @param registry The address of the global schema registry.
*/ */
constructor(ISchemaRegistry registry) Semver(1, 0, 0) EIP712Verifier("EAS", "1.0.0") { constructor() Semver(1, 0, 0) EIP712Verifier("EAS", "1.0.0") {
if (address(registry) == address(0)) {
revert InvalidRegistry();
}
_schemaRegistry = registry;
} }
/** /**
......
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