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
1896b7c7
Unverified
Commit
1896b7c7
authored
Nov 16, 2022
by
mergify[bot]
Committed by
GitHub
Nov 16, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4003 from protocolwhisper/develop
Deleted unused variables from contracts-bedrock and add changeset
parents
66d56a47
9fda7d93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
67 deletions
+6
-67
green-roses-prove.md
.changeset/green-roses-prove.md
+5
-0
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+1
-67
No files found.
.changeset/green-roses-prove.md
0 → 100644
View file @
1896b7c7
---
'
@eth-optimism/contracts-bedrock'
:
minor
---
Deleted Unused Variables fundAccount , impersonatedTx
packages/contracts-bedrock/src/deploy-utils.ts
View file @
1896b7c7
...
@@ -3,8 +3,7 @@ import assert from 'assert'
...
@@ -3,8 +3,7 @@ import assert from 'assert'
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Signer
}
from
'
@ethersproject/abstract-signer
'
import
{
Signer
}
from
'
@ethersproject/abstract-signer
'
import
{
sleep
,
awaitCondition
,
getChainId
}
from
'
@eth-optimism/core-utils
'
import
{
sleep
,
getChainId
}
from
'
@eth-optimism/core-utils
'
import
{
HttpNetworkConfig
}
from
'
hardhat/types
'
export
interface
DictatorConfig
{
export
interface
DictatorConfig
{
globalConfig
:
{
globalConfig
:
{
...
@@ -196,71 +195,6 @@ export const getAdvancedContract = (opts: {
...
@@ -196,71 +195,6 @@ export const getAdvancedContract = (opts: {
return
contract
return
contract
}
}
export
const
fundAccount
=
async
(
hre
:
any
,
address
:
string
,
amount
:
ethers
.
BigNumber
)
=>
{
if
(
!
hre
.
deployConfig
.
isForkedNetwork
)
{
throw
new
Error
(
'
this method can only be used against a forked network
'
)
}
console
.
log
(
`Funding account
${
address
}
...`
)
await
hre
.
ethers
.
provider
.
send
(
'
hardhat_setBalance
'
,
[
address
,
amount
.
toHexString
(),
])
console
.
log
(
`Waiting for balance to reflect...`
)
await
awaitCondition
(
async
()
=>
{
const
balance
=
await
hre
.
ethers
.
provider
.
getBalance
(
address
)
return
balance
.
gte
(
amount
)
},
5000
,
100
)
console
.
log
(
`Account successfully funded.`
)
}
export
const
sendImpersonatedTx
=
async
(
opts
:
{
hre
:
any
contract
:
ethers
.
Contract
fn
:
string
from
:
string
gas
:
string
args
:
any
[]
})
=>
{
if
(
!
opts
.
hre
.
deployConfig
.
isForkedNetwork
)
{
throw
new
Error
(
'
this method can only be used against a forked network
'
)
}
console
.
log
(
`Impersonating account
${
opts
.
from
}
...`
)
await
opts
.
hre
.
ethers
.
provider
.
send
(
'
hardhat_impersonateAccount
'
,
[
opts
.
from
])
console
.
log
(
`Funding account
${
opts
.
from
}
...`
)
await
fundAccount
(
opts
.
hre
,
opts
.
from
,
BIG_BALANCE
)
console
.
log
(
`Sending impersonated transaction...`
)
const
tx
=
await
opts
.
contract
.
populateTransaction
[
opts
.
fn
](...
opts
.
args
)
const
provider
=
new
opts
.
hre
.
ethers
.
providers
.
JsonRpcProvider
(
(
opts
.
hre
.
network
.
config
as
HttpNetworkConfig
).
url
)
await
provider
.
send
(
'
eth_sendTransaction
'
,
[
{
...
tx
,
from
:
opts
.
from
,
gas
:
opts
.
gas
,
},
])
console
.
log
(
`Stopping impersonation of account
${
opts
.
from
}
...`
)
await
opts
.
hre
.
ethers
.
provider
.
send
(
'
hardhat_stopImpersonatingAccount
'
,
[
opts
.
from
,
])
}
export
const
getContractFromArtifact
=
async
(
export
const
getContractFromArtifact
=
async
(
hre
:
any
,
hre
:
any
,
name
:
string
,
name
:
string
,
...
...
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