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
dfa735c5
Unverified
Commit
dfa735c5
authored
Sep 25, 2020
by
Ralph Pichler
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add configuration for goerli (#736)
parent
7b42ae38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
node.go
pkg/node/node.go
+11
-4
factory.go
pkg/settlement/swap/chequebook/factory.go
+9
-0
No files found.
pkg/node/node.go
View file @
dfa735c5
...
...
@@ -175,15 +175,22 @@ func NewBee(addr string, swarmAddress swarm.Address, keystore keystore.Service,
return
nil
,
err
}
// TODO: factory address discovery for well-known networks (goerli for beta)
var
factoryAddress
common
.
Address
if
o
.
SwapFactoryAddress
==
""
{
return
nil
,
errors
.
New
(
"no known factory address"
)
var
found
bool
factoryAddress
,
found
=
chequebook
.
DiscoverFactoryAddress
(
chainID
.
Int64
())
if
!
found
{
return
nil
,
errors
.
New
(
"no known factory address"
)
}
logger
.
Infof
(
"using default factory address for chain id %d: %x"
,
chainID
,
factoryAddress
)
}
else
if
!
common
.
IsHexAddress
(
o
.
SwapFactoryAddress
)
{
return
nil
,
errors
.
New
(
"invalid factory address"
)
}
else
{
factoryAddress
=
common
.
HexToAddress
(
o
.
SwapFactoryAddress
)
logger
.
Infof
(
"using custom factory address: %x"
,
factoryAddress
)
}
chequebookFactory
,
err
:=
chequebook
.
NewFactory
(
swapBackend
,
transactionService
,
common
.
HexToAddress
(
o
.
SwapFactoryAddress
)
,
chequebook
.
NewSimpleSwapFactoryBindingFunc
)
chequebookFactory
,
err
:=
chequebook
.
NewFactory
(
swapBackend
,
transactionService
,
factoryAddress
,
chequebook
.
NewSimpleSwapFactoryBindingFunc
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
pkg/settlement/swap/chequebook/factory.go
View file @
dfa735c5
...
...
@@ -156,3 +156,12 @@ func (c *factory) ERC20Address(ctx context.Context) (common.Address, error) {
}
return
erc20Address
,
nil
}
// DiscoverFactoryAddress returns the canonical factory for this chainID
func
DiscoverFactoryAddress
(
chainID
int64
)
(
common
.
Address
,
bool
)
{
if
chainID
==
5
{
// goerli
return
common
.
HexToAddress
(
"0x334394E8c891E77b1449084aaDD659920BB25247"
),
true
}
return
common
.
Address
{},
false
}
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