Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ pkg/sentry/SENTRY_PRODUCTION
# Don't ignore generated files in the vendor/ directory
!vendor/**/*.pb.go
!vendor/**/migrations.go
services/wallet/token/local-token-lists/default-lists/status.go
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to store initial token lists in the repo. They will be fetched on every build (maybe we should do some smarter approach like download only if there are no local lists or the forceDownload flag is true, by default don't download).

services/wallet/token/local-token-lists/default-lists/coingecko_*.go
services/wallet/token/local-token-lists/default-lists/uniswap.go
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ status-go-deps:



statusgo-library: generate
statusgo-library: generate download-tokens
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statusgo-library: $(LIBWAKU) ##@cross-compile Build status-go as static library for current platform
## cmd/library/README.md explains the magic incantation behind this
mkdir -p build/bin/statusgo-lib
Expand All @@ -196,7 +196,7 @@ statusgo-library: $(LIBWAKU) ##@cross-compile Build status-go as static library

build-libwaku: $(LIBWAKU)

statusgo-shared-library: generate
statusgo-shared-library: generate download-tokens
statusgo-shared-library: $(LIBWAKU) ##@cross-compile Build status-go as shared library for current platform
## cmd/library/README.md explains the magic incantation behind this
mkdir -p build/bin/statusgo-lib
Expand Down Expand Up @@ -252,9 +252,10 @@ generate: ##@ Run generate for all given packages using go-generate-fast, fallb
generate-contracts:
go generate ./contracts
download-tokens:
go run ./services/wallet/token/token-lists/default-lists/downloader/main.go
@echo "Downloading token lists..."
go run ./services/wallet/token/local-token-lists/default-lists/downloader/main.go
analyze-token-stores:
go run ./services/wallet/token/token-lists/analyzer/main.go
go run ./services/wallet/token/local-token-lists/analyzer/main.go

prepare-release: clean-release
mkdir -p $(RELEASE_DIR)
Expand Down
453 changes: 235 additions & 218 deletions contracts/hop/address.go

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions contracts/snt/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ import (
var errorNotAvailableOnChainID = errors.New("not available for chainID")

var contractAddressByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x744d70fdbe2ba4cf95131626614a1763df805b9e"), // mainnet
11155111: common.HexToAddress("0xE452027cdEF746c7Cd3DB31CB700428b16cD8E51"), // sepolia
1: common.HexToAddress("0x744d70fdbe2ba4cf95131626614a1763df805b9e"), // mainnet
10: common.HexToAddress("0x650af3c15af43dcb218406d30784416d64cfb6b2"), // optimism
8453: common.HexToAddress("0x662015ec830df08c0fc45896fab726542e8ac09e"), // base
42161: common.HexToAddress("0x707f635951193ddafbb40971a0fcaab8a6415160"), // arbitrum
11155111: common.HexToAddress("0xE452027cdEF746c7Cd3DB31CB700428b16cD8E51"), // sepolia
84532: common.HexToAddress("0xfdb3b57944943a7724fcc0520ee2b10659969a06"), // base testnet
1660990954: common.HexToAddress("0x1c3ac2a186c6149ae7cb4d716ebbd0766e4f898a"), // status testnet
}

func ContractAddress(chainID uint64) (common.Address, error) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ require (
github.com/prometheus/client_model v0.6.1
github.com/schollz/peerdiscovery v1.7.0
github.com/status-im/extkeys v1.3.0
github.com/status-im/go-wallet-sdk v0.0.0-20250912130226-d334ec9bff18
github.com/status-im/go-wallet-sdk v0.0.0-20250915173310-79b8fc965dd9
github.com/waku-org/go-waku v0.8.1-0.20250825172353-0c3d6dc0a8cc
github.com/waku-org/waku-go-bindings v0.0.0-20250714110306-6feba5b0df4d
github.com/wk8/go-ordered-map/v2 v2.1.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,8 @@ github.com/status-im/go-ethereum v1.10.25-status.24 h1:TOLSwMHbJ1KeLAPljVP7o8jmg
github.com/status-im/go-ethereum v1.10.25-status.24/go.mod h1:kcIyUwKuTYxEXYRTVkvHtV6EyESKuI5EubF3et9cyR8=
github.com/status-im/go-sqlcipher/v4 v4.5.4-status.3 h1:/73h1w1hUfb3wVyTlNrUIwahZxatgesCHa6lwO57C2M=
github.com/status-im/go-sqlcipher/v4 v4.5.4-status.3/go.mod h1:mF2UmIpBnzFeBdu/ypTDb/LdbS0nk0dfSN1WUsWTjMA=
github.com/status-im/go-wallet-sdk v0.0.0-20250912130226-d334ec9bff18 h1:yBufceOQkh+LkOgMlkQUkvaJPlrjsH0S+m/0nl9as9U=
github.com/status-im/go-wallet-sdk v0.0.0-20250912130226-d334ec9bff18/go.mod h1:mFt4aWzn/gR/IOWL75oEowJNQaBvpe3DxYQo0woAdCE=
github.com/status-im/go-wallet-sdk v0.0.0-20250915173310-79b8fc965dd9 h1:jRacPB2GowJM13xTEvo+UEdh629mP80o0YH4XF6uH3c=
github.com/status-im/go-wallet-sdk v0.0.0-20250915173310-79b8fc965dd9/go.mod h1:9OJTHMVtuLPIWWY3l7b00IgqKjlHSz9j77BHzc5/UnU=
github.com/status-im/gomoji v1.1.3-0.20220213022530-e5ac4a8732d4 h1:CtobZoiNdHpx+xurFxnuJ1xsGm3oKMfcZkB3vmomJmA=
github.com/status-im/gomoji v1.1.3-0.20220213022530-e5ac4a8732d4/go.mod h1:hmpnZzkzSZJbFYWAUkrPV8I36x7mdYiPhPqnALP4fKA=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
Expand Down
1 change: 1 addition & 0 deletions nix/pkgs/status-go/library/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ in pkgs.buildGoModule {
preBuild = ''
go run cmd/library/*.go > $NIX_BUILD_TOP/main.go
make generate SHELL=$SHELL GO111MODULE=on GO_GENERATE_CMD='go generate'
make download-tokens SHELL=$SHELL GO111MODULE=on
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should always download initial tokens when building on CI.

'';

# Build the Go library
Expand Down
23 changes: 13 additions & 10 deletions node/get_status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,6 @@ func (n *StatusNode) startWithDB(config *params.NodeConfig) error {
}

func (n *StatusNode) createAndStartTokenManager() error {
accDB, err := accounts.NewDB(n.appDB)
if err != nil {
return err
}

n.tokenManager = token.NewTokenManager(n.walletDB, n.rpcClient, community.NewManager(n.appDB, n.mediaServer, nil),
n.rpcClient.GetNetworkManager(), n.appDB, n.mediaServer, &n.walletFeed, n.accountsPublisher, accDB,
token.NewPersistence(n.walletDB))

const (
defaultAutoRefreshInterval = 30 * time.Minute // interval after which we should fetch the token lists from the remote source (or use the default one if remote source is not set)
defaultAutoRefreshCheckInterval = 3 * time.Minute // interval after which we should check if we should trigger the auto-refresh
Expand All @@ -382,7 +373,19 @@ func (n *StatusNode) createAndStartTokenManager() error {
autoRefreshCheckInterval = time.Duration(n.config.WalletConfig.TokensListsAutoRefreshCheckInterval) * time.Second
}

n.tokenManager.Start(context.Background(), autoRefreshInterval, autoRefreshCheckInterval)
accDB, err := accounts.NewDB(n.appDB)
if err != nil {
return err
}

n.tokenManager, err = token.NewTokenManager(n.walletDB, n.rpcClient, community.NewManager(n.appDB, n.mediaServer, nil),
n.rpcClient.GetNetworkManager(), n.appDB, n.mediaServer, &n.walletFeed, n.accountsPublisher, accDB,
autoRefreshInterval, autoRefreshCheckInterval)
if err != nil {
return err
}

n.tokenManager.Start(context.Background())
return nil
}

Expand Down
13 changes: 8 additions & 5 deletions node/status_node_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ func (b *StatusNode) initServices(config *params.NodeConfig, mediaServer *server
// Wallet Service is used by wakuExtSrvc/wakuV2ExtSrvc
// Keep this initialization before the other two
if config.WalletConfig.Enabled {
walletService := b.walletService(accDB, b.appDB, b.accountsPublisher, &b.walletFeed, config.WalletConfig.StatusProxyStageName)
services = append(services, walletService)
err := b.createWalletService(accDB, b.appDB, b.accountsPublisher, &b.walletFeed, config.WalletConfig.StatusProxyStageName)
if err != nil {
return err
}
services = append(services, b.walletSrvc)
}

// CollectiblesManager needs the WakuExt service to get metadata for
Expand Down Expand Up @@ -283,9 +286,9 @@ func (b *StatusNode) SetWalletCommunityInfoProvider(provider thirdparty.Communit
}
}

func (b *StatusNode) walletService(accountsDB *accounts.Database, appDB *sql.DB, accountsPublisher *pubsub.Publisher, walletFeed *event.Feed, statusProxyStageName string) *wallet.Service {
func (b *StatusNode) createWalletService(accountsDB *accounts.Database, appDB *sql.DB, accountsPublisher *pubsub.Publisher, walletFeed *event.Feed, statusProxyStageName string) (err error) {
if b.walletSrvc == nil {
b.walletSrvc = wallet.NewService(
b.walletSrvc, err = wallet.NewService(
b.walletDB, accountsDB, appDB, b.rpcClient, accountsPublisher, b.gethAccountsManager, b.transactor, b.config,
b.ensService(b.timeSourceNow()).API().EnsResolver(),
b.pendingTracker,
Expand All @@ -295,7 +298,7 @@ func (b *StatusNode) walletService(accountsDB *accounts.Database, appDB *sql.DB,
statusProxyStageName,
)
}
return b.walletSrvc
return
}

func (b *StatusNode) ethService() *eth.Service {
Expand Down
3 changes: 0 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ type WalletConfig struct {
StatusProxyBlockchainPassword security.SensitiveString `json:"StatusProxyBlockchainPassword"`

StatusProxyStageName string `json:"StatusProxyStageName"`
EnableCelerBridge bool `json:"EnableCelerBridge"`
EnableMercuryoProvider bool `json:"EnableMercuryoProvider"`
EthRpcProxyUrl security.SensitiveString `json:"EthRpcProxyUrl"`
EthRpcProxyUser security.SensitiveString `json:"EthRpcProxyUser"`
Expand All @@ -249,13 +248,11 @@ type MarketDataProxyConfig struct {
func (wc WalletConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Enabled bool `json:"Enabled"`
EnableCelerBridge bool `json:"EnableCelerBridge"`
EnableMercuryoProvider bool `json:"EnableMercuryoProvider"`
TokensListsAutoRefreshInterval int `json:"TokensListsAutoRefreshInterval"`
TokensListsAutoRefreshCheckInterval int `json:"TokensListsAutoRefreshCheckInterval"`
}{
Enabled: wc.Enabled,
EnableCelerBridge: wc.EnableCelerBridge,
EnableMercuryoProvider: wc.EnableMercuryoProvider,
TokensListsAutoRefreshInterval: wc.TokensListsAutoRefreshInterval,
TokensListsAutoRefreshCheckInterval: wc.TokensListsAutoRefreshCheckInterval,
Expand Down
3 changes: 0 additions & 3 deletions protocol/common/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ type FeatureFlags struct {
// Peersyncing indicates whether we should advertise and sync messages with other peers
Peersyncing bool

// EnableCelerBridge indicates whether we should enable the Celer bridge in the Router
EnableCelerBridge bool

// EnableMercuryoProvider indicates whether we should enable the Mercuryo provider in the Wallet
EnableMercuryoProvider bool

Expand Down
6 changes: 5 additions & 1 deletion protocol/messenger_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ func newTestMessenger(messagingEnv *messaging.TestMessagingEnvironment, config t
"",
)

tokenManager := token.NewTokenManager(walletDb, nil, nil, network.NewManager(appDb, nil), appDb, nil, nil, nil, nil, token.NewPersistence(walletDb))
tokenManager, err := token.NewTokenManager(walletDb, nil, nil, network.NewManager(appDb, nil), appDb, nil, nil, nil,
nil, time.Hour, time.Hour)
if err != nil {
return nil, err
}

options := []Option{
WithCustomLogger(config.logger),
Expand Down
6 changes: 4 additions & 2 deletions services/wallet/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ func TestAPI_GetAddressDetails(t *testing.T) {
c, err := rpc.NewClient(config)
require.NoError(t, err)

tokenManager := token.NewTokenManager(db, c, nil, nil, appDB, nil, nil, nil, accountsDb, token.NewPersistence(db))
tokenManager, err := token.NewTokenManager(db, c, nil, nil, appDB, nil, nil, nil, accountsDb, time.Hour, time.Hour)
require.NoError(t, err)

service := NewService(db, accountsDb, appDB, c, accountsPublisher, nil, nil, &params.NodeConfig{}, nil, nil, nil, nil, tokenManager, "")
service, err := NewService(db, accountsDb, appDB, c, accountsPublisher, nil, nil, &params.NodeConfig{}, nil, nil, nil, nil, tokenManager, "")
require.NoError(t, err)

api := &API{
s: service,
Expand Down
Loading
Loading