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
b2331d5c
Commit
b2331d5c
authored
Nov 08, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ethers contract wrapper
parent
9fc86361
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
service.ts
packages/chain-mon/src/balance-mon/service.ts
+7
-8
No files found.
packages/chain-mon/src/balance-mon/service.ts
View file @
b2331d5c
...
...
@@ -7,6 +7,7 @@ import {
}
from
'
@eth-optimism/common-ts
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
BigNumber
,
ethers
}
from
'
ethers
'
import
Safe
from
'
@eth-optimism/contracts-bedrock/forge-artifacts/IGnosisSafe.sol/IGnosisSafe.0.8.19.json
'
import
{
version
}
from
'
../../package.json
'
...
...
@@ -76,9 +77,8 @@ export class BalanceMonService extends BaseServiceV2<
protected
async
main
():
Promise
<
void
>
{
for
(
const
account
of
this
.
state
.
accounts
)
{
let
balance
:
ethers
.
BigNumber
try
{
balance
=
await
this
.
options
.
rpc
.
getBalance
(
account
.
address
)
const
balance
=
await
this
.
options
.
rpc
.
getBalance
(
account
.
address
)
this
.
logger
.
info
(
`got balance`
,
{
address
:
account
.
address
,
nickname
:
account
.
nickname
,
...
...
@@ -106,14 +106,13 @@ export class BalanceMonService extends BaseServiceV2<
// Get the safe nonce to report
if
(
account
.
safe
)
{
let
safeNonce
:
ethers
.
BigNumber
try
{
safeNonce
=
BigNumber
.
from
(
await
this
.
options
.
rpc
.
call
({
to
:
account
.
address
,
data
:
'
0xaffed0e0
'
,
// call the nonce() function in the safe contract
})
const
safeContract
=
new
ethers
.
Contract
(
account
.
address
,
Safe
.
abi
,
this
.
options
.
rpc
)
const
safeNonce
=
BigNumber
.
from
(
await
safeContract
.
nonce
())
this
.
logger
.
info
(
`got nonce`
,
{
address
:
account
.
address
,
nickname
:
account
.
nickname
,
...
...
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