Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
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
vicotor
mybee
Commits
5e654403
Unverified
Commit
5e654403
authored
Sep 25, 2020
by
Ralph Pichler
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix goerli factory address (#749)
parent
5b44ec7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
factory.go
pkg/settlement/swap/chequebook/factory.go
+1
-1
init.go
pkg/settlement/swap/chequebook/init.go
+21
-0
No files found.
pkg/settlement/swap/chequebook/factory.go
View file @
5e654403
...
@@ -161,7 +161,7 @@ func (c *factory) ERC20Address(ctx context.Context) (common.Address, error) {
...
@@ -161,7 +161,7 @@ func (c *factory) ERC20Address(ctx context.Context) (common.Address, error) {
func
DiscoverFactoryAddress
(
chainID
int64
)
(
common
.
Address
,
bool
)
{
func
DiscoverFactoryAddress
(
chainID
int64
)
(
common
.
Address
,
bool
)
{
if
chainID
==
5
{
if
chainID
==
5
{
// goerli
// goerli
return
common
.
HexToAddress
(
"0x
334394E8c891E77b1449084aaDD659920BB25247
"
),
true
return
common
.
HexToAddress
(
"0x
A6B88705036F2a56807af157c116b7dfCDabf968
"
),
true
}
}
return
common
.
Address
{},
false
return
common
.
Address
{},
false
}
}
pkg/settlement/swap/chequebook/init.go
View file @
5e654403
...
@@ -6,8 +6,10 @@ package chequebook
...
@@ -6,8 +6,10 @@ package chequebook
import
(
import
(
"context"
"context"
"errors"
"math/big"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/storage"
...
@@ -45,6 +47,25 @@ func Init(
...
@@ -45,6 +47,25 @@ func Init(
if
err
!=
storage
.
ErrNotFound
{
if
err
!=
storage
.
ErrNotFound
{
return
nil
,
err
return
nil
,
err
}
}
if
swapInitialDeposit
!=
0
{
erc20Token
,
err
:=
erc20BindingFunc
(
erc20Address
,
swapBackend
)
if
err
!=
nil
{
return
nil
,
err
}
balance
,
err
:=
erc20Token
.
BalanceOf
(
&
bind
.
CallOpts
{
Context
:
ctx
,
},
overlayEthAddress
)
if
err
!=
nil
{
return
nil
,
err
}
if
balance
.
Cmp
(
big
.
NewInt
(
int64
(
swapInitialDeposit
)))
<
0
{
return
nil
,
errors
.
New
(
"insufficient token for initial deposit"
)
}
}
// if we don't yet have a chequebook, deploy a new one
// if we don't yet have a chequebook, deploy a new one
logger
.
Info
(
"deploying new chequebook"
)
logger
.
Info
(
"deploying new chequebook"
)
...
...
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