Skip to content
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

Merged
merged 8 commits into from
Dec 3, 2024

Conversation

theKosmoss
Copy link
Contributor

No description provided.

@theKosmoss theKosmoss self-assigned this Nov 10, 2024
Copy link

changeset-bot bot commented Nov 10, 2024

🦋 Changeset detected

Latest commit: d214557

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@peeramid-labs/multipass Minor

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

const registrarSignature = "0x933ebb2d720914dd53fccf4278d12a40e156e57f4a56873c3d5d7ccbe09c9015092b81179f82b3c2daf8192732bc844c22583aafe4634c47910979e0233b2e461c";

try {
const tx = await contract.register(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works

@theKosmoss theKosmoss force-pushed the 19-migrate-register-username-playbook-from-contracts branch from c0afc70 to 87441a4 Compare November 13, 2024 06:49
Copy link
Member

@peersky peersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some changes desired

Copy link
Member

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
Copy link
Member

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

targetDomain: ethers.utils.formatBytes32String(""),
},
ethers.constants.HashZero,
{ maxFeePerGas: 100000000000, maxPriorityFeePerGas: 1000000000, value: 0 }
Copy link
Member

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.

@peersky
Copy link
Member

peersky commented Nov 13, 2024

also needs changeset

process.exitCode = 1;
});

async function main() {

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

@theKosmoss theKosmoss marked this pull request as draft November 14, 2024 07:09
@theKosmoss theKosmoss marked this pull request as ready for review November 28, 2024 10:26
@theKosmoss theKosmoss linked an issue Dec 2, 2024 that may be closed by this pull request
@theKosmoss theKosmoss changed the title Register nickname script and ts debug configuration Update initialize domain playbook with register username code Dec 2, 2024
Copy link
Member

@peersky peersky left a 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

process.exitCode = 1;
});

async function main() {
Copy link
Member

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

import { LibMultipass } from '../types/src/Multipass';
import crypto from "crypto";
import { signRegistrarMessage } from "../playbook/utils/utils";
import { ethers } from 'ethers';
Copy link
Member

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

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)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use hre.ethers instead

playbook/initializeDomain.ts Outdated Show resolved Hide resolved
playbook/initializeDomain.ts Outdated Show resolved Hide resolved
theKosmoss and others added 3 commits December 3, 2024 11:52
Co-authored-by: Peersky <61459744+peersky@users.noreply.github.com>
Co-authored-by: Peersky <61459744+peersky@users.noreply.github.com>
@peersky peersky merged commit 03fe50c into main Dec 3, 2024
3 checks passed
@peersky peersky deleted the 19-migrate-register-username-playbook-from-contracts branch December 3, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate register username playbook from contracts
4 participants