-
Notifications
You must be signed in to change notification settings - Fork 40
Standalone Nova Fee Sweep Proposal #303
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
Open
godzillaba
wants to merge
9
commits into
main
Choose a base branch
from
nova-timelock-sweep-patcher
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
684fb59
add script to patch proposal
godzillaba e122a9b
add comment
godzillaba 0867b4e
present gas price instead of submission cost
godzillaba f3f732f
use l2 balance for submission fee
godzillaba 397983e
Merge branch 'main' into nova-timelock-sweep-patcher
godzillaba 857b3eb
standalone proposal
godzillaba a1a2e57
salt
godzillaba 5d285eb
salt and gen
godzillaba 52ccaeb
common format
godzillaba 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 |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // takes proposal data as input and adds a transaction to sweep ETH from the L1 Timelock alias on Nova | ||
| // context: https://www.tally.xyz/gov/arbitrum/proposal/108288822474129076868455956066667369439381709547570289793612729242368710728616 | ||
|
|
||
| import { ethers } from 'ethers' | ||
| import { | ||
| IInbox__factory, | ||
| L1ArbitrumTimelock__factory, | ||
| } from '../../../typechain-types' | ||
| import { JsonRpcProvider } from '@ethersproject/providers' | ||
|
|
||
| ;(async () => { | ||
| // this is the bianca payload and serves as an example | ||
| // TODO: this should be replaced with some future proposal | ||
| const inputData = | ||
| '0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000e13fb8241eb0e976305ff5f40d43d783c08468da55f38eee093510e004f512aa000000000000000000000000000000000000000000000000000000000003f48000000000000000000000000000000000000000000000000000000000000000070000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd0000000000000000000000003fffbadaf827559da092217e474760e2b2c3cedd000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c00000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000000000000000000000000000000008e000000000000000000000000000000000000000000000000000000000000000841cff79cd00000000000000000000000019b715cf310c28c9020e53aaa11ce9df42e718b500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000658afc9d5ec4476fa6bb7033ea465f9901fbff2700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000af81c82ec98f86d0017d78cd66f1026f1a5cf1db00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000b040b105a4a0c7a9cc290164accbc3285536832200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000c4448b71118c9071bcb9734a0eac55d18a15394900000000000000000000000086a02dd71363c440b21f4c0e5b2ad01ffe1a748200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd0000000000000000000000006dd43360d2a69bb9fffc5349f2511f2a3bcbc2da00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000c4448b71118c9071bcb9734a0eac55d18a15394900000000000000000000000086a02dd71363c440b21f4c0e5b2ad01ffe1a748200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd00000000000000000000000061703bf337341f2e09d96dd6488c2907718a8e2600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000c4448b71118c9071bcb9734a0eac55d18a15394900000000000000000000000086a02dd71363c440b21f4c0e5b2ad01ffe1a748200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000849e360a247132f961c9cbe95ba39106c72e126800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' | ||
|
|
||
| const l1TimelockAlias = '0xf7951d92b0c345144506576ec13ecf5103ac905a' | ||
| const novaInbox = '0xc4448b71118c9071Bcb9734A0EAc55D18A153949' | ||
| const novaToParentRouter = '0x36D0170D92F66e8949eB276C3AC4FEA64f83704d' | ||
| const maxSubmissionCost = ethers.utils.parseEther('0.01') | ||
| const callValue = await new JsonRpcProvider('https://nova.arbitrum.io/rpc').getBalance(l1TimelockAlias) | ||
|
|
||
| const timelockIface = L1ArbitrumTimelock__factory.createInterface() | ||
| const inboxIface = IInbox__factory.createInterface() | ||
|
|
||
| const unsafeCreateRetryableCalldata = inboxIface.encodeFunctionData( | ||
| 'unsafeCreateRetryableTicket', | ||
| [ | ||
| novaToParentRouter, // to | ||
| callValue, // l2CallValue | ||
godzillaba marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| maxSubmissionCost, // maxSubmissionCost | ||
| novaToParentRouter, // excessFeeRefundAddress | ||
| novaToParentRouter, // callValueRefundAddress | ||
| 0, // gasLimit | ||
| 0, // maxFeePerGas | ||
| '0x', // calldata | ||
| ] | ||
| ) | ||
|
|
||
| const decodedScheduleBatch = timelockIface.decodeFunctionData( | ||
| 'scheduleBatch', | ||
| inputData | ||
| ) | ||
|
|
||
| const patchedScheduleBatchCalldata = timelockIface.encodeFunctionData( | ||
| 'scheduleBatch', | ||
| [ | ||
| [...decodedScheduleBatch[0], novaInbox], | ||
| [...decodedScheduleBatch[1], maxSubmissionCost], | ||
| [...decodedScheduleBatch[2], unsafeCreateRetryableCalldata], | ||
| decodedScheduleBatch[3], | ||
| decodedScheduleBatch[4], | ||
| decodedScheduleBatch[5], | ||
| ] | ||
| ) | ||
|
|
||
| console.log(patchedScheduleBatchCalldata) | ||
| })() | ||
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.