Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
adea1c40
Unverified
Commit
adea1c40
authored
Oct 25, 2021
by
kf
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: correctly transform uni mainnet multicall contract
parent
a38d2658
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
classifiers.ts
packages/regenesis-surgery/scripts/classifiers.ts
+4
-0
constants.ts
packages/regenesis-surgery/scripts/constants.ts
+6
-2
handlers.ts
packages/regenesis-surgery/scripts/handlers.ts
+19
-1
types.ts
packages/regenesis-surgery/scripts/types.ts
+1
-0
No files found.
packages/regenesis-surgery/scripts/classifiers.ts
View file @
adea1c40
...
@@ -3,6 +3,7 @@ import {
...
@@ -3,6 +3,7 @@ import {
UNISWAP_V3_FACTORY_ADDRESS
,
UNISWAP_V3_FACTORY_ADDRESS
,
UNISWAP_V3_NFPM_ADDRESS
,
UNISWAP_V3_NFPM_ADDRESS
,
UNISWAP_V3_CONTRACT_ADDRESSES
,
UNISWAP_V3_CONTRACT_ADDRESSES
,
UNISWAP_V3_MAINNET_MULTICALL
,
PREDEPLOY_WIPE_ADDRESSES
,
PREDEPLOY_WIPE_ADDRESSES
,
PREDEPLOY_NO_WIPE_ADDRESSES
,
PREDEPLOY_NO_WIPE_ADDRESSES
,
PREDEPLOY_NEW_NOT_ETH_ADDRESSES
,
PREDEPLOY_NEW_NOT_ETH_ADDRESSES
,
...
@@ -67,6 +68,9 @@ export const classifiers: {
...
@@ -67,6 +68,9 @@ export const classifiers: {
[
AccountType
.
UNISWAP_V3_NFPM
]:
(
account
)
=>
{
[
AccountType
.
UNISWAP_V3_NFPM
]:
(
account
)
=>
{
return
hexStringEqual
(
account
.
address
,
UNISWAP_V3_NFPM_ADDRESS
)
return
hexStringEqual
(
account
.
address
,
UNISWAP_V3_NFPM_ADDRESS
)
},
},
[
AccountType
.
UNISWAP_V3_MAINNET_MULTICALL
]:
(
account
)
=>
{
return
hexStringEqual
(
account
.
address
,
UNISWAP_V3_MAINNET_MULTICALL
)
},
[
AccountType
.
UNISWAP_V3_POOL
]:
(
account
,
data
)
=>
{
[
AccountType
.
UNISWAP_V3_POOL
]:
(
account
,
data
)
=>
{
return
data
.
pools
.
some
((
pool
)
=>
{
return
data
.
pools
.
some
((
pool
)
=>
{
return
hexStringEqual
(
pool
.
oldAddress
,
account
.
address
)
return
hexStringEqual
(
pool
.
oldAddress
,
account
.
address
)
...
...
packages/regenesis-surgery/scripts/constants.ts
View file @
adea1c40
...
@@ -35,10 +35,14 @@ export const UNISWAP_V3_CONTRACT_ADDRESSES = [
...
@@ -35,10 +35,14 @@ export const UNISWAP_V3_CONTRACT_ADDRESSES = [
'
0xC36442b4a4522E871399CD717aBDD847Ab11FE88
'
,
'
0xC36442b4a4522E871399CD717aBDD847Ab11FE88
'
,
// UniswapInterfaceMulticall (OP KOVAN)
// UniswapInterfaceMulticall (OP KOVAN)
'
0x1F98415757620B543A52E61c46B32eB19261F984
'
,
'
0x1F98415757620B543A52E61c46B32eB19261F984
'
,
// UniswapInterfaceMulticall (OP MAINNET)
'
0x90f872b3d8f33f305e0250db6A2761B354f7710A
'
,
]
]
export
const
UNISWAP_V3_KOVAN_MULTICALL
=
'
0x1F98415757620B543A52E61c46B32eB19261F984
'
export
const
UNISWAP_V3_MAINNET_MULTICALL
=
'
0x90f872b3d8f33f305e0250db6A2761B354f7710A
'
export
const
PREDEPLOY_WIPE_ADDRESSES
=
[
export
const
PREDEPLOY_WIPE_ADDRESSES
=
[
// L2CrossDomainMessenger
// L2CrossDomainMessenger
'
0x4200000000000000000000000000000000000007
'
,
'
0x4200000000000000000000000000000000000007
'
,
...
...
packages/regenesis-surgery/scripts/handlers.ts
View file @
adea1c40
...
@@ -5,7 +5,11 @@ import {
...
@@ -5,7 +5,11 @@ import {
POOL_INIT_CODE_HASH_OPTIMISM_KOVAN
,
POOL_INIT_CODE_HASH_OPTIMISM_KOVAN
,
}
from
'
@uniswap/v3-sdk
'
}
from
'
@uniswap/v3-sdk
'
import
{
sleep
,
add0x
,
remove0x
,
clone
}
from
'
@eth-optimism/core-utils
'
import
{
sleep
,
add0x
,
remove0x
,
clone
}
from
'
@eth-optimism/core-utils
'
import
{
OLD_ETH_ADDRESS
,
WETH_TRANSFER_ADDRESSES
}
from
'
./constants
'
import
{
OLD_ETH_ADDRESS
,
WETH_TRANSFER_ADDRESSES
,
UNISWAP_V3_KOVAN_MULTICALL
,
}
from
'
./constants
'
import
{
import
{
findAccount
,
findAccount
,
hexStringIncludes
,
hexStringIncludes
,
...
@@ -226,6 +230,20 @@ export const handlers: {
...
@@ -226,6 +230,20 @@ export const handlers: {
code
:
poolCode
,
code
:
poolCode
,
}
}
},
},
[
AccountType
.
UNISWAP_V3_MAINNET_MULTICALL
]:
async
(
account
,
data
)
=>
{
// When upgrading mainnet, we want to get rid of the old multicall contract and introduce a new
// multicall contract at the OP Kovan address (also the ETH mainnet address). By changing the
// address here and piping into the UNISWAP_V3_OTHER handler, we:
// (1) Get the state of the old multicall but with the new address
// (2) Query the code using the new address (required)
return
handlers
[
AccountType
.
UNISWAP_V3_OTHER
](
{
...
account
,
address
:
UNISWAP_V3_KOVAN_MULTICALL
,
},
data
)
},
[
AccountType
.
UNISWAP_V3_OTHER
]:
async
(
account
,
data
)
=>
{
[
AccountType
.
UNISWAP_V3_OTHER
]:
async
(
account
,
data
)
=>
{
let
code
=
await
data
.
ethProvider
.
getCode
(
account
.
address
)
let
code
=
await
data
.
ethProvider
.
getCode
(
account
.
address
)
...
...
packages/regenesis-surgery/scripts/types.ts
View file @
adea1c40
...
@@ -55,6 +55,7 @@ export enum AccountType {
...
@@ -55,6 +55,7 @@ export enum AccountType {
PREDEPLOY_WETH
,
PREDEPLOY_WETH
,
UNISWAP_V3_FACTORY
,
UNISWAP_V3_FACTORY
,
UNISWAP_V3_NFPM
,
UNISWAP_V3_NFPM
,
UNISWAP_V3_MAINNET_MULTICALL
,
UNISWAP_V3_POOL
,
UNISWAP_V3_POOL
,
UNISWAP_V3_OTHER
,
UNISWAP_V3_OTHER
,
UNVERIFIED
,
UNVERIFIED
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment