-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
106 additions
and
111 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
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { SchemaRegistry } from "@ethereum-attestation-service/eas-sdk"; | ||
import hre from "hardhat"; | ||
import type { | ||
Account, | ||
Address, | ||
Chain, | ||
Client, | ||
Transport, | ||
WalletClient, | ||
} from "viem"; | ||
import { clientToSigner } from "./clientToSigner"; | ||
|
||
export async function deployEAS(deployer: WalletClient) { | ||
const registry = await hre.viem.deployContract("SchemaRegistry", [], { | ||
account: deployer.account, | ||
}); | ||
const eas = await hre.viem.deployContract("EAS", [registry.address], { | ||
account: deployer.account, | ||
}); | ||
return { | ||
registry, | ||
eas, | ||
}; | ||
} | ||
|
||
export async function deploySchema( | ||
deployer: Client<Transport, Chain, Account>, | ||
registryAddress: string, | ||
schema: string, | ||
resolverAddress = "0x0000000000000000000000000000000000000000", | ||
revocable = true, | ||
): Promise<Address> { | ||
const registry = new SchemaRegistry(registryAddress); | ||
|
||
const signer = clientToSigner(deployer); | ||
registry.connect(signer); | ||
const tx = await registry.register({ schema, resolverAddress, revocable }); | ||
return (await tx.wait()) as Address; | ||
} |
This file was deleted.
Oops, something went wrong.