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

Creating Transacton to Migrate to L2 #387

Merged
merged 25 commits into from
Feb 15, 2024
Merged

Conversation

anquetil
Copy link
Contributor

Description

This PR has all my work on the migration work so far, primarily things in the TransactionForm/Migration folder.

Code review

This isn't meant to be fully functional / ready on the front-end, but moreso away to get feedback on progress so far, and whether the data being used to prepare the L1Messenger transaction is working, since there's a lot of moving parts. I want to make sure to catch stuff early.

I'm not a fan of the C1/C2/C3 structure for naming the files but the sections are very linear - you have to do them in order, and so it makes sense to reflect that in the filenames?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have done a self-review of my own code
  • Any new and existing tests pass locally with my changes
  • My changes generate no new warnings (lint warnings, console warnings, etc)

@vercel
Copy link

vercel bot commented Oct 13, 2023

@anquetil is attempting to deploy a commit to the Nouns Builder Team on Vercel.

A member of the Team first needs to authorize it.

@neokry neokry self-requested a review October 16, 2023 02:58
where: {
dao: collectionAddress,
},
first: 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally this should work with DAOs of any size. You can improve this by querying ownerCount before this call and if the ownerCount is > 1000 create n batches where n = ownerCount / 1000 ie 1200 members will create 2 batches, 3000 will create 3 batches then merge them together at the end of the function.

.vscode/settings.json Outdated Show resolved Hide resolved
data: members,
error,
isValidating,
} = useSWR(isReady ? [token, chain.id] : undefined, () =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

we only need to run this query if the DAO is on step 2 right? currently this will run every time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think the issue here is that I need it in handleC2Submit, which is declared at this level, because the C2Form is rendered here. Since useSWR is a hook, it can't be inside of handleC2Submit, however. Is there a way to get this without SWR in handleC2Submit ? Or maybe I can enable the hook only if we're on Step 2?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yea only enable the hook if we are on step 2

L2_DEPLOYMENT_ADDRESSES[targetChainID].MANAGER,
encodeFunctionData({
abi: parseAbi([
'function deploy(FounderParams[] calldata _founderParams, address[] calldata _implAddresses, bytes[] calldata _implData)',
Copy link
Collaborator

Choose a reason for hiding this comment

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

same thing about the ABI for these calls (mentioned this to you already but adding here so we don't forget)

onSubmit,
disabled,
}) => {
const [receivingChain, setReceivingChain] = useState<ChainType>('ZORA')
Copy link
Collaborator

Choose a reason for hiding this comment

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

use formik instead of useState for form data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in both DroposalForm and create, the dropdowns are used to set the state. should I just set onChange to be null?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah yea I think the dropdown component is a bit weird. continue using state hooks for now

]
: [zeroFounder]

const abiCoder = new ethers.utils.AbiCoder()
Copy link
Collaborator

Choose a reason for hiding this comment

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

mentioned this to you already but remove any instances of ethers. commenting here so we dont forget

)

const propertyMetadataParamsHex = abiCoder.encode(
['string', 'string', 'string', 'string'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

these params should actually be encoded as structs. pull this from the ABI instead of hardcoding here to get the right values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these don't exist in the Manager ABI - should i be pulling it from the IMetadata ABI for example? That's the only place I see the actual structs

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.

2 participants