Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth: v1 contract #2038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ client/cmd/translationsreport/translationsreport
client/cmd/translationsreport/worksheets
server/cmd/dexadm/dexadm
server/cmd/geogame/geogame
server/cmd/dcrdex/evm-protocol-overrides.json
13 changes: 8 additions & 5 deletions client/asset/eth/cmd/getgas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func mainErr() error {
flag.BoolVar(&useMainnet, "mainnet", false, "use mainnet")
flag.BoolVar(&useTestnet, "testnet", false, "use testnet")
flag.BoolVar(&useSimnet, "simnet", false, "use simnet")
flag.BoolVar(&trace, "trace", false, "use simnet")
flag.BoolVar(&debug, "debug", false, "use simnet")
flag.BoolVar(&trace, "trace", false, "use trace logging")
flag.BoolVar(&debug, "debug", false, "use debug logging")
flag.IntVar(&maxSwaps, "n", 5, "max number of swaps per transaction. minimum is 2. test will run from 2 swap up to n swaps.")
flag.StringVar(&chain, "chain", "eth", "symbol of the base chain")
flag.StringVar(&token, "token", "", "symbol of the token. if token is not specified, will check gas for base chain")
Expand Down Expand Up @@ -125,7 +125,8 @@ func mainErr() error {

wParams := new(eth.GetGasWalletParams)
wParams.BaseUnitInfo = bui
if token != chain {
isToken := token != chain
if isToken {
var exists bool
tkn, exists := tokens[assetID]
if !exists {
Expand All @@ -139,16 +140,18 @@ func mainErr() error {
}
swapContract, exists := netToken.SwapContracts[contractVer]
if !exists {
return nil, fmt.Errorf("no verion %d contract for %s token on %s network %s", contractVer, tkn.Name, chain, net)
return nil, fmt.Errorf("no version %d contract for %s token on %s network %s", contractVer, tkn.Name, chain, net)
}
wParams.Gas = &swapContract.Gas
} else {
wParams.UnitInfo = bui
g, exists := gases[contractVer]
if !exists {
return nil, fmt.Errorf("no verion %d contract for %s network %s", contractVer, chain, net)
return nil, fmt.Errorf("no version %d contract for %s network %s", contractVer, chain, net)
}
wParams.Gas = g
}
if !isToken || contractVer == 1 {
cs, exists := contracts[contractVer]
if !exists {
return nil, fmt.Errorf("no version %d base chain swap contract on %s", contractVer, chain)
Expand Down
Loading
Loading