Skip to content

Commit

Permalink
call-params fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaulverin committed Nov 23, 2022
1 parent ef699ab commit 9c4bfaf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ module github.com/vaulverin/uniswapv2-sdk
go 1.18

require (
github.com/daoleno/uniswap-sdk-core v0.1.4
github.com/ethereum/go-ethereum v1.10.20
github.com/daoleno/uniswap-sdk-core v0.1.6
github.com/ethereum/go-ethereum v1.10.21
)

require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/stretchr/testify v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/sys v0.0.0-20220702020025-31831981b65f // indirect
)
16 changes: 2 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/daoleno/uniswap-sdk-core v0.1.4 h1:9+DjNuNV+blwd5n3U5JhmWyy+zV2cSxVQaf3F1hnAog=
github.com/daoleno/uniswap-sdk-core v0.1.4/go.mod h1:kVVHaxqCY/FH8KSj441D/gf8oFn8J+oGlauLTRyzTF4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/daoleno/uniswap-sdk-core v0.1.6 h1:m8d5/vd8IAsu6+eG2fCrhbAI9zziTYYcBnw7DjnsxKE=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/ethereum/go-ethereum v1.10.20 h1:75IW830ClSS40yrQC1ZCMZCt5I+zU16oqId2SiQwdQ4=
github.com/ethereum/go-ethereum v1.10.20/go.mod h1:LWUN82TCHGpxB3En5HVmLLzPD7YSrEUFmFfN1nKkVN0=
github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY=
golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
8 changes: 4 additions & 4 deletions router/swap-call-params.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func SwapCallParameters(trade *entities.Trade, options TradeOptions) (*SwapParam
if etherIn && etherOut {
return nil, ErrEtherInOut
}
to := options.Recipient.Hex()
to := options.Recipient
slippage := options.AllowedSlippage
if slippage == nil {
slippage = core.NewPercent(big.NewInt(0), big.NewInt(1))
Expand All @@ -68,9 +68,9 @@ func SwapCallParameters(trade *entities.Trade, options TradeOptions) (*SwapParam
return nil, err
}
amountOut := minAmountOut.Quotient()
var path []string
var path []common.Address
for _, token := range trade.Route.Path {
path = append(path, token.Address.Hex())
path = append(path, token.Address)
}
deadline := options.Deadline
if options.Deadline == nil {
Expand Down Expand Up @@ -150,7 +150,7 @@ func SwapCallParametersPacked(trade *entities.Trade, options TradeOptions) (*big
if err != nil {
return nil, nil, err
}
data, err := routerABI.Pack(params.MethodName, params.Args)
data, err := routerABI.Pack(params.MethodName, params.Args...)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 9c4bfaf

Please sign in to comment.