Repository navigation
feat: generic platform handling #35
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4eed58e
feat: generic platform handling in command
benceharomi 53e82ec
feat: generic deployment script for link handle entrypoint
benceharomi a4fbb0f
feat: added platform name check and renamed key to record
benceharomi ead64bb
chore: small script changes
benceharomi 54f1245
chore: organized linkHandleCommand fixtures
benceharomi b3799b6
fix: deployment script
benceharomi 72e1608
feat: removed discord
benceharomi cad0610
feat: updated twitter circuit
benceharomi 3c2f413
test: unsupported key
benceharomi 82bb358
chore: fixture compile script fix
benceharomi 53db751
chore: added sepolia rpc to foundry.toml
benceharomi 38f610d
chore: fixture prove script fix
benceharomi 12d9386
chore: comment updated
benceharomi 83035df
fix: use correct honk verifier for discord
benceharomi 577bec1
chore: comment updated
benceharomi 1e3474e
chore: fixture prove script grep fix
benceharomi d81e58f
fix: use correct honk verifier for discord
benceharomi 266a0cc
chore: fixture prove script fix
benceharomi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| PRIVATE_KEY= | ||
| ETHERSCAN_API_KEY= | ||
| SEPOLIA_URL= | ||
| SEPOLIA_RPC_URL= |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
24 changes: 24 additions & 0 deletions
24
script/DeployLinkHandleEntrypoint/DeployLinkHandleEntrypointTwitter.s.sol
This file contains hidden or 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,24 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.30; | ||
|
|
||
| import { DeployLinkHandleEntrypointScript } from "./_DeployLinkHandleEntrypoint.s.sol"; | ||
| import { HonkVerifier } from "../../test/fixtures/linkHandleCommand/twitter/target/HonkVerifier.sol"; | ||
|
|
||
| contract DeployLinkHandleEntrypointTwitterScript is DeployLinkHandleEntrypointScript { | ||
| function _deployHonkVerifier() internal override returns (address) { | ||
| return address(new HonkVerifier()); | ||
| } | ||
|
|
||
| function _getDkimRegistryAddress() internal pure override returns (address) { | ||
| // sepolia always valid dkim registry | ||
| return 0xc4f628496b8c474096650C8f9023954643cC614F; | ||
| } | ||
|
|
||
| function _getPlatformName() internal pure override returns (string memory) { | ||
| return "x"; | ||
| } | ||
|
|
||
| function _getRecordName() internal pure override returns (string memory) { | ||
| return "com.twitter"; | ||
| } | ||
| } |
68 changes: 68 additions & 0 deletions
68
script/DeployLinkHandleEntrypoint/_DeployLinkHandleEntrypoint.s.sol
This file contains hidden or 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,68 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.30; | ||
|
|
||
| import { Script, console } from "forge-std/Script.sol"; | ||
| import { LinkHandleEntrypoint } from "../../src/entrypoints/LinkHandleEntrypoint.sol"; | ||
| import { LinkHandleCommandVerifier } from "../../src/verifiers/LinkHandleCommandVerifier.sol"; | ||
|
|
||
| abstract contract DeployLinkHandleEntrypointScript is Script { | ||
| function run() external { | ||
| uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
|
|
||
| vm.startBroadcast(deployerPrivateKey); | ||
|
|
||
| console.log("\n=== Step 0: Deploy HonkVerifier ==="); | ||
| address honkVerifierAddress = _deployHonkVerifier(); | ||
| console.log("HonkVerifier deployed at:", honkVerifierAddress); | ||
|
|
||
| console.log("\n=== Step 1: Deploy LinkHandleCommandVerifier ==="); | ||
| LinkHandleCommandVerifier commandVerifier = | ||
| new LinkHandleCommandVerifier(honkVerifierAddress, _getDkimRegistryAddress()); | ||
| console.log("LinkHandleCommandVerifier deployed at:", address(commandVerifier)); | ||
|
|
||
| console.log("\n=== Step 2: Deploy LinkHandleEntrypoint ==="); | ||
| LinkHandleEntrypoint entrypoint = | ||
| new LinkHandleEntrypoint(address(commandVerifier), _getRecordName(), _getPlatformName()); | ||
| console.log("LinkHandleEntrypoint deployed at:", address(entrypoint)); | ||
|
|
||
| vm.stopBroadcast(); | ||
|
|
||
| console.log("\n=== Deployment Complete ==="); | ||
| console.log("HONK_VERIFIER=", honkVerifierAddress); | ||
| console.log("DKIM_REGISTRY=", _getDkimRegistryAddress()); | ||
| console.log("LINK_HANDLE_COMMAND_VERIFIER=", address(commandVerifier)); | ||
| console.log("RECORD_NAME=", _getRecordName()); | ||
| console.log("PLATFORM_NAME=", _getPlatformName()); | ||
| console.log("LINK_HANDLE_ENTRYPOINT=", address(entrypoint)); | ||
| } | ||
|
|
||
| /** | ||
| * @notice Deploys the HonkVerifier and returns the address. | ||
| * @dev TODO: ideally ths would be a pure address getter and would only return the address of the HonkVerifier | ||
| * deployed by the | ||
| * registry. Currently this is deployed inside this function. Remove it once the registry deploys the | ||
| * HonkVerifier. | ||
| * @return The address of the HonkVerifier | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| */ | ||
| function _deployHonkVerifier() internal virtual returns (address); | ||
|
|
||
| /** | ||
| * @notice The DKIM registry address. | ||
| * @dev Example (sepolia): return 0xe24c24Ab94c93D5754De1cbE61b777e47cc57723; | ||
| * Example (sepolia always valid): return 0xc4f628496b8c474096650C8f9023954643cC614F; | ||
| * @return The address of the DKIM registry | ||
| */ | ||
| function _getDkimRegistryAddress() internal pure virtual returns (address); | ||
|
|
||
| /** | ||
| * @notice The platform name in the command (e.g. "x"). | ||
| * @return The platform name used in the command | ||
| */ | ||
| function _getPlatformName() internal pure virtual returns (string memory); | ||
|
|
||
| /** | ||
| * @notice ENS text record name (e.g. "com.twitter") — the key in setText(node, key, value). | ||
| * @return The record name for the text record | ||
| */ | ||
| function _getRecordName() internal pure virtual returns (string memory); | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.