Skip to content

Commit

Permalink
Merge pull request #1480 from 0chain/sc-int-overflow
Browse files Browse the repository at this point in the history
Use string for ZCN token
  • Loading branch information
dabasov authored May 24, 2024
2 parents 0f2c91d + 54e08b5 commit e5a796e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========

package version
const VERSIONSTR = "v1.12.1-3-gbc68f654"
const VERSIONSTR = "v1.14.0-RC7"

4 changes: 2 additions & 2 deletions wasmsdk/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func getNotProcessedZCNBurnTickets() string {
}

// estimateBurnWZCNGasAmount performs gas amount estimation for the given burn wzcn transaction.
func estimateBurnWZCNGasAmount(from, to string, amountTokens int) string { // nolint:golint,unused
func estimateBurnWZCNGasAmount(from, to, amountTokens string) string { // nolint:golint,unused
estimateBurnWZCNGasAmountResponse, err := bridge.EstimateBurnWZCNGasAmount(
context.Background(), from, to, amountTokens)
if err != nil {
Expand All @@ -192,7 +192,7 @@ func estimateBurnWZCNGasAmount(from, to string, amountTokens int) string { // no
}

// estimateMintWZCNGasAmount performs gas amount estimation for the given mint wzcn transaction.
func estimateMintWZCNGasAmount(from, to, zcnTransaction string, amountToken, nonce int64, signaturesRaw []string) string { // nolint:golint,unused
func estimateMintWZCNGasAmount(from, to, zcnTransaction, amountToken string, nonce int64, signaturesRaw []string) string { // nolint:golint,unused
var signaturesBytes [][]byte

var (
Expand Down
8 changes: 4 additions & 4 deletions zcnbridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ func (b *BridgeClient) estimateAlchemyGasAmount(ctx context.Context, from, to, d
}

// EstimateBurnWZCNGasAmount performs gas amount estimation for the given wzcn burn transaction.
func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to string, amountTokens int) (float64, error) {
func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to, amountTokens string) (float64, error) {
switch b.getProviderType() {
case AlchemyProvider:
abi, err := bridge.BridgeMetaData.GetAbi()
Expand All @@ -1058,7 +1058,7 @@ func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to s
clientID := DefaultClientIDEncoder(zcncore.GetClientWalletID())

amount := new(big.Int)
amount.SetInt64(int64(amountTokens))
amount.SetString(amountTokens, 10)

var packRaw []byte
packRaw, err = abi.Pack("burn", amount, clientID)
Expand All @@ -1078,11 +1078,11 @@ func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to s

// EstimateMintWZCNGasAmount performs gas amount estimation for the given wzcn mint transaction.
func (b *BridgeClient) EstimateMintWZCNGasAmount(
ctx context.Context, from, to, zcnTransactionRaw string, amountToken, nonceRaw int64, signaturesRaw [][]byte) (float64, error) {
ctx context.Context, from, to, zcnTransactionRaw, amountToken string, nonceRaw int64, signaturesRaw [][]byte) (float64, error) {
switch b.getProviderType() {
case AlchemyProvider:
amount := new(big.Int)
amount.SetInt64(amountToken)
amount.SetString(amountToken, 10)

zcnTransaction := DefaultClientIDEncoder(zcnTransactionRaw)

Expand Down

0 comments on commit e5a796e

Please sign in to comment.