mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 16:56:53 +00:00
fix: use real id of token to estimate gas
This commit is contained in:
parent
010afb4b39
commit
0345612a31
@ -2,6 +2,7 @@ package bridge
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -60,11 +61,15 @@ func (s *ERC721TransferBridge) EstimateGas(fromNetwork *params.Network, toNetwor
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
id, success := big.NewInt(0).SetString(token.Symbol, 0)
|
||||||
|
if !success {
|
||||||
|
return 0, fmt.Errorf("failed to convert %s to big.Int", token.Symbol)
|
||||||
|
}
|
||||||
input, err = abi.Pack("safeTransferFrom",
|
input, err = abi.Pack("safeTransferFrom",
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
new(big.Int))
|
id,
|
||||||
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user