-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update initialize domain playbook with register username code #20
Update initialize domain playbook with register username code #20
Conversation
🦋 Changeset detectedLatest commit: d214557 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
scripts/register.ts
Outdated
const registrarSignature = "0x933ebb2d720914dd53fccf4278d12a40e156e57f4a56873c3d5d7ccbe09c9015092b81179f82b3c2daf8192732bc844c22583aafe4634c47910979e0233b2e461c"; | ||
|
||
try { | ||
const tx = await contract.register( |
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.
This works
c0afc70
to
87441a4
Compare
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.
some changes desired
.vscode/launch.json
Outdated
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.
Please don't commit .vscode files. We should keep our work IDE agnostic.
@@ -1,5 +1,6 @@ | |||
#! /bin/bash | |||
|
|||
rm -rf ./deployments/localhost | |||
rm -rf ./artifacts |
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.
I would also suggest removing ./cache
scripts/register.ts
Outdated
targetDomain: ethers.utils.formatBytes32String(""), | ||
}, | ||
ethers.constants.HashZero, | ||
{ maxFeePerGas: 100000000000, maxPriorityFeePerGas: 1000000000, value: 0 } |
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.
Can we remove maxFeePerGas
and maxPriorityFeePerGas
? I think they got here as debug values, we should not need them really.
also needs changeset |
scripts/register.ts
Outdated
process.exitCode = 1; | ||
}); | ||
|
||
async function main() { |
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.
can we add promises or explicitly define the resulting type at least for async functions?
makes it more readable and ensures type safety.
more of a philosophical general question
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.
looks good, just optimize imports a bit
scripts/register.ts
Outdated
process.exitCode = 1; | ||
}); | ||
|
||
async function main() { |
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.
I think it makes sense to have explicit return typing for client-like functions. I this particular case this is more of executable script entry point (main) is less of a priority
playbook/initializeDomain.ts
Outdated
import { LibMultipass } from '../types/src/Multipass'; | ||
import crypto from "crypto"; | ||
import { signRegistrarMessage } from "../playbook/utils/utils"; | ||
import { ethers } from 'ethers'; |
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.
I suggest using hre.ethers instead
playbook/initializeDomain.ts
Outdated
name: hre.ethers.utils.formatBytes32String(username), | ||
id: hre.ethers.utils.formatBytes32String(playerId), | ||
domainName: hre.ethers.utils.formatBytes32String(domain), | ||
validUntil: ethers.BigNumber.from(Math.floor(Date.now() / 1000) + (365 * 24 * 60 * 60)), |
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.
use hre.ethers instead
Co-authored-by: Peersky <61459744+peersky@users.noreply.github.com>
Co-authored-by: Peersky <61459744+peersky@users.noreply.github.com>
No description provided.