-
Notifications
You must be signed in to change notification settings - Fork 478
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
chore: add change custody example #2506
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for putting this together.
Left some minor suggestions on how to run this easier.
|
||
1. Clone the repo locally | ||
2. Navigate to this folder with `cd packages/hub-nodejs/examples/change-custody` | ||
3. Run `yarn install` to install dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Run `yarn install` to install dependencies | |
3. Edit the `index.ts` mnemonics | |
4. Start a Docker container `docker run --rm -v "$(pwd):/app" -w /app -it farcasterxyz/hubble bash` |
1. Clone the repo locally | ||
2. Navigate to this folder with `cd packages/hub-nodejs/examples/change-custody` | ||
3. Run `yarn install` to install dependencies | ||
4. Run `yarn start` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. Run `yarn start` | |
5. Run `yarn start` |
|
||
const nonce = await readNonce(newAccount.address); | ||
const deadline = getDeadline(); | ||
const newRecovery = WARPCAST_RECOVERY_PROXY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const newRecovery = WARPCAST_RECOVERY_PROXY; | |
const newRecovery = WARPCAST_RECOVERY_PROXY; | |
const fid = await publicClient.readContract({ | |
address: ID_REGISTRY_ADDRESS, | |
abi: idRegistryABI, | |
chain: optimism, | |
functionName: "idOf", | |
args: [oldAccount.address], | |
}); |
...ID_REGISTRY_EIP_712_TYPES, | ||
primaryType: "TransferAndChangeRecovery", | ||
message: { | ||
fid: 864711n, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fid: 864711n, | |
fid, |
}); | ||
|
||
// Uncomment if simulation succeeds to execute transfer. | ||
// console.log("Sending transfer from old account to new account."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// console.log("Sending transfer from old account to new account."); | |
// console.log(`Transferring fid#${fid} from ${oldAccount.address} to ${newAccount.address}...`); |
Why is this change needed?
Describe why this issue should be fixed and link to any relevant design docs, issues or other relevant items.
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewPR-Codex overview
This PR introduces an example application for changing custody addresses in a blockchain context, utilizing
hardhat
for Ethereum development. It includes configuration files, TypeScript setup, and a README for local execution.Detailed summary
.gitignore
to excludecache/
.hardhat.config.cjs
for network configuration.tsconfig.json
for TypeScript compiler options.README.md
with instructions on changing custody addresses.package.json
with dependencies and scripts for starting the app.index.ts
with functions for generating transfer signatures and simulating transfers.yarn.lock
to lock dependencies.