From 320244046666e249fae269e683f596d6ad7d356e Mon Sep 17 00:00:00 2001 From: storybehind Date: Wed, 4 Dec 2024 10:15:17 +0530 Subject: [PATCH 01/23] add eth node url to config --- core/conf/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/conf/config.go b/core/conf/config.go index 4444892e3..e174d3ed9 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -179,6 +179,7 @@ func LoadConfig(v Reader) (Config, error) { cfg.SignatureScheme = v.GetString("signature_scheme") cfg.ChainID = v.GetString("chain_id") cfg.ZauthServer = v.GetString("zauth.server") + cfg.EthereumNode = v.GetString("ethereum_node_url") return cfg, nil } From 62fc7ab4010d90f238ed62700674d7569c17b0bd Mon Sep 17 00:00:00 2001 From: storybehind Date: Wed, 11 Dec 2024 19:15:07 +0530 Subject: [PATCH 02/23] revert --- core/conf/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/conf/config.go b/core/conf/config.go index 026332917..b1db3d098 100644 --- a/core/conf/config.go +++ b/core/conf/config.go @@ -176,7 +176,7 @@ func LoadConfig(v Reader) (Config, error) { cfg.SignatureScheme = v.GetString("signature_scheme") cfg.ChainID = v.GetString("chain_id") - cfg.ZauthServer = v.GetString("zauth.server") + cfg.ZauthServer = v.GetString("zauth_server") cfg.EthereumNode = v.GetString("ethereum_node_url") return cfg, nil From a4e82053d01995b341abf6cc338b121bb70d996f Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Thu, 2 Jan 2025 21:51:49 +0530 Subject: [PATCH 03/23] Empty commit From e1d9de00a484d438238f43e94f5c0d3f6f81856e Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 01:12:44 +0530 Subject: [PATCH 04/23] Fix restricted blobber round --- mobilesdk/sdk/sdk.go | 10 ++++++---- wasmsdk/allocation.go | 17 ++++++++++------- zboxcore/sdk/allocation.go | 10 +++++----- zboxcore/sdk/blobber_operations.go | 6 ++++-- zboxcore/sdk/sdk.go | 3 ++- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/mobilesdk/sdk/sdk.go b/mobilesdk/sdk/sdk.go index eaab794ad..f319cf968 100644 --- a/mobilesdk/sdk/sdk.go +++ b/mobilesdk/sdk/sdk.go @@ -155,7 +155,7 @@ func InitStorageSDK(clientJson string, configJson string) (*StorageSDK, error) { // - expiration: duration to allocation expiration // - lock: lock write pool with given number of tokens // - blobberAuthTickets: list of blobber auth tickets needed for the restricted blobbers -func (s *StorageSDK) CreateAllocation(datashards, parityshards int, size, expiration int64, lock string, blobberAuthTickets []string) (*zbox.Allocation, error) { +func (s *StorageSDK) CreateAllocation(datashards, parityshards int, size, expiration, authRoundExpiry int64, lock string, blobberAuthTickets []string) (*zbox.Allocation, error) { readPrice := sdk.PriceRange{Min: 0, Max: math.MaxInt64} writePrice := sdk.PriceRange{Min: 0, Max: math.MaxInt64} @@ -174,6 +174,7 @@ func (s *StorageSDK) CreateAllocation(datashards, parityshards int, size, expira BlobberIds: []string{}, FileOptionsParams: &sdk.FileOptionsParameters{}, BlobberAuthTickets: blobberAuthTickets, + AuthRoundExpiry: authRoundExpiry, } sdkAllocationID, _, _, err := sdk.CreateAllocationWith(options) @@ -196,7 +197,7 @@ func (s *StorageSDK) CreateAllocation(datashards, parityshards int, size, expira // - lock: lock write pool with given number of tokens // - blobberUrls: concat blobber urls with comma. leave it as empty if you don't have any preferred blobbers // - blobberIds: concat blobber ids with comma. leave it as empty if you don't have any preferred blobbers -func (s *StorageSDK) CreateAllocationWithBlobbers(name string, datashards, parityshards int, size int64, lock string, blobberUrls, blobberIds string, blobberAuthTickets []string) (*zbox.Allocation, error) { +func (s *StorageSDK) CreateAllocationWithBlobbers(name string, datashards, parityshards int, size, authRoundExpiry int64, lock string, blobberUrls, blobberIds string, blobberAuthTickets []string) (*zbox.Allocation, error) { readPrice := sdk.PriceRange{Min: 0, Max: math.MaxInt64} writePrice := sdk.PriceRange{Min: 0, Max: math.MaxInt64} @@ -213,6 +214,7 @@ func (s *StorageSDK) CreateAllocationWithBlobbers(name string, datashards, parit WritePrice: writePrice, ReadPrice: readPrice, BlobberAuthTickets: blobberAuthTickets, + AuthRoundExpiry: authRoundExpiry, } if blobberUrls != "" { @@ -364,12 +366,12 @@ func (s *StorageSDK) GetVersion() string { // - extend: extend allocation // - allocationID: allocation ID // - lock: Number of tokens to lock to the allocation after the update -func (s *StorageSDK) UpdateAllocation(size int64, extend bool, allocationID string, lock uint64) (hash string, err error) { +func (s *StorageSDK) UpdateAllocation(size, authRoundExpiry int64, extend bool, allocationID string, lock uint64) (hash string, err error) { if lock > math.MaxInt64 { return "", errors.Errorf("int64 overflow in lock") } - hash, _, err = sdk.UpdateAllocation(size, extend, allocationID, lock, "", "", "", "", "", false, &sdk.FileOptionsParameters{}, "") + hash, _, err = sdk.UpdateAllocation(size, authRoundExpiry, extend, allocationID, lock, "", "", "", "", "", false, &sdk.FileOptionsParameters{}, "") return hash, err } diff --git a/wasmsdk/allocation.go b/wasmsdk/allocation.go index d310b10f6..25aae7861 100644 --- a/wasmsdk/allocation.go +++ b/wasmsdk/allocation.go @@ -88,7 +88,7 @@ func getAllocationBlobbers(preferredBlobberURLs []string, // - lock is the lock value to add to the allocation. // - blobberIds is the list of blobber ids. // - blobberAuthTickets is the list of blobber auth tickets in case of using restricted blobbers. -func createAllocation(datashards, parityshards int, size int64, +func createAllocation(datashards, parityshards int, size, authRoundExpiry int64, minReadPrice, maxReadPrice, minWritePrice, maxWritePrice int64, lock int64, blobberIds, blobberAuthTickets []string, setThirdPartyExtendable, IsEnterprise, force bool) ( *transaction.Transaction, error) { @@ -111,6 +111,7 @@ func createAllocation(datashards, parityshards int, size int64, StorageVersion: sdk.StorageV2, BlobberAuthTickets: blobberAuthTickets, Force: force, + AuthRoundExpiry: authRoundExpiry, } sdkLogger.Info(options) @@ -161,7 +162,8 @@ func transferAllocation(allocationID, newOwnerId, newOwnerPublicKey string) erro func UpdateForbidAllocation(allocationID string, forbidupload, forbiddelete, forbidupdate, forbidmove, forbidcopy, forbidrename bool) (string, error) { hash, _, err := sdk.UpdateAllocation( - 0, //size, + 0, //size, + 0, false, //extend, allocationID, // allocID, 0, //lock, @@ -192,7 +194,8 @@ func UpdateForbidAllocation(allocationID string, forbidupload, forbiddelete, for func freezeAllocation(allocationID string) (string, error) { hash, _, err := sdk.UpdateAllocation( - 0, //size, + 0, //size, + 0, false, //extend, allocationID, // allocID, 0, //lock, @@ -245,7 +248,7 @@ func cancelAllocation(allocationID string) (string, error) { // - addBlobberAuthTicket: blobber auth ticket to add to the allocation, in case of restricted blobbers // - removeBlobberId: blobber ID to remove from the allocation func updateAllocationWithRepair(allocationID string, - size int64, + size, authRoundExpiry int64, extend bool, lock int64, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey, updateAllocTicket, callbackFuncName string) (string, error) { @@ -265,7 +268,7 @@ func updateAllocationWithRepair(allocationID string, } } - alloc, hash, isRepairRequired, err := allocationObj.UpdateWithStatus(size, extend, uint64(lock), addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey, false, &sdk.FileOptionsParameters{}, updateAllocTicket) + alloc, hash, isRepairRequired, err := allocationObj.UpdateWithStatus(size, authRoundExpiry, extend, uint64(lock), addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey, false, &sdk.FileOptionsParameters{}, updateAllocTicket) if err != nil { return hash, err } @@ -299,10 +302,10 @@ func updateAllocationWithRepair(allocationID string, // - removeBlobberId: blobber ID to remove from the allocation // - setThirdPartyExtendable: third party extendable flag, if true, the allocation can be extended (in terms of size) by a non-owner client func updateAllocation(allocationID string, - size int64, extend bool, + size, authRoundExpiry int64, extend bool, lock int64, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey string, setThirdPartyExtendable bool) (string, error) { - hash, _, err := sdk.UpdateAllocation(size, extend, allocationID, uint64(lock), addBlobberId, addBlobberAuthTicket, removeBlobberId, "", ownerSigninPublicKey, setThirdPartyExtendable, &sdk.FileOptionsParameters{}, "") + hash, _, err := sdk.UpdateAllocation(size, authRoundExpiry, extend, allocationID, uint64(lock), addBlobberId, addBlobberAuthTicket, removeBlobberId, "", ownerSigninPublicKey, setThirdPartyExtendable, &sdk.FileOptionsParameters{}, "") if err == nil { clearAllocation(allocationID) diff --git a/zboxcore/sdk/allocation.go b/zboxcore/sdk/allocation.go index 03209f484..1162f2342 100644 --- a/zboxcore/sdk/allocation.go +++ b/zboxcore/sdk/allocation.go @@ -465,7 +465,7 @@ func (a *Allocation) generateAndSetOwnerSigningPublicKey() { if a.OwnerSigningPublicKey == "" && !a.Finalized && !a.Canceled && client.Wallet().IsSplit { pubKey := privateSigningKey.Public().(ed25519.PublicKey) a.OwnerSigningPublicKey = hex.EncodeToString(pubKey) - hash, _, err := UpdateAllocation(0, false, a.ID, 0, "", "", "", "", a.OwnerSigningPublicKey, false, nil, "") + hash, _, err := UpdateAllocation(0, 0, false, a.ID, 0, "", "", "", "", a.OwnerSigningPublicKey, false, nil, "") if err != nil { l.Logger.Error("Failed to update owner signing public key ", err, " allocationID: ", a.ID, " hash: ", hash) return @@ -3185,14 +3185,14 @@ func (a *Allocation) SetConsensusThreshold() { // - fileOptionsParams: The file options parameters which control permissions of the files of the allocations. // - statusCB: A callback function to receive status updates during the update operation. func (a *Allocation) UpdateWithRepair( - size int64, + size, authRoundExpiry int64, extend bool, lock uint64, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey string, setThirdPartyExtendable bool, fileOptionsParams *FileOptionsParameters, updateAllocTicket string, statusCB StatusCallback, ) (string, error) { - updatedAlloc, hash, isRepairRequired, err := a.UpdateWithStatus(size, extend, lock, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey, setThirdPartyExtendable, fileOptionsParams, updateAllocTicket) + updatedAlloc, hash, isRepairRequired, err := a.UpdateWithStatus(size, authRoundExpiry, extend, lock, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey, setThirdPartyExtendable, fileOptionsParams, updateAllocTicket) if err != nil { return hash, err } @@ -3220,7 +3220,7 @@ func (a *Allocation) UpdateWithRepair( // // Returns the updated allocation, hash, and a boolean indicating whether repair is required. func (a *Allocation) UpdateWithStatus( - size int64, + size, authRoundExpiry int64, extend bool, lock uint64, addBlobberId, addBlobberAuthTicket, removeBlobberId, ownerSigninPublicKey string, @@ -3236,7 +3236,7 @@ func (a *Allocation) UpdateWithStatus( } l.Logger.Info("Updating allocation") - hash, _, err := UpdateAllocation(size, extend, a.ID, lock, addBlobberId, addBlobberAuthTicket, removeBlobberId, "", ownerSigninPublicKey, setThirdPartyExtendable, fileOptionsParams, updateAllocTicket) + hash, _, err := UpdateAllocation(size, authRoundExpiry, extend, a.ID, lock, addBlobberId, addBlobberAuthTicket, removeBlobberId, "", ownerSigninPublicKey, setThirdPartyExtendable, fileOptionsParams, updateAllocTicket) if err != nil { return alloc, "", isRepairRequired, err } diff --git a/zboxcore/sdk/blobber_operations.go b/zboxcore/sdk/blobber_operations.go index 9caa83686..fa15777d9 100644 --- a/zboxcore/sdk/blobber_operations.go +++ b/zboxcore/sdk/blobber_operations.go @@ -34,7 +34,7 @@ func CreateAllocationForOwner( owner, ownerpublickey string, datashards, parityshards int, size int64, readPrice, writePrice PriceRange, - lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, IsEnterprise, force bool, fileOptionsParams *FileOptionsParameters, + lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, IsEnterprise, force bool, fileOptionsParams *FileOptionsParameters, authRoundExpiry int64, ) (hash string, nonce int64, txn *transaction.Transaction, err error) { if lock > math.MaxInt64 { @@ -71,6 +71,7 @@ func CreateAllocationForOwner( allocationRequest["file_options_changed"], allocationRequest["file_options"] = calculateAllocationFileOptions(63 /*0011 1111*/, fileOptionsParams) allocationRequest["is_enterprise"] = IsEnterprise allocationRequest["storage_version"] = StorageV2 + allocationRequest["auth_round_expiry"] = authRoundExpiry var sn = transaction.SmartContractTxnData{ Name: transaction.NEW_ALLOCATION_REQUEST, @@ -126,7 +127,7 @@ func CreateFreeAllocation(marker string, value uint64) (string, int64, error) { // // returns the hash of the transaction, the nonce of the transaction and an error if any. func UpdateAllocation( - size int64, + size, authRoundExpiry int64, extend bool, allocationID string, lock uint64, @@ -162,6 +163,7 @@ func UpdateAllocation( updateAllocationRequest["set_third_party_extendable"] = setThirdPartyExtendable updateAllocationRequest["owner_signing_public_key"] = ownerSigninPublicKey updateAllocationRequest["file_options_changed"], updateAllocationRequest["file_options"] = calculateAllocationFileOptions(alloc.FileOptions, fileOptionsParams) + updateAllocationRequest["auth_round_expiry"] = authRoundExpiry if ticket != "" { diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index 260cd57cc..86bfcee5d 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -796,6 +796,7 @@ type CreateAllocationOptions struct { FileOptionsParams *FileOptionsParameters Force bool StorageVersion int + AuthRoundExpiry int64 } // CreateAllocationWith creates a new allocation with the given options for the current client using the SDK. @@ -809,7 +810,7 @@ func CreateAllocationWith(options CreateAllocationOptions) ( return CreateAllocationForOwner(client.Id(), client.PublicKey(), options.DataShards, options.ParityShards, options.Size, options.ReadPrice, options.WritePrice, options.Lock, - options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.IsEnterprise, options.Force, options.FileOptionsParams) + options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.IsEnterprise, options.Force, options.FileOptionsParams, options.AuthRoundExpiry) } // GetAllocationBlobbers returns a list of blobber ids that can be used for a new allocation. From 6205f97c3c94a57ee0856f4b9730ed933470e85b Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 19:44:43 +0530 Subject: [PATCH 05/23] Add hardfork round request --- zcncore/get_data.go | 22 ++++++++++++++++++++++ zcncore/wallet_base.go | 2 ++ 2 files changed, 24 insertions(+) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index 6a17f7aff..affea0a2b 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -374,3 +374,25 @@ func GetUserLockedTotal(clientID string) (int64, error) { return 0, err } } + +func GetHardforkRound(name string) (int64, error) { + res, err := client.MakeSCRestAPICall(MinerSmartContractAddress, GET_HARDFORK, Params{ + "name": name, + }) + if err != nil { + return 0, err + } + + var result map[string]int64 + err = json.Unmarshal(res, &result) + if err != nil { + return 0, err + } + + round, ok := result[name] + if !ok { + return 0, errors.New("hardfork not found") + } + + return round, nil +} diff --git a/zcncore/wallet_base.go b/zcncore/wallet_base.go index f4ead5968..f47b4b5f9 100644 --- a/zcncore/wallet_base.go +++ b/zcncore/wallet_base.go @@ -45,6 +45,8 @@ const ( GET_MINERSC_USER = "/getUserPools" GET_MINERSC_MINERS = "/getMinerList" GET_MINERSC_SHARDERS = "/getSharderList" + + GET_HARDFORK = "/hardfork" ) const ( From 0d88122d4ba897dc2c01c6e75a721f7bb8302b5a Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 20:06:46 +0530 Subject: [PATCH 06/23] Fix is hardfork activated --- zcncore/get_data.go | 29 ++++++++++++++++++++++++----- zcncore/wallet_base.go | 3 ++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index affea0a2b..c23576c23 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -375,24 +375,43 @@ func GetUserLockedTotal(clientID string) (int64, error) { } } -func GetHardforkRound(name string) (int64, error) { +func IsHardforkActivated(name string) (bool, error) { res, err := client.MakeSCRestAPICall(MinerSmartContractAddress, GET_HARDFORK, Params{ "name": name, }) if err != nil { - return 0, err + return false, err } var result map[string]int64 err = json.Unmarshal(res, &result) if err != nil { - return 0, err + return false, err } round, ok := result[name] if !ok { - return 0, errors.New("hardfork not found") + return false, errors.New("hardfork not found") + } + + currentRound, err := GetCurrentRound() + if err != nil { + return false, err } - return round, nil + return currentRound >= round, nil +} + +func GetCurrentRound() (int64, error) { + res, err := client.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil) + if err != nil { + return 0, err + } + + var result int64 + err = json.Unmarshal(res, &result) + if err != nil { + return 0, err + } + return result, nil } diff --git a/zcncore/wallet_base.go b/zcncore/wallet_base.go index f47b4b5f9..97a6ec052 100644 --- a/zcncore/wallet_base.go +++ b/zcncore/wallet_base.go @@ -46,7 +46,8 @@ const ( GET_MINERSC_MINERS = "/getMinerList" GET_MINERSC_SHARDERS = "/getSharderList" - GET_HARDFORK = "/hardfork" + GET_HARDFORK = "/hardfork" + GET_CURRENT_ROUND = "/v1/current-round" ) const ( From cefe782f114603a7bd9b6c92e411dcc28cfbb2ed Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 20:16:33 +0530 Subject: [PATCH 07/23] Fix --- zcncore/get_data.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index c23576c23..55f8d99ae 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -380,13 +380,13 @@ func IsHardforkActivated(name string) (bool, error) { "name": name, }) if err != nil { - return false, err + return false, fmt.Errorf("error getting hardfork status: %v", err) } var result map[string]int64 err = json.Unmarshal(res, &result) if err != nil { - return false, err + return false, fmt.Errorf("error unmarshalling hardfork status: %v", err) } round, ok := result[name] @@ -396,7 +396,7 @@ func IsHardforkActivated(name string) (bool, error) { currentRound, err := GetCurrentRound() if err != nil { - return false, err + return false, fmt.Errorf("error getting current round: %v", err) } return currentRound >= round, nil @@ -408,10 +408,16 @@ func GetCurrentRound() (int64, error) { return 0, err } - var result int64 + var result string err = json.Unmarshal(res, &result) if err != nil { - return 0, err + return 0, fmt.Errorf("error getting current round : %v", err) } - return result, nil + + round, err := strconv.ParseInt(result, 10, 64) + if err != nil { + return 0, fmt.Errorf("error parsing current round : %v", err) + } + + return round, nil } From 1d110f70662bab42d95ccb46b8652e6eac982ae8 Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 20:18:48 +0530 Subject: [PATCH 08/23] Fix --- zcncore/get_data.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index 55f8d99ae..3e3c85111 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -383,17 +383,22 @@ func IsHardforkActivated(name string) (bool, error) { return false, fmt.Errorf("error getting hardfork status: %v", err) } - var result map[string]int64 + var result map[string]string err = json.Unmarshal(res, &result) if err != nil { return false, fmt.Errorf("error unmarshalling hardfork status: %v", err) } - round, ok := result[name] + roundString, ok := result[name] if !ok { return false, errors.New("hardfork not found") } + round, err := strconv.ParseInt(roundString, 10, 64) + if err != nil { + return false, fmt.Errorf("error parsing round: %v", err) + } + currentRound, err := GetCurrentRound() if err != nil { return false, fmt.Errorf("error getting current round: %v", err) From 0f4cb303af5c580c0265ce030fdcda34392a99cf Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Mon, 6 Jan 2025 20:29:17 +0530 Subject: [PATCH 09/23] Fix --- zcncore/get_data.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index 3e3c85111..0ad2611d0 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -389,7 +389,7 @@ func IsHardforkActivated(name string) (bool, error) { return false, fmt.Errorf("error unmarshalling hardfork status: %v", err) } - roundString, ok := result[name] + roundString, ok := result["round"] if !ok { return false, errors.New("hardfork not found") } @@ -408,21 +408,16 @@ func IsHardforkActivated(name string) (bool, error) { } func GetCurrentRound() (int64, error) { - res, err := client.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil) + res, err := client.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil, "") if err != nil { return 0, err } - var result string - err = json.Unmarshal(res, &result) + var round int64 + err = json.Unmarshal(res, &round) if err != nil { return 0, fmt.Errorf("error getting current round : %v", err) } - round, err := strconv.ParseInt(result, 10, 64) - if err != nil { - return 0, fmt.Errorf("error parsing current round : %v", err) - } - return round, nil } From 1a0614400aedc42642d31dba71458848d0de3b98 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 20:03:37 +0530 Subject: [PATCH 10/23] test 1 --- core/client/http.go | 13 +++++---- core/client/init_node.go | 5 ++++ core/client/set.go | 27 ++++++++++++++++++ core/conf/vars.go | 5 ++++ core/transaction/get_data.go | 3 +- mobilesdk/sdk/sdk.go | 17 ++++++++---- wasmsdk/sdk.go | 19 +++++++++++-- zboxapi/sdk.go | 33 +++++++++++++++++++++- zboxcore/logger/logger.go | 4 ++- zboxcore/sdk/sdk.go | 53 ++++++++++++++++++++++++++++++------ zcnbridge/rest.go | 7 +++-- zcncore/get_data.go | 20 +++++++------- 12 files changed, 169 insertions(+), 37 deletions(-) diff --git a/core/client/http.go b/core/client/http.go index 744ce0d4b..4572b366e 100644 --- a/core/client/http.go +++ b/core/client/http.go @@ -3,14 +3,15 @@ package client import ( "encoding/json" "fmt" - "github.com/0chain/errors" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/util" - "github.com/shopspring/decimal" "log" "net/http" "net/url" "sync" + + "github.com/0chain/errors" + "github.com/0chain/gosdk/core/conf" + "github.com/0chain/gosdk/core/util" + "github.com/shopspring/decimal" ) // SCRestAPIHandler is a function type to handle the response from the SC Rest API @@ -20,7 +21,7 @@ import ( // `err` - the error if any type SCRestAPIHandler func(response map[string][]byte, numSharders int, err error) -func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) ([]byte, error) { +func MakeSCRestAPICallToSharder(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) ([]byte, error) { const ( consensusThresh = float32(25.0) ScRestApiUrl = "v1/screst/" @@ -159,7 +160,7 @@ func GetBalance(clientIDs ...string) (*GetBalanceResponse, error) { clientID = Id() } - if res, err = MakeSCRestAPICall("", GetBalance, map[string]string{ + if res, err = MakeSCRestAPICallToSharder("", GetBalance, map[string]string{ "client_id": clientID, }, "v1/"); err != nil { return nil, err diff --git a/core/client/init_node.go b/core/client/init_node.go index 444b33834..d356f2071 100644 --- a/core/client/init_node.go +++ b/core/client/init_node.go @@ -20,6 +20,7 @@ import ( var ( logging = logger.GetLogger() nodeClient *Node + IsAppFlow = false ) // Node Maintains central states of SDK (client's context, network). @@ -34,6 +35,10 @@ type Node struct { networkGuard sync.RWMutex } +func SetIsAppFlow(val bool) { + IsAppFlow = true +} + // GetStableMiners Returns stable miner urls. // Length of stable miners is depedent on config's MinSubmit and number of miners in network. func (n *Node) GetStableMiners() []string { diff --git a/core/client/set.go b/core/client/set.go index 3eb4d486e..f0ba52ad4 100644 --- a/core/client/set.go +++ b/core/client/set.go @@ -36,6 +36,23 @@ type Client struct { sign SignFunc } +type InitSdkOptions struct { + WalletJSON string + BlockWorker string + ChainID string + SignatureScheme string + Nonce int64 + IsSplitWallet bool + AddWallet bool + TxnFee *int + MinConfirmation *int + MinSubmit *int + ConfirmationChainLength *int + SharderConsensous *int + ZboxHost string + ZboxAppType string +} + func init() { sys.Sign = signHash sys.SignWithAuth = signHash @@ -326,6 +343,16 @@ func InitSDK(walletJSON string, return nil } +func InitSDKWithWebApp(params InitSdkOptions) error { + err := InitSDK(params.WalletJSON, params.BlockWorker, params.ChainID, params.SignatureScheme, params.Nonce, params.AddWallet, *params.MinConfirmation, *params.MinSubmit, *params.ConfirmationChainLength, *params.SharderConsensous) + if err != nil { + return err + } + conf.SetZboxAppConfigs(params.ZboxHost, params.ZboxAppType) + SetIsAppFlow(true) + return nil +} + func IsSDKInitialized() bool { return sdkInitialized } diff --git a/core/conf/vars.go b/core/conf/vars.go index 8551c1cd9..e31cbcd8f 100644 --- a/core/conf/vars.go +++ b/core/conf/vars.go @@ -39,6 +39,11 @@ func GetClientConfig() (*Config, error) { return cfg, nil } +func SetZboxAppConfigs(zboxHost, zboxAppType string) { + cfg.ZboxHost = zboxHost + cfg.ZboxAppType = zboxAppType +} + // InitClientConfig set global client config func InitClientConfig(c *Config) { onceCfg.Do(func() { diff --git a/core/transaction/get_data.go b/core/transaction/get_data.go index cf7a60065..7ac58359a 100644 --- a/core/transaction/get_data.go +++ b/core/transaction/get_data.go @@ -2,6 +2,7 @@ package transaction import ( "encoding/json" + "github.com/0chain/errors" coreHttp "github.com/0chain/gosdk/core/client" ) @@ -45,7 +46,7 @@ func GetConfig(configType string) (conf *InputMap, err error) { relativePath = GET_MINERSC_CONFIGS } - b, err = coreHttp.MakeSCRestAPICall(scAddress, relativePath, nil) + b, err = coreHttp.MakeSCRestAPICallToSharder(scAddress, relativePath, nil) if err != nil { return nil, errors.Wrap(err, "error requesting storage SC configs:") } diff --git a/mobilesdk/sdk/sdk.go b/mobilesdk/sdk/sdk.go index eaab794ad..1b22d06b7 100644 --- a/mobilesdk/sdk/sdk.go +++ b/mobilesdk/sdk/sdk.go @@ -125,11 +125,18 @@ func InitStorageSDK(clientJson string, configJson string) (*StorageSDK, error) { l.Logger.Info(configObj.ChainID) l.Logger.Info(configObj.SignatureScheme) l.Logger.Info(configObj.PreferredBlobbers) - if err = client.InitSDK(clientJson, - configObj.BlockWorker, - configObj.ChainID, - configObj.SignatureScheme, - 0, true); err != nil { + params := client.InitSdkOptions{ + WalletJSON: clientJson, + BlockWorker: configObj.BlockWorker, + ChainID: configObj.ChainID, + SignatureScheme: configObj.SignatureScheme, + Nonce: int64(0), + AddWallet: true, + ZboxHost: configObj.ZboxHost, + ZboxAppType: configObj.ZboxAppType, + } + + if err = client.InitSDKWithWebApp(params); err != nil { l.Logger.Error(err) return nil, err } diff --git a/wasmsdk/sdk.go b/wasmsdk/sdk.go index c0b78a2b6..89045bee6 100644 --- a/wasmsdk/sdk.go +++ b/wasmsdk/sdk.go @@ -40,7 +40,22 @@ func initSDKs(chainID, blockWorker, signatureScheme string, zboxApiClient.SetRequest(zboxHost, zboxAppType) - err := client.InitSDK("{}", blockWorker, chainID, signatureScheme, 0, false, minConfirmation, minSubmit, confirmationChainLength, sharderConsensous) + params := client.InitSdkOptions{ + WalletJSON: "{}", + BlockWorker: blockWorker, + ChainID: chainID, + SignatureScheme: signatureScheme, + Nonce: int64(0), + AddWallet: false, + MinConfirmation: &minConfirmation, + MinSubmit: &minSubmit, + SharderConsensous: &sharderConsensous, + ConfirmationChainLength: &confirmationChainLength, + ZboxHost: zboxHost, + ZboxAppType: zboxAppType, + } + + err := client.InitSDKWithWebApp(params) if err != nil { fmt.Println("wasm: InitStorageSDK ", err) return err @@ -146,7 +161,7 @@ func makeSCRestAPICall(scAddress, relativePath, paramsJson string) (string, erro if err != nil { sdkLogger.Error(fmt.Sprintf("Error parsing JSON: %v", err)) } - b, err := client.MakeSCRestAPICall(scAddress, relativePath, params) + b, err := client.MakeSCRestAPICallToSharder(scAddress, relativePath, params) return string(b), err } diff --git a/zboxapi/sdk.go b/zboxapi/sdk.go index 0ac6e7064..270e18c63 100644 --- a/zboxapi/sdk.go +++ b/zboxapi/sdk.go @@ -6,11 +6,14 @@ import ( "encoding/json" "errors" "fmt" - "github.com/0chain/gosdk/core/client" + "io" "net/http" + "net/url" "strconv" "time" + "github.com/0chain/gosdk/core/client" + thrown "github.com/0chain/errors" "github.com/0chain/gosdk/core/encryption" "github.com/0chain/gosdk/core/logger" @@ -371,3 +374,31 @@ func (c *Client) GetSharedToMe(ctx context.Context, phoneNumber, token string) ( return result.Data, nil } + +func (c *Client) MakeRestApiCallToZbox(ctx context.Context, relativePath string, params map[string]string) ([]byte, error) { + urlPath := c.baseUrl + "/v2" + relativePath + u, err := url.Parse(urlPath) + if err != nil { + return nil, fmt.Errorf("error parsing URL: %w", err) + } + + // Add query parameters + q := u.Query() + for key, value := range params { + q.Add(key, value) + } + u.RawQuery = q.Encode() + + resp, err := http.Get(u.String()) + if err != nil { + return nil, fmt.Errorf("error making GET request: %w", err) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + resp.Body.Close() + + return body, nil +} diff --git a/zboxcore/logger/logger.go b/zboxcore/logger/logger.go index 64134eb35..0a78ddab7 100644 --- a/zboxcore/logger/logger.go +++ b/zboxcore/logger/logger.go @@ -1,7 +1,9 @@ // Proxy for the core logger package. package logger -import "github.com/0chain/gosdk/core/logger" +import ( + "github.com/0chain/gosdk/core/logger" +) // Logger global logger instance var Logger = logger.GetLogger() diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index adb6eddbe..f2eba124f 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -12,6 +12,8 @@ import ( "github.com/0chain/common/core/currency" "github.com/0chain/errors" "github.com/0chain/gosdk/core/logger" + "github.com/0chain/gosdk/core/screstapi" + "go.uber.org/zap" "gopkg.in/natefinch/lumberjack.v2" "github.com/0chain/gosdk/core/client" @@ -163,7 +165,7 @@ func GetStakePoolInfo(providerType ProviderType, providerID string) (info *Stake } var b []byte - b, err = client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/getStakePoolStat", + b, err = screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/getStakePoolStat", map[string]string{"provider_type": strconv.Itoa(int(providerType)), "provider_id": providerID}) if err != nil { return nil, errors.Wrap(err, "error requesting stake pool info:") @@ -204,7 +206,7 @@ func GetStakePoolUserInfo(clientID string, offset, limit int) (info *StakePoolUs "offset": strconv.FormatInt(int64(offset), 10), "limit": strconv.FormatInt(int64(limit), 10), } - b, err = client.MakeSCRestAPICall(STORAGE_SCADDRESS, + b, err = screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/getUserStakePoolStat", params) if err != nil { return nil, errors.Wrap(err, "error requesting stake pool user info:") @@ -257,7 +259,7 @@ func GetChallengePoolInfo(allocID string) (info *ChallengePoolInfo, err error) { } var b []byte - b, err = client.MakeSCRestAPICall(STORAGE_SCADDRESS, + b, err = screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/getChallengePoolStat", map[string]string{"allocation_id": allocID}) if err != nil { return nil, errors.Wrap(err, "error requesting challenge pool info:") @@ -281,7 +283,7 @@ func GetMptData(key string) ([]byte, error) { } var b []byte - b, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, + b, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/get_mpt_key", map[string]string{"key": key}, ) if err != nil { @@ -625,10 +627,19 @@ func GetAllocation(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } + + allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + if err != nil { + return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) + } + + l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) + l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) + allocationObj := &Allocation{} err = json.Unmarshal(allocationBytes, allocationObj) if err != nil { @@ -646,10 +657,19 @@ func GetAllocationForUpdate(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } + + allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + if err != nil { + return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) + } + + l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) + l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) + allocationObj := &Allocation{} err = json.Unmarshal(allocationBytes, allocationObj) if err != nil { @@ -665,11 +685,19 @@ func GetAllocationUpdates(allocation *Allocation) error { params := make(map[string]string) params["allocation"] = allocation.ID - allocationBytes, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } + allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + if err != nil { + return errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) + } + + l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) + l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) + updatedAllocationObj := new(Allocation) if err := json.Unmarshal(allocationBytes, updatedAllocationObj); err != nil { return errors.New("allocation_decode_error", "Error decoding the allocation."+err.Error()) @@ -718,10 +746,19 @@ func getAllocationsInternal(clientID string, limit, offset int) ([]*Allocation, params["client"] = clientID params["limit"] = fmt.Sprint(limit) params["offset"] = fmt.Sprint(offset) - allocationsBytes, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocations", params) + allocationsBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocations", params) if err != nil { return nil, errors.New("allocations_fetch_error", "Error fetching the allocations."+err.Error()) } + + allocationsBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocations", params) + if err != nil { + return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) + } + + l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationsBytes))) + l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationsBytes2))) + allocations := make([]*Allocation, 0) err = json.Unmarshal(allocationsBytes, &allocations) if err != nil { diff --git a/zcnbridge/rest.go b/zcnbridge/rest.go index ab860b16d..f5c12241f 100644 --- a/zcnbridge/rest.go +++ b/zcnbridge/rest.go @@ -3,6 +3,7 @@ package zcnbridge import ( "encoding/json" "fmt" + coreHttp "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/common" @@ -88,7 +89,7 @@ func GetAuthorizer(id string) (res []byte, err error) { return nil, err } - return coreHttp.MakeSCRestAPICall(zcncore.ZCNSCSmartContractAddress, PathGetAuthorizer, zcncore.Params{ + return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, PathGetAuthorizer, zcncore.Params{ "id": id, }) } @@ -101,7 +102,7 @@ func GetAuthorizers(active bool) (res []byte, err error) { if err != nil { return nil, err } - return coreHttp.MakeSCRestAPICall(zcncore.ZCNSCSmartContractAddress, fmt.Sprintf(PathGetAuthorizerNodes, active), nil) + return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, fmt.Sprintf(PathGetAuthorizerNodes, active), nil) } // GetGlobalConfig Returns global config @@ -111,5 +112,5 @@ func GetGlobalConfig() (res []byte, err error) { if err != nil { return nil, err } - return coreHttp.MakeSCRestAPICall(zcncore.ZCNSCSmartContractAddress, PathGetGlobalConfig, nil) + return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, PathGetGlobalConfig, nil) } diff --git a/zcncore/get_data.go b/zcncore/get_data.go index 6a17f7aff..fdb1f0b05 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -213,7 +213,7 @@ func withParams(uri string, params Params) string { //nolint:unused // return // } // -// return coreHttp.MakeSCRestAPICall(StorageSmartContractAddress, STORAGE_GET_BLOBBER_SNAPSHOT, Params{ +// return coreHttp.MakeSCRestAPICallToSharder(StorageSmartContractAddress, STORAGE_GET_BLOBBER_SNAPSHOT, Params{ // "round": strconv.FormatInt(round, 10), // "limit": strconv.FormatInt(limit, 10), // "offset": strconv.FormatInt(offset, 10), @@ -228,7 +228,7 @@ func GetMinerSCNodeInfo(id string) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_NODE, Params{ + return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_NODE, Params{ "id": id, }) } @@ -241,7 +241,7 @@ func GetMintNonce() ([]byte, error) { return nil, err } - return client.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_MINT_NONCE, Params{ + return client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_MINT_NONCE, Params{ "client_id": client.Id(), }) } @@ -251,7 +251,7 @@ func GetMiners(active, stakable bool, limit, offset int) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{ + return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{ "active": strconv.FormatBool(active), "stakable": strconv.FormatBool(stakable), "offset": strconv.FormatInt(int64(offset), 10), @@ -264,7 +264,7 @@ func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{ + return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{ "active": strconv.FormatBool(active), "stakable": strconv.FormatBool(stakable), "offset": strconv.FormatInt(int64(offset), 10), @@ -276,7 +276,7 @@ func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) { // - numSharders: number of sharders // - timeout: request timeout func GetLatestFinalizedMagicBlock() (m *block.MagicBlock, err error) { - res, err := client.MakeSCRestAPICall("", GET_LATEST_FINALIZED_MAGIC_BLOCK, nil, "") + res, err := client.MakeSCRestAPICallToSharder("", GET_LATEST_FINALIZED_MAGIC_BLOCK, nil, "") if err != nil { return nil, err } @@ -305,7 +305,7 @@ func GetMinerSCUserInfo(clientID string) ([]byte, error) { clientID = client.Id() } - return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_USER, Params{ + return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_USER, Params{ "client_id": clientID, }) } @@ -317,7 +317,7 @@ func GetMinerSCNodePool(id string) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_POOL, Params{ + return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_POOL, Params{ "id": id, "pool_id": client.Id(), }) @@ -335,7 +335,7 @@ func GetNotProcessedZCNBurnTickets(ethereumAddress, startNonce string) ([]byte, const GET_NOT_PROCESSED_BURN_TICKETS = `/v1/not_processed_burn_tickets` - return client.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_NOT_PROCESSED_BURN_TICKETS, Params{ + return client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_NOT_PROCESSED_BURN_TICKETS, Params{ "ethereum_address": ethereumAddress, "nonce": startNonce, }) @@ -354,7 +354,7 @@ func GetUserLockedTotal(clientID string) (int64, error) { const GET_USER_LOCKED_TOTAL = `/v1/getUserLockedTotal` - info, err := client.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_USER_LOCKED_TOTAL, Params{ + info, err := client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_USER_LOCKED_TOTAL, Params{ "client_id": clientID, }) From 67345859df67962be9743d6a83bba569ed2ad6dd Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 20:04:27 +0530 Subject: [PATCH 11/23] new folder --- core/screstapi/http.go | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 core/screstapi/http.go diff --git a/core/screstapi/http.go b/core/screstapi/http.go new file mode 100644 index 000000000..45c9aee56 --- /dev/null +++ b/core/screstapi/http.go @@ -0,0 +1,84 @@ +package screstapi + +import ( + "context" + + "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk/core/conf" + "github.com/0chain/gosdk/zboxapi" +) + +var urlPathSharderToZboxMap = map[string]string{ + "/getStakePoolStat": "/getStakePoolStat", + "/getUserStakePoolStat": "/getUserStakePoolStat", + "/getChallengePoolStat": "/getChallengePoolStat", + "/getBlobber": "/blobber", + "/getblobbers": "/blobbers", + "/blobber_ids": "/blobber_ids", + "/alloc_blobbers": "/blobbers/allocation", + "/get_validator": "/validator", + "/validators": "/validators", + "/allocation": "/getAllocation", + "/allocations": "/getAllocations", + "/v1/mint_nonce": "/mintNonce", + "client/get/balance": "/balance", + "/v1/not_processed_burn_tickets": "/not_processed_burn_tickets", +} + +func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) (resp []byte, err error) { + _, ok := urlPathSharderToZboxMap[relativePath] + if client.IsAppFlow && ok { + resp, err = MakeSCRestAPICallToZbox(urlPathSharderToZboxMap[relativePath], params) + if err != nil { + resp, err = client.MakeSCRestAPICallToSharder(scAddress, relativePath, params, restApiUrls...) + } + } else { + resp, err = client.MakeSCRestAPICallToSharder(scAddress, relativePath, params, restApiUrls...) + } + + return resp, err +} + +func MakeSCRestAPICallToZbox(relativePath string, params map[string]string) ([]byte, error) { + // req, err := http.NewRequest(method, relativePath) + zboxApiClient := zboxapi.NewClient() + configObj, err := conf.GetClientConfig() + if err != nil { + return nil, err + } + zboxApiClient.SetRequest(configObj.ZboxHost, configObj.ZboxAppType) + + resp, err := zboxApiClient.MakeRestApiCallToZbox(context.TODO(), relativePath, params) + if err != nil { + return nil, err + } + + return resp, nil +} + +// func GetBalance(clientIDs ...string) (*client.GetBalanceResponse, error) { +// var clientID string +// if len(clientIDs) > 0 { +// clientID = clientIDs[0] +// } else { +// clientID = client.Id() +// } + +// var ( +// balance client.GetBalanceResponse +// err error +// resp []byte +// ) + +// if resp, err = client.MakeSCRestAPICallToSharder("", GetBalanceUrl, map[string]string{ +// "client_id": clientID, +// }, "v1/"); err != nil { +// return nil, err +// } + +// if err = json.Unmarshal(resp, &balance); err != nil { +// return nil, err +// } + +// return &balance, err +// } From c86e869ace51fc5fccaa2b89ce52804dc86ea4fa Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 20:06:51 +0530 Subject: [PATCH 12/23] lint fix --- zboxcore/sdk/sdk.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index f2eba124f..400015213 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -455,7 +455,7 @@ func getBlobbersInternal(active, stakable bool, limit, offset int) (bs []*Blobbe offset, strconv.FormatBool(stakable), ) - b, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, url, nil) + b, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, url, nil) var wrap nodes if err != nil { return nil, errors.Wrap(err, "error requesting blobbers:") @@ -513,7 +513,7 @@ func GetBlobber(blobberID string) (blob *Blobber, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICall( + b, err = client.MakeSCRestAPICallToSharder( STORAGE_SCADDRESS, "/getBlobber", map[string]string{"blobber_id": blobberID}, @@ -538,7 +538,7 @@ func GetValidator(validatorID string) (validator *Validator, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICall( + b, err = client.MakeSCRestAPICallToSharder( STORAGE_SCADDRESS, "/get_validator", map[string]string{"validator_id": validatorID}, @@ -563,7 +563,7 @@ func GetValidators(stakable bool) (validators []*Validator, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICall( + b, err = client.MakeSCRestAPICallToSharder( STORAGE_SCADDRESS, "/validators", map[string]string{ @@ -884,7 +884,7 @@ func GetAllocationBlobbers( params["force"] = strconv.FormatBool(force[0]) } - allocBlobber, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/alloc_blobbers", params) + allocBlobber, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/alloc_blobbers", params) if err != nil { return nil, err } @@ -971,7 +971,7 @@ func GetBlobberIds(blobberUrls []string) ([]string, error) { params := make(map[string]string) params["blobber_urls"] = string(urlsStr) - idsStr, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/blobber_ids", params) + idsStr, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/blobber_ids", params) if err != nil { return nil, err } @@ -996,7 +996,7 @@ func GetFreeAllocationBlobbers(request map[string]interface{}) ([]string, error) params := make(map[string]string) params["free_allocation_data"] = string(data) - allocBlobber, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/free_alloc_blobbers", params) + allocBlobber, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/free_alloc_blobbers", params) if err != nil { return nil, err } @@ -1442,7 +1442,7 @@ func GetUpdateAllocationMinLock( params := make(map[string]string) params["data"] = string(data) - responseBytes, err := client.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation-update-min-lock", params) + responseBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation-update-min-lock", params) if err != nil { return 0, errors.Wrap(err, "failed to request allocation update min lock") } From f3dee3cfc7a515d7f82f8528a65a7bb3470b5549 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 20:42:08 +0530 Subject: [PATCH 13/23] test 2 --- zboxcore/sdk/sdk.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index 400015213..a83a67b30 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -283,7 +283,7 @@ func GetMptData(key string) ([]byte, error) { } var b []byte - b, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, + b, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/get_mpt_key", map[string]string{"key": key}, ) if err != nil { @@ -641,7 +641,7 @@ func GetAllocation(allocationID string) (*Allocation, error) { l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) allocationObj := &Allocation{} - err = json.Unmarshal(allocationBytes, allocationObj) + err = json.Unmarshal(allocationBytes2, allocationObj) if err != nil { return nil, errors.New("allocation_decode_error", "Error decoding the allocation: "+err.Error()+" "+string(allocationBytes)) } @@ -671,7 +671,7 @@ func GetAllocationForUpdate(allocationID string) (*Allocation, error) { l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) allocationObj := &Allocation{} - err = json.Unmarshal(allocationBytes, allocationObj) + err = json.Unmarshal(allocationBytes2, allocationObj) if err != nil { return nil, errors.New("allocation_decode_error", "Error decoding the allocation: "+err.Error()+" "+string(allocationBytes)) } @@ -699,7 +699,7 @@ func GetAllocationUpdates(allocation *Allocation) error { l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) updatedAllocationObj := new(Allocation) - if err := json.Unmarshal(allocationBytes, updatedAllocationObj); err != nil { + if err := json.Unmarshal(allocationBytes2, updatedAllocationObj); err != nil { return errors.New("allocation_decode_error", "Error decoding the allocation."+err.Error()) } @@ -760,7 +760,7 @@ func getAllocationsInternal(clientID string, limit, offset int) ([]*Allocation, l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationsBytes2))) allocations := make([]*Allocation, 0) - err = json.Unmarshal(allocationsBytes, &allocations) + err = json.Unmarshal(allocationsBytes2, &allocations) if err != nil { return nil, errors.New("allocations_decode_error", "Error decoding the allocations."+err.Error()) } From 5c7ed0871dfcb6c6ae18437a1240c9a2dd3ca789 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 21:38:44 +0530 Subject: [PATCH 14/23] test 2 --- zboxcore/sdk/sdk.go | 49 ++++++++------------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index a83a67b30..d9ac51cab 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -13,7 +13,6 @@ import ( "github.com/0chain/errors" "github.com/0chain/gosdk/core/logger" "github.com/0chain/gosdk/core/screstapi" - "go.uber.org/zap" "gopkg.in/natefinch/lumberjack.v2" "github.com/0chain/gosdk/core/client" @@ -627,21 +626,13 @@ func GetAllocation(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } - allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) - if err != nil { - return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) - } - - l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) - l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) - allocationObj := &Allocation{} - err = json.Unmarshal(allocationBytes2, allocationObj) + err = json.Unmarshal(allocationBytes, allocationObj) if err != nil { return nil, errors.New("allocation_decode_error", "Error decoding the allocation: "+err.Error()+" "+string(allocationBytes)) } @@ -657,21 +648,13 @@ func GetAllocationForUpdate(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } - allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) - if err != nil { - return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) - } - - l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) - l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) - allocationObj := &Allocation{} - err = json.Unmarshal(allocationBytes2, allocationObj) + err = json.Unmarshal(allocationBytes, allocationObj) if err != nil { return nil, errors.New("allocation_decode_error", "Error decoding the allocation: "+err.Error()+" "+string(allocationBytes)) } @@ -685,21 +668,13 @@ func GetAllocationUpdates(allocation *Allocation) error { params := make(map[string]string) params["allocation"] = allocation.ID - allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } - allocationBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) - if err != nil { - return errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) - } - - l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationBytes))) - l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationBytes2))) - updatedAllocationObj := new(Allocation) - if err := json.Unmarshal(allocationBytes2, updatedAllocationObj); err != nil { + if err := json.Unmarshal(allocationBytes, updatedAllocationObj); err != nil { return errors.New("allocation_decode_error", "Error decoding the allocation."+err.Error()) } @@ -746,21 +721,13 @@ func getAllocationsInternal(clientID string, limit, offset int) ([]*Allocation, params["client"] = clientID params["limit"] = fmt.Sprint(limit) params["offset"] = fmt.Sprint(offset) - allocationsBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocations", params) + allocationsBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocations", params) if err != nil { return nil, errors.New("allocations_fetch_error", "Error fetching the allocations."+err.Error()) } - allocationsBytes2, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocations", params) - if err != nil { - return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) - } - - l.Logger.Debug("0box res allocation", zap.Any("response", string(allocationsBytes))) - l.Logger.Debug("sharder res allocation", zap.Any("response", string(allocationsBytes2))) - allocations := make([]*Allocation, 0) - err = json.Unmarshal(allocationsBytes2, &allocations) + err = json.Unmarshal(allocationsBytes, &allocations) if err != nil { return nil, errors.New("allocations_decode_error", "Error decoding the allocations."+err.Error()) } From 04299ea0b5282aa1084f742bb51edc115865c6d9 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 22:15:51 +0530 Subject: [PATCH 15/23] test 3 --- zboxcore/sdk/sdk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index d9ac51cab..6608ad7a2 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -668,7 +668,7 @@ func GetAllocationUpdates(allocation *Allocation) error { params := make(map[string]string) params["allocation"] = allocation.ID - allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } @@ -721,7 +721,7 @@ func getAllocationsInternal(clientID string, limit, offset int) ([]*Allocation, params["client"] = clientID params["limit"] = fmt.Sprint(limit) params["offset"] = fmt.Sprint(offset) - allocationsBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocations", params) + allocationsBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocations", params) if err != nil { return nil, errors.New("allocations_fetch_error", "Error fetching the allocations."+err.Error()) } From 8898b7d41005bc9b5f0c01ecb720e2638e5225ed Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 22:33:48 +0530 Subject: [PATCH 16/23] test 4 --- zboxcore/sdk/sdk.go | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index 6608ad7a2..edcf8d747 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -282,7 +282,7 @@ func GetMptData(key string) ([]byte, error) { } var b []byte - b, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, + b, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/get_mpt_key", map[string]string{"key": key}, ) if err != nil { @@ -448,13 +448,9 @@ func getBlobbersInternal(active, stakable bool, limit, offset int) (bs []*Blobbe Nodes []*Blobber } - url := fmt.Sprintf("/getblobbers?active=%s&limit=%d&offset=%d&stakable=%s", - strconv.FormatBool(active), - limit, - offset, - strconv.FormatBool(stakable), - ) - b, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, url, nil) + b, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/getblobbers", map[string]string{"active": strconv.FormatBool(active), "limit": strconv.FormatInt(int64(limit), 10), + "offset": strconv.FormatInt(int64(offset), 10), + "stakable": strconv.FormatBool(stakable)}) var wrap nodes if err != nil { return nil, errors.Wrap(err, "error requesting blobbers:") @@ -512,7 +508,7 @@ func GetBlobber(blobberID string) (blob *Blobber, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICallToSharder( + b, err = screstapi.MakeSCRestAPICall( STORAGE_SCADDRESS, "/getBlobber", map[string]string{"blobber_id": blobberID}, @@ -537,7 +533,7 @@ func GetValidator(validatorID string) (validator *Validator, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICallToSharder( + b, err = screstapi.MakeSCRestAPICall( STORAGE_SCADDRESS, "/get_validator", map[string]string{"validator_id": validatorID}, @@ -562,7 +558,7 @@ func GetValidators(stakable bool) (validators []*Validator, err error) { return nil, sdkNotInitialized } var b []byte - b, err = client.MakeSCRestAPICallToSharder( + b, err = screstapi.MakeSCRestAPICall( STORAGE_SCADDRESS, "/validators", map[string]string{ @@ -626,7 +622,7 @@ func GetAllocation(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } @@ -648,7 +644,7 @@ func GetAllocationForUpdate(allocationID string) (*Allocation, error) { } params := make(map[string]string) params["allocation"] = allocationID - allocationBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation", params) + allocationBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation", params) if err != nil { return nil, errors.New("allocation_fetch_error", "Error fetching the allocation."+err.Error()) } @@ -851,7 +847,7 @@ func GetAllocationBlobbers( params["force"] = strconv.FormatBool(force[0]) } - allocBlobber, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/alloc_blobbers", params) + allocBlobber, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/alloc_blobbers", params) if err != nil { return nil, err } @@ -938,7 +934,7 @@ func GetBlobberIds(blobberUrls []string) ([]string, error) { params := make(map[string]string) params["blobber_urls"] = string(urlsStr) - idsStr, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/blobber_ids", params) + idsStr, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/blobber_ids", params) if err != nil { return nil, err } @@ -963,7 +959,7 @@ func GetFreeAllocationBlobbers(request map[string]interface{}) ([]string, error) params := make(map[string]string) params["free_allocation_data"] = string(data) - allocBlobber, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/free_alloc_blobbers", params) + allocBlobber, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/free_alloc_blobbers", params) if err != nil { return nil, err } @@ -1409,7 +1405,7 @@ func GetUpdateAllocationMinLock( params := make(map[string]string) params["data"] = string(data) - responseBytes, err := client.MakeSCRestAPICallToSharder(STORAGE_SCADDRESS, "/allocation-update-min-lock", params) + responseBytes, err := screstapi.MakeSCRestAPICall(STORAGE_SCADDRESS, "/allocation-update-min-lock", params) if err != nil { return 0, errors.Wrap(err, "failed to request allocation update min lock") } From 4a24461246f14f4829493bfe74abcccf2f22c080 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 22:55:40 +0530 Subject: [PATCH 17/23] test 5 --- core/screstapi/http.go | 46 +++++++++++++++++++++------------------- wasmsdk/sdk.go | 3 ++- wasmsdk/zcn.go | 4 ++-- winsdk/wallet.go | 5 +++-- zcncore/get_data.go | 19 +++++++++-------- zcncore/wallet_mobile.go | 3 ++- 6 files changed, 43 insertions(+), 37 deletions(-) diff --git a/core/screstapi/http.go b/core/screstapi/http.go index 45c9aee56..095305230 100644 --- a/core/screstapi/http.go +++ b/core/screstapi/http.go @@ -2,6 +2,7 @@ package screstapi import ( "context" + "encoding/json" "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/conf" @@ -56,29 +57,30 @@ func MakeSCRestAPICallToZbox(relativePath string, params map[string]string) ([]b return resp, nil } -// func GetBalance(clientIDs ...string) (*client.GetBalanceResponse, error) { -// var clientID string -// if len(clientIDs) > 0 { -// clientID = clientIDs[0] -// } else { -// clientID = client.Id() -// } +func GetBalance(clientIDs ...string) (*client.GetBalanceResponse, error) { + var clientID string + if len(clientIDs) > 0 { + clientID = clientIDs[0] + } else { + clientID = client.Id() + } -// var ( -// balance client.GetBalanceResponse -// err error -// resp []byte -// ) + const GetBalanceUrl = "client/get/balance" + var ( + balance client.GetBalanceResponse + err error + resp []byte + ) -// if resp, err = client.MakeSCRestAPICallToSharder("", GetBalanceUrl, map[string]string{ -// "client_id": clientID, -// }, "v1/"); err != nil { -// return nil, err -// } + if resp, err = client.MakeSCRestAPICallToSharder("", GetBalanceUrl, map[string]string{ + "client_id": clientID, + }, "v1/"); err != nil { + return nil, err + } -// if err = json.Unmarshal(resp, &balance); err != nil { -// return nil, err -// } + if err = json.Unmarshal(resp, &balance); err != nil { + return nil, err + } -// return &balance, err -// } + return &balance, err +} diff --git a/wasmsdk/sdk.go b/wasmsdk/sdk.go index 89045bee6..07f9974ad 100644 --- a/wasmsdk/sdk.go +++ b/wasmsdk/sdk.go @@ -12,6 +12,7 @@ import ( "github.com/0chain/gosdk/core/encryption" "github.com/0chain/gosdk/core/imageutil" "github.com/0chain/gosdk/core/logger" + "github.com/0chain/gosdk/core/screstapi" "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk/zcncore" @@ -161,7 +162,7 @@ func makeSCRestAPICall(scAddress, relativePath, paramsJson string) (string, erro if err != nil { sdkLogger.Error(fmt.Sprintf("Error parsing JSON: %v", err)) } - b, err := client.MakeSCRestAPICallToSharder(scAddress, relativePath, params) + b, err := screstapi.MakeSCRestAPICall(scAddress, relativePath, params) return string(b), err } diff --git a/wasmsdk/zcn.go b/wasmsdk/zcn.go index bb3a53a3d..f0272e4b5 100644 --- a/wasmsdk/zcn.go +++ b/wasmsdk/zcn.go @@ -4,7 +4,7 @@ package main import ( - "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk/core/screstapi" "github.com/0chain/gosdk/zcncore" ) @@ -17,7 +17,7 @@ type Balance struct { // getWalletBalance retrieves the wallet balance of the client from the network. // - clientId is the client id func getWalletBalance(clientId string) (*Balance, error) { - bal, err := client.GetBalance(clientId) + bal, err := screstapi.GetBalance(clientId) if err != nil { return nil, err } diff --git a/winsdk/wallet.go b/winsdk/wallet.go index 0e72008f8..51762ea61 100644 --- a/winsdk/wallet.go +++ b/winsdk/wallet.go @@ -8,10 +8,11 @@ import ( ) import ( - "github.com/0chain/gosdk/core/client" "os" "path/filepath" + "github.com/0chain/gosdk/core/screstapi" + "github.com/0chain/gosdk/zcncore" ) @@ -87,7 +88,7 @@ func RecoverWallet(mnemonic *C.char) *C.char { // //export GetWalletBalance func GetWalletBalance(clientID *C.char) *C.char { - b, err := client.GetBalance(C.GoString(clientID)) + b, err := screstapi.GetBalance(C.GoString(clientID)) if err != nil { log.Error("win: ", err) return WithJSON(0, err) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index fdb1f0b05..dcc343b1d 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -10,6 +10,7 @@ import ( "github.com/0chain/gosdk/core/block" "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk/core/screstapi" "github.com/0chain/gosdk/core/sys" "github.com/0chain/gosdk/core/tokenrate" "github.com/0chain/gosdk/core/util" @@ -228,7 +229,7 @@ func GetMinerSCNodeInfo(id string) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_NODE, Params{ + return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_NODE, Params{ "id": id, }) } @@ -241,7 +242,7 @@ func GetMintNonce() ([]byte, error) { return nil, err } - return client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_MINT_NONCE, Params{ + return screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_MINT_NONCE, Params{ "client_id": client.Id(), }) } @@ -251,7 +252,7 @@ func GetMiners(active, stakable bool, limit, offset int) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{ + return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{ "active": strconv.FormatBool(active), "stakable": strconv.FormatBool(stakable), "offset": strconv.FormatInt(int64(offset), 10), @@ -264,7 +265,7 @@ func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{ + return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{ "active": strconv.FormatBool(active), "stakable": strconv.FormatBool(stakable), "offset": strconv.FormatInt(int64(offset), 10), @@ -276,7 +277,7 @@ func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) { // - numSharders: number of sharders // - timeout: request timeout func GetLatestFinalizedMagicBlock() (m *block.MagicBlock, err error) { - res, err := client.MakeSCRestAPICallToSharder("", GET_LATEST_FINALIZED_MAGIC_BLOCK, nil, "") + res, err := screstapi.MakeSCRestAPICall("", GET_LATEST_FINALIZED_MAGIC_BLOCK, nil, "") if err != nil { return nil, err } @@ -305,7 +306,7 @@ func GetMinerSCUserInfo(clientID string) ([]byte, error) { clientID = client.Id() } - return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_USER, Params{ + return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_USER, Params{ "client_id": clientID, }) } @@ -317,7 +318,7 @@ func GetMinerSCNodePool(id string) ([]byte, error) { return nil, err } - return client.MakeSCRestAPICallToSharder(MinerSmartContractAddress, GET_MINERSC_POOL, Params{ + return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_POOL, Params{ "id": id, "pool_id": client.Id(), }) @@ -335,7 +336,7 @@ func GetNotProcessedZCNBurnTickets(ethereumAddress, startNonce string) ([]byte, const GET_NOT_PROCESSED_BURN_TICKETS = `/v1/not_processed_burn_tickets` - return client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_NOT_PROCESSED_BURN_TICKETS, Params{ + return screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_NOT_PROCESSED_BURN_TICKETS, Params{ "ethereum_address": ethereumAddress, "nonce": startNonce, }) @@ -354,7 +355,7 @@ func GetUserLockedTotal(clientID string) (int64, error) { const GET_USER_LOCKED_TOTAL = `/v1/getUserLockedTotal` - info, err := client.MakeSCRestAPICallToSharder(ZCNSCSmartContractAddress, GET_USER_LOCKED_TOTAL, Params{ + info, err := screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_USER_LOCKED_TOTAL, Params{ "client_id": clientID, }) diff --git a/zcncore/wallet_mobile.go b/zcncore/wallet_mobile.go index 7fd9b0564..b84955efd 100644 --- a/zcncore/wallet_mobile.go +++ b/zcncore/wallet_mobile.go @@ -5,6 +5,7 @@ package zcncore import ( "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk/core/screstapi" "github.com/0chain/gosdk/core/zcncrypto" ) @@ -31,7 +32,7 @@ func (w *wallet) Sign(hash string) (string, error) { // GetWalletBalance retrieve wallet balance from sharders // - id: client id func GetWalletBalance(id string) (int64, error) { - response, err := client.GetBalance(id) + response, err := screstapi.GetBalance(id) if err != nil { return 0, err } From 3f9b9adc68ca6070ab5d1d3d3fa5936b837857ee Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Mon, 13 Jan 2025 22:58:14 +0530 Subject: [PATCH 18/23] test 5 --- core/screstapi/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/screstapi/http.go b/core/screstapi/http.go index 095305230..53f5823b5 100644 --- a/core/screstapi/http.go +++ b/core/screstapi/http.go @@ -72,7 +72,7 @@ func GetBalance(clientIDs ...string) (*client.GetBalanceResponse, error) { resp []byte ) - if resp, err = client.MakeSCRestAPICallToSharder("", GetBalanceUrl, map[string]string{ + if resp, err = MakeSCRestAPICall("", GetBalanceUrl, map[string]string{ "client_id": clientID, }, "v1/"); err != nil { return nil, err From 6272db39ae066b53db914485c8afe8511ce991a2 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Wed, 15 Jan 2025 15:04:00 +0530 Subject: [PATCH 19/23] fix --- zcncore/get_data.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zcncore/get_data.go b/zcncore/get_data.go index 29a659a9e..f6f752e76 100644 --- a/zcncore/get_data.go +++ b/zcncore/get_data.go @@ -377,7 +377,7 @@ func GetUserLockedTotal(clientID string) (int64, error) { } func IsHardforkActivated(name string) (bool, error) { - res, err := client.MakeSCRestAPICall(MinerSmartContractAddress, GET_HARDFORK, Params{ + res, err := screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_HARDFORK, Params{ "name": name, }) if err != nil { @@ -409,7 +409,7 @@ func IsHardforkActivated(name string) (bool, error) { } func GetCurrentRound() (int64, error) { - res, err := client.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil, "") + res, err := screstapi.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil, "") if err != nil { return 0, err } From e2f8762d03a2559d4425f11e4cd004bd04da48d9 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Thu, 23 Jan 2025 00:49:50 +0530 Subject: [PATCH 20/23] refactor --- README.md | 2 +- constants/context_key.go | 27 - constants/errors.go | 37 - constants/files.go | 24 - constants/signscheme.go | 13 - core/block/block.go | 95 - core/block/magic_block_entity.go | 71 - core/build.go | 2 - core/client/cache.go | 58 - core/client/http.go | 187 - core/client/init_node.go | 245 - core/client/node.go | 102 - core/client/set.go | 392 -- core/common/math.go | 33 - core/common/math_test.go | 77 - core/common/misc.go | 259 -- core/common/misc_test.go | 135 - core/common/time.go | 80 - core/common/time_test.go | 77 - core/common/utils.go | 26 - core/conf/config.go | 188 - core/conf/config_test.go | 195 - core/conf/mocks/Reader.go | 54 - core/conf/mocks/doc.go | 2 - core/conf/network.go | 81 - core/conf/reader.go | 99 - core/conf/reader_test.go | 67 - core/conf/vars.go | 96 - core/encryption/hash.go | 86 - core/imageutil/thumbnailer.go | 75 - core/logger/logger.go | 182 - core/pathutil/path.go | 64 - core/pathutil/path_test.go | 73 - core/resty/client.go | 21 - core/resty/client_wasm.go | 34 - core/resty/doc.go | 2 - core/resty/mocks/Client.go | 37 - core/resty/mocks/doc.go | 2 - core/resty/mocks/timeout.go | 21 - core/resty/option.go | 48 - core/resty/resty.go | 304 -- core/resty/resty_test.go | 165 - core/resty/result.go | 11 - core/resty/transport.go | 29 - core/resty/transport_wasm.go | 27 - core/resty/vars.go | 14 - core/screstapi/http.go | 86 - core/sys/doc.go | 2 - core/sys/fs.go | 65 - core/sys/fs_disk.go | 94 - core/sys/fs_mem.go | 236 - core/sys/sign.go | 16 - core/sys/util.go | 307 -- core/sys/vars.go | 40 - core/tokenrate/bancor.go | 143 - core/tokenrate/bancor_test.go | 44 - core/tokenrate/coingecko.go | 83 - core/tokenrate/coinmarketcap.go | 186 - core/tokenrate/doc.go | 2 - core/tokenrate/mockresponses/bancor.json | 25 - core/tokenrate/mockresponses/coingecko.json | 21 - .../mockresponses/coinmarketcap.json | 87 - core/tokenrate/tokenrate.go | 54 - core/tokenrate/tokenrate_test.go | 243 - core/tokenrate/uniswap.go | 100 - core/transaction/entity.go | 670 --- core/transaction/entity_test.go | 28 - core/transaction/get_data.go | 64 - core/transaction/transaction.go | 21 - core/transaction/transport.go | 20 - core/transaction/transport_wasm.go | 15 - core/transaction/type.go | 15 - core/transaction/utils.go | 465 -- core/transaction/vars.go | 19 - core/util/doc.go | 2 - core/util/fixed_merkle_tree.go | 271 -- core/util/fixed_merkle_tree_test.go | 71 - core/util/http_consensus_maps.go | 93 - core/util/httpnet.go | 190 - core/util/merkle_tree.go | 148 - core/util/merkle_tree_interface.go | 83 - core/util/rand.go | 115 - core/util/rand_test.go | 59 - core/util/secure_value.go | 72 - core/util/transport.go | 27 - core/util/transport_wasm.go | 20 - core/util/uint64.go | 19 - core/util/uuid.go | 24 - core/util/validation_tree.go | 342 -- core/util/validation_tree_test.go | 331 -- core/version/.emptydir | 0 core/version/doc.go | 3 - core/version/version.go | 5 - core/zcncrypto/bls.go | 66 - core/zcncrypto/bls0chain_herumi.go | 310 -- core/zcncrypto/bls0chain_herumi_test.go | 188 - core/zcncrypto/bls0chain_test.go | 65 - core/zcncrypto/bls0chain_wasm.go | 109 - core/zcncrypto/bls_herumi.go | 210 - core/zcncrypto/ed255190chain.go | 179 - core/zcncrypto/ed25519_test.go | 86 - core/zcncrypto/factory.go | 114 - core/zcncrypto/factory_wasm.go | 65 - core/zcncrypto/signature_scheme.go | 112 - dev/blobber/handlers.go | 98 - dev/blobber/init.go | 29 - dev/blobber/model/commit_result.go | 10 - dev/blobber/model/ref.go | 179 - dev/blobber/model/reference_path.go | 7 - dev/blobber/model/reference_path_result.go | 35 - dev/blobber/model/upload_form_data.go | 38 - dev/blobber/model/upload_result.go | 8 - dev/blobber/model/write_marker.go | 22 - dev/blobber/ref.go | 23 - dev/mock/response.go | 34 - dev/server.go | 36 - go.mod | 1 + go.sum | 2 + mobilesdk/sdk/common.go | 2 +- mobilesdk/sdk/keys.go | 2 +- mobilesdk/sdk/sdk.go | 20 +- mobilesdk/sdk/sign.go | 8 +- mobilesdk/zbox/allocation.go | 6 +- mobilesdk/zbox/models.go | 2 +- mobilesdk/zbox/storage.go | 2 +- mobilesdk/zbox/streaming.go | 2 +- mobilesdk/zboxapi/client.go | 6 +- mobilesdk/zcn/transaction_query.go | 2 +- mobilesdk/zcn/writepool.go | 3 +- sdks/blobber/blobber.go | 23 - sdks/blobber/doc.go | 2 - sdks/blobber/endpoints.go | 12 - sdks/client.go | 51 - sdks/doc.go | 2 - sdks/request.go | 21 - sdks/zbox.go | 146 - wasmsdk/README.md | 2 +- wasmsdk/allocation.go | 6 +- wasmsdk/auth_txn.go | 6 +- wasmsdk/blobber.go | 20 +- wasmsdk/bridge.go | 10 +- wasmsdk/cache.go | 4 +- wasmsdk/common.go | 4 +- wasmsdk/demo/main.go | 4 +- wasmsdk/ethwallet.go | 2 +- wasmsdk/jsbridge/file_reader.go | 2 +- wasmsdk/jsbridge/file_writer.go | 2 +- wasmsdk/jsbridge/template_data.go | 2 +- wasmsdk/player_file.go | 4 +- wasmsdk/player_stream.go | 6 +- wasmsdk/proxy.go | 14 +- wasmsdk/sdk.go | 14 +- wasmsdk/statusbar.go | 2 +- wasmsdk/tokenrate.go | 2 +- wasmsdk/wallet.go | 6 +- wasmsdk/wallet_base.go | 2 +- wasmsdk/zbox.go | 2 +- wasmsdk/zcn.go | 4 +- winsdk/allocation.go | 4 +- winsdk/cache.go | 2 +- winsdk/helper.go | 4 +- winsdk/sdk.go | 20 +- winsdk/storage.go | 4 +- winsdk/wallet.go | 4 +- winsdk/zboxapi.go | 6 +- zboxapi/sdk.go | 8 +- zboxcore/allocationchange/change.go | 2 +- zboxcore/allocationchange/copyobject.go | 8 +- zboxcore/allocationchange/createdir.go | 6 +- zboxcore/allocationchange/deletefile.go | 4 +- zboxcore/allocationchange/moveobject.go | 8 +- zboxcore/allocationchange/newfile.go | 10 +- zboxcore/allocationchange/renameobject.go | 6 +- zboxcore/allocationchange/updatefile.go | 6 +- zboxcore/blockchain/entity.go | 2 +- zboxcore/encoder/erasurecode.go | 2 +- zboxcore/encryption/pre_test.go | 2 +- zboxcore/fileref/fileref.go | 4 +- zboxcore/fileref/hashnode.go | 2 +- zboxcore/fileref/hashnode_test.go | 2 +- zboxcore/logger/logger.go | 2 +- zboxcore/marker/authticket.go | 4 +- zboxcore/marker/deletetoken.go | 4 +- zboxcore/marker/readmarker.go | 8 +- zboxcore/marker/writemarker.go | 6 +- zboxcore/mocks/AllocationChange.go | 2 +- zboxcore/mocks/EncryptionScheme.go | 2 +- zboxcore/mocks/RefEntity.go | 2 +- zboxcore/sdk/allocation.go | 24 +- zboxcore/sdk/allocation_file_delete_test.go | 12 +- zboxcore/sdk/allocation_file_test.go | 17 +- zboxcore/sdk/allocation_test.go | 22 +- zboxcore/sdk/authticket.go | 4 +- zboxcore/sdk/blobber_operations.go | 8 +- zboxcore/sdk/blockdownloadworker.go | 14 +- zboxcore/sdk/chunked_upload.go | 20 +- zboxcore/sdk/chunked_upload_bench_test.go | 6 +- zboxcore/sdk/chunked_upload_blobber.go | 12 +- zboxcore/sdk/chunked_upload_chunk_reader.go | 6 +- .../chunked_upload_chunk_reader_bench_test.go | 2 +- .../sdk/chunked_upload_chunk_reader_test.go | 2 +- zboxcore/sdk/chunked_upload_form_builder.go | 4 +- zboxcore/sdk/chunked_upload_hasher.go | 4 +- zboxcore/sdk/chunked_upload_model.go | 6 +- zboxcore/sdk/chunked_upload_process_js.go | 8 +- .../sdk/chunked_upload_progress_storer.go | 6 +- zboxcore/sdk/chunked_upload_web_streaming.go | 2 +- zboxcore/sdk/commitworker.go | 14 +- zboxcore/sdk/common.go | 8 +- zboxcore/sdk/copyworker.go | 14 +- zboxcore/sdk/copyworker_test.go | 17 +- zboxcore/sdk/deleteworker.go | 12 +- zboxcore/sdk/deleteworker_test.go | 13 +- zboxcore/sdk/dirworker.go | 12 +- zboxcore/sdk/download_progress_storer.go | 2 +- zboxcore/sdk/downloader.go | 4 +- zboxcore/sdk/downloader_option.go | 2 +- zboxcore/sdk/downloadworker.go | 20 +- zboxcore/sdk/filemetaworker.go | 8 +- zboxcore/sdk/filemetaworker_test.go | 13 +- zboxcore/sdk/filerefsworker.go | 10 +- zboxcore/sdk/filestatsworker.go | 6 +- zboxcore/sdk/filestatsworker_test.go | 13 +- zboxcore/sdk/listworker.go | 10 +- zboxcore/sdk/listworker_test.go | 13 +- zboxcore/sdk/live_upload_reader.go | 2 +- zboxcore/sdk/m3u8.go | 2 +- zboxcore/sdk/moveworker.go | 12 +- zboxcore/sdk/multi_operation_worker.go | 10 +- zboxcore/sdk/playlist.go | 12 +- zboxcore/sdk/reader.go | 2 +- zboxcore/sdk/renameworker.go | 12 +- zboxcore/sdk/renameworker_test.go | 17 +- zboxcore/sdk/repairCallback.go | 2 +- zboxcore/sdk/repairworker.go | 8 +- zboxcore/sdk/rollback.go | 8 +- zboxcore/sdk/sdk.go | 20 +- zboxcore/sdk/sharerequest.go | 12 +- zboxcore/sdk/sync.go | 8 +- zboxcore/sdk/upload_worker.go | 8 +- zboxcore/sdk/writemarker_mutex.go | 6 +- zboxcore/sdk/writemarker_mutex_test.go | 5 +- zboxcore/zboxutil/download_buffer.go | 2 +- zboxcore/zboxutil/http.go | 6 +- zboxcore/zboxutil/util.go | 2 +- zcnbridge/README.MD | 970 ---- zcnbridge/authorizer/doc.go | 3 - zcnbridge/authorizer/proofBurnTicket.go | 88 - zcnbridge/authorizer/proofBurnTicket_test.go | 72 - zcnbridge/authorizer_response.go | 124 - zcnbridge/authorizers_query.go | 351 -- zcnbridge/bridge.go | 1157 ----- zcnbridge/bridge_helper.go | 105 - zcnbridge/bridge_test.go | 639 --- zcnbridge/config.go | 169 - zcnbridge/crypto/hash.go | 46 - zcnbridge/doc.go | 4 - zcnbridge/errors/errors.go | 109 - zcnbridge/errors/errors_test.go | 243 - zcnbridge/ethereum/authorizers/authorizers.go | 639 --- zcnbridge/ethereum/bridge/bridge.go | 1032 ----- zcnbridge/ethereum/doc.go | 3 - zcnbridge/ethereum/mint_payload.go | 29 - zcnbridge/ethereum/nftconfig/nftconfig.go | 656 --- .../ethereum/uniswapnetwork/uniswapnetwork.go | 536 --- .../ethereum/uniswaprouter/uniswaprouter.go | 777 ---- zcnbridge/ethereum/zcntoken/zcntoken.go | 1336 ------ zcnbridge/http/client.go | 42 - zcnbridge/http/doc.go | 2 - zcnbridge/keystore.go | 202 - zcnbridge/log/doc.go | 2 - zcnbridge/log/handler.go | 57 - zcnbridge/log/logging.go | 93 - zcnbridge/mocks/EthereumClient.go | 332 -- zcnbridge/mocks/JobResult.go | 74 - zcnbridge/mocks/KeyStore.go | 112 - zcnbridge/mocks/doc.go | 2 - zcnbridge/rest.go | 116 - zcnbridge/time/doc.go | 2 - zcnbridge/time/time.go | 34 - zcnbridge/transaction/const.go | 62 - zcnbridge/transaction/doc.go | 2 - zcnbridge/utils/convert.go | 18 - zcnbridge/wallet/doc.go | 2 - zcnbridge/wallet/status.go | 152 - zcnbridge/wallet/wallet.go | 33 - zcnbridge/wallets/README.md | 1 - ...--d8c9156e782c68ee671c09b6b92de76c97948432 | 1 - zcnbridge/zcnsc/burn_event.go | 6 - zcnbridge/zcnsc/burn_payload.go | 18 - zcnbridge/zcnsc/burn_ticket.go | 7 - zcnbridge/zcnsc/doc.go | 2 - zcnbridge/zcnsc/mint_payload.go | 26 - zcncore/doc.go | 2 - zcncore/ethhdwallet/hdwallet.go | 558 --- zcncore/ethhdwallet/hdwallet_test.go | 344 -- zcncore/ethwallet.go | 10 - zcncore/ethwallet_base.go | 321 -- zcncore/ethwallet_base_test.go | 286 -- zcncore/execute_transactions.go | 222 - zcncore/get_data.go | 424 -- zcncore/transaction.go | 171 - zcncore/wallet.go | 28 - zcncore/wallet_base.go | 428 -- zcncore/wallet_base_test.go | 37 - zcncore/wallet_callback.go | 28 - zcncore/wallet_mobile.go | 40 - zcncore/zauth.go | 601 --- znft/README.MD | 1308 ------ ...02057996-nft_dstorage_activity_diagram.png | Bin 430030 -> 0 bytes znft/contracts/doc.go | 2 - .../dstorageerc721/binding/dstorageerc721.go | 2660 ----------- .../binding/dstorageerc721fixed.go | 2930 ------------ .../binding/dstorageerc721pack.go | 3731 ---------------- .../binding/dstorageerc721random.go | 3925 ----------------- znft/contracts/factory/binding/factory.go | 862 ---- .../binding/factorymoduleerc721.go | 201 - .../binding/factorymoduleerc721fixed.go | 201 - .../binding/factorymoduleerc721pack.go | 201 - .../binding/factorymoduleerc721random.go | 201 - znft/doc.go | 4 - znft/ethereum_wallet.go | 110 - znft/example/go.mod | 32 - znft/example/go.sum | 188 - znft/example/main.go | 141 - znft/factoryerc721.go | 48 - znft/factoryerc721fixed.go | 47 - znft/factoryerc721pack.go | 47 - znft/factoryerc721random.go | 47 - znft/keystore.go | 156 - znft/storageerc721.go | 347 -- znft/storageerc721fixed.go | 297 -- znft/storageerc721pack.go | 344 -- znft/storageerc721random.go | 154 - znft/transaction.go | 52 - znft/znft.go | 505 --- 336 files changed, 432 insertions(+), 44372 deletions(-) delete mode 100644 constants/context_key.go delete mode 100644 constants/errors.go delete mode 100644 constants/files.go delete mode 100644 constants/signscheme.go delete mode 100644 core/block/block.go delete mode 100644 core/block/magic_block_entity.go delete mode 100644 core/build.go delete mode 100644 core/client/cache.go delete mode 100644 core/client/http.go delete mode 100644 core/client/init_node.go delete mode 100644 core/client/node.go delete mode 100644 core/client/set.go delete mode 100644 core/common/math.go delete mode 100644 core/common/math_test.go delete mode 100644 core/common/misc.go delete mode 100644 core/common/misc_test.go delete mode 100644 core/common/time.go delete mode 100644 core/common/time_test.go delete mode 100644 core/common/utils.go delete mode 100644 core/conf/config.go delete mode 100644 core/conf/config_test.go delete mode 100644 core/conf/mocks/Reader.go delete mode 100644 core/conf/mocks/doc.go delete mode 100644 core/conf/network.go delete mode 100644 core/conf/reader.go delete mode 100644 core/conf/reader_test.go delete mode 100644 core/conf/vars.go delete mode 100644 core/encryption/hash.go delete mode 100644 core/imageutil/thumbnailer.go delete mode 100644 core/logger/logger.go delete mode 100644 core/pathutil/path.go delete mode 100644 core/pathutil/path_test.go delete mode 100644 core/resty/client.go delete mode 100644 core/resty/client_wasm.go delete mode 100644 core/resty/doc.go delete mode 100644 core/resty/mocks/Client.go delete mode 100644 core/resty/mocks/doc.go delete mode 100644 core/resty/mocks/timeout.go delete mode 100644 core/resty/option.go delete mode 100644 core/resty/resty.go delete mode 100644 core/resty/resty_test.go delete mode 100644 core/resty/result.go delete mode 100644 core/resty/transport.go delete mode 100644 core/resty/transport_wasm.go delete mode 100644 core/resty/vars.go delete mode 100644 core/screstapi/http.go delete mode 100644 core/sys/doc.go delete mode 100644 core/sys/fs.go delete mode 100644 core/sys/fs_disk.go delete mode 100644 core/sys/fs_mem.go delete mode 100644 core/sys/sign.go delete mode 100644 core/sys/util.go delete mode 100644 core/sys/vars.go delete mode 100644 core/tokenrate/bancor.go delete mode 100644 core/tokenrate/bancor_test.go delete mode 100644 core/tokenrate/coingecko.go delete mode 100644 core/tokenrate/coinmarketcap.go delete mode 100644 core/tokenrate/doc.go delete mode 100644 core/tokenrate/mockresponses/bancor.json delete mode 100644 core/tokenrate/mockresponses/coingecko.json delete mode 100644 core/tokenrate/mockresponses/coinmarketcap.json delete mode 100644 core/tokenrate/tokenrate.go delete mode 100644 core/tokenrate/tokenrate_test.go delete mode 100644 core/tokenrate/uniswap.go delete mode 100644 core/transaction/entity.go delete mode 100644 core/transaction/entity_test.go delete mode 100644 core/transaction/get_data.go delete mode 100644 core/transaction/transaction.go delete mode 100644 core/transaction/transport.go delete mode 100644 core/transaction/transport_wasm.go delete mode 100644 core/transaction/type.go delete mode 100644 core/transaction/utils.go delete mode 100644 core/transaction/vars.go delete mode 100644 core/util/doc.go delete mode 100644 core/util/fixed_merkle_tree.go delete mode 100644 core/util/fixed_merkle_tree_test.go delete mode 100644 core/util/http_consensus_maps.go delete mode 100644 core/util/httpnet.go delete mode 100644 core/util/merkle_tree.go delete mode 100644 core/util/merkle_tree_interface.go delete mode 100644 core/util/rand.go delete mode 100644 core/util/rand_test.go delete mode 100644 core/util/secure_value.go delete mode 100644 core/util/transport.go delete mode 100644 core/util/transport_wasm.go delete mode 100644 core/util/uint64.go delete mode 100644 core/util/uuid.go delete mode 100644 core/util/validation_tree.go delete mode 100644 core/util/validation_tree_test.go delete mode 100644 core/version/.emptydir delete mode 100644 core/version/doc.go delete mode 100644 core/version/version.go delete mode 100644 core/zcncrypto/bls.go delete mode 100644 core/zcncrypto/bls0chain_herumi.go delete mode 100644 core/zcncrypto/bls0chain_herumi_test.go delete mode 100644 core/zcncrypto/bls0chain_test.go delete mode 100644 core/zcncrypto/bls0chain_wasm.go delete mode 100644 core/zcncrypto/bls_herumi.go delete mode 100644 core/zcncrypto/ed255190chain.go delete mode 100644 core/zcncrypto/ed25519_test.go delete mode 100644 core/zcncrypto/factory.go delete mode 100644 core/zcncrypto/factory_wasm.go delete mode 100644 core/zcncrypto/signature_scheme.go delete mode 100644 dev/blobber/handlers.go delete mode 100644 dev/blobber/init.go delete mode 100644 dev/blobber/model/commit_result.go delete mode 100644 dev/blobber/model/ref.go delete mode 100644 dev/blobber/model/reference_path.go delete mode 100644 dev/blobber/model/reference_path_result.go delete mode 100644 dev/blobber/model/upload_form_data.go delete mode 100644 dev/blobber/model/upload_result.go delete mode 100644 dev/blobber/model/write_marker.go delete mode 100644 dev/blobber/ref.go delete mode 100644 dev/mock/response.go delete mode 100644 dev/server.go delete mode 100644 sdks/blobber/blobber.go delete mode 100644 sdks/blobber/doc.go delete mode 100644 sdks/blobber/endpoints.go delete mode 100644 sdks/client.go delete mode 100644 sdks/doc.go delete mode 100644 sdks/request.go delete mode 100644 sdks/zbox.go delete mode 100644 zcnbridge/README.MD delete mode 100644 zcnbridge/authorizer/doc.go delete mode 100644 zcnbridge/authorizer/proofBurnTicket.go delete mode 100644 zcnbridge/authorizer/proofBurnTicket_test.go delete mode 100644 zcnbridge/authorizer_response.go delete mode 100644 zcnbridge/authorizers_query.go delete mode 100644 zcnbridge/bridge.go delete mode 100644 zcnbridge/bridge_helper.go delete mode 100644 zcnbridge/bridge_test.go delete mode 100644 zcnbridge/config.go delete mode 100644 zcnbridge/crypto/hash.go delete mode 100644 zcnbridge/doc.go delete mode 100644 zcnbridge/errors/errors.go delete mode 100644 zcnbridge/errors/errors_test.go delete mode 100644 zcnbridge/ethereum/authorizers/authorizers.go delete mode 100644 zcnbridge/ethereum/bridge/bridge.go delete mode 100644 zcnbridge/ethereum/doc.go delete mode 100644 zcnbridge/ethereum/mint_payload.go delete mode 100644 zcnbridge/ethereum/nftconfig/nftconfig.go delete mode 100644 zcnbridge/ethereum/uniswapnetwork/uniswapnetwork.go delete mode 100644 zcnbridge/ethereum/uniswaprouter/uniswaprouter.go delete mode 100644 zcnbridge/ethereum/zcntoken/zcntoken.go delete mode 100644 zcnbridge/http/client.go delete mode 100644 zcnbridge/http/doc.go delete mode 100644 zcnbridge/keystore.go delete mode 100644 zcnbridge/log/doc.go delete mode 100644 zcnbridge/log/handler.go delete mode 100644 zcnbridge/log/logging.go delete mode 100644 zcnbridge/mocks/EthereumClient.go delete mode 100644 zcnbridge/mocks/JobResult.go delete mode 100644 zcnbridge/mocks/KeyStore.go delete mode 100644 zcnbridge/mocks/doc.go delete mode 100644 zcnbridge/rest.go delete mode 100644 zcnbridge/time/doc.go delete mode 100644 zcnbridge/time/time.go delete mode 100644 zcnbridge/transaction/const.go delete mode 100644 zcnbridge/transaction/doc.go delete mode 100644 zcnbridge/utils/convert.go delete mode 100644 zcnbridge/wallet/doc.go delete mode 100644 zcnbridge/wallet/status.go delete mode 100644 zcnbridge/wallet/wallet.go delete mode 100644 zcnbridge/wallets/README.md delete mode 100644 zcnbridge/wallets/UTC--2023-08-29T19-30-47.946612000Z--d8c9156e782c68ee671c09b6b92de76c97948432 delete mode 100644 zcnbridge/zcnsc/burn_event.go delete mode 100644 zcnbridge/zcnsc/burn_payload.go delete mode 100644 zcnbridge/zcnsc/burn_ticket.go delete mode 100644 zcnbridge/zcnsc/doc.go delete mode 100644 zcnbridge/zcnsc/mint_payload.go delete mode 100644 zcncore/doc.go delete mode 100644 zcncore/ethhdwallet/hdwallet.go delete mode 100644 zcncore/ethhdwallet/hdwallet_test.go delete mode 100644 zcncore/ethwallet.go delete mode 100644 zcncore/ethwallet_base.go delete mode 100644 zcncore/ethwallet_base_test.go delete mode 100644 zcncore/execute_transactions.go delete mode 100644 zcncore/get_data.go delete mode 100644 zcncore/transaction.go delete mode 100644 zcncore/wallet.go delete mode 100644 zcncore/wallet_base.go delete mode 100644 zcncore/wallet_base_test.go delete mode 100644 zcncore/wallet_callback.go delete mode 100644 zcncore/wallet_mobile.go delete mode 100644 zcncore/zauth.go delete mode 100644 znft/README.MD delete mode 100644 znft/assets/1652602057996-nft_dstorage_activity_diagram.png delete mode 100644 znft/contracts/doc.go delete mode 100644 znft/contracts/dstorageerc721/binding/dstorageerc721.go delete mode 100644 znft/contracts/dstorageerc721fixed/binding/dstorageerc721fixed.go delete mode 100644 znft/contracts/dstorageerc721pack/binding/dstorageerc721pack.go delete mode 100644 znft/contracts/dstorageerc721random/binding/dstorageerc721random.go delete mode 100644 znft/contracts/factory/binding/factory.go delete mode 100644 znft/contracts/factorymoduleerc721/binding/factorymoduleerc721.go delete mode 100644 znft/contracts/factorymoduleerc721fixed/binding/factorymoduleerc721fixed.go delete mode 100644 znft/contracts/factorymoduleerc721pack/binding/factorymoduleerc721pack.go delete mode 100644 znft/contracts/factorymoduleerc721random/binding/factorymoduleerc721random.go delete mode 100644 znft/doc.go delete mode 100644 znft/ethereum_wallet.go delete mode 100644 znft/example/go.mod delete mode 100644 znft/example/go.sum delete mode 100644 znft/example/main.go delete mode 100644 znft/factoryerc721.go delete mode 100644 znft/factoryerc721fixed.go delete mode 100644 znft/factoryerc721pack.go delete mode 100644 znft/factoryerc721random.go delete mode 100644 znft/keystore.go delete mode 100644 znft/storageerc721.go delete mode 100644 znft/storageerc721fixed.go delete mode 100644 znft/storageerc721pack.go delete mode 100644 znft/storageerc721random.go delete mode 100644 znft/transaction.go delete mode 100644 znft/znft.go diff --git a/README.md b/README.md index 369499924..8bbe1af8f 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ This repository currently supports the following platforms: import ( "fmt" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) func main() { diff --git a/constants/context_key.go b/constants/context_key.go deleted file mode 100644 index 8ac44740a..000000000 --- a/constants/context_key.go +++ /dev/null @@ -1,27 +0,0 @@ -package constants - -// ContextKey type for key used to store values into context -type ContextKey string - -const ( - // ContextKeyAllocation represents key for context value for allocation - ContextKeyAllocation ContextKey = "allocation" - - // ContextKeyAllocationObject represents key for context value for allocation object - ContextKeyAllocationObject ContextKey = "allocation_object" - - // ContextKeyClient represents key for context value for client - ContextKeyClient ContextKey = "client" - - // ContextKeyClientKey represents key for context value for client key - ContextKeyClientKey ContextKey = "client_key" - - // ContextKeyClientID represents key for context value for allocation id - ContextKeyAllocationID ContextKey = "allocation_id" - - // ContextKeyClientSignatureHeaderKey represents key for context value passed with common.ClientSignatureHeader request header. - ContextKeyClientSignatureHeaderKey ContextKey = "signature" - - // ContextKeyClientSignatureHeaderV2Key represents key for context value passed with common.ClientSignatureHeaderV2 request header. - ContextKeyClientSignatureHeaderV2Key ContextKey = "signature_v2" -) diff --git a/constants/errors.go b/constants/errors.go deleted file mode 100644 index 703259889..000000000 --- a/constants/errors.go +++ /dev/null @@ -1,37 +0,0 @@ -// Package constants provides constants. -// The convention of naming is to use MixedCaps or mixedCaps rather than underscores to write multiword names. https://golang.org/doc/effective_go#mixed-caps -package constants - -import "errors" - -var ( - // ErrInvalidParameter parameter is not specified or invalid - ErrInvalidParameter = errors.New("invalid parameter") - - // ErrUnableHash failed to hash with unknown exception - ErrUnableHash = errors.New("unable to hash") - - // ErrUnableWriteFile failed to write bytes to file - ErrUnableWriteFile = errors.New("unable to write file") - - // ErrNotImplemented feature/method is not implemented yet - ErrNotImplemented = errors.New("Not Implemented") - - // ErrNotLockedWritMarker failed to lock WriteMarker - ErrNotLockedWritMarker = errors.New("failed to lock WriteMarker") - - // ErrNotUnlockedWritMarker failed to unlock WriteMarker - ErrNotUnlockedWritMarker = errors.New("failed to unlock WriteMarker") - - // ErrInvalidHashnode invalid hashnode - ErrInvalidHashnode = errors.New("invalid hashnode") - - // ErrBadRequest bad request - ErrBadRequest = errors.New("bad request") - - // ErrNotFound ref not found - ErrNotFound = errors.New("ref not found") - - // ErrFileOptionNotPermitted requested operation is not allowed on this allocation (file_options) - ErrFileOptionNotPermitted = errors.New("this options for this file is not permitted for this allocation") -) diff --git a/constants/files.go b/constants/files.go deleted file mode 100644 index 0051a1404..000000000 --- a/constants/files.go +++ /dev/null @@ -1,24 +0,0 @@ -package constants - -const ( - // FileOperationInsert method name of add new file - FileOperationInsert = "insert" - - // FileOperationDelete method name of delete file - FileOperationDelete = "delete" - - // FileOperationUpdate method name of update file - FileOperationUpdate = "update" - - // FileOperationRename method name of rename file - FileOperationRename = "rename" - - // FileOperationCopy method name of copy file - FileOperationCopy = "copy" - - // FileOperationMove method name of move file - FileOperationMove = "move" - - // FileOperationCreateDir method name of create directory - FileOperationCreateDir = "createdir" -) diff --git a/constants/signscheme.go b/constants/signscheme.go deleted file mode 100644 index f8d918751..000000000 --- a/constants/signscheme.go +++ /dev/null @@ -1,13 +0,0 @@ -package constants - -type SignScheme string - -const ( - ED25519 SignScheme = "ed25519" - BLS0CHAIN SignScheme = "bls0chain" -) - -func (s SignScheme) String() string { - return string(s) -} - diff --git a/core/block/block.go b/core/block/block.go deleted file mode 100644 index 385d4ab46..000000000 --- a/core/block/block.go +++ /dev/null @@ -1,95 +0,0 @@ -// Provides the data structures and methods to work with the block data structure. -// The block data structure is the core data structure in the 0chain protocol. -// It is used to store the transactions and the state of the system at a given point in time. -// The block data structure is used to create the blockchain, which is a chain of blocks that are linked together using the hash of the previous block. -package block - -import ( - "fmt" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/transaction" -) - -const GET_BLOCK_INFO = `/v1/block/get?` - -type Key []byte - -type Header struct { - Version string `json:"version,omitempty"` - CreationDate int64 `json:"creation_date,omitempty"` - Hash string `json:"hash,omitempty"` - MinerID string `json:"miner_id,omitempty"` - Round int64 `json:"round,omitempty"` - RoundRandomSeed int64 `json:"round_random_seed,omitempty"` - MerkleTreeRoot string `json:"merkle_tree_root,omitempty"` - StateHash string `json:"state_hash,omitempty"` - ReceiptMerkleTreeRoot string `json:"receipt_merkle_tree_root,omitempty"` - NumTxns int64 `json:"num_txns,omitempty"` -} - -// IsBlockExtends - check if the block extends the previous block -// - prevHash is the hash of the previous block -func (h *Header) IsBlockExtends(prevHash string) bool { - var data = fmt.Sprintf("%s:%s:%d:%d:%d:%s:%s", h.MinerID, prevHash, - h.CreationDate, h.Round, h.RoundRandomSeed, h.MerkleTreeRoot, - h.ReceiptMerkleTreeRoot) - return encryption.Hash(data) == h.Hash -} - -/*Block - data structure that holds the block data */ -type Block struct { - Header *Header `json:"-"` - - MinerID common.Key `json:"miner_id"` - Round int64 `json:"round"` - RoundRandomSeed int64 `json:"round_random_seed"` - RoundTimeoutCount int `json:"round_timeout_count"` - - Hash common.Key `json:"hash"` - Signature string `json:"signature"` - ChainID common.Key `json:"chain_id"` - ChainWeight float64 `json:"chain_weight"` - RunningTxnCount int64 `json:"running_txn_count"` - - Version string `json:"version"` - CreationDate common.Timestamp `json:"creation_date"` - - MagicBlockHash string `json:"magic_block_hash"` - PrevHash string `json:"prev_hash"` - - ClientStateHash Key `json:"state_hash"` - Txns []*transaction.Transaction `json:"transactions,omitempty"` - - // muted - - // VerificationTickets []*VerificationTicket `json:"verification_tickets,omitempty"` - // PrevBlockVerificationTickets []*VerificationTicket `json:"prev_verification_tickets,omitempty"` -} - -type ChainStats struct { - BlockSize int `json:"block_size"` - Count int `json:"count"` - CurrentRound int `json:"current_round"` - Delta int `json:"delta"` - LatestFinalizedRound int `json:"latest_finalized_round"` - Max float64 `json:"max"` - Mean float64 `json:"mean"` - Min float64 `json:"min"` - Percentile50 float64 `json:"percentile_50"` - Percentile90 float64 `json:"percentile_90"` - Percentile95 float64 `json:"percentile_95"` - Percentile99 float64 `json:"percentile_99"` - Rate15Min float64 `json:"rate_15_min"` - Rate1Min float64 `json:"rate_1_min"` - Rate5Min float64 `json:"rate_5_min"` - RateMean float64 `json:"rate_mean"` - StdDev float64 `json:"std_dev"` - TotalTxns int `json:"total_txns"` -} - -type FeeStats struct { - MaxFees common.Balance `json:"max_fees"` - MinFees common.Balance `json:"min_fees"` - MeanFees common.Balance `json:"mean_fees"` -} diff --git a/core/block/magic_block_entity.go b/core/block/magic_block_entity.go deleted file mode 100644 index fdf06adaa..000000000 --- a/core/block/magic_block_entity.go +++ /dev/null @@ -1,71 +0,0 @@ -package block - -import "time" - -type Node struct { - ID string `yaml:"id" json:"id"` - Version string `yaml:"version" json:"version"` - CreationDate int64 `json:"creation_date"` - PublicKey string `yaml:"public_key" json:"public_key"` - PrivateKey string `yaml:"private_key" json:"-"` - N2NHost string `yaml:"n2n_ip" json:"n2n_host"` - Host string `yaml:"public_ip" json:"host"` - Port int `yaml:"port" json:"port"` - Path string `yaml:"path" json:"path"` - Type int `json:"type"` - Description string `yaml:"description" json:"description"` - SetIndex int `yaml:"set_index" json:"set_index"` - Status int `json:"status"` - Info Info `json:"info"` -} - -type Info struct { - BuildTag string `json:"build_tag"` - StateMissingNodes int64 `json:"state_missing_nodes"` - MinersMedianNetworkTime time.Duration `json:"miners_median_network_time"` - AvgBlockTxns int `json:"avg_block_txns"` -} - -type NodePool struct { - Type int `json:"type"` - Nodes map[string]Node `json:"nodes"` -} - -type GroupSharesOrSigns struct { - Shares map[string]*ShareOrSigns `json:"shares"` -} - -type ShareOrSigns struct { - ID string `json:"id"` - ShareOrSigns map[string]*DKGKeyShare `json:"share_or_sign"` -} - -type DKGKeyShare struct { - ID string `json:"id"` - Message string `json:"message"` - Share string `json:"share"` - Sign string `json:"sign"` -} - -type Mpks struct { - Mpks map[string]*MPK -} - -type MPK struct { - ID string - Mpk []string -} - -type MagicBlock struct { - Hash string `json:"hash"` - PreviousMagicBlockHash string `json:"previous_hash"` - MagicBlockNumber int64 `json:"magic_block_number"` - StartingRound int64 `json:"starting_round"` - Miners *NodePool `json:"miners"` //this is the pool of miners participating in the blockchain - Sharders *NodePool `json:"sharders"` //this is the pool of sharders participaing in the blockchain - ShareOrSigns *GroupSharesOrSigns `json:"share_or_signs"` - Mpks *Mpks `json:"mpks"` - T int `json:"t"` - K int `json:"k"` - N int `json:"n"` -} diff --git a/core/build.go b/core/build.go deleted file mode 100644 index 97e341d61..000000000 --- a/core/build.go +++ /dev/null @@ -1,2 +0,0 @@ -// Provides some low-level functions and types that are used by the SDK. -package core diff --git a/core/client/cache.go b/core/client/cache.go deleted file mode 100644 index cfeb3566d..000000000 --- a/core/client/cache.go +++ /dev/null @@ -1,58 +0,0 @@ -package client - -import ( - "github.com/0chain/gosdk/core/logger" - "sync" -) - -var Cache *NonceCache -var once sync.Once - -type NonceCache struct { - cache map[string]int64 - guard sync.Mutex - sharders *NodeHolder -} - -func InitCache(sharders *NodeHolder) { - Cache.sharders = sharders -} - -func init() { - once.Do(func() { - Cache = &NonceCache{ - cache: make(map[string]int64), - } - }) -} - -func (nc *NonceCache) GetNextNonce(clientId string) int64 { - nc.guard.Lock() - defer nc.guard.Unlock() - if _, ok := nc.cache[clientId]; !ok { - bal, err := GetBalance(clientId) - if err != nil || bal == nil { - nc.cache[clientId] = 0 - } else { - nc.cache[clientId] = bal.Nonce - } - } - - nc.cache[clientId] += 1 - - logger.Log.Info("GetNextNonce", "clientId", clientId, "nonce", nc.cache[clientId]) - - return nc.cache[clientId] -} - -func (nc *NonceCache) Set(clientId string, nonce int64) { - nc.guard.Lock() - defer nc.guard.Unlock() - nc.cache[clientId] = nonce -} - -func (nc *NonceCache) Evict(clientId string) { - nc.guard.Lock() - defer nc.guard.Unlock() - delete(nc.cache, clientId) -} diff --git a/core/client/http.go b/core/client/http.go deleted file mode 100644 index 4572b366e..000000000 --- a/core/client/http.go +++ /dev/null @@ -1,187 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - "log" - "net/http" - "net/url" - "sync" - - "github.com/0chain/errors" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/util" - "github.com/shopspring/decimal" -) - -// SCRestAPIHandler is a function type to handle the response from the SC Rest API -// -// `response` - the response from the SC Rest API -// `numSharders` - the number of sharders that responded -// `err` - the error if any -type SCRestAPIHandler func(response map[string][]byte, numSharders int, err error) - -func MakeSCRestAPICallToSharder(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) ([]byte, error) { - const ( - consensusThresh = float32(25.0) - ScRestApiUrl = "v1/screst/" - ) - - restApiUrl := ScRestApiUrl - if len(restApiUrls) > 0 { - restApiUrl = restApiUrls[0] - } - - sharders := nodeClient.sharders.Healthy() - responses := make(map[int]int) - entityResult := make(map[string][]byte) - - var ( - retObj []byte - maxCount int - dominant = 200 - wg sync.WaitGroup - mu sync.Mutex // Mutex to protect shared resources - ) - - cfg, err := conf.GetClientConfig() - if err != nil { - return nil, err - } - - for _, sharder := range sharders { - wg.Add(1) - go func(sharder string) { - defer wg.Done() - - urlString := fmt.Sprintf("%v/%v%v%v", sharder, restApiUrl, scAddress, relativePath) - urlObj, err := url.Parse(urlString) - if err != nil { - log.Println(err.Error()) - return - } - q := urlObj.Query() - for k, v := range params { - q.Add(k, v) - } - urlObj.RawQuery = q.Encode() - - req, err := util.NewHTTPGetRequest(urlObj.String()) - if err != nil { - log.Println("Error creating request", err.Error()) - return - } - - response, err := req.Get() - if err != nil { - nodeClient.sharders.Fail(sharder) - log.Println("Error getting response", err.Error()) - return - } - - mu.Lock() // Lock before updating shared maps - defer mu.Unlock() - - if response.StatusCode > http.StatusBadRequest { - nodeClient.sharders.Fail(sharder) - } else { - nodeClient.sharders.Success(sharder) - } - - responses[response.StatusCode]++ - if responses[response.StatusCode] > maxCount { - maxCount = responses[response.StatusCode] - } - - if isCurrentDominantStatus(response.StatusCode, responses, maxCount) { - dominant = response.StatusCode - retObj = []byte(response.Body) - } - - entityResult[sharder] = []byte(response.Body) - nodeClient.sharders.Success(sharder) - }(sharder) - } - - wg.Wait() - - rate := float32(maxCount*100) / float32(cfg.SharderConsensous) - if rate < consensusThresh { - err = errors.New("consensus_failed", "consensus failed on sharders") - } - - if dominant != 200 { - var objmap map[string]json.RawMessage - err := json.Unmarshal(retObj, &objmap) - if err != nil { - return nil, errors.New("", string(retObj)) - } - - var parsed string - err = json.Unmarshal(objmap["error"], &parsed) - if err != nil || parsed == "" { - return nil, errors.New("", string(retObj)) - } - - return nil, errors.New("", parsed) - } - - if rate > consensusThresh { - return retObj, nil - } - return nil, err -} - -// isCurrentDominantStatus determines whether the current response status is the dominant status among responses. -// -// The dominant status is where the response status is counted the most. -// On tie-breakers, 200 will be selected if included. -// -// Function assumes runningTotalPerStatus can be accessed safely concurrently. -func isCurrentDominantStatus(respStatus int, currentTotalPerStatus map[int]int, currentMax int) bool { - // mark status as dominant if - // - running total for status is the max and response is 200 or - // - running total for status is the max and count for 200 is lower - return currentTotalPerStatus[respStatus] == currentMax && (respStatus == 200 || currentTotalPerStatus[200] < currentMax) -} - -func GetBalance(clientIDs ...string) (*GetBalanceResponse, error) { - const GetBalance = "client/get/balance" - var ( - balance GetBalanceResponse - err error - res []byte - ) - - var clientID string - if len(clientIDs) > 0 { - clientID = clientIDs[0] - } else { - clientID = Id() - } - - if res, err = MakeSCRestAPICallToSharder("", GetBalance, map[string]string{ - "client_id": clientID, - }, "v1/"); err != nil { - return nil, err - } - - if err = json.Unmarshal(res, &balance); err != nil { - return nil, err - } - - return &balance, nil -} - -type GetBalanceResponse struct { - Txn string `json:"txn"` - Round int64 `json:"round"` - Balance int64 `json:"balance"` - Nonce int64 `json:"nonce"` -} - -// ToToken converts Balance to ZCN tokens. -func (b GetBalanceResponse) ToToken() (float64, error) { - f, _ := decimal.New(b.Balance, -10).Float64() - return f, nil -} diff --git a/core/client/init_node.go b/core/client/init_node.go deleted file mode 100644 index d356f2071..000000000 --- a/core/client/init_node.go +++ /dev/null @@ -1,245 +0,0 @@ -package client - -import ( - "context" - "encoding/json" - "errors" - "math" - "net/http" - "reflect" - "sync" - "time" - - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/util" - "go.uber.org/zap" -) - -var ( - logging = logger.GetLogger() - nodeClient *Node - IsAppFlow = false -) - -// Node Maintains central states of SDK (client's context, network). -// Initialized through [Init] function. -// Use client.GetNode() to get its instance after Init is called. -type Node struct { - stableMiners []string - sharders *NodeHolder - network *conf.Network - clientCtx context.Context - - networkGuard sync.RWMutex -} - -func SetIsAppFlow(val bool) { - IsAppFlow = true -} - -// GetStableMiners Returns stable miner urls. -// Length of stable miners is depedent on config's MinSubmit and number of miners in network. -func (n *Node) GetStableMiners() []string { - n.networkGuard.RLock() - defer n.networkGuard.RUnlock() - return n.stableMiners -} - -// ResetStableMiners resets stable miners as a random permutation of network miners. -// Length of stable miners is depedent on config's MinSubmit and number of miners in network. -func (n *Node) ResetStableMiners() { - n.networkGuard.Lock() - defer n.networkGuard.Unlock() - cfg, _ := conf.GetClientConfig() - reqMiners := util.MaxInt(3, int(math.Ceil(float64(cfg.MinSubmit)*float64(len(n.network.Miners))/100))) - n.stableMiners = util.GetRandom(n.network.Miners, reqMiners) -} - -// GetMinShardersVerify Returns minimum sharders used for verification -func (n *Node) GetMinShardersVerify() int { - n.networkGuard.RLock() - defer n.networkGuard.RUnlock() - cfg, _ := conf.GetClientConfig() - minSharders := util.MaxInt(1, int(math.Ceil(float64(cfg.MinConfirmation)*float64(len(n.sharders.Healthy()))/100))) - logging.Info("Minimum sharders used for verify :", minSharders) - return minSharders -} - -// Sharders Returns NodeHolder instance -func (n *Node) Sharders() *NodeHolder { - n.networkGuard.RLock() - defer n.networkGuard.RUnlock() - return n.sharders -} - -// Network Returns network configuration -func (n *Node) Network() *conf.Network { - n.networkGuard.RLock() - defer n.networkGuard.RUnlock() - return n.network -} - -// ShouldUpdateNetwork Gets network details and return it as second value. -// First value is true iff current network details doesn't match existing network details. -// Use node.UpdateNetwork() method to set the new network. -func (n *Node) ShouldUpdateNetwork() (bool, *conf.Network, error) { - cfg, err := conf.GetClientConfig() - if err != nil { - return false, nil, err - } - network, err := GetNetwork(n.clientCtx) - if err != nil { - logging.Error("Failed to get network details ", zap.Error(err), zap.String("block_worker", cfg.BlockWorker)) - return false, nil, err - } - n.networkGuard.RLock() - defer n.networkGuard.RUnlock() - if reflect.DeepEqual(network, n.network) { - return false, network, nil - } - return true, network, nil -} - -// UpdateNetwork Use node.UpdateNetwork() method to set the new network. -func (n *Node) UpdateNetwork(network *conf.Network) error { - n.networkGuard.Lock() - defer n.networkGuard.Unlock() - cfg, err := conf.GetClientConfig() - if err != nil { - return err - } - n.network = network - n.sharders = NewHolder(n.network.Sharders, util.MinInt(len(n.network.Sharders), util.MaxInt(cfg.SharderConsensous, conf.DefaultSharderConsensous))) - InitCache(n.sharders) - return nil -} - -// Init Initializes SDK. -func Init(ctx context.Context, cfg conf.Config) error { - // validate - err := validate(&cfg) - if err != nil { - return err - } - - // set default value for options if unset - setOptionsDefaultValue(&cfg) - - //init packages - conf.InitClientConfig(&cfg) - - network, err := GetNetwork(ctx) - if err != nil { - logging.Error("Failed to get network details ", zap.Error(err), zap.Any("block_worker", cfg.BlockWorker)) - return err - } - - reqMiners := util.MaxInt(3, int(math.Ceil(float64(cfg.MinSubmit)*float64(len(network.Miners))/100))) - sharders := NewHolder(network.Sharders, util.MinInt(len(network.Sharders), util.MaxInt(cfg.SharderConsensous, conf.DefaultSharderConsensous))) - nodeClient = &Node{ - stableMiners: util.GetRandom(network.Miners, reqMiners), - sharders: sharders, - network: network, - clientCtx: ctx, - } - - InitCache(nodeClient.sharders) - - // update Network periodically - go func() { - ticker := time.NewTicker(time.Duration(1) * time.Hour) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - shouldUpdate, network, err := nodeClient.ShouldUpdateNetwork() - if err != nil { - logging.Error("error on ShouldUpdateNetwork check: ", err) - continue - } - if shouldUpdate { - if err = nodeClient.UpdateNetwork(network); err != nil { - logging.Error("error on updating network: ", err) - } - } - } - } - }() - - return nil -} - -// GetNode Returns Node instance. If this function is called before Init(), error is returned. -func GetNode() (*Node, error) { - if nodeClient != nil { - return nodeClient, nil - } - return nil, errors.New("0chain-sdk is not initialized") -} - -// GetNetwork gets current network details from 0chain network. -func GetNetwork(ctx context.Context) (*conf.Network, error) { - cfg, err := conf.GetClientConfig() - if err != nil { - return nil, err - } - networkUrl := cfg.BlockWorker + "/network" - networkGetCtx, networkGetCancelCtx := context.WithTimeout(ctx, 60*time.Second) - defer networkGetCancelCtx() - req, err := util.NewHTTPGetRequestContext(networkGetCtx, networkUrl) - if err != nil { - return nil, errors.New("Unable to create new http request with error: " + err.Error()) - } - res, err := req.Get() - if err != nil { - return nil, errors.New("Unable to get http request with error: " + err.Error()) - } - if res.StatusCode != http.StatusOK { - return nil, errors.New("Unable to get http request with status Ok: " + res.Status) - } - type network struct { - Miners []string `json:"miners"` - Sharders []string `json:"sharders"` - } - var n network - err = json.Unmarshal([]byte(res.Body), &n) - if err != nil { - return nil, errors.New("Error unmarshaling response :" + res.Body) - } - return conf.NewNetwork(n.Miners, n.Sharders) -} - -func validate(cfg *conf.Config) error { - if cfg.BlockWorker == "" { - return errors.New("chain BlockWorker can't be empty") - } - if cfg.SignatureScheme != string(constants.BLS0CHAIN) && cfg.SignatureScheme != string(constants.ED25519) { - return errors.New("invalid/unsupported signature scheme") - } - return nil -} - -func setOptionsDefaultValue(cfg *conf.Config) { - if cfg.MinSubmit <= 0 { - cfg.MinSubmit = conf.DefaultMinSubmit - } - if cfg.MinConfirmation <= 0 { - cfg.MinConfirmation = conf.DefaultMinConfirmation - } - if cfg.ConfirmationChainLength <= 0 { - cfg.ConfirmationChainLength = conf.DefaultConfirmationChainLength - } - if cfg.MaxTxnQuery <= 0 { - cfg.MaxTxnQuery = conf.DefaultMaxTxnQuery - } - if cfg.QuerySleepTime <= 0 { - cfg.QuerySleepTime = conf.DefaultQuerySleepTime - } - if cfg.SharderConsensous <= 0 { - cfg.SharderConsensous = conf.DefaultSharderConsensous - } -} diff --git a/core/client/node.go b/core/client/node.go deleted file mode 100644 index 6b994cede..000000000 --- a/core/client/node.go +++ /dev/null @@ -1,102 +0,0 @@ -// Provides functions and data structures to interact with the system nodes in the context of the blockchain network. -package client - -import ( - "sort" - "sync" -) - -const statSize = 20 - -type NodeHolder struct { - consensus int - guard sync.Mutex - stats map[string]*NodeStruct - nodes []string -} - -type NodeStruct struct { - id string - weight int64 - stats []int -} - -func NewHolder(nodes []string, consensus int) *NodeHolder { - if len(nodes) < consensus { - panic("consensus is not correct") - } - holder := NodeHolder{consensus: consensus, stats: make(map[string]*NodeStruct)} - - for _, n := range nodes { - holder.nodes = append(holder.nodes, n) - holder.stats[n] = NewNode(n) - } - return &holder -} - -func NewNode(id string) *NodeStruct { - return &NodeStruct{ - id: id, - weight: 1, - stats: []int{1}, - } -} - -func (h *NodeHolder) Success(id string) { - h.guard.Lock() - defer h.guard.Unlock() - h.adjustNode(id, 1) -} - -func (h *NodeHolder) Fail(id string) { - h.guard.Lock() - defer h.guard.Unlock() - h.adjustNode(id, -1) -} - -func (h *NodeHolder) adjustNode(id string, res int) { - n := NewNode(id) - nodes := h.nodes - if node, ok := h.stats[id]; ok { - for i, v := range nodes { - if v == id { - nodes = append(nodes[:i], nodes[i+1:]...) - break - } - } - - sourceStats := node.stats - sourceStats = append(sourceStats, res) - if len(sourceStats) > statSize { - sourceStats = sourceStats[1:] - } - node.stats = sourceStats - - w := int64(0) - for i, s := range sourceStats { - w += int64(i+1) * int64(s) - } - node.weight = w - - n = node - } - - i := sort.Search(len(nodes), func(i int) bool { - return h.stats[nodes[i]].weight < n.weight - }) - h.nodes = append(nodes[:i], append([]string{n.id}, nodes[i:]...)...) -} - -func (h *NodeHolder) Healthy() (res []string) { - h.guard.Lock() - defer h.guard.Unlock() - - return h.nodes[:h.consensus] -} - -func (h *NodeHolder) All() (res []string) { - h.guard.Lock() - defer h.guard.Unlock() - - return h.nodes -} diff --git a/core/client/set.go b/core/client/set.go deleted file mode 100644 index f0ba52ad4..000000000 --- a/core/client/set.go +++ /dev/null @@ -1,392 +0,0 @@ -package client - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "strings" - - "github.com/0chain/gosdk/core/conf" - - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/zcncrypto" -) - -var ( - client Client - sdkInitialized bool - - Sign SignFunc - sigC = make(chan struct{}, 1) -) - -type SignFunc func(hash string, clients ...string) (string, error) - -// maintains client's information -type Client struct { - wallet *zcncrypto.Wallet - wallets map[string]*zcncrypto.Wallet - signatureScheme string - splitKeyWallet bool - authUrl string - nonce int64 - txnFee uint64 - sign SignFunc -} - -type InitSdkOptions struct { - WalletJSON string - BlockWorker string - ChainID string - SignatureScheme string - Nonce int64 - IsSplitWallet bool - AddWallet bool - TxnFee *int - MinConfirmation *int - MinSubmit *int - ConfirmationChainLength *int - SharderConsensous *int - ZboxHost string - ZboxAppType string -} - -func init() { - sys.Sign = signHash - sys.SignWithAuth = signHash - - sigC <- struct{}{} - - // initialize SignFunc as default implementation - Sign = func(hash string, clients ...string) (string, error) { - wallet := client.wallet - - if len(clients) > 0 && clients[0] != "" && client.wallets[clients[0]] != nil { - wallet = client.wallets[clients[0]] - } - - if !wallet.IsSplit { - return sys.Sign(hash, client.signatureScheme, GetClientSysKeys(clients...)) - } - - // get sign lock - <-sigC - fmt.Println("Sign: with sys.SignWithAuth:", sys.SignWithAuth, "sysKeys:", GetClientSysKeys(clients...)) - sig, err := sys.SignWithAuth(hash, client.signatureScheme, GetClientSysKeys(clients...)) - sigC <- struct{}{} - return sig, err - } - - sys.Verify = verifySignature - sys.VerifyWith = verifySignatureWith - sys.VerifyEd25519With = verifyEd25519With -} - -var SignFn = func(hash string) (string, error) { - ss := zcncrypto.NewSignatureScheme(client.signatureScheme) - - err := ss.SetPrivateKey(client.wallet.Keys[0].PrivateKey) - if err != nil { - return "", err - } - - return ss.Sign(hash) -} - -func signHash(hash string, signatureScheme string, keys []sys.KeyPair) (string, error) { - retSignature := "" - for _, kv := range keys { - ss := zcncrypto.NewSignatureScheme(signatureScheme) - - err := ss.SetPrivateKey(kv.PrivateKey) - if err != nil { - return "", err - } - - if len(retSignature) == 0 { - retSignature, err = ss.Sign(hash) - } else { - retSignature, err = ss.Add(retSignature, hash) - } - if err != nil { - return "", err - } - } - - return retSignature, nil -} - -func verifySignature(signature string, msg string) (bool, error) { - ss := zcncrypto.NewSignatureScheme(client.signatureScheme) - if err := ss.SetPublicKey(client.wallet.ClientKey); err != nil { - return false, err - } - - return ss.Verify(signature, msg) -} - -func verifySignatureWith(pubKey, signature, hash string) (bool, error) { - sch := zcncrypto.NewSignatureScheme(client.signatureScheme) - err := sch.SetPublicKey(pubKey) - if err != nil { - return false, err - } - return sch.Verify(signature, hash) -} - -func verifyEd25519With(pubKey, signature, hash string) (bool, error) { - sch := zcncrypto.NewSignatureScheme(constants.ED25519.String()) - err := sch.SetPublicKey(pubKey) - if err != nil { - return false, err - } - return sch.Verify(signature, hash) -} - -func GetClientSysKeys(clients ...string) []sys.KeyPair { - var wallet *zcncrypto.Wallet - if len(clients) > 0 && clients[0] != "" && client.wallets[clients[0]] != nil { - wallet = client.wallets[clients[0]] - } else { - wallet = client.wallet - } - - var keys []sys.KeyPair - for _, kv := range wallet.Keys { - keys = append(keys, sys.KeyPair{ - PrivateKey: kv.PrivateKey, - PublicKey: kv.PublicKey, - }) - } - - return keys -} - -// SetWallet should be set before any transaction or client specific APIs -func SetWallet(w zcncrypto.Wallet) { - client.wallet = &w - if client.wallets == nil { - client.wallets = make(map[string]*zcncrypto.Wallet) - } - client.wallets[w.ClientID] = &w -} - -// SetWalletMode sets current wallet split key mode. -func SetWalletMode(mode bool) { - if client.wallet != nil { - client.wallet.IsSplit = mode - } -} - -// splitKeyWallet parameter is valid only if SignatureScheme is "BLS0Chain" -func SetSplitKeyWallet(isSplitKeyWallet bool) error { - if client.signatureScheme == constants.BLS0CHAIN.String() { - client.splitKeyWallet = isSplitKeyWallet - } - return nil -} - -// SetAuthUrl will be called by app to set zauth URL to SDK -func SetAuthUrl(url string) error { - if !client.splitKeyWallet { - return errors.New("wallet type is not split key") - } - if url == "" { - return errors.New("invalid auth url") - } - client.authUrl = strings.TrimRight(url, "/") - return nil -} - -func SetNonce(n int64) { - client.nonce = n -} - -func SetTxnFee(f uint64) { - client.txnFee = f -} - -func SetSignatureScheme(signatureScheme string) { - if signatureScheme != constants.BLS0CHAIN.String() && signatureScheme != constants.ED25519.String() { - panic("invalid/unsupported signature scheme") - } - client.signatureScheme = signatureScheme -} - -func Wallet() *zcncrypto.Wallet { - return client.wallet -} - -func SignatureScheme() string { - return client.signatureScheme -} - -func SplitKeyWallet() bool { - return client.splitKeyWallet -} - -func AuthUrl() string { - return client.authUrl -} - -func Nonce() int64 { - return client.nonce -} - -func TxnFee() uint64 { - return client.txnFee -} - -func IsWalletSet() bool { - return client.wallet.ClientID != "" -} - -func PublicKey(clients ...string) string { - if len(clients) > 0 && clients[0] != "" && client.wallets[clients[0]] != nil { - if client.wallets[clients[0]] == nil { - fmt.Println("Public key is empty") - return "" - } - return client.wallets[clients[0]].ClientKey - } - return client.wallet.ClientKey -} - -func Mnemonic() string { - return client.wallet.Mnemonic -} - -func PrivateKey() string { - for _, kv := range client.wallet.Keys { - return kv.PrivateKey - } - return "" -} - -func Id(clients ...string) string { - if len(clients) > 0 && clients[0] != "" && client.wallets[clients[0]] != nil { - if client.wallets[clients[0]] == nil { - fmt.Println("Id is empty : ", clients[0]) - return "" - } - return client.wallets[clients[0]].ClientID - } - return client.wallet.ClientID -} - -func GetWallet() *zcncrypto.Wallet { - return client.wallet -} - -func GetClient() *zcncrypto.Wallet { - return client.wallet -} - -// InitSDK Initialize the storage SDK -// -// - walletJSON: Client's wallet JSON -// - blockWorker: Block worker URL (block worker refers to 0DNS) -// - chainID: ID of the blokcchain network -// - signatureScheme: Signature scheme that will be used for signing transactions -// - preferredBlobbers: List of preferred blobbers to use when creating an allocation. This is usually configured by the client in the configuration files -// - nonce: Initial nonce value for the transactions -// - fee: Preferred value for the transaction fee, just the first value is taken -func InitSDK(walletJSON string, - blockWorker, chainID, signatureScheme string, - nonce int64, addWallet bool, - options ...int) error { - - if addWallet { - wallet := zcncrypto.Wallet{} - err := json.Unmarshal([]byte(walletJSON), &wallet) - if err != nil { - return err - } - - SetWallet(wallet) - SetSignatureScheme(signatureScheme) - SetNonce(nonce) - if len(options) > 0 { - SetTxnFee(uint64(options[0])) - } - } - - var minConfirmation, minSubmit, confirmationChainLength, sharderConsensous int - if len(options) > 1 { - minConfirmation = options[1] - } - if len(options) > 2 { - minSubmit = options[2] - } - if len(options) > 3 { - confirmationChainLength = options[3] - } - if len(options) > 4 { - sharderConsensous = options[4] - } - - err := Init(context.Background(), conf.Config{ - BlockWorker: blockWorker, - SignatureScheme: signatureScheme, - ChainID: chainID, - MinConfirmation: minConfirmation, - MinSubmit: minSubmit, - ConfirmationChainLength: confirmationChainLength, - SharderConsensous: sharderConsensous, - }) - if err != nil { - return err - } - SetSdkInitialized(true) - return nil -} - -func InitSDKWithWebApp(params InitSdkOptions) error { - err := InitSDK(params.WalletJSON, params.BlockWorker, params.ChainID, params.SignatureScheme, params.Nonce, params.AddWallet, *params.MinConfirmation, *params.MinSubmit, *params.ConfirmationChainLength, *params.SharderConsensous) - if err != nil { - return err - } - conf.SetZboxAppConfigs(params.ZboxHost, params.ZboxAppType) - SetIsAppFlow(true) - return nil -} - -func IsSDKInitialized() bool { - return sdkInitialized -} - -func SetSdkInitialized(val bool) { - sdkInitialized = val -} - -func PopulateClient(walletJSON, signatureScheme string) (zcncrypto.Wallet, error) { - wallet := zcncrypto.Wallet{} - err := json.Unmarshal([]byte(walletJSON), &wallet) - if err != nil { - return wallet, err - } - - SetWallet(wallet) - SetSignatureScheme(signatureScheme) - return wallet, nil -} - -func VerifySignature(signature string, msg string) (bool, error) { - ss := zcncrypto.NewSignatureScheme(client.signatureScheme) - if err := ss.SetPublicKey(PublicKey()); err != nil { - return false, err - } - - return ss.Verify(signature, msg) -} - -func VerifySignatureWith(pubKey, signature, hash string) (bool, error) { - sch := zcncrypto.NewSignatureScheme(client.signatureScheme) - err := sch.SetPublicKey(pubKey) - if err != nil { - return false, err - } - return sch.Verify(signature, hash) -} diff --git a/core/common/math.go b/core/common/math.go deleted file mode 100644 index 0b9bbf59e..000000000 --- a/core/common/math.go +++ /dev/null @@ -1,33 +0,0 @@ -package common - -import ( - "errors" - "math" -) - -func TryAddInt(a, b int) (int, error) { - if a > 0 && b > 0 { - if math.MaxInt-a < b { - return 0, errors.New("math: integer overflow") - } - - } - - if a < 0 && b < 0 { - if math.MinInt-a > b { - return 0, errors.New("math: integer underflow") - } - - } - - return a + b, nil -} - -func MustAddInt(a, b int) int { - i, err := TryAddInt(a, b) - if err != nil { - panic(err.Error()) - } - - return i -} diff --git a/core/common/math_test.go b/core/common/math_test.go deleted file mode 100644 index 0959f05b5..000000000 --- a/core/common/math_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package common - -import ( - "math" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestMathAddInt(t *testing.T) { - a := math.MaxInt - b := 1 - - _, err := TryAddInt(a, b) - require.NotNil(t, err) - - tests := []struct { - name string - a int - b int - result int - wantErr bool - }{ - { - name: "greater than MaxInt must be overflow", - a: math.MaxInt, - b: 1, - wantErr: true, - }, - { - name: "equal to MaxInt must not be overflow", - a: math.MaxInt - 1, - b: 1, - result: math.MaxInt, - }, - { - name: "less than MaxInt must not be overflow", - a: math.MaxInt - 2, - b: 1, - result: math.MaxInt - 1, - }, - { - name: "greater than MinInt must not be underflow", - a: math.MinInt, - b: 1, - result: math.MinInt + 1, - }, - { - name: "equal to MinInt should not be underflow", - a: math.MinInt + 1, - b: -1, - result: math.MinInt, - }, - { - name: "less than MinInt must be underflow", - a: math.MinInt, - b: -1, - wantErr: true, - }, - } - - for _, test := range tests { - - t.Run(test.name, func(t *testing.T) { - - i, err := TryAddInt(test.a, test.b) - if test.wantErr { - require.NotNil(t, err) - } - - require.Equal(t, test.result, i) - - }) - - } - -} diff --git a/core/common/misc.go b/core/common/misc.go deleted file mode 100644 index e8377e04a..000000000 --- a/core/common/misc.go +++ /dev/null @@ -1,259 +0,0 @@ -package common - -import ( - "errors" - "fmt" - "math" - "regexp" - "strconv" - - "github.com/shopspring/decimal" -) - -const ( - ZCNExponent = 10 - // TokenUnit represents the minimum token unit (sas) - TokenUnit = 1e10 -) - -var ( - // ErrNegativeValue is returned if a float value is a negative number - ErrNegativeValue = errors.New("negative coin value") - // ErrTooManyDecimals is returned if a value has more than 10 decimal places - ErrTooManyDecimals = errors.New("too many decimal places") - // ErrTooLarge is returned if a value is greater than math.MaxInt64 - ErrTooLarge = errors.New("value is too large") - // ErrUint64OverflowsFloat64 is returned if when converting a uint64 to a float64 overflow float64 - ErrUint64OverflowsFloat64 = errors.New("uint64 overflows float64") - // ErrUint64AddOverflow is returned if when adding uint64 values overflow uint64 - ErrUint64AddOverflow = errors.New("uint64 addition overflow") -) - -// A Key represents an identifier. It can be a pool ID, client ID, smart -// contract address, etc. -type Key string - -// A Size represents a size in bytes. -type Size int64 - -func byteCountIEC(b int64) string { - const unit = 1024 - if b < unit { - return fmt.Sprintf("%d B", b) - } - div, exp := int64(unit), 0 - for n := b / unit; n >= unit; n /= unit { - div *= unit - exp++ - } - return fmt.Sprintf("%.1f %ciB", float64(b)/float64(div), "KMGTPE"[exp]) -} - -// String implements fmt.Stringer interface -func (s Size) String() string { - return byteCountIEC(int64(s)) -} - -/* Balance */ - -// reParseToken is a regexp to parse string representation of token -var reParseToken = regexp.MustCompile(`^((?:\d*\.)?\d+)\s+(SAS|sas|uZCN|uzcn|mZCN|mzcn|ZCN|zcn)$`) - -// Balance represents client's balance in Züs native token fractions (SAS = 10^-10 ZCN). -type Balance uint64 - -// ToToken converts Balance to ZCN tokens. -func (b Balance) ToToken() (float64, error) { - if b > math.MaxInt64 { - return 0.0, ErrTooLarge - } - - f, _ := decimal.New(int64(b), -ZCNExponent).Float64() - return f, nil -} - -// String implements fmt.Stringer interface. -func (b Balance) String() string { - if val, err := b.AutoFormat(); err == nil { - return val - } - return "" -} - -// Format returns a string representation of the balance with the given unit. -// - unit is the balance unit. -func (b Balance) Format(unit BalanceUnit) (string, error) { - v := float64(b) - if v < 0 { - return "", ErrUint64OverflowsFloat64 - } - switch unit { - case SAS: - return fmt.Sprintf("%d %v", b, unit), nil - case UZCN: - v /= 1e4 - case MZCN: - v /= 1e7 - case ZCN: - v /= 1e10 - default: - return "", fmt.Errorf("undefined balance unit: %d", unit) - } - return fmt.Sprintf("%.3f %v", v, unit), nil -} - -// AutoFormat returns a string representation of the balance with the most -func (b Balance) AutoFormat() (string, error) { - switch { - case b/1e10 > 0: - return b.Format(ZCN) - case b/1e7 > 0: - return b.Format(MZCN) - case b/1e4 > 0: - return b.Format(UZCN) - } - return b.Format(SAS) -} - -// ToBalance converts ZCN tokens to Balance. -// - token amount of ZCN tokens. -func ToBalance(token float64) (Balance, error) { - d := decimal.NewFromFloat(token) - if d.Sign() == -1 { - return 0, ErrNegativeValue - } - - // ZCN have a maximum of 10 decimal places - if d.Exponent() < -ZCNExponent { - return 0, ErrTooManyDecimals - } - - // Multiply the coin balance by 1e10 to obtain coin amount - e := d.Shift(ZCNExponent) - - // Check that there are no decimal places remaining. This error should not - // occur, because of the earlier check of ZCNExponent() - if e.Exponent() < 0 { - return 0, ErrTooManyDecimals - } - - maxDecimal := decimal.NewFromInt(math.MaxInt64) - // Values greater than math.MaxInt64 will overflow after conversion to int64 - if e.GreaterThan(maxDecimal) { - return 0, ErrTooLarge - } - - return Balance(e.IntPart()), nil -} - -// AddBalance adds c and b, returning an error if the values overflow -func AddBalance(c, b Balance) (Balance, error) { - sum := c + b - if sum < c || sum < b { - return 0, ErrUint64AddOverflow - } - return sum, nil -} - -// FormatBalance returns a string representation of the balance with the given unit. -func FormatBalance(b Balance, unit BalanceUnit) (string, error) { - return b.Format(unit) -} - -// AutoFormatBalance returns a string representation of the balance with the most -func AutoFormatBalance(b Balance) (string, error) { - return b.AutoFormat() -} - -func ParseBalance(str string) (Balance, error) { - - matches := reParseToken.FindAllStringSubmatch(str, -1) - - if len(matches) != 1 || len(matches[0]) != 3 { - return 0, fmt.Errorf("invalid input: %s", str) - } - - b, err := strconv.ParseFloat(matches[0][1], 64) - if err != nil { - return 0, err - } - - var unit BalanceUnit - - err = unit.Parse(matches[0][2]) - if err != nil { - return 0, err - } - - switch unit { - case UZCN: - b *= 1e4 - case MZCN: - b *= 1e7 - case ZCN: - b *= 1e10 - } - - return Balance(b), nil -} - -const ( - SAS BalanceUnit = iota - UZCN - MZCN - ZCN -) - -type BalanceUnit byte - -func (unit BalanceUnit) String() string { - switch unit { - case SAS: - return "SAS" - case MZCN: - return "mZCN" - case UZCN: - return "uZCN" - case ZCN: - return "ZCN" - } - return "" -} - -func (unit *BalanceUnit) Parse(s string) error { - switch s { - case "SAS", "sas": - *unit = SAS - case "uZCN", "uzcn": - *unit = UZCN - case "mZCN", "mzcn": - *unit = MZCN - case "ZCN", "zcn": - *unit = ZCN - default: - return errors.New("undefined balance unit: " + s) - } - return nil -} - -func ParseBalanceStatic(str string) (int64, error) { - bal, err := ParseBalance(str) - return int64(bal), err -} - -func FormatStatic(amount int64, unit string) (string, error) { - token := Balance(amount) - - var unitB BalanceUnit - err := unitB.Parse(unit) - if err != nil { - return "", err - } - - return token.Format(unitB) -} - -func AutoFormatStatic(amount int64) (string, error) { - token := Balance(amount) - return token.AutoFormat() -} diff --git a/core/common/misc_test.go b/core/common/misc_test.go deleted file mode 100644 index 1a585c483..000000000 --- a/core/common/misc_test.go +++ /dev/null @@ -1,135 +0,0 @@ -package common - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestFormat(t *testing.T) { - token := Balance(129382129321) - formattedToken, err := token.Format(ZCN) - require.Equal(t, "12.938 ZCN", formattedToken) - require.NoError(t, err) - - formattedToken, err = token.Format(MZCN) - require.Equal(t, "12938.213 mZCN", formattedToken) - require.NoError(t, err) - - formattedToken, err = token.Format(UZCN) - require.Equal(t, "12938212.932 uZCN", formattedToken) - require.NoError(t, err) - - formattedToken, err = token.Format(SAS) - require.Equal(t, "129382129321 SAS", formattedToken) - require.NoError(t, err) - - _, err = token.Format(5) - require.EqualError(t, err, "undefined balance unit: 5") -} - -func TestFormatStatic(t *testing.T) { - amount := int64(129382129321) - zcnAmount, err := FormatStatic(amount, "ZCN") - require.Equal(t, "12.938 ZCN", zcnAmount) - require.NoError(t, err) - - mZCNAmount, err := FormatStatic(amount, "mZCN") - require.Equal(t, "12938.213 mZCN", mZCNAmount) - require.NoError(t, err) - - uZCN, err := FormatStatic(amount, "uZCN") - require.Equal(t, "12938212.932 uZCN", uZCN) - require.NoError(t, err) - - sas, err := FormatStatic(amount, "SAS") - require.Equal(t, "129382129321 SAS", sas) - require.NoError(t, err) -} - -func TestAutoFormat(t *testing.T) { - autoFormatValue, err := AutoFormatStatic(239) - require.Equal(t, "239 SAS", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = AutoFormatStatic(27361) - require.Equal(t, "2.736 uZCN", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = AutoFormatStatic(23872013) - require.Equal(t, "2.387 mZCN", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = AutoFormatStatic(203827162834) - require.Equal(t, "20.383 ZCN", autoFormatValue) - require.NoError(t, err) -} - -func TestAutoFormatStatic(t *testing.T) { - autoFormatValue, err := Balance(239).AutoFormat() - require.Equal(t, "239 SAS", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = Balance(27361).AutoFormat() - require.Equal(t, "2.736 uZCN", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = Balance(23872013).AutoFormat() - require.Equal(t, "2.387 mZCN", autoFormatValue) - require.NoError(t, err) - - autoFormatValue, err = Balance(203827162834).AutoFormat() - require.Equal(t, "20.383 ZCN", autoFormatValue) - require.NoError(t, err) -} - -func TestParseBalance(t *testing.T) { - b, err := ParseBalance("12.938 ZCN") - require.NoError(t, err) - require.Equal(t, Balance(12.938*1e10), b) - - b, err = ParseBalance("12.938 mzcn") - require.NoError(t, err) - require.Equal(t, Balance(12.938*1e7), b) - - b, err = ParseBalance("12.938 uZCN") - require.NoError(t, err) - require.Equal(t, Balance(12.938*1e4), b) - - b, err = ParseBalance("122389 sas") - require.NoError(t, err) - require.Equal(t, Balance(122389*1e0), b) - - _, err = ParseBalance("10 ") - require.EqualError(t, err, "invalid input: 10 ") - - _, err = ParseBalance("10 zwe") - require.EqualError(t, err, "invalid input: 10 zwe") - - _, err = ParseBalance(" 10 zcn ") - require.EqualError(t, err, "invalid input: 10 zcn ") -} - -func TestToBalance(t *testing.T) { - expectedBalance := Balance(20100000000) - balance, err := ToBalance(2.01) - require.Equal(t, expectedBalance, balance) - require.NoError(t, err) - - expectedBalance = Balance(30099999999) - balance, err = ToBalance(3.0099999999) - require.Equal(t, expectedBalance, balance) - require.NoError(t, err) -} - -func TestToToken(t *testing.T) { - b := Balance(12.938 * 1e12) - token, err := b.ToToken() - require.Equal(t, 1293.8, token) - require.NoError(t, err) - - b = Balance(12.938 * 1e5) - token, err = b.ToToken() - require.Equal(t, 0.00012938, token) - require.NoError(t, err) -} diff --git a/core/common/time.go b/core/common/time.go deleted file mode 100644 index dbad4a2e4..000000000 --- a/core/common/time.go +++ /dev/null @@ -1,80 +0,0 @@ -package common - -import ( - "errors" - "strconv" - "strings" - "time" -) - -// Timestamp represents Unix time (e.g. in seconds) -type Timestamp int64 - -// Now current datetime -func Now() Timestamp { - return Timestamp(time.Now().Unix()) -} - -// Within ensures a given timestamp is within certain number of seconds -func (t Timestamp) Within(seconds Timestamp) bool { - var now = Now() - return now > t-seconds && now < t+seconds -} - -// ToTime converts the Timestamp to standard time.Time -func (t Timestamp) ToTime() time.Time { - return time.Unix(int64(t), 0) -} - -var ErrInvalidTime = errors.New("invalid time") - -// ParseTime parse a time string with 4 formats -// -// +1h5m : now (local timezone) + 1h5m -// +3900 : now (local timezone) +3900s -// 1647858200 : Unix timestamp -// 2022-03-21 10:21:38 : parse UTC date string with YYYY-MM-dd HH:mm:ss -// -// Parameters -// - now is the current time -// - input is the time string to parse -func ParseTime(now time.Time, input string) (*time.Time, error) { - - if len(input) == 0 { - return nil, ErrInvalidTime - } - - if input[0] == '+' { - val := strings.TrimLeft(input, "+") - s, err := strconv.Atoi(val) - // +3900 : now (local timezone) +3900s - if err == nil { - now = now.Add(time.Duration(s) * time.Second) - return &now, nil - } - - d, err := time.ParseDuration(val) - // +1h5m : now (local timezone) + 1h5m - if err == nil { - now = now.Add(d) - return &now, nil - } - - return nil, ErrInvalidTime - } - - s, err := strconv.ParseInt(input, 10, 64) - if err == nil { - now = time.Unix(s, 0) - return &now, nil - } - - // 2022-03-21 10:21:38 : parse UTC date string with YYYY-MM-dd HH:mm:ss - t, err := time.Parse("2006-01-02 15:04:05 -0700", input+" +0000") - if err == nil { - return &t, nil - } - - return nil, ErrInvalidTime - -} diff --git a/core/common/time_test.go b/core/common/time_test.go deleted file mode 100644 index 0a4d5ca2f..000000000 --- a/core/common/time_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package common - -import ( - "errors" - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -func TestParseTime(t *testing.T) { - - now := time.Date(2022, 3, 22, 0, 0, 0, 0, time.Now().UTC().Location()) - null := time.Now() - - tests := []struct { - name string - input string - exceptedTime time.Time - exceptedErr error - }{ - { - name: "duration", - input: "+1h30m", - exceptedTime: now.Add(90 * time.Minute), - }, - { - name: "seconds", - input: "+30", - exceptedTime: now.Add(30 * time.Second), - }, - { - name: "Unix timestamp", - input: "1647858200", - exceptedTime: time.Unix(1647858200, 0), - }, - { - name: "YYYY-MM-dd HH:mm:ss", - input: "1647858200", - exceptedTime: time.Unix(1647858200, 0), - }, - { - name: "empty input", - input: "", - exceptedTime: null, - exceptedErr: ErrInvalidTime, - }, - { - name: "invaid input", - input: "s", - exceptedTime: null, - exceptedErr: ErrInvalidTime, - }, - } - - for _, test := range tests { - - t.Run(test.name, func(t *testing.T) { - - v, err := ParseTime(now, test.input) - - if test.exceptedTime.Equal(null) { - require.Nil(t, v) - } else { - require.NotNil(t, v) - require.True(t, v.Equal(test.exceptedTime)) - } - - if test.exceptedErr == nil { - require.Nil(t, err) - } else { - require.True(t, errors.Is(err, test.exceptedErr)) - } - }) - } - -} diff --git a/core/common/utils.go b/core/common/utils.go deleted file mode 100644 index c88159ba3..000000000 --- a/core/common/utils.go +++ /dev/null @@ -1,26 +0,0 @@ -// Provides the data structures and methods to work with the common data structures. -package common - -import ( - "fmt" - "path" - "strings" - - "github.com/valyala/bytebufferpool" -) - -var MemPool bytebufferpool.Pool - -func GetPathFields(p string) ([]string, error) { - if p == "" || p == "/" { - return nil, nil - } - - if !path.IsAbs(p) { - return nil, fmt.Errorf("path %s is not absolute", p) - } - - p = path.Clean(p) - fields := strings.Split(p, "/") - return fields[1:], nil -} diff --git a/core/conf/config.go b/core/conf/config.go deleted file mode 100644 index 4fae43bec..000000000 --- a/core/conf/config.go +++ /dev/null @@ -1,188 +0,0 @@ -// Provides the data structures and methods to work with the configuration data structure. -// This includes parsing, loading, and saving the configuration data structure. -// It uses the viper library to parse and manage the configuration data structure. -package conf - -import ( - "errors" - "net/url" - "os" - "strings" - - thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/core/sys" - "github.com/spf13/viper" -) - -const ( - // DefaultMinSubmit default value for min_submit - DefaultMinSubmit = 20 - // DefaultMinConfirmation default value for min_confirmation - DefaultMinConfirmation = 10 - // DefaultMaxTxnQuery default value for max_txn_query - DefaultMaxTxnQuery = 10 - // DefaultConfirmationChainLength default value for confirmation_chain_length - DefaultConfirmationChainLength = 3 - // DefaultQuerySleepTime default value for query_sleep_time - DefaultQuerySleepTime = 1 - // DefaultSharderConsensous default consensous to take make SCRestAPI calls - DefaultSharderConsensous = 3 -) - -// Config settings from ~/.zcn/config.yaml -// -// block_worker: http://198.18.0.98:9091 -// signature_scheme: bls0chain -// min_submit: 50 -// min_confirmation: 50 -// confirmation_chain_length: 3 -// max_txn_query: 5 -// query_sleep_time: 5 -// # # OPTIONAL - Uncomment to use/ Add more if you want -// # preferred_blobbers: -// # - http://one.devnet-0chain.net:31051 -// # - http://one.devnet-0chain.net:31052 -// # - http://one.devnet-0chain.net:31053 -type Config struct { - // BlockWorker the url of 0dns's network api - BlockWorker string `json:"block_worker,omitempty"` - - // MinSubmit mininal submit from blobber - MinSubmit int `json:"min_submit,omitempty"` - // MinConfirmation mininal confirmation from sharders - MinConfirmation int `json:"min_confirmation,omitempty"` - // CconfirmationChainLength minial confirmation chain length - ConfirmationChainLength int `json:"confirmation_chain_length,omitempty"` - - // additional settings depending network latency - // MaxTxnQuery maximum transcation query from sharders - MaxTxnQuery int `json:"max_txn_query,omitempty"` - // QuerySleepTime sleep time before transcation query - QuerySleepTime int `json:"query_sleep_time,omitempty"` - - // SignatureScheme signature scheme - SignatureScheme string `json:"signature_scheme,omitempty"` - // ChainID which blockchain it is working - ChainID string `json:"chain_id,omitempty"` - - VerifyOptimistic bool - - // Ethereum node: "https://ropsten.infura.io/v3/xxxxxxxxxxxxxxx" - EthereumNode string `json:"ethereum_node,omitempty"` - - // ZboxHost 0box api host host: "https://0box.dev.0chain.net" - ZboxHost string `json:"zbox_host"` - // ZboxAppType app type name - ZboxAppType string `json:"zbox_app_type"` - // SharderConsensous is consensous for when quering for SCRestAPI calls - SharderConsensous int `json:"sharder_consensous"` - ZauthServer string `json:"zauth_server"` - V *viper.Viper `json:"-"` -} - -// LoadConfigFile load and parse SDK Config from file -// - file: config file path (full path) -func LoadConfigFile(file string) (Config, error) { - - var cfg Config - var err error - - _, err = sys.Files.Stat(file) - - if err != nil { - if errors.Is(err, os.ErrNotExist) { - return cfg, thrown.Throw(ErrMssingConfig, file) - } - return cfg, err - } - - v := viper.New() - - v.SetConfigFile(file) - - if err := v.ReadInConfig(); err != nil { - return cfg, thrown.Throw(ErrBadParsing, err.Error()) - } - - cfg, err = LoadConfig(v) - if err != nil { - return cfg, err - } - - cfg.V = v - - return cfg, nil -} - -// LoadConfig load and parse config -func LoadConfig(v Reader) (Config, error) { - - var cfg Config - - blockWorker := strings.TrimSpace(v.GetString("block_worker")) - - if !isURL(blockWorker) { - return cfg, thrown.Throw(ErrInvalidValue, "block_worker="+blockWorker) - } - - minSubmit := v.GetInt("min_submit") - if minSubmit < 1 { - minSubmit = DefaultMinSubmit - } else if minSubmit > 100 { - minSubmit = 100 - } - - minCfm := v.GetInt("min_confirmation") - - if minCfm < 1 { - minCfm = DefaultMinConfirmation - } else if minCfm > 100 { - minCfm = 100 - } - - CfmChainLength := v.GetInt("confirmation_chain_length") - - if CfmChainLength < 1 { - CfmChainLength = DefaultConfirmationChainLength - } - - // additional settings depending network latency - maxTxnQuery := v.GetInt("max_txn_query") - if maxTxnQuery < 1 { - maxTxnQuery = DefaultMaxTxnQuery - } - - querySleepTime := v.GetInt("query_sleep_time") - if querySleepTime < 1 { - querySleepTime = DefaultQuerySleepTime - } - VerifyOptimisticString := v.GetString("verify_optimistic") - if VerifyOptimisticString == "true" { - cfg.VerifyOptimistic = true - } - - sharderConsensous := v.GetInt("sharder_consensous") - if sharderConsensous < 1 { - sharderConsensous = DefaultSharderConsensous - } - - cfg.BlockWorker = blockWorker - cfg.MinSubmit = minSubmit - cfg.MinConfirmation = minCfm - cfg.ConfirmationChainLength = CfmChainLength - cfg.MaxTxnQuery = maxTxnQuery - cfg.QuerySleepTime = querySleepTime - cfg.SharderConsensous = sharderConsensous - - cfg.SignatureScheme = v.GetString("signature_scheme") - cfg.ChainID = v.GetString("chain_id") - cfg.ZauthServer = v.GetString("zauth_server") - cfg.EthereumNode = v.GetString("ethereum_node_url") - - return cfg, nil -} - -func isURL(s string) bool { - u, err := url.Parse(s) - return err == nil && u.Scheme != "" && u.Host != "" -} diff --git a/core/conf/config_test.go b/core/conf/config_test.go deleted file mode 100644 index 8762195bd..000000000 --- a/core/conf/config_test.go +++ /dev/null @@ -1,195 +0,0 @@ -package conf - -import ( - "testing" - - "github.com/0chain/gosdk/core/conf/mocks" - "github.com/stretchr/testify/require" -) - -func TestLoadConfig(t *testing.T) { - - var mockDefaultReader = func() Reader { - reader := &mocks.Reader{} - reader.On("GetString", "block_worker").Return("http://127.0.0.1:9091/dns") - reader.On("GetString", "zauth_server").Return("http://127.0.0.1:8090/") - reader.On("GetInt", "min_submit").Return(0) - reader.On("GetInt", "min_confirmation").Return(0) - reader.On("GetInt", "max_txn_query").Return(0) - reader.On("GetInt", "query_sleep_time").Return(0) - reader.On("GetInt", "confirmation_chain_length").Return(0) - reader.On("GetStringSlice", "preferred_blobbers").Return(nil) - reader.On("GetString", "signature_scheme").Return("") - reader.On("GetString", "chain_id").Return("") - reader.On("GetString", "verify_optimistic").Return("true") - reader.On("GetInt", "sharder_consensous").Return(0) - - return reader - - } - - tests := []struct { - name string - exceptedErr error - - setup func(*testing.T) Reader - run func(*require.Assertions, Config) - }{ - { - name: "Test_Config_Invalid_BlockWorker", - exceptedErr: ErrInvalidValue, - setup: func(t *testing.T) Reader { - - reader := &mocks.Reader{} - reader.On("GetString", "block_worker").Return("") - reader.On("GetString", "zauth_server").Return("") - reader.On("GetInt", "min_submit").Return(0) - reader.On("GetInt", "min_confirmation").Return(0) - reader.On("GetInt", "max_txn_query").Return(0) - reader.On("GetInt", "query_sleep_time").Return(0) - reader.On("GetInt", "confirmation_chain_length").Return(0) - reader.On("GetStringSlice", "preferred_blobbers").Return(nil) - reader.On("GetString", "signature_scheme").Return("") - reader.On("GetString", "chain_id").Return("") - reader.On("GetString", "verify_optimistic").Return("true") - reader.On("GetInt", "sharder_consensous").Return(0) - - return reader - }, - run: func(r *require.Assertions, cfg Config) { - - }, - }, - { - name: "Test_Config_BlockWorker", - - setup: func(t *testing.T) Reader { - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal("http://127.0.0.1:9091/dns", cfg.BlockWorker) - }, - }, - { - name: "Test_Config_Min_Submit_Less_Than_1", - - setup: func(t *testing.T) Reader { - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(20, cfg.MinSubmit) - }, - }, - { - name: "Test_Config_Min_Submit_Greater_Than_100", - - setup: func(t *testing.T) Reader { - - reader := &mocks.Reader{} - reader.On("GetString", "block_worker").Return("https://127.0.0.1:9091/dns") - reader.On("GetString", "zauth_server").Return("http://127.0.0.1:8090/") - reader.On("GetInt", "min_submit").Return(101) - reader.On("GetInt", "min_confirmation").Return(0) - reader.On("GetInt", "max_txn_query").Return(0) - reader.On("GetInt", "query_sleep_time").Return(0) - reader.On("GetInt", "confirmation_chain_length").Return(0) - reader.On("GetStringSlice", "preferred_blobbers").Return(nil) - reader.On("GetString", "signature_scheme").Return("") - reader.On("GetString", "chain_id").Return("") - reader.On("GetString", "verify_optimistic").Return("true") - reader.On("GetInt", "sharder_consensous").Return(0) - - return reader - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(100, cfg.MinSubmit) - }, - }, - { - name: "Test_Config_Min_Confirmation_Less_Than_1", - - setup: func(t *testing.T) Reader { - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(10, cfg.MinConfirmation) - }, - }, - { - name: "Test_Config_Min_Confirmation_Greater_100", - - setup: func(t *testing.T) Reader { - - reader := &mocks.Reader{} - reader.On("GetString", "block_worker").Return("https://127.0.0.1:9091/dns") - reader.On("GetString", "zauth_server").Return("http://127.0.0.1:8090/") - reader.On("GetInt", "min_submit").Return(0) - reader.On("GetInt", "min_confirmation").Return(101) - reader.On("GetInt", "max_txn_query").Return(0) - reader.On("GetInt", "query_sleep_time").Return(0) - reader.On("GetInt", "confirmation_chain_length").Return(0) - reader.On("GetStringSlice", "preferred_blobbers").Return(nil) - reader.On("GetString", "signature_scheme").Return("") - reader.On("GetString", "chain_id").Return("") - reader.On("GetString", "verify_optimistic").Return("false") - reader.On("GetInt", "sharder_consensous").Return(0) - - return reader - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(100, cfg.MinConfirmation) - }, - }, { - name: "Test_Config_Nax_Txn_Query_Less_Than_1", - - setup: func(t *testing.T) Reader { - - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(1, cfg.QuerySleepTime) - }, - }, { - name: "Test_Config_Max_Txn_Query_Less_Than_1", - - setup: func(t *testing.T) Reader { - - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(10, cfg.MaxTxnQuery) - }, - }, { - name: "Test_Config_Confirmation_Chain_Length_Less_Than_1", - - setup: func(t *testing.T) Reader { - return mockDefaultReader() - }, - run: func(r *require.Assertions, cfg Config) { - r.Equal(3, cfg.ConfirmationChainLength) - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - - require := require.New(t) - - reader := tt.setup(t) - - cfg, err := LoadConfig(reader) - - // test it by predefined error variable instead of error message - if tt.exceptedErr != nil { - require.ErrorIs(err, tt.exceptedErr) - } else { - require.Equal(nil, err) - } - - if tt.run != nil { - tt.run(require, cfg) - } - - }) - } -} diff --git a/core/conf/mocks/Reader.go b/core/conf/mocks/Reader.go deleted file mode 100644 index 9bb859362..000000000 --- a/core/conf/mocks/Reader.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by mockery 2.9.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// Reader is an autogenerated mock type for the Reader type -type Reader struct { - mock.Mock -} - -// GetInt provides a mock function with given fields: key -func (_m *Reader) GetInt(key string) int { - ret := _m.Called(key) - - var r0 int - if rf, ok := ret.Get(0).(func(string) int); ok { - r0 = rf(key) - } else { - r0 = ret.Get(0).(int) - } - - return r0 -} - -// GetString provides a mock function with given fields: key -func (_m *Reader) GetString(key string) string { - ret := _m.Called(key) - - var r0 string - if rf, ok := ret.Get(0).(func(string) string); ok { - r0 = rf(key) - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// GetStringSlice provides a mock function with given fields: key -func (_m *Reader) GetStringSlice(key string) []string { - ret := _m.Called(key) - - var r0 []string - if rf, ok := ret.Get(0).(func(string) []string); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]string) - } - } - - return r0 -} diff --git a/core/conf/mocks/doc.go b/core/conf/mocks/doc.go deleted file mode 100644 index d5f5048fa..000000000 --- a/core/conf/mocks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOGENERATED! Do not use. -package mocks \ No newline at end of file diff --git a/core/conf/network.go b/core/conf/network.go deleted file mode 100644 index a73624949..000000000 --- a/core/conf/network.go +++ /dev/null @@ -1,81 +0,0 @@ -package conf - -import ( - "errors" - "os" - "strings" - - thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/core/sys" - "github.com/spf13/viper" -) - -// Network settings from ~/.zcn/network.yaml -type Network struct { - // Sharders sharder list of blockchain - Sharders []string - // Miners miner list of blockchain - Miners []string -} - -func NewNetwork(miners, sharders []string) (*Network, error) { - n := &Network{ - Miners: miners, - Sharders: sharders, - } - if !n.IsValid() { - return nil, errors.New("network has no miners/sharders") - } - n.NormalizeURLs() - return n, nil -} - -// IsValid check network if it has miners and sharders -func (n *Network) IsValid() bool { - return n != nil && len(n.Miners) > 0 && len(n.Sharders) > 0 -} - -func (n *Network) NormalizeURLs() { - for i := 0; i < len(n.Miners); i++ { - n.Miners[i] = strings.TrimSuffix(n.Miners[i], "/") - } - - for i := 0; i < len(n.Sharders); i++ { - n.Sharders[i] = strings.TrimSuffix(n.Sharders[i], "/") - } -} - -// LoadNetworkFile load and parse Network from file -// - file is the path of the file (full path) -func LoadNetworkFile(file string) (Network, error) { - - var network Network - var err error - - _, err = sys.Files.Stat(file) - - if err != nil { - if errors.Is(err, os.ErrNotExist) { - return network, thrown.Throw(ErrMssingConfig, file) - } - return network, err - } - - v := viper.New() - - v.SetConfigFile(file) - - if err := v.ReadInConfig(); err != nil { - return network, thrown.Throw(ErrBadParsing, err.Error()) - } - - return LoadNetwork(v), nil -} - -// LoadNetwork load and parse network -func LoadNetwork(v Reader) Network { - return Network{ - Sharders: v.GetStringSlice("sharders"), - Miners: v.GetStringSlice("miners"), - } -} diff --git a/core/conf/reader.go b/core/conf/reader.go deleted file mode 100644 index 75df8a940..000000000 --- a/core/conf/reader.go +++ /dev/null @@ -1,99 +0,0 @@ -// pakcage conf provide config helpers for ~/.zcn/config.yaml, ~/.zcn/network.yaml and ~/.zcn/wallet.json - -package conf - -import ( - "encoding/json" -) - -// Reader a config reader -type Reader interface { - GetString(key string) string - GetInt(key string) int - GetStringSlice(key string) []string -} - -// JSONReader read config from json -type JSONReader struct { - items map[string]json.RawMessage -} - -func (r *JSONReader) getRawMessage(key string) (json.RawMessage, bool) { - if r == nil || r.items == nil { - return nil, false - } - v, ok := r.items[key] - if !ok { - return nil, false - } - - return v, true - -} - -// GetString read string from key -func (r *JSONReader) GetString(key string) string { - v, ok := r.getRawMessage(key) - if !ok { - return "" - } - - var s string - err := json.Unmarshal(v, &s) - if err != nil { - return "" - } - - return s -} - -// GetInt read int from key -func (r *JSONReader) GetInt(key string) int { - v, ok := r.getRawMessage(key) - if !ok { - return 0 - } - - var i int - - err := json.Unmarshal(v, &i) - if err != nil { - return 0 - } - - return i -} - -// GetStringSlice get string slice from key -func (r *JSONReader) GetStringSlice(key string) []string { - - v, ok := r.getRawMessage(key) - if !ok { - return nil - } - - var list []string - - err := json.Unmarshal(v, &list) - if err != nil { - return nil - } - - return list -} - -// NewReaderFromJSON create a JSONReader from json string -func NewReaderFromJSON(data string) (Reader, error) { - - var items map[string]json.RawMessage - - err := json.Unmarshal([]byte(data), &items) - - if err != nil { - return nil, err - } - - return &JSONReader{ - items: items, - }, nil -} diff --git a/core/conf/reader_test.go b/core/conf/reader_test.go deleted file mode 100644 index ecc03e934..000000000 --- a/core/conf/reader_test.go +++ /dev/null @@ -1,67 +0,0 @@ -package conf - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestJSONReader(t *testing.T) { - - reader, _ := NewReaderFromJSON(`{ - "chain_id":"chain_id", - "signature_scheme" : "bls0chain", - "block_worker" : "http://localhost/dns", - "min_submit" : -20, - "min_confirmation" : 10, - "confirmation_chain_length" : 0, - "preferred_blobbers":["http://localhost:31051", - "http://localhost:31052", - "http://localhost:31053" - ] -}`) - - tests := []struct { - name string - run func(*require.Assertions) - }{ - { - name: "Test_JSONReader_GetString", - run: func(r *require.Assertions) { - r.Equal("chain_id", reader.GetString("chain_id")) - r.Equal("bls0chain", reader.GetString("signature_scheme")) - r.Equal("http://localhost/dns", reader.GetString("block_worker")) - }, - }, - { - name: "Test_JSONReader_GetInt", - - run: func(r *require.Assertions) { - r.Equal(-20, reader.GetInt("min_submit")) - r.Equal(10, reader.GetInt("min_confirmation")) - r.Equal(0, reader.GetInt("confirmation_chain_length")) - }, - }, - { - name: "Test_JSONReader_GetStringSlice", - run: func(r *require.Assertions) { - - preferredBlobbers := reader.GetStringSlice("preferred_blobbers") - - r.Equal(3, len(preferredBlobbers)) - r.Equal(preferredBlobbers[0], "http://localhost:31051") - r.Equal(preferredBlobbers[1], "http://localhost:31052") - r.Equal(preferredBlobbers[2], "http://localhost:31053") - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - - require := require.New(t) - - tt.run(require) - - }) - } -} diff --git a/core/conf/vars.go b/core/conf/vars.go deleted file mode 100644 index e31cbcd8f..000000000 --- a/core/conf/vars.go +++ /dev/null @@ -1,96 +0,0 @@ -package conf - -import ( - "errors" - "strings" - "sync" -) - -var ( - // global client config - cfg *Config - onceCfg sync.Once - // global sharders and miners - //TODO: remove as it is not used - network *Network -) - -var ( - //ErrNilConfig config is nil - ErrNilConfig = errors.New("[conf]config is nil") - - // ErrMssingConfig config file is missing - ErrMssingConfig = errors.New("[conf]missing config file") - // ErrInvalidValue invalid value in config - ErrInvalidValue = errors.New("[conf]invalid value") - // ErrBadParsing fail to parse config via spf13/viper - ErrBadParsing = errors.New("[conf]bad parsing") - - // ErrConfigNotInitialized config is not initialized - ErrConfigNotInitialized = errors.New("[conf]conf.cfg is not initialized. please initialize it by conf.InitClientConfig") -) - -// GetClientConfig get global client config -func GetClientConfig() (*Config, error) { - if cfg == nil { - return nil, ErrConfigNotInitialized - } - - return cfg, nil -} - -func SetZboxAppConfigs(zboxHost, zboxAppType string) { - cfg.ZboxHost = zboxHost - cfg.ZboxAppType = zboxAppType -} - -// InitClientConfig set global client config -func InitClientConfig(c *Config) { - onceCfg.Do(func() { - cfg = c - if cfg.SharderConsensous < 1 { - cfg.SharderConsensous = DefaultSharderConsensous - } - if cfg.MaxTxnQuery < 1 { - cfg.MaxTxnQuery = DefaultMaxTxnQuery - } - if cfg.QuerySleepTime < 1 { - cfg.QuerySleepTime = DefaultQuerySleepTime - } - if cfg.MinSubmit < 1 { - cfg.MinSubmit = DefaultMinSubmit - } - }) -} - -// Deprecated: Use client.Init() function. To normalize urls, use network.NormalizeURLs() method -// // InitChainNetwork set global chain network -func InitChainNetwork(n *Network) { - if n == nil { - return - } - - normalizeURLs(n) - - if network == nil { - network = n - return - } - - network.Sharders = n.Sharders - network.Miners = n.Miners -} - -func normalizeURLs(network *Network) { - if network == nil { - return - } - - for i := 0; i < len(network.Miners); i++ { - network.Miners[i] = strings.TrimSuffix(network.Miners[i], "/") - } - - for i := 0; i < len(network.Sharders); i++ { - network.Sharders[i] = strings.TrimSuffix(network.Sharders[i], "/") - } -} diff --git a/core/encryption/hash.go b/core/encryption/hash.go deleted file mode 100644 index 310c9bb2d..000000000 --- a/core/encryption/hash.go +++ /dev/null @@ -1,86 +0,0 @@ -// Provides the data structures and methods used in encryption. -package encryption - -import ( - "crypto/sha1" - "encoding/hex" - - "github.com/minio/sha256-simd" - "golang.org/x/crypto/sha3" -) - -const HASH_LENGTH = 32 - -// HashBytes hash bytes -type HashBytes [HASH_LENGTH]byte - -// Hash hash the given data and return the hash as hex string -// - data is the data to hash -func Hash(data interface{}) string { - return hex.EncodeToString(RawHash(data)) -} - -// RawHash Logic to hash the text and return the hash bytes -// - data is the data to hash -func RawHash(data interface{}) []byte { - var databuf []byte - switch dataImpl := data.(type) { - case []byte: - databuf = dataImpl - case HashBytes: - databuf = dataImpl[:] - case string: - databuf = []byte(dataImpl) - default: - panic("unknown type") - } - hash := sha3.New256() - hash.Write(databuf) - var buf []byte - return hash.Sum(buf) -} - -// ShaHash hash the given data and return the hash as hex string -// - data is the data to hash -func ShaHash(data interface{}) []byte { - var databuf []byte - switch dataImpl := data.(type) { - case []byte: - databuf = dataImpl - case HashBytes: - databuf = dataImpl[:] - case string: - databuf = []byte(dataImpl) - default: - panic("unknown type") - } - hash := sha256.New() - _, _ = hash.Write(databuf) - return hash.Sum(nil) -} - -// FastHash - sha1 hash the given data and return the hash as hex string -// - data is the data to hash -func FastHash(data interface{}) string { - return hex.EncodeToString(RawFastHash(data)) -} - -// RawFastHash - Logic to sha1 hash the text and return the hash bytes -// - data is the data to hash -func RawFastHash(data interface{}) []byte { - var databuf []byte - switch dataImpl := data.(type) { - case []byte: - databuf = dataImpl - case HashBytes: - databuf = dataImpl[:] - case string: - databuf = []byte(dataImpl) - default: - panic("unknown type") - } - hash := sha1.New() - hash.Write(databuf) - var buf []byte - return hash.Sum(buf) -} diff --git a/core/imageutil/thumbnailer.go b/core/imageutil/thumbnailer.go deleted file mode 100644 index 4d9dae350..000000000 --- a/core/imageutil/thumbnailer.go +++ /dev/null @@ -1,75 +0,0 @@ -// Provides helper methods and data structures to work with images. -package imageutil - -import ( - "bytes" - "fmt" - "image" - _ "image/gif" - _ "image/jpeg" - "image/png" - _ "image/png" - - _ "golang.org/x/image/bmp" - _ "golang.org/x/image/ccitt" - _ "golang.org/x/image/riff" - _ "golang.org/x/image/tiff" - _ "golang.org/x/image/vector" - _ "golang.org/x/image/vp8" - _ "golang.org/x/image/vp8l" - _ "golang.org/x/image/webp" -) - -type SubImager interface { - SubImage(r image.Rectangle) image.Image -} - -// CreateThumbnail create thumbnail of an image buffer. It supports -// - png -// - jpeg -// - gif -// - bmp -// - ccitt -// - riff -// - tiff -// - vector -// - vp8 -// - vp8l -// - webp -func CreateThumbnail(buf []byte, width, height int) ([]byte, error) { - // image.Decode requires that you import the right image package. - // Ignored return value is image format name. - img, _, err := image.Decode(bytes.NewReader(buf)) - if err != nil { - return nil, err - } - - // I've hard-coded a crop rectangle, start (0,0), end (100, 100). - img, err = cropImage(img, image.Rect(0, 0, width, height)) - if err != nil { - return nil, err - } - - fd := &bytes.Buffer{} - - err = png.Encode(fd, img) - if err != nil { - return nil, err - } - - return fd.Bytes(), nil -} - -// cropImage takes an image and crops it to the specified rectangle. -func cropImage(img image.Image, crop image.Rectangle) (image.Image, error) { - - // img is an Image interface. This checks if the underlying value has a - // method called SubImage. If it does, then we can use SubImage to crop the - // image. - simg, ok := img.(SubImager) - if !ok { - return nil, fmt.Errorf("image does not support cropping") - } - - return simg.SubImage(crop), nil -} diff --git a/core/logger/logger.go b/core/logger/logger.go deleted file mode 100644 index 4af6e8692..000000000 --- a/core/logger/logger.go +++ /dev/null @@ -1,182 +0,0 @@ -// Provides a simple logger for the SDK. -package logger - -import ( - "fmt" - "github.com/0chain/gosdk/core/version" - "gopkg.in/natefinch/lumberjack.v2" - "io" - "log" - "os" -) - -const ( - NONE = 0 - FATAL = 1 - ERROR = 2 - INFO = 3 - DEBUG = 4 -) - -// Log global logger instance -var Log Logger - -const cRed = "\u001b[31m" -const cReset = "\u001b[0m" - -const ( - strFATAL = cRed + "[FATAL] " - strERROR = cRed + "[ERROR] " - strINFO = "[INFO] " - strDEBUG = "[DEBUG] " -) - -type Logger struct { - lvl int - prefix string - logDebug *log.Logger - logInfo *log.Logger - logError *log.Logger - logFatal *log.Logger - fWriter io.Writer -} - -// Init - Initialize logging -func (l *Logger) Init(lvl int, prefix string) { - l.SetLevel(lvl) - l.prefix = prefix - l.logDebug = log.New(os.Stderr, prefix+": "+strDEBUG, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logInfo = log.New(os.Stderr, prefix+": "+strINFO, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logError = log.New(os.Stderr, prefix+": "+strERROR, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logFatal = log.New(os.Stderr, prefix+": "+strFATAL, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) -} - -// SetLevel - Configures the log level. Higher the number more verbose. -func (l *Logger) SetLevel(lvl int) { - l.lvl = lvl -} - -// syncPrefixes - syncs the logger prefixes -func syncPrefixes(maxPrefixLen int, loggers []*Logger) { - for _, lgr := range loggers { - if maxPrefixLen-len(lgr.prefix) > 0 { - lgr.prefix = fmt.Sprintf("%-*s", maxPrefixLen, lgr.prefix) - } - } -} - -// SyncLoggers syncs the loggers prefixes -// - loggers is the list of loggers to sync -func SyncLoggers(loggers []*Logger) { - maxPrefixLen := 0 - for _, lgr := range loggers { - if len(lgr.prefix) > maxPrefixLen { - maxPrefixLen = len(lgr.prefix) - } - } - syncPrefixes(maxPrefixLen, loggers) -} - -// SetLogFile - Writes log to the file. set verbose false disables log to os.Stderr -func (l *Logger) SetLogFile(logFile io.Writer, verbose bool) { - dLogs := []io.Writer{logFile} - iLogs := []io.Writer{logFile} - eLogs := []io.Writer{logFile} - fLogs := []io.Writer{logFile} - if verbose { - dLogs = append(dLogs, os.Stderr) - iLogs = append(iLogs, os.Stderr) - eLogs = append(eLogs, os.Stderr) - fLogs = append(fLogs, os.Stderr) - } - l.logDebug = log.New(io.MultiWriter(dLogs...), l.prefix+" "+strDEBUG, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logInfo = log.New(io.MultiWriter(iLogs...), l.prefix+" "+strINFO, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logError = log.New(io.MultiWriter(eLogs...), l.prefix+" "+strERROR, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) - l.logFatal = log.New(io.MultiWriter(fLogs...), l.prefix+" "+strFATAL, log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) -} - -func (l *Logger) Debug(v ...interface{}) { - if l.lvl >= DEBUG { - err := l.logDebug.Output(2, fmt.Sprint(v...)) - if err != nil { - fmt.Printf("Error logging debug message: %v", err) - return - } - } -} - -func (l *Logger) Info(v ...interface{}) { - if l.lvl >= INFO { - err := l.logInfo.Output(2, fmt.Sprint(v...)) - if err != nil { - fmt.Printf("Error logging info message: %v", err) - return - } - } -} - -func (l *Logger) Error(v ...interface{}) { - if l.lvl >= ERROR { - err := l.logError.Output(2, fmt.Sprint(v...)+cReset) - if err != nil { - fmt.Printf("Error logging error message: %v", err) - return - } - } -} - -func (l *Logger) Fatal(v ...interface{}) { - if l.lvl >= FATAL { - err := l.logFatal.Output(2, fmt.Sprint(v...)+cReset) - if err != nil { - fmt.Printf("Error logging fatal message: %v", err) - return - } - } -} - -func (l *Logger) Close() { - if c, ok := l.fWriter.(io.Closer); ok && c != nil { - err := c.Close() - if err != nil { - fmt.Printf("Error closing log file: %v", err) - return - } - } -} - -// Initialize common logger -var logging Logger - -func GetLogger() *Logger { - return &logging -} - -func CloseLog() { - logging.Close() -} - -func init() { - logging.Init(DEBUG, "0chain-core-sdk") -} - -// SetLogLevel set the log level. -// lvl - 0 disabled; higher number (upto 4) more verbosity -func SetLogLevel(lvl int) { - logging.SetLevel(lvl) -} - -// SetLogFile - sets file path to write log -// verbose - true - console output; false - no console output -func SetLogFile(logFile string, verbose bool) { - ioWriter := &lumberjack.Logger{ - Filename: logFile, - MaxSize: 100, // MB - MaxBackups: 5, // number of backups - MaxAge: 28, //days - LocalTime: false, - Compress: false, // disabled by default - } - logging.SetLogFile(ioWriter, verbose) - logging.Info("******* Wallet SDK Version:", version.VERSIONSTR, " ******* (SetLogFile)") -} diff --git a/core/pathutil/path.go b/core/pathutil/path.go deleted file mode 100644 index 91b36d967..000000000 --- a/core/pathutil/path.go +++ /dev/null @@ -1,64 +0,0 @@ -// Provides utility functions for working with file paths. -package pathutil - -import ( - "strings" -) - -// Split splits path immediately following the final Separator, -// separating it into a directory and file name component. -// If there is no Separator in path, Split returns an empty dir -// and file set to path. -// The returned values have the property that path = dir+file. -// - path is the path to be split. -func Split(path string) (dir, file string) { - if path == "" { - return "", "" - } - - if path == "/" { - return "/", "" - } - - i := strings.LastIndex(path, "/") - - if i == -1 { - return "", path - } - - return string(path[:i]), string(path[i+1:]) -} - -// Dir returns all but the last element of path, typically the path's directory. -// - path is the path to be split. -func Dir(path string) string { - dir, _ := Split(path) - - return dir -} - -// Join joins any number of path elements into a single path, -// separating them with slash. Empty elements are ignored. -// The result is Cleaned. However, if the argument -// list is empty or all its elements are empty, Join returns -// an empty string. -func Join(elem ...string) string { - var items []string - var hasElements bool - for _, e := range elem { - if e != "" { - hasElements = true - for _, it := range strings.Split(e, "/") { - if it != "" { - items = append(items, it) - } - } - } - } - if !hasElements { - return "" - } - - return "/" + strings.Join(items, "/") - -} diff --git a/core/pathutil/path_test.go b/core/pathutil/path_test.go deleted file mode 100644 index 6e9a6e94b..000000000 --- a/core/pathutil/path_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package pathutil - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestSplit(t *testing.T) { - - tests := []struct { - name string - path string - dir string - file string - }{ - { - name: "empty", - path: "", - dir: "", - file: "", - }, - { - name: "only file", - path: "file", - dir: "", - file: "file", - }, - { - name: "only dir", - path: "/dir/", - dir: "/dir", - file: "", - }, - { - name: "only root", - path: "/", - dir: "/", - file: "", - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - dir, file := Split(test.path) - require.Equal(t, test.dir, dir) - require.Equal(t, test.file, file) - }) - } -} - -func TestJoin(t *testing.T) { - tests := []struct { - name string - elem []string - path string - }{ - {name: "empty", elem: []string{"", ""}, path: ""}, - {name: "only slash", elem: []string{"/", "/"}, path: "/"}, - {name: "multiple slashes", elem: []string{"/", "/images"}, path: "/images"}, - {name: "one path without slash", elem: []string{"only_path"}, path: "/only_path"}, - {name: "multiple paths without slash", elem: []string{"path1", "path2"}, path: "/path1/path2"}, - {name: "multiple paths", elem: []string{"path1", "path2", "/path3", "path4/"}, path: "/path1/path2/path3/path4"}, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - path := Join(test.elem...) - - require.Equal(t, test.path, path) - }) - } -} diff --git a/core/resty/client.go b/core/resty/client.go deleted file mode 100644 index 784c99f7a..000000000 --- a/core/resty/client.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package resty - -import ( - "net/http" - "time" -) - -// CreateClient a function that create a client instance -var CreateClient = func(t *http.Transport, timeout time.Duration) Client { - client := &http.Client{ - Transport: t, - } - if timeout > 0 { - client.Timeout = timeout - } - - return client -} diff --git a/core/resty/client_wasm.go b/core/resty/client_wasm.go deleted file mode 100644 index 451983933..000000000 --- a/core/resty/client_wasm.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package resty - -import ( - "net/http" - "time" -) - -// CreateClient a function that create a client instance -var CreateClient = func(t *http.Transport, timeout time.Duration) Client { - c := &WasmClient{ - Client: &http.Client{ - Transport: t, - }, - } - - if timeout > 0 { - c.Client.Timeout = timeout - } - - return c -} - -type WasmClient struct { - *http.Client -} - -func (c *WasmClient) Do(req *http.Request) (*http.Response, error) { - req.Header.Set("js.fetch:mode", "cors") - - return c.Client.Do(req) -} diff --git a/core/resty/doc.go b/core/resty/doc.go deleted file mode 100644 index 1f3a8c885..000000000 --- a/core/resty/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// HTTP and REST client library with parallel feature. -package resty \ No newline at end of file diff --git a/core/resty/mocks/Client.go b/core/resty/mocks/Client.go deleted file mode 100644 index db64565a0..000000000 --- a/core/resty/mocks/Client.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by mockery 2.9.0. DO NOT EDIT. - -package mocks - -import ( - http "net/http" - - mock "github.com/stretchr/testify/mock" -) - -// Client is an autogenerated mock type for the Client type -type Client struct { - mock.Mock -} - -// Do provides a mock function with given fields: req -func (_m *Client) Do(req *http.Request) (*http.Response, error) { - ret := _m.Called(req) - - var r0 *http.Response - if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { - r0 = rf(req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*http.Response) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(*http.Request) error); ok { - r1 = rf(req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} diff --git a/core/resty/mocks/doc.go b/core/resty/mocks/doc.go deleted file mode 100644 index d5f5048fa..000000000 --- a/core/resty/mocks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOGENERATED! Do not use. -package mocks \ No newline at end of file diff --git a/core/resty/mocks/timeout.go b/core/resty/mocks/timeout.go deleted file mode 100644 index a14f100a3..000000000 --- a/core/resty/mocks/timeout.go +++ /dev/null @@ -1,21 +0,0 @@ -package mocks - -import ( - "context" - http "net/http" - "time" -) - -// Timeout mock any request with timeout -type Timeout struct { - Timeout time.Duration -} - -// Do provides a mock function with given fields: req -func (t *Timeout) Do(req *http.Request) (*http.Response, error) { - time.Sleep(t.Timeout) - - time.Sleep(1 * time.Second) - - return nil, context.DeadlineExceeded -} diff --git a/core/resty/option.go b/core/resty/option.go deleted file mode 100644 index 2c8b708a0..000000000 --- a/core/resty/option.go +++ /dev/null @@ -1,48 +0,0 @@ -package resty - -import ( - "net/http" -) - -// WithRetry set retry times if request is failure with 5xx status code. retry is ingore if it is less than 1. -func WithRetry(retry int) Option { - return func(r *Resty) { - if retry > 0 { - r.retry = retry - } - } -} - -// WithHeader set header for http request -func WithHeader(header map[string]string) Option { - return func(r *Resty) { - if r.header == nil { - r.header = make(map[string]string) - } - - for k, v := range header { - r.header[k] = v - } - } -} - -// WithRequestInterceptor intercept request -func WithRequestInterceptor(interceptor func(req *http.Request) error) Option { - return func(r *Resty) { - r.requestInterceptor = interceptor - } -} - -// WithTransport set transport -func WithTransport(transport *http.Transport) Option { - return func(r *Resty) { - r.transport = transport - } -} - -// WithClient set client -func WithClient(c Client) Option { - return func(r *Resty) { - r.client = c - } -} diff --git a/core/resty/resty.go b/core/resty/resty.go deleted file mode 100644 index 404797755..000000000 --- a/core/resty/resty.go +++ /dev/null @@ -1,304 +0,0 @@ -package resty - -import ( - "context" - "io" - "net" - "net/http" - "sync" - "time" - - "github.com/0chain/gosdk/core/sys" -) - -func clone(m map[string]string) map[string]string { - cl := make(map[string]string, len(m)) - for k, v := range m { - cl[k] = v - } - - return cl -} - -// New create a Resty instance. -func New(opts ...Option) *Resty { - r := &Resty{ - // Default timeout to use for HTTP requests when either the parent context doesn't have a timeout set - // or the context's timeout is longer than DefaultRequestTimeout. - timeout: DefaultRequestTimeout, - retry: DefaultRetry, - header: clone(DefaultHeader), - } - - for _, option := range opts { - option(r) - } - - if r.transport == nil { - if DefaultTransport == nil { - DefaultTransport = &http.Transport{ - Dial: (&net.Dialer{ - Timeout: DefaultDialTimeout, - }).Dial, - TLSHandshakeTimeout: DefaultDialTimeout, - } - } - r.transport = DefaultTransport - } - - if r.client == nil { - r.client = CreateClient(r.transport, r.timeout) - } - - return r -} - -// Client http client -type Client interface { - Do(req *http.Request) (*http.Response, error) -} - -// Handle handler of http response -type Handle func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error - -// Option set restry option -type Option func(*Resty) - -// Resty HTTP and REST client library with parallel feature -type Resty struct { - ctx context.Context - cancelFunc context.CancelFunc - qty int - done chan Result - - transport *http.Transport - client Client - handle Handle - requestInterceptor func(req *http.Request) error - - timeout time.Duration - retry int - header map[string]string -} - -// Then is used to call the handle function when the request has completed processing -func (r *Resty) Then(fn Handle) *Resty { - if r == nil { - return r - } - r.handle = fn - return r -} - -// DoGet executes http requests with GET method in parallel -func (r *Resty) DoGet(ctx context.Context, urls ...string) *Resty { - return r.Do(ctx, http.MethodGet, nil, urls...) -} - -// DoPost executes http requests with POST method in parallel -func (r *Resty) DoPost(ctx context.Context, body io.Reader, urls ...string) *Resty { - return r.Do(ctx, http.MethodPost, body, urls...) -} - -// DoPut executes http requests with PUT method in parallel -func (r *Resty) DoPut(ctx context.Context, body io.Reader, urls ...string) *Resty { - return r.Do(ctx, http.MethodPut, body, urls...) -} - -// DoDelete executes http requests with DELETE method in parallel -func (r *Resty) DoDelete(ctx context.Context, urls ...string) *Resty { - return r.Do(ctx, http.MethodDelete, nil, urls...) -} - -func (r *Resty) Do(ctx context.Context, method string, body io.Reader, urls ...string) *Resty { - r.ctx, r.cancelFunc = context.WithCancel(ctx) - - r.qty = len(urls) - r.done = make(chan Result, r.qty) - - bodyReader := body - - for _, url := range urls { - go func(url string) { - req, err := http.NewRequest(method, url, bodyReader) - if err != nil { - r.done <- Result{Request: req, Response: nil, Err: err} - return - } - for key, value := range r.header { - req.Header.Set(key, value) - } - // re-use http connection if it is possible - req.Header.Set("Connection", "keep-alive") - - if r.requestInterceptor != nil { - if err := r.requestInterceptor(req); err != nil { - r.done <- Result{Request: req, Response: nil, Err: err} - return - } - } - r.httpDo(req.WithContext(r.ctx)) - }(url) - } - return r -} - -func (r *Resty) httpDo(req *http.Request) { - wg := &sync.WaitGroup{} - wg.Add(1) - - go func(request *http.Request) { - defer wg.Done() - var resp *http.Response - var err error - if r.retry > 0 { - for i := 1; ; i++ { - var bodyCopy io.ReadCloser - if (request.Method == http.MethodPost || request.Method == http.MethodPut) && request.Body != nil { - // clone io.ReadCloser to fix retry issue https://github.com/golang/go/issues/36095 - bodyCopy, _ = request.GetBody() //nolint: errcheck - } - - resp, err = r.client.Do(request) - //success: 200,201,202,204 - if resp != nil && (resp.StatusCode == http.StatusOK || - resp.StatusCode == http.StatusCreated || - resp.StatusCode == http.StatusAccepted || - resp.StatusCode == http.StatusNoContent) { - break - } - // close body ReadClose to release resource before retrying it - if resp != nil && resp.Body != nil { - // don't close it if it is latest retry - if i < r.retry { - resp.Body.Close() - } - } - - if i == r.retry { - break - } - - if resp != nil && resp.StatusCode == http.StatusTooManyRequests { - sys.Sleep(1 * time.Second) - } - - if (request.Method == http.MethodPost || request.Method == http.MethodPut) && request.Body != nil { - request.Body = bodyCopy - } - } - } else { - resp, err = r.client.Do(request.WithContext(r.ctx)) - } - - result := Result{Request: request, Response: resp, Err: err} - if resp != nil { - // read and close body to reuse http connection - buf, err := io.ReadAll(resp.Body) - if err != nil { - result.Err = err - } else { - resp.Body.Close() //nolint: errcheck - result.ResponseBody = buf - } - } - r.done <- result - }(req) - wg.Wait() -} - -// Wait waits for all the requests to be completed -func (r *Resty) Wait() []error { - defer func() { - // call cancelFunc, to avoid to memory leaks - if r.cancelFunc != nil { - r.cancelFunc() - } - }() - errs := make([]error, 0, r.qty) - done := 0 - - // no urls - if r.qty == 0 { - return errs - } - for { - select { - case <-r.ctx.Done(): - if r.ctx.Err() == context.DeadlineExceeded { - return []error{r.ctx.Err()} - } - return errs - - case result := <-r.done: - if r.handle != nil { - err := r.handle(result.Request, result.Response, result.ResponseBody, r.cancelFunc, result.Err) - if err != nil { - errs = append(errs, err) - } else if result.Err != nil { - // if r.handle doesn't return any error, then append result.Err if it is not nil - errs = append(errs, result.Err) - } - } else { - if result.Err != nil { - errs = append(errs, result.Err) - } - } - } - done++ - if done >= r.qty { - return errs - } - } -} - -// First successful result or errors -func (r *Resty) First() []error { - defer func() { - // call cancelFunc, avoid to memory leak issue - if r.cancelFunc != nil { - r.cancelFunc() - } - }() - - errs := make([]error, 0, r.qty) - done := 0 - - // no urls - if r.qty == 0 { - return errs - } - - for { - select { - case <-r.ctx.Done(): - return errs - - case result := <-r.done: - - if r.handle != nil { - err := r.handle(result.Request, result.Response, result.ResponseBody, r.cancelFunc, result.Err) - - if err != nil { - errs = append(errs, err) - } else { - return nil - } - } else { - if result.Err != nil { - errs = append(errs, result.Err) - } else { - return nil - } - - } - } - - done++ - - if done >= r.qty { - return errs - } - - } -} diff --git a/core/resty/resty_test.go b/core/resty/resty_test.go deleted file mode 100644 index fabb4fecf..000000000 --- a/core/resty/resty_test.go +++ /dev/null @@ -1,165 +0,0 @@ -package resty - -import ( - "context" - "fmt" - "io" - "net/http" - "strings" - "testing" - "time" - - "github.com/0chain/gosdk/core/resty/mocks" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" -) - -func TestResty(t *testing.T) { - - tests := []struct { - name string - urls []string - - statusCode int - expectedErr error - setup func(a *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) - }{ - { - name: "Test_Resty_Cancel_With_Timeout", - expectedErr: context.DeadlineExceeded, - urls: []string{"Test_Resty_Timeout_1", "Test_Resty_Timeout_2", "Test_Resty_Timeout_3"}, - setup: getSetupFuncForCtxDeadlineExtendedTest(), - }, - { - name: "Test_Resty_All_Success", - statusCode: 200, - expectedErr: nil, - urls: []string{"http://Test_Resty_Success_1", "http://Test_Resty_Success_2"}, - setup: getSetupFuncForAllSuccessTest(), - }, - { - name: "Test_Resty_Failed_Due_To_Handler_Failing", - expectedErr: fmt.Errorf("handler returned error"), - urls: []string{"http://Test_Resty_Failure_1", "http://Test_Resty_Failure_2"}, - setup: getSetupFuncForHandlerErrorTest(), - }, - { - name: "Test_Resty_Failed_Due_To_Interceptor_Error", - expectedErr: fmt.Errorf("interceptor returned with error"), - urls: []string{"http://Test_Resty_Failure_1", "http://Test_Resty_Failure_2"}, - setup: getSetupFuncForInterceptorErrorTest(), - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - r := require.New(t) - ctx, resty := tt.setup(r, tt.name, tt.statusCode, tt.urls) - resty.DoGet(ctx, tt.urls...) - errs := resty.Wait() - if tt.expectedErr != nil && tt.expectedErr != context.DeadlineExceeded && len(errs) == 0 { - t.Fatalf("expected err: %v, got: %v", tt.expectedErr, errs) - } - for _, err := range errs { - // test it by predefined error variable instead of error message - if tt.expectedErr != nil { - r.Errorf(err, tt.expectedErr.Error()) - } else { - r.Equal(nil, err) - } - } - }) - } -} - -func getSetupFuncForCtxDeadlineExtendedTest() func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - return func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - r := New() - r.client = &mocks.Timeout{ - Timeout: 1 * time.Second, - } - ctx, cancel := context.WithTimeout(context.TODO(), 1*time.Second) - go func() { - <-ctx.Done() - cancel() - }() - return ctx, r - } -} - -func getSetupFuncForAllSuccessTest() func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - return func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - resty := New().Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - ra.Equal(200, resp.StatusCode) - ra.Equal(nil, err) - ra.Equal(name, string(respBody)) - return nil - }) - - client := &mocks.Client{} - setupMockClient(client, urls, statusCode, name) - resty.client = client - - ctx, cancel := context.WithTimeout(context.TODO(), 3*time.Second) - go func() { - <-ctx.Done() - cancel() - }() - return context.TODO(), resty - } -} - -func getSetupFuncForHandlerErrorTest() func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - return func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - resty := New().Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - return fmt.Errorf("handler returned error") - }) - - client := &mocks.Client{} - setupMockClient(client, urls, statusCode, name) - resty.client = client - - ctx, cancel := context.WithTimeout(context.TODO(), 3*time.Second) - go func() { - <-ctx.Done() - cancel() - }() - return context.TODO(), resty - } -} - -func getSetupFuncForInterceptorErrorTest() func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - return func(ra *require.Assertions, name string, statusCode int, urls []string) (context.Context, *Resty) { - opts := make([]Option, 0) - opts = append(opts, WithRequestInterceptor(func(r *http.Request) error { - return fmt.Errorf("interceptor returned with error") //nolint - })) - // create a resty object with an interceptor which returns an error, but the handler doesn't return any error - resty := New(opts...).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - return nil - }) - - client := &mocks.Client{} - setupMockClient(client, urls, statusCode, name) - resty.client = client - - ctx, cancel := context.WithTimeout(context.TODO(), 3*time.Second) - go func() { - <-ctx.Done() - cancel() - }() - return context.TODO(), resty - } -} - -func setupMockClient(mck *mocks.Client, urls []string, statusCode int, name string) { - for _, url := range urls { - func(u string) { - mck.On("Do", mock.MatchedBy(func(r *http.Request) bool { - return r.URL.String() == u - })).Return(&http.Response{ - StatusCode: statusCode, - Body: io.NopCloser(strings.NewReader(name)), - }, nil) - }(url) - } -} diff --git a/core/resty/result.go b/core/resty/result.go deleted file mode 100644 index b86e7f2a0..000000000 --- a/core/resty/result.go +++ /dev/null @@ -1,11 +0,0 @@ -package resty - -import "net/http" - -// Result result of a http request -type Result struct { - Request *http.Request - Response *http.Response - ResponseBody []byte - Err error -} diff --git a/core/resty/transport.go b/core/resty/transport.go deleted file mode 100644 index 941e0e649..000000000 --- a/core/resty/transport.go +++ /dev/null @@ -1,29 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package resty - -import ( - "net" - "net/http" - "time" -) - -var DefaultHeader = make(map[string]string) - -// Run the HTTP request in a goroutine and pass the response to f. -var DefaultTransport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - MaxIdleConns: 1000, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: 5, - ForceAttemptHTTP2: true, - - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, -} diff --git a/core/resty/transport_wasm.go b/core/resty/transport_wasm.go deleted file mode 100644 index 2896166a0..000000000 --- a/core/resty/transport_wasm.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package resty - -import ( - "net/http" - "time" -) - -var DefaultHeader map[string]string - -// Run the HTTP request in a goroutine and pass the response to f. -var DefaultTransport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - MaxIdleConns: 1000, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: 5, - ForceAttemptHTTP2: true, -} - -func init() { - DefaultHeader = make(map[string]string) - DefaultHeader["js.fetch:mode"] = "cors" -} diff --git a/core/resty/vars.go b/core/resty/vars.go deleted file mode 100644 index 5204c5025..000000000 --- a/core/resty/vars.go +++ /dev/null @@ -1,14 +0,0 @@ -package resty - -import ( - "time" -) - -var ( - // DefaultDialTimeout default timeout of a dialer - DefaultDialTimeout = 5 * time.Second - // DefaultRequestTimeout default time out of a http request - DefaultRequestTimeout = 10 * time.Second - // DefaultRetry retry times if a request is failed with 5xx status code - DefaultRetry = 3 -) diff --git a/core/screstapi/http.go b/core/screstapi/http.go deleted file mode 100644 index 53f5823b5..000000000 --- a/core/screstapi/http.go +++ /dev/null @@ -1,86 +0,0 @@ -package screstapi - -import ( - "context" - "encoding/json" - - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/zboxapi" -) - -var urlPathSharderToZboxMap = map[string]string{ - "/getStakePoolStat": "/getStakePoolStat", - "/getUserStakePoolStat": "/getUserStakePoolStat", - "/getChallengePoolStat": "/getChallengePoolStat", - "/getBlobber": "/blobber", - "/getblobbers": "/blobbers", - "/blobber_ids": "/blobber_ids", - "/alloc_blobbers": "/blobbers/allocation", - "/get_validator": "/validator", - "/validators": "/validators", - "/allocation": "/getAllocation", - "/allocations": "/getAllocations", - "/v1/mint_nonce": "/mintNonce", - "client/get/balance": "/balance", - "/v1/not_processed_burn_tickets": "/not_processed_burn_tickets", -} - -func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, restApiUrls ...string) (resp []byte, err error) { - _, ok := urlPathSharderToZboxMap[relativePath] - if client.IsAppFlow && ok { - resp, err = MakeSCRestAPICallToZbox(urlPathSharderToZboxMap[relativePath], params) - if err != nil { - resp, err = client.MakeSCRestAPICallToSharder(scAddress, relativePath, params, restApiUrls...) - } - } else { - resp, err = client.MakeSCRestAPICallToSharder(scAddress, relativePath, params, restApiUrls...) - } - - return resp, err -} - -func MakeSCRestAPICallToZbox(relativePath string, params map[string]string) ([]byte, error) { - // req, err := http.NewRequest(method, relativePath) - zboxApiClient := zboxapi.NewClient() - configObj, err := conf.GetClientConfig() - if err != nil { - return nil, err - } - zboxApiClient.SetRequest(configObj.ZboxHost, configObj.ZboxAppType) - - resp, err := zboxApiClient.MakeRestApiCallToZbox(context.TODO(), relativePath, params) - if err != nil { - return nil, err - } - - return resp, nil -} - -func GetBalance(clientIDs ...string) (*client.GetBalanceResponse, error) { - var clientID string - if len(clientIDs) > 0 { - clientID = clientIDs[0] - } else { - clientID = client.Id() - } - - const GetBalanceUrl = "client/get/balance" - var ( - balance client.GetBalanceResponse - err error - resp []byte - ) - - if resp, err = MakeSCRestAPICall("", GetBalanceUrl, map[string]string{ - "client_id": clientID, - }, "v1/"); err != nil { - return nil, err - } - - if err = json.Unmarshal(resp, &balance); err != nil { - return nil, err - } - - return &balance, err -} diff --git a/core/sys/doc.go b/core/sys/doc.go deleted file mode 100644 index 5fc9edc91..000000000 --- a/core/sys/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Provides functions and data structures for working with memory and disk file systems. -package sys \ No newline at end of file diff --git a/core/sys/fs.go b/core/sys/fs.go deleted file mode 100644 index c7e05e608..000000000 --- a/core/sys/fs.go +++ /dev/null @@ -1,65 +0,0 @@ -package sys - -import ( - "io/fs" - "os" -) - -// FS An FS provides access to a hierarchical file system. -type FS interface { - - // Open opens the named file for reading. If successful, methods on - // the returned file can be used for reading; the associated file - // descriptor has mode O_RDONLY. - // If there is an error, it will be of type *PathError. - Open(name string) (File, error) - - // OpenFile open a file - OpenFile(name string, flag int, perm os.FileMode) (File, error) - - // ReadFile reads the file named by filename and returns the contents. - ReadFile(name string) ([]byte, error) - - // WriteFile writes data to a file named by filename. - WriteFile(name string, data []byte, perm fs.FileMode) error - - Stat(name string) (fs.FileInfo, error) - - // Remove removes the named file or (empty) directory. - // If there is an error, it will be of type *PathError. - Remove(name string) error - - //MkdirAll creates a directory named path - MkdirAll(path string, perm os.FileMode) error - - // LoadProgress load progress - LoadProgress(progressID string) ([]byte, error) - - // SaveProgress save progress - SaveProgress(progressID string, data []byte, perm fs.FileMode) error - - // RemoveProgress remove progress - RemoveProgress(progressID string) error - - StoreLogs(key string, data string) error - - // Create Directory - CreateDirectory(dirID string) error - - // GetFileHandler - GetFileHandler(dirID, name string) (File, error) - - // Remove all created directories(used in download directory) - RemoveAllDirectories() -} - -type File interface { - Stat() (fs.FileInfo, error) - Read([]byte) (int, error) - Write(p []byte) (n int, err error) - - Sync() error - Seek(offset int64, whence int) (ret int64, err error) - - Close() error -} diff --git a/core/sys/fs_disk.go b/core/sys/fs_disk.go deleted file mode 100644 index 956589338..000000000 --- a/core/sys/fs_disk.go +++ /dev/null @@ -1,94 +0,0 @@ -package sys - -import ( - "io/fs" - "os" - "path/filepath" -) - -// DiskFS implement file system on disk -type DiskFS struct { -} - -// NewDiskFS create DiskFS instance -func NewDiskFS() FS { - return &DiskFS{} -} - -// Open opens the named file for reading. If successful, methods on -// the returned file can be used for reading; the associated file -// descriptor has mode O_RDONLY. -// If there is an error, it will be of type *PathError. -func (dfs *DiskFS) Open(name string) (File, error) { - return dfs.OpenFile(name, os.O_RDONLY, 0) -} - -func (dfs *DiskFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - dir := filepath.Dir(name) - if _, err := os.Stat(dir); os.IsNotExist(err) { - if err := os.MkdirAll(dir, 0744); err != nil { - return nil, err - } - } - return os.OpenFile(name, flag, perm) -} - -// ReadFile reads the file named by filename and returns the contents. -func (dfs *DiskFS) ReadFile(name string) ([]byte, error) { - return os.ReadFile(name) -} - -// WriteFile writes data to a file named by filename. -func (dfs *DiskFS) WriteFile(name string, data []byte, perm os.FileMode) error { - return os.WriteFile(name, data, perm) -} - -// Remove removes the named file or (empty) directory. -// If there is an error, it will be of type *PathError. -func (dfs *DiskFS) Remove(name string) error { - return os.Remove(name) -} - -// MkdirAll creates a directory named path -func (dfs *DiskFS) MkdirAll(path string, perm os.FileMode) error { - return os.MkdirAll(path, perm) -} - -// Stat returns a FileInfo describing the named file. -// If there is an error, it will be of type *PathError. -func (dfs *DiskFS) Stat(name string) (fs.FileInfo, error) { - return os.Stat(name) -} - -func (dfs *DiskFS) LoadProgress(progressID string) ([]byte, error) { - return dfs.ReadFile(progressID) -} - -func (dfs *DiskFS) SaveProgress(progressID string, data []byte, perm fs.FileMode) error { - return dfs.WriteFile(progressID, data, perm) -} - -func (dfs *DiskFS) RemoveProgress(progressID string) error { - return dfs.Remove(progressID) -} - -func (dfs *DiskFS) StoreLogs(key string, data string) error { - return nil -} - -func (dfs *DiskFS) CreateDirectory(_ string) error { - return nil -} - -func (dfs *DiskFS) GetFileHandler(_, name string) (File, error) { - dir := filepath.Dir(name) - if _, err := os.Stat(dir); os.IsNotExist(err) { - if err := os.MkdirAll(dir, 0744); err != nil { - return nil, err - } - } - return os.OpenFile(name, os.O_CREATE|os.O_WRONLY, 0644) -} - -func (dfs *DiskFS) RemoveAllDirectories() { -} diff --git a/core/sys/fs_mem.go b/core/sys/fs_mem.go deleted file mode 100644 index a07552efe..000000000 --- a/core/sys/fs_mem.go +++ /dev/null @@ -1,236 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package sys - -import ( - "encoding/json" - "errors" - "io/fs" - "os" - "path/filepath" - "strings" - "sync" - "syscall/js" - "time" - - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/valyala/bytebufferpool" -) - -// MemFS implement file system on memory -type MemFS struct { - files map[string]*MemFile - dirs map[string]js.Value - sync.Mutex -} - -// NewMemFS create MemFS instance -func NewMemFS() FS { - return &MemFS{ - files: make(map[string]*MemFile), - dirs: make(map[string]js.Value), - } -} - -// Open opens the named file for reading. If successful, methods on -// the returned file can be used for reading; the associated file -// descriptor has mode O_RDONLY. -// If there is an error, it will be of type *PathError. -func (mfs *MemFS) Open(name string) (File, error) { - mfs.Lock() - defer mfs.Unlock() - file := mfs.files[name] - if file != nil { - return file, nil - } - - fileName := filepath.Base(name) - - file = &MemFile{Name: fileName, Mode: fs.ModePerm, ModTime: time.Now()} - - mfs.files[name] = file - - return file, nil -} - -func (mfs *MemFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - mfs.Lock() - defer mfs.Unlock() - file := mfs.files[name] - if file != nil { - return file, nil - } - - fileName := filepath.Base(name) - file = &MemFile{Name: fileName, Mode: perm, ModTime: time.Now()} - - mfs.files[name] = file - - return file, nil - -} - -// ReadFile reads the file named by filename and returns the contents. -func (mfs *MemFS) ReadFile(name string) ([]byte, error) { - mfs.Lock() - defer mfs.Unlock() - file, ok := mfs.files[name] - if ok { - return file.Buffer, nil - } - - return nil, os.ErrNotExist -} - -// WriteFile writes data to a file named by filename. -func (mfs *MemFS) WriteFile(name string, data []byte, perm os.FileMode) error { - fileName := filepath.Base(name) - file := &MemFile{Name: fileName, Mode: perm, ModTime: time.Now()} - mfs.Lock() - defer mfs.Unlock() - mfs.files[name] = file - - return nil -} - -// Remove removes the named file or (empty) directory. -// If there is an error, it will be of type *PathError. -func (mfs *MemFS) Remove(name string) error { - mfs.Lock() - defer mfs.Unlock() - f, ok := mfs.files[name] - if ok { - b := f.Buffer - if len(b) > 0 { - buff := &bytebufferpool.ByteBuffer{ - B: b, - } - common.MemPool.Put(buff) - } - } - delete(mfs.files, name) - return nil -} - -// MkdirAll creates a directory named path -func (mfs *MemFS) MkdirAll(path string, perm os.FileMode) error { - return nil -} - -// Stat returns a FileInfo describing the named file. -// If there is an error, it will be of type *PathError. -func (mfs *MemFS) Stat(name string) (fs.FileInfo, error) { - mfs.Lock() - defer mfs.Unlock() - file, ok := mfs.files[name] - if ok { - return file.Stat() - } - - return nil, os.ErrNotExist -} - -func (mfs *MemFS) LoadProgress(progressID string) ([]byte, error) { - key := filepath.Base(progressID) - val := js.Global().Get("localStorage").Call("getItem", key) - if val.Truthy() { - return []byte(val.String()), nil - } - return nil, os.ErrNotExist -} - -func (mfs *MemFS) SaveProgress(progressID string, data []byte, _ fs.FileMode) error { - key := filepath.Base(progressID) - js.Global().Get("localStorage").Call("setItem", key, string(data)) - return nil -} - -func (mfs *MemFS) RemoveProgress(progressID string) error { - key := filepath.Base(progressID) - js.Global().Get("localStorage").Call("removeItem", key) - return nil -} - -func (mfs *MemFS) StoreLogs(key string, data string) error { - //get existing logs - var logs []string - val := js.Global().Get("localStorage").Call("getItem", key) - if val.Truthy() { - json.Unmarshal([]byte(val.String()), &logs) - } - //append new logs - logs = append(logs, data) - //store logs - encodedData, err := json.Marshal(logs) - if err != nil { - return err - } - js.Global().Get("localStorage").Call("setItem", key, string(encodedData)) - return nil -} - -func (mfs *MemFS) CreateDirectory(dirID string) error { - if !js.Global().Get("showDirectoryPicker").Truthy() || !js.Global().Get("WritableStream").Truthy() { - return errors.New("dir_picker: not supported") - } - showDirectoryPicker := js.Global().Get("showDirectoryPicker") - dirHandle, err := jsbridge.Await(showDirectoryPicker.Invoke()) - if len(err) > 0 && !err[0].IsNull() { - return errors.New("dir_picker: " + err[0].String()) - } - mfs.dirs[dirID] = dirHandle[0] - return nil -} - -func (mfs *MemFS) GetFileHandler(dirID, path string) (File, error) { - dirHandler, ok := mfs.dirs[dirID] - if !ok { - return nil, errors.New("dir_picker: directory not found") - } - currHandler, err := mfs.mkdir(dirHandler, filepath.Dir(path)) - if err != nil { - return nil, err - } - return jsbridge.NewFileWriterFromHandle(currHandler, filepath.Base(path)) -} - -func (mfs *MemFS) RemoveAllDirectories() { - for k := range mfs.dirs { - delete(mfs.dirs, k) - } -} - -func (mfs *MemFS) mkdir(dirHandler js.Value, dirPath string) (js.Value, error) { - if dirPath == "/" { - return dirHandler, nil - } - currHandler, ok := mfs.dirs[dirPath] - if !ok { - currHandler = dirHandler - paths := strings.Split(dirPath, "/") - paths = paths[1:] - currPath := "/" - for _, path := range paths { - currPath = filepath.Join(currPath, path) - handler, ok := mfs.dirs[currPath] - if ok { - currHandler = handler - continue - } - options := js.Global().Get("Object").New() - options.Set("create", true) - currHandlers, err := jsbridge.Await(currHandler.Call("getDirectoryHandle", path, options)) - if len(err) > 0 && !err[0].IsNull() { - return js.Value{}, errors.New("dir_picker: " + err[0].String()) - } - currHandler = currHandlers[0] - mfs.dirs[currPath] = currHandler - } - if !currHandler.Truthy() { - return js.Value{}, errors.New("dir_picker: failed to create directory") - } - } - return currHandler, nil -} diff --git a/core/sys/sign.go b/core/sys/sign.go deleted file mode 100644 index 37ac18479..000000000 --- a/core/sys/sign.go +++ /dev/null @@ -1,16 +0,0 @@ -package sys - -// KeyPair private and publickey -type KeyPair struct { - PublicKey string `json:"public_key"` - PrivateKey string `json:"private_key"` -} - -// SignFunc sign method for request verification -type SignFunc func(hash string, signatureScheme string, keys []KeyPair) (string, error) - -type VerifyFunc func(signature string, msg string) (bool, error) - -type VerifyWithFunc func(pk, signature string, msg string) (bool, error) - -type AuthorizeFunc func(msg string) (string, error) diff --git a/core/sys/util.go b/core/sys/util.go deleted file mode 100644 index 14ef762da..000000000 --- a/core/sys/util.go +++ /dev/null @@ -1,307 +0,0 @@ -package sys - -import ( - "bytes" - "io" - "io/fs" - "os" - "time" - - "github.com/0chain/gosdk/core/common" - "github.com/valyala/bytebufferpool" -) - -// MemFile represents a file totally loaded in memory -// Aware of the file size, so it can seek and truncate. -type MemFile struct { - Name string - Buffer []byte // file content - Mode fs.FileMode // FileInfo.Mode - ModTime time.Time // FileInfo.ModTime - Sys interface{} // FileInfo.Sys - reader io.Reader -} - -// Stat returns the file information -func (f *MemFile) Stat() (fs.FileInfo, error) { - return &MemFileInfo{name: f.Name, f: f}, nil -} - -// Read reads data from the file -func (f *MemFile) Read(p []byte) (int, error) { - if f.reader == nil { - f.reader = bytes.NewReader(f.Buffer) - } - return f.reader.Read(p) - -} - -// Write writes data to the file -func (f *MemFile) Write(p []byte) (n int, err error) { - f.Buffer = append(f.Buffer, p...) - return len(p), nil -} - -// WriteAt writes data to the file at a specific offset -func (f *MemFile) WriteAt(p []byte, offset int64) (n int, err error) { - if offset < 0 || offset > int64(len(f.Buffer)) || len(p) > len(f.Buffer)-int(offset) { - return 0, io.ErrShortWrite - } - - copy(f.Buffer[offset:], p) - - return len(p), nil -} - -// InitBuffer initializes the buffer with a specific size -func (f *MemFile) InitBuffer(size int) { - buff := common.MemPool.Get() - if cap(buff.B) < size { - buff.B = make([]byte, size) - } - f.Buffer = buff.B[:size] -} - -// Sync not implemented -func (f *MemFile) Sync() error { - return nil -} -func (f *MemFile) Seek(offset int64, whence int) (ret int64, err error) { - - if whence != io.SeekStart { - return 0, os.ErrInvalid - } - switch { - case offset < 0: - return 0, os.ErrInvalid - case offset > int64(len(f.Buffer)): - return 0, io.EOF - default: - f.reader = bytes.NewReader(f.Buffer[offset:]) - return offset, nil - } -} - -func (f *MemFile) Close() error { - f.reader = nil - return nil -} - -// MemFileInfo represents file information -type MemFileInfo struct { - name string - f *MemFile -} - -// Name returns the base name of the file -func (i *MemFileInfo) Name() string { - return i.name -} - -// Size returns the size of the file -func (i *MemFileInfo) Size() int64 { - return int64(len(i.f.Buffer)) -} - -// Mode returns the file mode bits -func (i *MemFileInfo) Mode() fs.FileMode { - return i.f.Mode -} - -// Type returns the file mode type -func (i *MemFileInfo) Type() fs.FileMode { - return i.f.Mode.Type() -} - -// ModTime returns the modification time of the file -func (i *MemFileInfo) ModTime() time.Time { - return i.f.ModTime -} - -// IsDir returns true if the file is a directory -func (i *MemFileInfo) IsDir() bool { - return i.f.Mode&fs.ModeDir != 0 -} - -// Sys returns the underlying data source (can return nil) -func (i *MemFileInfo) Sys() interface{} { - return i.f.Sys -} - -// Info returns the file information -func (i *MemFileInfo) Info() (fs.FileInfo, error) { - return i, nil -} - -// MemChanFile used to read or write file content sequentially through a buffer channel. -// Not aware of the file size, so it can't seek or truncate. -type MemChanFile struct { - Name string - Buffer chan []byte // file content - Mode fs.FileMode // FileInfo.Mode - ModTime time.Time // FileInfo.ModTime - ChunkWriteSize int // 0 value means no limit - Sys interface{} // FileInfo.Sys - ErrChan chan error - data []byte -} - -// Stat returns the file information -func (f *MemChanFile) Stat() (fs.FileInfo, error) { - return &MemFileChanInfo{name: f.Name, f: f}, nil -} - -// Read reads data from the file through the buffer channel -// It returns io.EOF when the buffer channel is closed. -// - p: file in bytes loaded from the buffer channel -func (f *MemChanFile) Read(p []byte) (int, error) { - select { - case err := <-f.ErrChan: - return 0, err - case recieveData, ok := <-f.Buffer: - if !ok { - return 0, io.EOF - } - if len(recieveData) > len(p) { - return 0, io.ErrShortBuffer - } - n := copy(p, recieveData) - return n, nil - } -} - -// Write writes data to the file through the buffer channel -// It writes the data to the buffer channel in chunks of ChunkWriteSize. -// If ChunkWriteSize is 0, it writes the data as a whole. -// - p: file in bytes to write to the buffer channel -func (f *MemChanFile) Write(p []byte) (n int, err error) { - if f.ChunkWriteSize == 0 { - data := make([]byte, len(p)) - copy(data, p) - f.Buffer <- data - } else { - if cap(f.data) == 0 { - bbuf := common.MemPool.Get() - if cap(bbuf.B) < len(p) { - bbuf.B = make([]byte, 0, len(p)) - } - f.data = bbuf.B - } - f.data = append(f.data, p...) - } - return len(p), nil -} - -// Sync write the data chunk to the buffer channel -// It writes the data to the buffer channel in chunks of ChunkWriteSize. -// If ChunkWriteSize is 0, it writes the data as a whole. -func (f *MemChanFile) Sync() error { - current := 0 - for ; current < len(f.data); current += f.ChunkWriteSize { - end := current + f.ChunkWriteSize - if end > len(f.data) { - end = len(f.data) - } - f.Buffer <- f.data[current:end] - } - f.data = f.data[:0] - return nil -} - -// Seek not implemented -func (f *MemChanFile) Seek(offset int64, whence int) (ret int64, err error) { - return 0, nil -} - -// Close closes the buffer channel -func (f *MemChanFile) Close() error { - close(f.Buffer) - if cap(f.data) > 0 { - bbuf := &bytebufferpool.ByteBuffer{ - B: f.data, - } - common.MemPool.Put(bbuf) - } - return nil -} - -// MemFileChanInfo represents file information -type MemFileChanInfo struct { - name string - f *MemChanFile -} - -// Name returns the base name of the file -func (i *MemFileChanInfo) Name() string { - return i.name -} - -// Size not implemented -func (i *MemFileChanInfo) Size() int64 { - return 0 -} - -// Mode returns the file mode bits -func (i *MemFileChanInfo) Mode() fs.FileMode { - return i.f.Mode -} - -// Type returns the file mode type -func (i *MemFileChanInfo) Type() fs.FileMode { - return i.f.Mode.Type() -} - -// ModTime returns the modification time of the file -func (i *MemFileChanInfo) ModTime() time.Time { - return i.f.ModTime -} - -// IsDir returns true if the file is a directory -func (i *MemFileChanInfo) IsDir() bool { - return i.f.Mode&fs.ModeDir != 0 -} - -// Sys returns the underlying data source (can return nil) -func (i *MemFileChanInfo) Sys() interface{} { - return i.f.Sys -} - -// Info returns the file information -func (i *MemFileChanInfo) Info() (fs.FileInfo, error) { - return i, nil -} - -// wrapper over io pipe to implement File interface -type PipeFile struct { - w *io.PipeWriter - r *io.PipeReader -} - -func NewPipeFile() *PipeFile { - r, w := io.Pipe() - return &PipeFile{w: w, r: r} -} - -func (pf *PipeFile) Write(p []byte) (int, error) { - return pf.w.Write(p) -} - -func (pf *PipeFile) Close() error { - return pf.w.Close() -} - -func (pf *PipeFile) Read(p []byte) (int, error) { - return pf.r.Read(p) -} - -func (pf *PipeFile) Stat() (fs.FileInfo, error) { - return nil, nil -} - -func (pf *PipeFile) Sync() error { - return nil -} - -func (pf *PipeFile) Seek(offset int64, whence int) (int64, error) { - return 0, nil -} diff --git a/core/sys/vars.go b/core/sys/vars.go deleted file mode 100644 index f1f0fde5c..000000000 --- a/core/sys/vars.go +++ /dev/null @@ -1,40 +0,0 @@ -// Package sys provides platform-independent interfaces to support webassembly runtime -package sys - -import ( - "time" -) - -var ( - //Files file system implementation on sdk. DiskFS doesn't work on webassembly. it should be initialized with common.NewMemFS() - Files FS = NewDiskFS() - - //Sleep pauses the current goroutine for at least the duration. - // time.Sleep will stop webassembly main thread. it should be bridged to javascript method on webassembly sdk - Sleep = time.Sleep - - // Sign sign method. it should be initialized on different platform. - Sign SignFunc - SignWithAuth SignFunc - - // Verify verify method. it should be initialized on different platform. - Verify VerifyFunc - - // Verify verify method. it should be initialized on different platform. - VerifyWith VerifyWithFunc - - Authorize AuthorizeFunc - - AuthCommon AuthorizeFunc - - VerifyEd25519With VerifyWithFunc -) - -// SetAuthorize sets the authorize callback function -func SetAuthorize(auth AuthorizeFunc) { - Authorize = auth -} - -func SetAuthCommon(auth AuthorizeFunc) { - AuthCommon = auth -} diff --git a/core/tokenrate/bancor.go b/core/tokenrate/bancor.go deleted file mode 100644 index 2f3a4d501..000000000 --- a/core/tokenrate/bancor.go +++ /dev/null @@ -1,143 +0,0 @@ -package tokenrate - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - "strconv" - "strings" - - "github.com/0chain/gosdk/core/resty" -) - -type bancorQuoteQuery struct { -} - -func (qq *bancorQuoteQuery) getUSD(ctx context.Context, symbol string) (float64, error) { - - var result bancorResponse - - s := strings.ToLower(symbol) - var dltId string - // - switch s { - case "zcn": - dltId = "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78" - case "eth": - dltId = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" - default: - evnName := "BANCOR_DLTID_" + strings.ToUpper(symbol) - id, ok := os.LookupEnv(evnName) - if !ok { - return 0, errors.New("bancor: please configure dlt_id on environment variable [" + evnName + "] first") - } - dltId = id - } - - r := resty.New() - r.DoGet(ctx, "https://api-v3.bancor.network/tokens?dlt_id="+dltId). - Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - - if err != nil { - return err - } - - if resp.StatusCode != http.StatusOK { - return errors.New("bancor: " + strconv.Itoa(resp.StatusCode) + resp.Status) - } - - err = json.Unmarshal(respBody, &result) - if err != nil { - return err - } - - result.Raw = string(respBody) - - return nil - - }) - - errs := r.Wait() - if len(errs) > 0 { - return 0, errs[0] - } - - rate, ok := result.Data.Rate24hAgo["usd"] - - if ok { - - if rate.Value > 0 { - return rate.Value, nil - } - - //rate24ago is invalid, try get current rate - rate, ok = result.Data.Rate["usd"] - if ok && rate.Value > 0 { - return rate.Value, nil - } - } - - return 0, fmt.Errorf("bancor: %s price is not provided on bancor apis", symbol) -} - -// { -// "data": { -// "dltId": "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78", -// "symbol": "ZCN", -// "decimals": 10, -// "rate": { -// "bnt": "0.271257342312491431", -// "usd": "0.118837", -// "eur": "0.121062", -// "eth": "0.000089243665620809" -// }, -// "rate24hAgo": { -// "bnt": "0.273260935543748855", -// "usd": "0.120972", -// "eur": "0.126301", -// "eth": "0.000094001761827049" -// } -// }, -// "timestamp": { -// "ethereum": { -// "block": 15644407, -// "timestamp": 1664519843 -// } -// } -// } - -type bancorResponse struct { - Data bancorMarketData `json:"data"` - Raw string `json:"-"` -} - -type bancorMarketData struct { - Rate map[string]Float64 `json:"rate"` - Rate24hAgo map[string]Float64 `json:"rate24hAgo"` -} - -type Float64 struct { - Value float64 -} - -func (s *Float64) UnmarshalJSON(data []byte) error { - - if data == nil { - s.Value = 0 - return nil - } - - js := strings.Trim(string(data), "\"") - - v, err := strconv.ParseFloat(js, 64) - if err != nil { - return err - } - - s.Value = v - return nil - -} diff --git a/core/tokenrate/bancor_test.go b/core/tokenrate/bancor_test.go deleted file mode 100644 index 94a9899f2..000000000 --- a/core/tokenrate/bancor_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package tokenrate - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestBancorJson(t *testing.T) { - js := ` { - "data": { - "dltId": "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78", - "symbol": "ZCN", - "decimals": 10, - "rate": { - "bnt": "0.271257342312491431", - "usd": "0.118837", - "eur": "0.121062", - "eth": "0.000089243665620809" - }, - "rate24hAgo": { - "bnt": "0.273260935543748855", - "usd": "0.120972", - "eur": "0.126301", - "eth": "0.000094001761827049" - } - }, - "timestamp": { - "ethereum": { - "block": 15644407, - "timestamp": 1664519843 - } - } - }` - bs := &bancorResponse{} - - err := json.Unmarshal([]byte(js), bs) - require.Nil(t, err) - - require.Equal(t, 0.118837, bs.Data.Rate["usd"].Value) - require.Equal(t, 0.120972, bs.Data.Rate24hAgo["usd"].Value) - -} diff --git a/core/tokenrate/coingecko.go b/core/tokenrate/coingecko.go deleted file mode 100644 index 440a77f30..000000000 --- a/core/tokenrate/coingecko.go +++ /dev/null @@ -1,83 +0,0 @@ -package tokenrate - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strconv" - - "github.com/0chain/gosdk/core/resty" -) - -type coingeckoQuoteQuery struct { -} - -func (qq *coingeckoQuoteQuery) getUSD(ctx context.Context, symbol string) (float64, error) { - - var result coingeckoResponse - - r := resty.New() - r.DoGet(ctx, "https://zcnprices.zus.network/market"). - Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - - if err != nil { - return err - } - - if resp.StatusCode != http.StatusOK { - return errors.New("market API: " + strconv.Itoa(resp.StatusCode) + resp.Status) - } - - err = json.Unmarshal(respBody, &result) - if err != nil { - return err - } - result.Raw = string(respBody) - - return nil - - }) - - errs := r.Wait() - if len(errs) > 0 { - return 0, errs[0] - } - - var rate float64 - - h, ok := result.MarketData.High24h["usd"] - if ok { - l, ok := result.MarketData.Low24h["usd"] - if ok { - rate = (h + l) / 2 - if rate > 0 { - return rate, nil - } - } - } - - rate, ok = result.MarketData.CurrentPrice["usd"] - - if ok { - if rate > 0 { - return rate, nil - } - - return 0, fmt.Errorf("market API: invalid response %s", result.Raw) - } - - return 0, fmt.Errorf("market API: %s price is not provided on internal https://zcnprices.zus.network/market api", symbol) -} - -type coingeckoResponse struct { - MarketData coingeckoMarketData `json:"market_data"` - Raw string `json:"-"` -} - -type coingeckoMarketData struct { - CurrentPrice map[string]float64 `json:"current_price"` - High24h map[string]float64 `json:"high_24h"` - Low24h map[string]float64 `json:"low_24h"` -} diff --git a/core/tokenrate/coinmarketcap.go b/core/tokenrate/coinmarketcap.go deleted file mode 100644 index 0bba459b1..000000000 --- a/core/tokenrate/coinmarketcap.go +++ /dev/null @@ -1,186 +0,0 @@ -package tokenrate - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "os" - "strconv" - "strings" - - "github.com/0chain/gosdk/core/resty" -) - -type coinmarketcapQuoteQuery struct { - APIKey string -} - -// js call is unsupported for coinmarketcap api due to core issue -// https://coinmarketcap.com/api/documentation/v1/#section/Quick-Start-Guide -// Note: Making HTTP requests on the client side with Javascript is currently prohibited through CORS configuration. This is to protect your API Key which should not be visible to users of your application so your API Key is not stolen. Secure your API Key by routing calls through your own backend service. -func createCoinmarketcapQuoteQuery() quoteQuery { - - coinmarketcapAPIKEY, ok := os.LookupEnv("COINMARKETCAP_API_KEY") - if !ok { - coinmarketcapAPIKEY = "7e386213-56ef-4a7e-af17-806496c20d3b" - } - - return &coinmarketcapQuoteQuery{ - APIKey: coinmarketcapAPIKEY, - } -} - -func (qq *coinmarketcapQuoteQuery) getUSD(ctx context.Context, symbol string) (float64, error) { - - var result coinmarketcapResponse - - r := resty.New(resty.WithHeader(map[string]string{ - "X-CMC_PRO_API_KEY": qq.APIKey, - })) - - s := strings.ToUpper(symbol) - - r.DoGet(ctx, "https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?symbol="+s). - Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { - return err - } - if resp.StatusCode != http.StatusOK { - return errors.New("coinmarketcap: " + strconv.Itoa(resp.StatusCode) + resp.Status) - } - - err = json.Unmarshal(respBody, &result) - if err != nil { - return err - } - - result.Raw = string(respBody) - - return nil - - }) - - errs := r.Wait() - if len(errs) > 0 { - return 0, errs[0] - } - - zcn, ok := result.Data[s] - - if !ok || len(zcn) == 0 { - return 0, errors.New("coinmarketcap: " + symbol + " is not provided on coinmarketcap apis") - } - - rate, ok := zcn[0].Quote["USD"] - if ok { - if rate.Price > 0 { - return rate.Price, nil - } - - return 0, fmt.Errorf("coinmarketcap: invalid response %s", result.Raw) - } - - return 0, errors.New("coinmarketcap: " + symbol + " to USD quote is not provided on coinmarketcap apis") -} - -// { -// "status": { -// "timestamp": "2022-06-03T02:18:34.093Z", -// "error_code": 0, -// "error_message": null, -// "elapsed": 50, -// "credit_count": 1, -// "notice": null -// }, -// "data": { -// "ZCN": [ -// { -// "id": 2882, -// "name": "0Chain", -// "symbol": "ZCN", -// "slug": "0chain", -// "num_market_pairs": 8, -// "date_added": "2018-07-02T00:00:00.000Z", -// "tags": [ -// { -// "slug": "platform", -// "name": "Platform", -// "category": "PROPERTY" -// }, -// { -// "slug": "ai-big-data", -// "name": "AI & Big Data", -// "category": "PROPERTY" -// }, -// { -// "slug": "distributed-computing", -// "name": "Distributed Computing", -// "category": "PROPERTY" -// }, -// { -// "slug": "filesharing", -// "name": "Filesharing", -// "category": "PROPERTY" -// }, -// { -// "slug": "iot", -// "name": "IoT", -// "category": "PROPERTY" -// }, -// { -// "slug": "storage", -// "name": "Storage", -// "category": "PROPERTY" -// } -// ], -// "max_supply": 400000000, -// "circulating_supply": 48400982, -// "total_supply": 200000000, -// "platform": { -// "id": 1027, -// "name": "Ethereum", -// "symbol": "ETH", -// "slug": "ethereum", -// "token_address": "0xb9ef770b6a5e12e45983c5d80545258aa38f3b78" -// }, -// "is_active": 1, -// "cmc_rank": 782, -// "is_fiat": 0, -// "self_reported_circulating_supply": 115000000, -// "self_reported_market_cap": 25409234.858036295, -// "last_updated": "2022-06-03T02:17:00.000Z", -// "quote": { -// "USD": { -// "price": 0.2209498683307504, -// "volume_24h": 28807.79174117, -// "volume_change_24h": -78.341, -// "percent_change_1h": 0.09600341, -// "percent_change_24h": 0.1834049, -// "percent_change_7d": 24.08736297, -// "percent_change_30d": -43.56084388, -// "percent_change_60d": -63.69787917, -// "percent_change_90d": -27.17695342, -// "market_cap": 10694190.59997902, -// "market_cap_dominance": 0.0008, -// "fully_diluted_market_cap": 88379947.33, -// "last_updated": "2022-06-03T02:17:00.000Z" -// } -// } -// } -// ] -// } -// } -type coinmarketcapResponse struct { - Data map[string][]coinmarketcapCurrency `json:"data"` - Raw string `json:"-"` -} - -type coinmarketcapCurrency struct { - Quote map[string]coinmarketcapQuote `json:"quote"` -} - -type coinmarketcapQuote struct { - Price float64 `json:"price"` -} diff --git a/core/tokenrate/doc.go b/core/tokenrate/doc.go deleted file mode 100644 index c268146ea..000000000 --- a/core/tokenrate/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Provides functions to get token rates from different sources (for example: CoinGecko, Bancor, Uniswap, CoinMarketCap). -package tokenrate diff --git a/core/tokenrate/mockresponses/bancor.json b/core/tokenrate/mockresponses/bancor.json deleted file mode 100644 index 5532d34ea..000000000 --- a/core/tokenrate/mockresponses/bancor.json +++ /dev/null @@ -1,25 +0,0 @@ -{ -"data": { - "dltId": "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78", - "symbol": "ZCN", - "decimals": 10, - "rate": { - "bnt": "0.271257342312491431", - "usd": "0.118837", - "eur": "0.121062", - "eth": "0.000089243665620809" - }, - "rate24hAgo": { - "bnt": "0.273260935543748855", - "usd": "0.120972", - "eur": "0.126301", - "eth": "0.000094001761827049" - } -}, -"timestamp": { - "ethereum": { - "block": 15644407, - "timestamp": 1664519843 - } -} -} \ No newline at end of file diff --git a/core/tokenrate/mockresponses/coingecko.json b/core/tokenrate/mockresponses/coingecko.json deleted file mode 100644 index 0afee7141..000000000 --- a/core/tokenrate/mockresponses/coingecko.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "0chain", - "symbol": "zcn", - "name": "Zus", - "asset_platform_id": "ethereum", - "market_data": { - "current_price": { - "aed": 0.801944, - "ars": 42.97, - "usd": 0.218343 - }, - "high_24h": { - "aed": 0.813634, - "ars": 43.39 - }, - "low_24h": { - "aed": 0.770675, - "ars": 41.13 - } - } -} \ No newline at end of file diff --git a/core/tokenrate/mockresponses/coinmarketcap.json b/core/tokenrate/mockresponses/coinmarketcap.json deleted file mode 100644 index 5a2d8996d..000000000 --- a/core/tokenrate/mockresponses/coinmarketcap.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "status": { - "timestamp": "2022-06-03T02:18:34.093Z", - "error_code": 0, - "error_message": null, - "elapsed": 50, - "credit_count": 1, - "notice": null - }, - "data": { - "ZCN": [ - { - "id": 2882, - "name": "0Chain", - "symbol": "ZCN", - "slug": "0chain", - "num_market_pairs": 8, - "date_added": "2018-07-02T00:00:00.000Z", - "tags": [ - { - "slug": "platform", - "name": "Platform", - "category": "PROPERTY" - }, - { - "slug": "ai-big-data", - "name": "AI & Big Data", - "category": "PROPERTY" - }, - { - "slug": "distributed-computing", - "name": "Distributed Computing", - "category": "PROPERTY" - }, - { - "slug": "filesharing", - "name": "Filesharing", - "category": "PROPERTY" - }, - { - "slug": "iot", - "name": "IoT", - "category": "PROPERTY" - }, - { - "slug": "storage", - "name": "Storage", - "category": "PROPERTY" - } - ], - "max_supply": 400000000, - "circulating_supply": 48400982, - "total_supply": 200000000, - "platform": { - "id": 1027, - "name": "Ethereum", - "symbol": "ETH", - "slug": "ethereum", - "token_address": "0xb9ef770b6a5e12e45983c5d80545258aa38f3b78" - }, - "is_active": 1, - "cmc_rank": 782, - "is_fiat": 0, - "self_reported_circulating_supply": 115000000, - "self_reported_market_cap": 25409234.858036295, - "last_updated": "2022-06-03T02:17:00.000Z", - "quote": { - "USD": { - "price": 0.2209498683307504, - "volume_24h": 28807.79174117, - "volume_change_24h": -78.341, - "percent_change_1h": 0.09600341, - "percent_change_24h": 0.1834049, - "percent_change_7d": 24.08736297, - "percent_change_30d": -43.56084388, - "percent_change_60d": -63.69787917, - "percent_change_90d": -27.17695342, - "market_cap": 10694190.59997902, - "market_cap_dominance": 0.0008, - "fully_diluted_market_cap": 88379947.33, - "last_updated": "2022-06-03T02:17:00.000Z" - } - } - } - ] - } -} \ No newline at end of file diff --git a/core/tokenrate/tokenrate.go b/core/tokenrate/tokenrate.go deleted file mode 100644 index d7decffeb..000000000 --- a/core/tokenrate/tokenrate.go +++ /dev/null @@ -1,54 +0,0 @@ -package tokenrate - -import ( - "context" - "errors" -) - -var ErrNoAvailableQuoteQuery = errors.New("token: no available quote query service") -var quotes []quoteQuery - -func init() { - - //priority: uniswap > bancor > coingecko > coinmarketcap - quotes = []quoteQuery{ - &coingeckoQuoteQuery{}, - &bancorQuoteQuery{}, - &uniswapQuoteQuery{}, - createCoinmarketcapQuoteQuery(), - //more query services - } - -} - -func GetUSD(ctx context.Context, symbol string) (float64, error) { - var err error - - ctx, cancel := context.WithCancel(ctx) - defer func() { - cancel() - }() - - for _, q := range quotes { - val, err := q.getUSD(ctx, symbol) - - if err != nil { - continue - } - - if val > 0 { - return val, nil - } - } - - // All conversion APIs failed - if err != nil { - return 0, err - } - - return 0, ErrNoAvailableQuoteQuery -} - -type quoteQuery interface { - getUSD(ctx context.Context, symbol string) (float64, error) -} diff --git a/core/tokenrate/tokenrate_test.go b/core/tokenrate/tokenrate_test.go deleted file mode 100644 index f2e30abde..000000000 --- a/core/tokenrate/tokenrate_test.go +++ /dev/null @@ -1,243 +0,0 @@ -package tokenrate - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/stretchr/testify/mock" - "io" - "log" - "net/http" - "os" - "strings" - "testing" - "time" - - "github.com/0chain/gosdk/zboxcore/mocks" - "github.com/stretchr/testify/require" - - "github.com/0chain/gosdk/core/resty" -) - -func TestGetUSD(t *testing.T) { - mockProviderUrl := "coinProvider" - var mockClient = mocks.HttpClient{} - resty.CreateClient = func(t *http.Transport, timeout time.Duration) resty.Client { - return &mockClient - } - - for _, tc := range []struct { - name string - expectedErr error - expectedValue float64 - timeout time.Duration - symbol string - provider string - setup func(testcaseName, symbol, provider string) - response func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) - }{ - { - name: "ContextDeadlineExceeded", - expectedErr: context.DeadlineExceeded, - timeout: 1 * time.Microsecond, - symbol: "ZCN", - provider: "bancor", - setup: func(testCaseName, symbol, provider string) { - setupMockHttpResponse(&mockClient, provider, mockProviderUrl, "TestGetUSD", testCaseName, "GET", symbol, http.StatusOK, getProviderJsonResponse(t, provider)) - }, - response: getBancorResponse(), - }, - { - name: "TestBancorCorrectSymbol", - expectedErr: nil, - expectedValue: 0.118837, - timeout: 10 * time.Second, - symbol: "ZCN", - provider: "bancor", - setup: func(testCaseName, symbol, provider string) { - setupMockHttpResponse(&mockClient, provider, mockProviderUrl, "TestGetUSD", testCaseName, "GET", symbol, http.StatusOK, getProviderJsonResponse(t, provider)) - }, - response: getBancorResponse(), - }, - { - name: "TestCoinmarketcapCorrectSymbol", - expectedErr: nil, - expectedValue: 0.2209498683307504, - timeout: 10 * time.Second, - symbol: "ZCN", - provider: "coinmarketcap", - setup: func(testCaseName, symbol, provider string) { - setupMockHttpResponse(&mockClient, provider, mockProviderUrl, "TestGetUSD", testCaseName, "GET", symbol, http.StatusOK, getProviderJsonResponse(t, provider)) - }, - response: getCoinmarketcapResponse(), - }, - { - name: "TestCoingeckoCorrectSymbol", - expectedErr: nil, - expectedValue: 0.218343, - timeout: 10 * time.Second, - symbol: "0chain", - provider: "coingecko", - setup: func(testCaseName, symbol, provider string) { - setupMockHttpResponse(&mockClient, provider, mockProviderUrl, "TestGetUSD", testCaseName, "GET", symbol, http.StatusOK, getProviderJsonResponse(t, provider)) - }, - response: getCoinGeckoResponse(), - }, - { - name: "TestCoinmarketcapWrongSymbol", - expectedErr: fmt.Errorf("429, failed to get coin data from provider coinmarketcap for symbol \"wrong\""), - timeout: 10 * time.Second, - symbol: "wrong", - provider: "coinmarketcap", - setup: func(testCaseName, symbol, provider string) { - setupMockHttpResponse(&mockClient, provider, mockProviderUrl, "TestGetUSD", testCaseName, "GET", symbol, http.StatusTooManyRequests, getProviderJsonResponse(t, provider)) - }, - response: getBancorResponse(), - }, - } { - t.Run(tc.name, func(t *testing.T) { - if tc.setup != nil { - tc.setup(tc.name, tc.symbol, tc.provider) - } - var value float64 - var err error - if tc.response != nil { - value, err = tc.response(tc.name, mockProviderUrl, tc.provider, tc.symbol, tc.timeout) - } - - if tc.expectedErr != nil { - require.EqualError(t, err, tc.expectedErr.Error()) - } else { - require.NoError(t, err) - require.Equal(t, value, tc.expectedValue) - } - }) - } -} - -func setupMockHttpResponse( - mockClient *mocks.HttpClient, provider, mockProviderUrl, funcName, testCaseName, httpMethod, symbol string, - statusCode int, body []byte) { - url := funcName + testCaseName + mockProviderUrl + provider - mockClient.On("Do", mock.MatchedBy(func(req *http.Request) bool { - return req.Method == httpMethod && - strings.Contains(req.URL.String(), url) && (req.URL.Query().Get("symbol") == symbol) - })).Return( - &http.Response{ - StatusCode: statusCode, - Body: io.NopCloser(bytes.NewReader(body)), - }, nil).Once() -} - -func getBancorResponse() func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - return func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - var br bancorResponse - ctx, cancel := context.WithTimeout(context.TODO(), timeout) - go func() { - <-ctx.Done() - cancel() - }() - - reqUrl := "TestGetUSD" + testCaseName + mockProviderURL + providerName + "?symbol=" + symbol - r := resty.New(resty.WithRetry(1)) - r.DoGet(ctx, reqUrl).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { - return err - } - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("%v, failed to get coin data from provider %v for symbol \"%v\"", resp.StatusCode, providerName, symbol) - } - err = json.Unmarshal(respBody, &br) - log.Printf("==Response: %v", br) - if err != nil { - return err - } - br.Raw = string(respBody) - return nil - }) - errs := r.Wait() - if len(errs) != 0 { - return 0.0, errs[0] - } - return br.Data.Rate["usd"].Value, nil - } -} - -func getCoinmarketcapResponse() func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - return func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - var cr coinmarketcapResponse - ctx, cancel := context.WithTimeout(context.TODO(), timeout) - go func() { - <-ctx.Done() - cancel() - }() - - reqUrl := "TestGetUSD" + testCaseName + mockProviderURL + providerName + "?symbol=" + symbol - r := resty.New(resty.WithRetry(1)) - r.DoGet(ctx, reqUrl).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { - return err - } - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("failed to get coin data from provider %v for symbol \"%v\"", providerName, symbol) - } - err = json.Unmarshal(respBody, &cr) - if err != nil { - return err - } - cr.Raw = string(respBody) - return nil - }) - errs := r.Wait() - if len(errs) != 0 { - return 0.0, errs[0] - } - if len(cr.Data[strings.ToUpper(symbol)]) == 0 { - return 0.0, fmt.Errorf("coinmarketcap: symbol \"%v\" is not provided on coinmarketcap apis", symbol) - } - val := cr.Data[strings.ToUpper(symbol)][0].Quote["USD"].Price - return val, nil - } -} - -func getCoinGeckoResponse() func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - return func(testCaseName, mockProviderURL, providerName, symbol string, timeout time.Duration) (float64, error) { - var cg coingeckoResponse - ctx, cancel := context.WithTimeout(context.TODO(), timeout) - go func() { - <-ctx.Done() - cancel() - }() - - reqUrl := "TestGetUSD" + testCaseName + mockProviderURL + providerName + "?symbol=" + symbol - r := resty.New(resty.WithRetry(1)) - r.DoGet(ctx, reqUrl).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { - return err - } - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("failed to get coin data from provider %v for symbol \"%v\"", providerName, symbol) - } - err = json.Unmarshal(respBody, &cg) - if err != nil { - return err - } - cg.Raw = string(respBody) - return nil - }) - errs := r.Wait() - if len(errs) != 0 { - return 0.0, errs[0] - } - return cg.MarketData.CurrentPrice["usd"], nil - } -} - -func getProviderJsonResponse(t *testing.T, provider string) []byte { - data, err := os.ReadFile("mockresponses/" + provider + ".json") - if err != nil { - t.Fatal(err) - } - return data -} diff --git a/core/tokenrate/uniswap.go b/core/tokenrate/uniswap.go deleted file mode 100644 index 502c88f0b..000000000 --- a/core/tokenrate/uniswap.go +++ /dev/null @@ -1,100 +0,0 @@ -package tokenrate - -import ( - "context" - "errors" - "strconv" - "strings" - - "github.com/0chain/gosdk/core/resty" - "github.com/machinebox/graphql" -) - -type V2Pair struct { - ID string - VolumeToken0 string - VolumeToken1 string - Token0Price string - Token1Price string - Token0 V2Token - Token1 V2Token -} - -type V2Token struct { - ID string - Symbol string -} - -type Query struct { - ZCN V2Pair - USDC V2Pair -} - -type uniswapQuoteQuery struct { -} - -func (qq *uniswapQuoteQuery) getUSD(ctx context.Context, symbol string) (float64, error) { - - hql := graphql.NewClient("https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2") - - // make a request - req := graphql.NewRequest(` - { - zcn: pair(id:"0xa6890ac41e3a99a427bef68398bf06119fb5e211"){ - token0 { - id - symbol - totalSupply - } - token1 { - id - symbol - totalSupply - } - token0Price - token1Price - volumeToken0 - volumeToken1 - } - - usdc: pair(id:"0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc"){ - token0 { - id - symbol - totalSupply - } - token1 { - id - symbol - totalSupply - } - token0Price - token1Price - volumeToken0 - volumeToken1 - } - } -`) - - for k, v := range resty.DefaultHeader { - req.Header.Add(k, v) - } - - // run it and capture the response - q := &Query{} - if err := hql.Run(ctx, req, q); err != nil { - return 0, err - } - - switch strings.ToUpper(symbol) { - case "ZCN": - ethPerZCN, _ := strconv.ParseFloat(q.ZCN.Token1Price, 64) - usdcPerETH, _ := strconv.ParseFloat(q.USDC.Token0Price, 64) - return ethPerZCN * usdcPerETH, nil - case "ETH": - usdcPerETH, _ := strconv.ParseFloat(q.USDC.Token0Price, 64) - return usdcPerETH, nil - } - - return 0, errors.New("uniswap: quote [" + symbol + "] is unimplemented yet") -} diff --git a/core/transaction/entity.go b/core/transaction/entity.go deleted file mode 100644 index 995a45954..000000000 --- a/core/transaction/entity.go +++ /dev/null @@ -1,670 +0,0 @@ -// Provides low-level functions and types to work with the native smart contract transactions. -package transaction - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "strings" - "sync" - "time" - - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/sys" - "go.uber.org/zap" - - "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/util" - lru "github.com/hashicorp/golang-lru" -) - -var Logger = logger.GetLogger() - -const STORAGE_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7" -const MINERSC_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d9" -const ZCNSC_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0" - -const TXN_SUBMIT_URL = "v1/transaction/put" -const TXN_VERIFY_URL = "v1/transaction/get/confirmation?hash=" -const BLOCK_BY_ROUND_URL = "v1/screst/6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7/block?round=" - -const ( - TxnSuccess = 1 // Indicates the transaction is successful in updating the state or smart contract - TxnChargeableError = 2 // Indicates the transaction is successful in updating the state or smart contract - TxnFail = 3 // Indicates a transaction has failed to update the state or smart contract -) - -// TxnReceipt - a transaction receipt is a processed transaction that contains the output -type TxnReceipt struct { - Transaction *Transaction -} - -// SmartContractTxnData data structure to hold the smart contract transaction data -type SmartContractTxnData struct { - Name string `json:"name"` - InputArgs interface{} `json:"input"` -} - -type StorageAllocation struct { - ID string `json:"id"` - DataShards int `json:"data_shards"` - ParityShards int `json:"parity_shards"` - Size int64 `json:"size"` - Expiration int64 `json:"expiration_date"` - Owner string `json:"owner_id"` - OwnerPublicKey string `json:"owner_public_key"` - ReadRatio *Ratio `json:"read_ratio"` - WriteRatio *Ratio `json:"write_ratio"` - MinLockDemand float64 `json:"min_lock_demand"` -} -type Ratio struct { - ZCN int64 `json:"zcn"` - Size int64 `json:"size"` -} -type RoundBlockHeader struct { - Version string `json:"version"` - CreationDate int64 `json:"creation_date"` - Hash string `json:"block_hash"` - PreviousBlockHash string `json:"previous_block_hash"` - MinerID string `json:"miner_id"` - Round int64 `json:"round"` - RoundRandomSeed int64 `json:"round_random_seed"` - MerkleTreeRoot string `json:"merkle_tree_root"` - StateChangesCount int `json:"state_changes_count"` - StateHash string `json:"state_hash"` - ReceiptMerkleTreeRoot string `json:"receipt_merkle_tree_root"` - NumberOfTxns int64 `json:"num_txns"` -} - -type Block struct { - Hash string `json:"hash" gorm:"uniqueIndex:idx_bhash"` - Version string `json:"version"` - CreationDate int64 `json:"creation_date" gorm:"index:idx_bcreation_date"` - Round int64 `json:"round" gorm:"index:idx_bround"` - MinerID string `json:"miner_id"` - RoundRandomSeed int64 `json:"round_random_seed"` - MerkleTreeRoot string `json:"merkle_tree_root"` - StateHash string `json:"state_hash"` - ReceiptMerkleTreeRoot string `json:"receipt_merkle_tree_root"` - NumTxns int `json:"num_txns"` - MagicBlockHash string `json:"magic_block_hash"` - PrevHash string `json:"prev_hash"` - Signature string `json:"signature"` - ChainId string `json:"chain_id"` - StateChangesCount int `json:"state_changes_count"` - RunningTxnCount string `json:"running_txn_count"` - RoundTimeoutCount int `json:"round_timeout_count"` -} - -const ( - NEW_ALLOCATION_REQUEST = "new_allocation_request" - NEW_FREE_ALLOCATION = "free_allocation_request" - UPDATE_ALLOCATION_REQUEST = "update_allocation_request" - LOCK_TOKEN = "lock" - UNLOCK_TOKEN = "unlock" - - ADD_FREE_ALLOCATION_ASSIGNER = "add_free_storage_assigner" - - // Storage SC - STORAGESC_FINALIZE_ALLOCATION = "finalize_allocation" - STORAGESC_CANCEL_ALLOCATION = "cancel_allocation" - STORAGESC_CREATE_ALLOCATION = "new_allocation_request" - STORAGESC_CREATE_READ_POOL = "new_read_pool" - STORAGESC_READ_POOL_LOCK = "read_pool_lock" - STORAGESC_READ_POOL_UNLOCK = "read_pool_unlock" - STORAGESC_STAKE_POOL_LOCK = "stake_pool_lock" - STORAGESC_STAKE_POOL_UNLOCK = "stake_pool_unlock" - STORAGESC_UPDATE_BLOBBER_SETTINGS = "update_blobber_settings" - STORAGESC_UPDATE_VALIDATOR_SETTINGS = "update_validator_settings" - STORAGESC_UPDATE_ALLOCATION = "update_allocation_request" - STORAGESC_WRITE_POOL_LOCK = "write_pool_lock" - STORAGESC_WRITE_POOL_UNLOCK = "write_pool_unlock" - STORAGESC_UPDATE_SETTINGS = "update_settings" - ADD_HARDFORK = "add_hardfork" - STORAGESC_COLLECT_REWARD = "collect_reward" - STORAGESC_KILL_BLOBBER = "kill_blobber" - STORAGESC_KILL_VALIDATOR = "kill_validator" - STORAGESC_SHUTDOWN_BLOBBER = "shutdown_blobber" - STORAGESC_SHUTDOWN_VALIDATOR = "shutdown_validator" - STORAGESC_RESET_BLOBBER_STATS = "reset_blobber_stats" - STORAGESC_RESET_ALLOCATION_STATS = "reset_allocation_stats" - STORAGESC_RESET_BLOBBER_VERSION = "update_blobber_version" - STORAGESC_INSERT_KILLED_PROVIDER_ID = "insert_killed_provider_id" - - MINERSC_LOCK = "addToDelegatePool" - MINERSC_UNLOCK = "deleteFromDelegatePool" - MINERSC_MINER_SETTINGS = "update_miner_settings" - MINERSC_SHARDER_SETTINGS = "update_sharder_settings" - MINERSC_UPDATE_SETTINGS = "update_settings" - MINERSC_UPDATE_GLOBALS = "update_globals" - MINERSC_MINER_DELETE = "delete_miner" - MINERSC_SHARDER_DELETE = "delete_sharder" - MINERSC_COLLECT_REWARD = "collect_reward" - MINERSC_KILL_MINER = "kill_miner" - MINERSC_KILL_SHARDER = "kill_sharder" - - // Faucet SC - FAUCETSC_UPDATE_SETTINGS = "update-settings" - - // ZCNSC smart contract - - ZCNSC_UPDATE_GLOBAL_CONFIG = "update-global-config" - ZCNSC_UPDATE_AUTHORIZER_CONFIG = "update-authorizer-config" - ZCNSC_ADD_AUTHORIZER = "add-authorizer" - ZCNSC_AUTHORIZER_HEALTH_CHECK = "authorizer-health-check" - ZCNSC_DELETE_AUTHORIZER = "delete-authorizer" - ZCNSC_COLLECT_REWARD = "collect-rewards" - ZCNSC_LOCK = "add-to-delegate-pool" - ZCNSC_UNLOCK = "delete-from-delegate-pool" - - ESTIMATE_TRANSACTION_COST = `/v1/estimate_txn_fee` - FEES_TABLE = `/v1/fees_table` -) - -type SignFunc = func(msg string) (string, error) -type VerifyFunc = func(publicKey, signature, msgHash string) (bool, error) -type SignWithWallet = func(msg string, wallet interface{}) (string, error) - -var cache *lru.Cache - -func init() { - var err error - cache, err = lru.New(100) - if err != nil { - fmt.Println("caching Initilization failed, err:", err) - } -} - -func NewTransactionEntity(clientID string, chainID string, publicKey string, nonce int64) *Transaction { - txn := &Transaction{} - txn.Version = "1.0" - txn.ClientID = clientID - txn.CreationDate = int64(common.Now()) - txn.ChainID = chainID - txn.PublicKey = publicKey - txn.TransactionNonce = nonce - return txn -} - -func (t *Transaction) ComputeHashAndSignWithWallet(signHandler SignWithWallet, signingWallet interface{}) error { - t.ComputeHashData() - var err error - t.Signature, err = signHandler(t.Hash, signingWallet) - if err != nil { - return err - } - return nil -} - -func (t *Transaction) getAuthorize() (string, error) { - jsonByte, err := json.Marshal(t) - if err != nil { - return "", err - } - - if sys.Authorize == nil { - return "", errors.New("not_initialized", "no authorize func is set, define it in native code and set in sys") - } - - authorize, err := sys.Authorize(string(jsonByte)) - if err != nil { - return "", err - } - - return authorize, nil -} - -func (t *Transaction) ComputeHashAndSign(signHandler SignFunc) error { - t.ComputeHashData() - var err error - t.Signature, err = signHandler(t.Hash) - if err != nil { - return err - } - return nil -} - -func (t *Transaction) ComputeHashData() { - hashdata := fmt.Sprintf("%v:%v:%v:%v:%v:%v", t.CreationDate, t.TransactionNonce, t.ClientID, - t.ToClientID, t.Value, encryption.Hash(t.TransactionData)) - t.Hash = encryption.Hash(hashdata) -} - -func (t *Transaction) DebugJSON() []byte { - jsonByte, err := json.MarshalIndent(t, "", " ") - if err != nil { - panic(err) // This JSONify function only supposed to be debug-only anyway. - } - return jsonByte -} - -// GetHash - implement interface -func (rh *TxnReceipt) GetHash() string { - return rh.Transaction.OutputHash -} - -/*GetHashBytes - implement Hashable interface */ -func (rh *TxnReceipt) GetHashBytes() []byte { - return util.HashStringToBytes(rh.Transaction.OutputHash) -} - -// NewTransactionReceipt - create a new transaction receipt -func NewTransactionReceipt(t *Transaction) *TxnReceipt { - return &TxnReceipt{Transaction: t} -} - -// VerifySigWith verify the signature with the given public key and handler -func (t *Transaction) VerifySigWith(pubkey string, verifyHandler VerifyFunc) (bool, error) { - // Store the hash - hash := t.Hash - t.ComputeHashData() - if t.Hash != hash { - return false, errors.New("verify_transaction", fmt.Sprintf(`{"error":"hash_mismatch", "expected":"%v", "actual":%v"}`, t.Hash, hash)) - } - return verifyHandler(pubkey, t.Signature, t.Hash) -} - -func SendTransactionSync(txn *Transaction, miners []string) error { - const requestTimeout = 3 * time.Second // Timeout for each request - - fails := make(chan error, len(miners)) - var wg sync.WaitGroup - - for _, miner := range miners { - wg.Add(1) - minerURL := fmt.Sprintf("%v/%v", miner, TXN_SUBMIT_URL) - - go func(url string) { - defer wg.Done() - - // Create a context with a 30-second timeout for each request - ctx, cancel := context.WithTimeout(context.Background(), requestTimeout) - defer cancel() - - _, err := sendTransactionToURL(ctx, url, txn) - if err != nil { - fails <- err - } - }(minerURL) - } - - // Close the channel when all requests are finished - go func() { - wg.Wait() - close(fails) - }() - - // Collect errors from all requests - var failureCount int - messages := make(map[string]int) - - for err := range fails { - if err != nil { - failureCount++ - messages[err.Error()]++ - } - } - - // Identify the most frequent error - var maxCount int - var dominantErr string - for msg, count := range messages { - if count > maxCount { - maxCount = count - dominantErr = msg - } - } - - if failureCount == len(miners) { - return fmt.Errorf(dominantErr) - } - return nil -} - -func sendTransactionToURL(ctx context.Context, url string, txn *Transaction) ([]byte, error) { - // Create a new HTTP POST request with context - postReq, err := util.NewHTTPPostRequest(url, txn) - if err != nil { - return nil, fmt.Errorf("error creating HTTP request: %w", err) - } - - // Use the provided context in the request's Post method - postReq.Ctx = ctx - postResponse, err := postReq.Post() - if err != nil { - return nil, fmt.Errorf("submit transaction failed: %w", err) - } - - if postResponse.StatusCode >= 200 && postResponse.StatusCode <= 299 { - return []byte(postResponse.Body), nil - } - - return nil, fmt.Errorf("submit transaction failed: %s", postResponse.Body) -} - -type cachedObject struct { - Expiration time.Duration - Value interface{} -} - -func retriveFromTable(table map[string]map[string]int64, txnName, toAddress string) (uint64, error) { - var fees uint64 - if val, ok := table[toAddress]; ok { - fees = uint64(val[txnName]) - } else { - if txnName == "transfer" { - fees = uint64(table["transfer"]["transfer"]) - } else { - return 0, fmt.Errorf("failed to get fees for txn %s", txnName) - } - } - return fees, nil -} - -// EstimateFee estimates transaction fee -func EstimateFee(txn *Transaction, miners []string, reqPercent ...float32) (uint64, error) { - const minReqNum = 3 - var reqN int - - if len(reqPercent) > 0 { - reqN = int(reqPercent[0] * float32(len(miners))) - } - - txData := txn.TransactionData - - var sn SmartContractTxnData - err := json.Unmarshal([]byte(txData), &sn) - if err != nil { - return 0, err - } - - txnName := sn.Name - txnName = strings.ToLower(txnName) - toAddress := txn.ToClientID - - reqN = util.MaxInt(minReqNum, reqN) - reqN = util.MinInt(reqN, len(miners)) - randomMiners := util.Shuffle(miners)[:reqN] - - // Retrieve the object from the cache - cached, ok := cache.Get(FEES_TABLE) - if ok { - cachedObj, ok := cached.(*cachedObject) - if ok { - table := cachedObj.Value.(map[string]map[string]int64) - fees, err := retriveFromTable(table, txnName, toAddress) - if err != nil { - return 0, err - } - return fees, nil - } - } - - table, err := GetFeesTable(randomMiners, reqPercent...) - if err != nil { - return 0, err - } - - fees, err := retriveFromTable(table, txnName, toAddress) - if err != nil { - return 0, err - } - - cache.Add(FEES_TABLE, &cachedObject{ - Expiration: 30 * time.Hour, - Value: table, - }) - - return fees, nil -} - -// GetFeesTable get fee tables -func GetFeesTable(miners []string, reqPercent ...float32) (map[string]map[string]int64, error) { - const minReqNum = 3 - var reqN int - - if len(reqPercent) > 0 { - reqN = int(reqPercent[0] * float32(len(miners))) - } - - reqN = util.MaxInt(minReqNum, reqN) - reqN = util.MinInt(reqN, len(miners)) - randomMiners := util.Shuffle(miners)[:reqN] - - var ( - feesC = make(chan string, reqN) - errC = make(chan error, reqN) - ) - - wg := &sync.WaitGroup{} - wg.Add(len(randomMiners)) - - for _, miner := range randomMiners { - go func(minerUrl string) { - defer wg.Done() - - url := minerUrl + FEES_TABLE - req, err := util.NewHTTPGetRequest(url) - if err != nil { - errC <- fmt.Errorf("create request failed, url: %s, err: %v", url, err) - return - } - - res, err := req.Get() - if err != nil { - errC <- fmt.Errorf("request failed, url: %s, err: %v", url, err) - return - } - - if res.StatusCode == http.StatusOK { - feesC <- res.Body - return - } - - feesC <- "" - - }(miner) - } - - // wait for requests to complete - wg.Wait() - close(feesC) - close(errC) - - feesCount := make(map[string]int, reqN) - for f := range feesC { - feesCount[f]++ - } - - if len(feesCount) > 0 { - var ( - max int - fees string - ) - - for f, count := range feesCount { - if f != "" && count > max { - max = count - fees = f - } - } - - feesTable := make(map[string]map[string]int64) - err := json.Unmarshal([]byte(fees), &feesTable) - if err != nil { - return nil, errors.New("failed to get fees table", err.Error()) - } - - return feesTable, nil - } - - errs := make([]string, 0, reqN) - for err := range errC { - errs = append(errs, err.Error()) - } - - return nil, errors.New("failed to get fees table", strings.Join(errs, ",")) -} - -func SmartContractTxn(scAddress string, sn SmartContractTxnData, verifyTxn bool, clients ...string) ( - hash, out string, nonce int64, txn *Transaction, err error) { - return SmartContractTxnValue(scAddress, sn, 0, verifyTxn, clients...) -} - -func SmartContractTxnValue(scAddress string, sn SmartContractTxnData, value uint64, verifyTxn bool, clients ...string) ( - hash, out string, nonce int64, txn *Transaction, err error) { - - return SmartContractTxnValueFeeWithRetry(scAddress, sn, value, client.TxnFee(), verifyTxn, clients...) -} - -func SmartContractTxnValueFeeWithRetry(scAddress string, sn SmartContractTxnData, - value, fee uint64, verifyTxn bool, clients ...string) (hash, out string, nonce int64, t *Transaction, err error) { - hash, out, nonce, t, err = SmartContractTxnValueFee(scAddress, sn, value, fee, verifyTxn, clients...) - - if err != nil && (strings.Contains(err.Error(), "invalid transaction nonce") || strings.Contains(err.Error(), "invalid future transaction")) { - return SmartContractTxnValueFee(scAddress, sn, value, fee, verifyTxn, clients...) - } - return -} - -func SmartContractTxnValueFee(scAddress string, sn SmartContractTxnData, - value, fee uint64, verifyTxn bool, clients ...string) (hash, out string, nonce int64, t *Transaction, err error) { - - clientId := client.Id() - if len(clients) > 0 && clients[0] != "" { - clientId = clients[0] - } - - var requestBytes []byte - if requestBytes, err = json.Marshal(sn); err != nil { - return - } - - cfg, err := conf.GetClientConfig() - if err != nil { - return - } - - nodeClient, err := client.GetNode() - if err != nil { - return - } - - txn := NewTransactionEntity(client.Id(clientId), - cfg.ChainID, client.PublicKey(clientId), nonce) - - txn.TransactionData = string(requestBytes) - txn.ToClientID = scAddress - txn.Value = value - txn.TransactionFee = fee - txn.TransactionType = TxnTypeSmartContract - txn.ClientID = clientId - - if len(clients) > 1 { - txn.ToClientID = clients[1] - txn.TransactionType = TxnTypeSend - } - - // adjust fees if not set - if fee == 0 { - fee, err = EstimateFee(txn, nodeClient.Network().Miners, 0.2) - if err != nil { - Logger.Error("failed to estimate txn fee", - zap.Error(err), - zap.Any("txn", txn)) - return - } - txn.TransactionFee = fee - } - - if txn.TransactionNonce == 0 { - txn.TransactionNonce = client.Cache.GetNextNonce(txn.ClientID) - } - - err = txn.ComputeHashAndSign(client.SignFn) - if err != nil { - return - } - - if client.GetClient().IsSplit { - txn.Signature, err = txn.getAuthorize() - if err != nil { - return - } - } - - ok, err := txn.VerifySigWith(txn.PublicKey, sys.VerifyWith) - if err != nil { - err = errors.New("", "verification failed for auth response") - return - } - - if !ok { - err = errors.New("", "verification failed for auth response") - return - } - - msg := fmt.Sprintf("executing transaction '%s' with hash %s ", sn.Name, txn.Hash) - Logger.Info(msg) - Logger.Info("estimated txn fee: ", txn.TransactionFee) - - err = SendTransactionSync(txn, nodeClient.GetStableMiners()) - if err != nil { - Logger.Info("transaction submission failed", zap.Error(err)) - client.Cache.Evict(txn.ClientID) - nodeClient.ResetStableMiners() - return - } - - if verifyTxn { - var ( - querySleepTime = time.Duration(cfg.QuerySleepTime) * time.Second - retries = 0 - ) - - sys.Sleep(querySleepTime) - - var confirmationResponse string - - for retries < cfg.MaxTxnQuery { - t, confirmationResponse, err = VerifyTransactionWithRes(txn.Hash) - if err == nil { - break - } - retries++ - sys.Sleep(querySleepTime) - } - - if err != nil { - Logger.Error("Error verifying the transaction", err.Error(), txn.Hash) - client.Cache.Evict(txn.ClientID) - return - } - - if t == nil { - return "", "", 0, txn, errors.New("transaction_validation_failed", - "Failed to get the transaction confirmation : "+txn.Hash) - } - - if t.Status == TxnFail { - return t.Hash, t.TransactionOutput, 0, t, errors.New("", t.TransactionOutput) - } - - if t.Status == TxnChargeableError { - return t.Hash, t.TransactionOutput, t.TransactionNonce, t, errors.New("", t.TransactionOutput) - } - - if t.TransactionType == TxnTypeSend { - t.TransactionOutput = confirmationResponse - } - - return t.Hash, t.TransactionOutput, t.TransactionNonce, t, nil - } - - return txn.Hash, "", txn.TransactionNonce, txn, nil -} diff --git a/core/transaction/entity_test.go b/core/transaction/entity_test.go deleted file mode 100644 index 7cdf31273..000000000 --- a/core/transaction/entity_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package transaction - -import ( - "testing" - - "github.com/0chain/gosdk/core/conf" - "github.com/stretchr/testify/assert" -) - -func TestOptimisticVerificationLearning(t *testing.T) { - t.Skip() - conf.InitClientConfig(&conf.Config{ - BlockWorker: "", - MinSubmit: 0, - MinConfirmation: 50, - ConfirmationChainLength: 3, - MaxTxnQuery: 0, - QuerySleepTime: 0, - SignatureScheme: "", - ChainID: "", - EthereumNode: "", - }) - ov := NewOptimisticVerifier([]string{"https://dev.zus.network/sharder01", "https://dev.zus.network/sharder02"}) - _, _, err := ov.VerifyTransactionOptimistic("a20360964c067b319d52b5cad71d771b0e1d2a80e76001da73009899b09ffa31") - - assert.NoError(t, err) - -} diff --git a/core/transaction/get_data.go b/core/transaction/get_data.go deleted file mode 100644 index 7ac58359a..000000000 --- a/core/transaction/get_data.go +++ /dev/null @@ -1,64 +0,0 @@ -package transaction - -import ( - "encoding/json" - - "github.com/0chain/errors" - coreHttp "github.com/0chain/gosdk/core/client" -) - -const ( - StorageSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7` - FaucetSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d3` - MinerSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d9` - ZCNSCSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0` -) -const ( - GET_MINERSC_CONFIGS = "/configs" - GET_MINERSC_GLOBALS = "/globalSettings" - STORAGESC_GET_SC_CONFIG = "/storage-config" -) - -// -// storage SC configurations and blobbers -// - -type InputMap struct { - Fields map[string]string `json:"fields"` -} - -// GetStorageSCConfig retrieves storage SC configurations. -func GetConfig(configType string) (conf *InputMap, err error) { - var ( - scAddress string - relativePath string - b []byte - ) - - if configType == "storage_sc_config" { - scAddress = StorageSmartContractAddress - relativePath = STORAGESC_GET_SC_CONFIG - } else if configType == "miner_sc_globals" { - scAddress = MinerSmartContractAddress - relativePath = GET_MINERSC_GLOBALS - } else if configType == "miner_sc_configs" { - scAddress = MinerSmartContractAddress - relativePath = GET_MINERSC_CONFIGS - } - - b, err = coreHttp.MakeSCRestAPICallToSharder(scAddress, relativePath, nil) - if err != nil { - return nil, errors.Wrap(err, "error requesting storage SC configs:") - } - if len(b) == 0 { - return nil, errors.New("", "empty response") - } - - conf = new(InputMap) - conf.Fields = make(map[string]string) - if err = json.Unmarshal(b, conf); err != nil { - return nil, errors.Wrap(err, "1 error decoding response:") - } - - return -} diff --git a/core/transaction/transaction.go b/core/transaction/transaction.go deleted file mode 100644 index 985e2f37c..000000000 --- a/core/transaction/transaction.go +++ /dev/null @@ -1,21 +0,0 @@ -package transaction - -// Transaction entity that encapsulates the transaction related data and meta data -type Transaction struct { - Hash string `json:"hash,omitempty"` - Version string `json:"version,omitempty"` - ClientID string `json:"client_id,omitempty"` - PublicKey string `json:"public_key,omitempty"` - ToClientID string `json:"to_client_id,omitempty"` - ChainID string `json:"chain_id,omitempty"` - TransactionData string `json:"transaction_data"` - Value uint64 `json:"transaction_value"` - Signature string `json:"signature,omitempty"` - CreationDate int64 `json:"creation_date,omitempty"` - TransactionType int `json:"transaction_type"` - TransactionOutput string `json:"transaction_output,omitempty"` - TransactionFee uint64 `json:"transaction_fee"` - TransactionNonce int64 `json:"transaction_nonce"` - OutputHash string `json:"txn_output_hash"` - Status int `json:"transaction_status"` -} diff --git a/core/transaction/transport.go b/core/transaction/transport.go deleted file mode 100644 index 93677c398..000000000 --- a/core/transaction/transport.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package transaction - -import ( - "net" - "net/http" - "time" -) - -func createTransport(dialTimeout time.Duration) *http.Transport { - return &http.Transport{ - Dial: (&net.Dialer{ - Timeout: dialTimeout, - }).Dial, - TLSHandshakeTimeout: dialTimeout, - } - -} diff --git a/core/transaction/transport_wasm.go b/core/transaction/transport_wasm.go deleted file mode 100644 index 7a911d642..000000000 --- a/core/transaction/transport_wasm.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package transaction - -import ( - "net/http" - "time" -) - -func createTransport(dialTimeout time.Duration) *http.Transport { - return &http.Transport{ - TLSHandshakeTimeout: dialTimeout, - } -} diff --git a/core/transaction/type.go b/core/transaction/type.go deleted file mode 100644 index 5f75a1826..000000000 --- a/core/transaction/type.go +++ /dev/null @@ -1,15 +0,0 @@ -package transaction - -const ( - TxnTypeSend = 0 // A transaction to send tokens to another account, state is maintained by account - - TxnTypeLockIn = 2 // A transaction to lock tokens, state is maintained on the account and the parent lock in transaction - - // Any txn type that refers to a parent txn should have an odd value - TxnTypeStorageWrite = 101 // A transaction to write data to the blobber - TxnTypeStorageRead = 103 // A transaction to read data from the blobber - - TxnTypeData = 10 // A transaction to just store a piece of data on the block chain - - TxnTypeSmartContract = 1000 // A smart contract transaction type -) diff --git a/core/transaction/utils.go b/core/transaction/utils.go deleted file mode 100644 index db4287171..000000000 --- a/core/transaction/utils.go +++ /dev/null @@ -1,465 +0,0 @@ -package transaction - -import ( - "context" - "encoding/json" - "fmt" - "github.com/0chain/gosdk/core/client" - "math" - "net/http" - "strconv" - "strings" - "time" - - "github.com/0chain/common/core/encryption" - "github.com/0chain/errors" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/util" -) - -const retriesCount = 30 - -type OptimisticVerifier struct { - allSharders []string - sharders []string - options []resty.Option -} - -func NewOptimisticVerifier(sharders []string) *OptimisticVerifier { - //initialize resty - header := map[string]string{ - "Content-Type": "application/json; charset=utf-8", - "Access-Control-Allow-Origin": "*", - } - - transport := createTransport(resty.DefaultDialTimeout) - - options := []resty.Option{ - resty.WithRetry(resty.DefaultRetry), - resty.WithHeader(header), - resty.WithTransport(transport), - } - - return &OptimisticVerifier{ - allSharders: sharders, - options: options, - } -} - -func (v *OptimisticVerifier) VerifyTransactionOptimistic(txnHash string) (*Transaction, string, error) { - cfg, err := conf.GetClientConfig() - if err != nil { - return nil, "", err - } - - //refresh sharders - v.sharders = v.allSharders - - //amount of sharders to query - minNumConfirmation := int(math.Ceil(float64(cfg.MinConfirmation*len(v.sharders)) / 100)) - if minNumConfirmation > len(v.sharders) { - return nil, "", errors.New("verify_optimistic", "wrong number of min_confirmations") - } - shuffled := util.Shuffle(v.sharders)[:minNumConfirmation] - - //prepare urls for confirmation request - urls := make([]string, 0, len(shuffled)) - mappedSharders := make(map[string]string) - for _, sharder := range shuffled { - url := fmt.Sprintf("%v/%v%v", sharder, TXN_VERIFY_URL, txnHash) - urls = append(urls, url) - mappedSharders[url] = sharder - } - - var url string - var chain []*RoundBlockHeader - var txn *Transaction - var confirmationResponse string - r := resty.New(v.options...).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { //network issue - return err - } - - if resp.StatusCode != 200 { - return errors.Throw(ErrInvalidRequest, strconv.Itoa(resp.StatusCode)+": "+resp.Status) - } - - //parse response - var objmap map[string]json.RawMessage - err = json.Unmarshal(respBody, &objmap) - if err != nil { - return err - } - txnRawJSON, ok := objmap["txn"] - // txn data is found, success - if !ok { - return errors.New("handle_response", "bad transaction response") - } - merklePathRawJSON, ok := objmap["merkle_tree_path"] - if !ok { - return errors.New("handle_response", "bad merkle_tree_path response") - } - - txn = &Transaction{} - err = json.Unmarshal(txnRawJSON, txn) - if err != nil { - return err - } - - // set objmap to confirmationResponse using json marshal - confirmationResponseByte, err := json.Marshal(map[string]map[string]json.RawMessage{ - "confirmation": objmap, - }) - if err != nil { - return err - } - confirmationResponse = string(confirmationResponseByte) - - b := &RoundBlockHeader{} - err = json.Unmarshal(respBody, b) - if err != nil { - return err - } - err = validateBlockHash(b) - if err != nil { - return err - } - - err = verifyMerklePath(merklePathRawJSON, txn.Hash, b.MerkleTreeRoot) - if err != nil { - return err - } - - url = req.URL.String() - chain = append(chain, b) - return nil - }) - - retries := 0 - ticker := time.NewTicker(time.Second) -L: - //loop query confirmation - for retries < retriesCount { - <-ticker.C - retries++ - r.DoGet(context.TODO(), urls...) - //need single valid confirmation - errs := r.First() - if len(errs) == 0 { - break L - } - } - - if len(chain) == 0 { - return nil, "", errors.Newf("verify", "can't get confirmation after %v retries", retriesCount) - } - - //remove current sharder from the list to avoid building chain with it - toDelete := mappedSharders[url] - for i, s := range v.sharders { - if s == toDelete { - v.sharders = append(v.sharders[:i], v.sharders[i+1:]...) - break - } - } - - err = v.checkConfirmation(chain) - if err != nil { - return nil, "", err - } - - return txn, confirmationResponse, err -} - -func (v *OptimisticVerifier) checkConfirmation(chain []*RoundBlockHeader) error { - cfg, err := conf.GetClientConfig() - if err != nil { - - return err - } - - //build blockchain starting from confirmation block - curRound := chain[0].Round - rb := resty.New(v.options...).Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - if err != nil { //network issue - return err - } - - if resp.StatusCode != 200 { - return errors.Throw(ErrInvalidRequest, strconv.Itoa(resp.StatusCode)+": "+resp.Status) - } - - curBlock := &Block{} - err = json.Unmarshal(respBody, &curBlock) - if err != nil { - return err - } - - //get tail block and check that current extends it - prevBlock := chain[len(chain)-1] - if prevBlock.Hash == curBlock.PrevHash && prevBlock.Round+1 == curBlock.Round { - blockHeader := &RoundBlockHeader{ - Version: curBlock.Version, - CreationDate: curBlock.CreationDate, - Hash: curBlock.Hash, - PreviousBlockHash: curBlock.PrevHash, - MinerID: curBlock.MinerID, - Round: curBlock.Round, - RoundRandomSeed: curBlock.RoundRandomSeed, - MerkleTreeRoot: curBlock.MerkleTreeRoot, - StateChangesCount: curBlock.StateChangesCount, - StateHash: curBlock.StateHash, - ReceiptMerkleTreeRoot: curBlock.ReceiptMerkleTreeRoot, - NumberOfTxns: int64(curBlock.NumTxns), - } - err = validateBlockHash(blockHeader) - if err != nil { - return err - } - - chain = append(chain, blockHeader) - return nil - } - return errors.New("get_block", "wrong block") - }) - - //query for blocks until ConfirmationChainLength is built or every sharder is queried - for len(chain) < cfg.ConfirmationChainLength && len(v.sharders) > 0 { - //for every new block create sharder list to query - rand := util.NewRand(len(v.sharders)) - //iterate through all sharders sequentially to get next block - for { - next, err := rand.Next() - if err != nil { - return errors.New("get_round_block", "can't get round block, blockchain might be stuck") - } - - cur := v.sharders[next] - burl := fmt.Sprintf("%v/%v%v", cur, BLOCK_BY_ROUND_URL, curRound+1) - rb.DoGet(context.TODO(), burl) - - wait := rb.Wait() - if len(wait) != 0 { - continue - } - //exclude sharder if it gave block, we do it to avoid building blockchain from single sharder - v.sharders = append(v.sharders[:next], v.sharders[next+1:]...) - curRound++ - break - } - } - - return nil -} - -func verifyMerklePath(merklePathRawJSON json.RawMessage, txnHash string, merkleRoot string) error { - merklePath := &util.MTPath{} - err := json.Unmarshal(merklePathRawJSON, merklePath) - if err != nil { - return err - } - if !util.VerifyMerklePath(txnHash, merklePath, merkleRoot) { - return errors.New("handle_response", "invalid merkle path") - } - return nil -} - -func validateBlockHash(b *RoundBlockHeader) error { - hashBuilder := strings.Builder{} - hashBuilder.WriteString(b.MinerID) - hashBuilder.WriteString(":") - hashBuilder.WriteString(b.PreviousBlockHash) - hashBuilder.WriteString(":") - hashBuilder.WriteString(strconv.FormatInt(b.CreationDate, 10)) - hashBuilder.WriteString(":") - hashBuilder.WriteString(strconv.FormatInt(b.Round, 10)) - hashBuilder.WriteString(":") - hashBuilder.WriteString(strconv.FormatInt(b.RoundRandomSeed, 10)) - hashBuilder.WriteString(":") - hashBuilder.WriteString(strconv.Itoa(b.StateChangesCount)) - hashBuilder.WriteString(":") - hashBuilder.WriteString(b.MerkleTreeRoot) - hashBuilder.WriteString(":") - hashBuilder.WriteString(b.ReceiptMerkleTreeRoot) - //todo handling of magic block here - hash := encryption.Hash(hashBuilder.String()) - if hash != b.Hash { - return errors.New("handle_response", "invalid block hash") - } - return nil -} - -func VerifyTransaction(txnHash string) (*Transaction, error) { - txn, _, err := VerifyTransactionWithRes(txnHash) - return txn, err -} - -// VerifyTransaction query transaction status from sharders, and verify it by mininal confirmation -func VerifyTransactionWithRes(txnHash string) (*Transaction, string, error) { - nodeClient, err := client.GetNode() - if err != nil { - return nil, "", err - } - - sharders := nodeClient.Sharders().Healthy() - - cfg, err := conf.GetClientConfig() - if err != nil { - return nil, "", err - } - - if cfg.VerifyOptimistic { - ov := NewOptimisticVerifier(sharders) - return ov.VerifyTransactionOptimistic(txnHash) - } else { - return VerifyTransactionTrusted(txnHash, sharders) - } -} - -// VerifyTransaction query transaction status from sharders, and verify it by mininal confirmation -func VerifyTransactionTrusted(txnHash string, sharders []string) (*Transaction, string, error) { - - cfg, err := conf.GetClientConfig() - if err != nil { - - return nil, "", err - } - - numSharders := len(sharders) - - if numSharders == 0 { - return nil, "", ErrNoAvailableSharder - } - - minNumConfirmation := int(math.Ceil(float64(cfg.MinConfirmation*numSharders) / 100)) - - rand := util.NewRand(numSharders) - - selectedSharders := make([]string, 0, minNumConfirmation+1) - - // random pick minNumConfirmation+1 first - for i := 0; i <= minNumConfirmation; i++ { - n, err := rand.Next() - - if err != nil { - break - } - - selectedSharders = append(selectedSharders, sharders[n]) - } - - numSuccess := 0 - - var retTxn *Transaction - var confirmationResponse string - - //leave first item for ErrTooLessConfirmation - var msgList = make([]string, 1, numSharders) - - urls := make([]string, 0, len(selectedSharders)) - - for _, sharder := range selectedSharders { - urls = append(urls, fmt.Sprintf("%v/%v%v", sharder, TXN_VERIFY_URL, txnHash)) - } - - header := map[string]string{ - "Content-Type": "application/json; charset=utf-8", - "Access-Control-Allow-Origin": "*", - } - - transport := createTransport(resty.DefaultDialTimeout) - - options := []resty.Option{ - resty.WithRetry(resty.DefaultRetry), - resty.WithHeader(header), - resty.WithTransport(transport), - } - - r := resty.New(options...). - Then(func(req *http.Request, resp *http.Response, respBody []byte, cf context.CancelFunc, err error) error { - url := req.URL.String() - - if err != nil { //network issue - msgList = append(msgList, err.Error()) - return err - } - - if resp.StatusCode != 200 { - msgList = append(msgList, url+": ["+strconv.Itoa(resp.StatusCode)+"] "+string(respBody)) - return errors.Throw(ErrInvalidRequest, strconv.Itoa(resp.StatusCode)+": "+resp.Status) - } - - var objmap map[string]json.RawMessage - err = json.Unmarshal(respBody, &objmap) - if err != nil { - msgList = append(msgList, "json: "+string(respBody)) - return err - } - txnRawJSON, ok := objmap["txn"] - - // txn data is found, success - if ok { - txn := &Transaction{} - err = json.Unmarshal(txnRawJSON, txn) - if err != nil { - msgList = append(msgList, "json: "+string(txnRawJSON)) - return err - } - if len(txn.Signature) > 0 { - retTxn = txn - confirmationResponseByte, err := json.Marshal(map[string]map[string]json.RawMessage{ - "confirmation": objmap, - }) - if err != nil { - return err - } - confirmationResponse = string(confirmationResponseByte) - } - numSuccess++ - - } else { - // txn data is not found, but get block_hash, success - if _, ok := objmap["block_hash"]; ok { - numSuccess++ - } else { - // txn and block_hash - msgList = append(msgList, fmt.Sprintf("Sharder does not have the block summary with url: %s, contents: %s", url, string(respBody))) - } - - } - - return nil - }) - - for { - r.DoGet(context.TODO(), urls...) - - r.Wait() - - if numSuccess >= minNumConfirmation { - break - } - - // pick one more sharder to query transaction - n, err := rand.Next() - - if errors.Is(err, util.ErrNoItem) { - break - } - - urls = []string{fmt.Sprintf("%v/%v%v", sharders[n], TXN_VERIFY_URL, txnHash)} - - } - - if numSuccess > 0 && numSuccess >= minNumConfirmation { - if retTxn == nil { - return nil, "", errors.Throw(ErrNoTxnDetail, strings.Join(msgList, "\r\n")) - } - return retTxn, confirmationResponse, nil - } - - msgList[0] = fmt.Sprintf("min_confirmation is %v%%, but got %v/%v sharders", cfg.MinConfirmation, numSuccess, numSharders) - return nil, confirmationResponse, errors.Throw(ErrTooLessConfirmation, strings.Join(msgList, "\r\n")) - -} diff --git a/core/transaction/vars.go b/core/transaction/vars.go deleted file mode 100644 index 1b33159e9..000000000 --- a/core/transaction/vars.go +++ /dev/null @@ -1,19 +0,0 @@ -package transaction - -import ( - "errors" -) - -var ( - // ErrInvalidRequest invalid request - ErrInvalidRequest = errors.New("[txn] invalid request") - - // ErrNoAvailableSharder no any available sharder - ErrNoAvailableSharder = errors.New("[txn] there is no any available sharder") - - // ErrNoTxnDetail No transaction detail was found on any of the sharders - ErrNoTxnDetail = errors.New("[txn] no transaction detail was found on any of the sharders") - - // ErrTooLessConfirmation too less sharder to confirm transaction - ErrTooLessConfirmation = errors.New("[txn] too less sharders to confirm it") -) diff --git a/core/util/doc.go b/core/util/doc.go deleted file mode 100644 index 425c3445d..000000000 --- a/core/util/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Provides miscellaneous utility functions and types for the SDK. -package util diff --git a/core/util/fixed_merkle_tree.go b/core/util/fixed_merkle_tree.go deleted file mode 100644 index 239dd923a..000000000 --- a/core/util/fixed_merkle_tree.go +++ /dev/null @@ -1,271 +0,0 @@ -package util - -import ( - "bytes" - "encoding/hex" - "hash" - "io" - "sync" - - goError "errors" - - "github.com/0chain/errors" - "github.com/minio/sha256-simd" -) - -const ( - // MerkleChunkSize is the size of a chunk of data that is hashed - MerkleChunkSize = 64 - - // MaxMerkleLeavesSize is the maximum size of the data that can be written to the merkle tree - MaxMerkleLeavesSize = 64 * 1024 - - // FixedMerkleLeaves is the number of leaves in the fixed merkle tree - FixedMerkleLeaves = 1024 - - // FixedMTDepth is the depth of the fixed merkle tree - FixedMTDepth = 11 -) - -var ( - leafPool = sync.Pool{ - New: func() interface{} { - return &leaf{ - h: sha256.New(), - } - }, - } -) - -type leaf struct { - h hash.Hash -} - -func (l *leaf) GetHashBytes() []byte { - return l.h.Sum(nil) -} - -func (l *leaf) GetHash() string { - return hex.EncodeToString(l.h.Sum(nil)) -} - -func (l *leaf) Write(b []byte) (int, error) { - return l.h.Write(b) -} - -func getNewLeaf() *leaf { - l, ok := leafPool.Get().(*leaf) - if !ok { - return &leaf{ - h: sha256.New(), - } - } - l.h.Reset() - return l -} - -// FixedMerkleTree A trusted mekerle tree for outsourcing attack protection. see section 1.8 on whitepager -// see detail on https://github.com/0chain/blobber/wiki/Protocols#what-is-fixedmerkletree -type FixedMerkleTree struct { - // Leaves will store hash digester that calculates sha256 hash of the leaf content - Leaves []Hashable `json:"leaves,omitempty"` - - writeLock sync.Mutex - // isFinal is set to true once Finalize() is called. - // After it is set to true, there will be no any writes to writeBytes field - isFinal bool - // writeCount will track count of bytes written to writeBytes field - writeCount int - // writeBytes will store bytes upto MaxMerkleLeavesSize. For the last bytes that - // does not make upto MaxMerkleLeavesSize, it will be sliced with writeCount field. - writeBytes []byte - merkleRoot []byte -} - -// Finalize will set isFinal to true and sends remaining bytes for leaf hash calculation -func (fmt *FixedMerkleTree) Finalize() error { - fmt.writeLock.Lock() - defer fmt.writeLock.Unlock() - - if fmt.isFinal { - return goError.New("already finalized") - } - fmt.isFinal = true - if fmt.writeCount > 0 { - return fmt.writeToLeaves(fmt.writeBytes[:fmt.writeCount]) - } - return nil -} - -// NewFixedMerkleTree create a FixedMerkleTree with specify hash method -func NewFixedMerkleTree() *FixedMerkleTree { - - t := &FixedMerkleTree{ - writeBytes: make([]byte, MaxMerkleLeavesSize), - } - t.initLeaves() - - return t - -} - -func (fmt *FixedMerkleTree) initLeaves() { - fmt.Leaves = make([]Hashable, FixedMerkleLeaves) - for i := 0; i < FixedMerkleLeaves; i++ { - fmt.Leaves[i] = getNewLeaf() - } -} - -// writeToLeaves will divide the data with MerkleChunkSize(64 bytes) and write to -// each leaf hasher -func (fmt *FixedMerkleTree) writeToLeaves(b []byte) error { - if len(b) > MaxMerkleLeavesSize { - return goError.New("data size greater than maximum required size") - } - - if len(b) < MaxMerkleLeavesSize && !fmt.isFinal { - return goError.New("invalid merkle leaf write") - } - - leafInd := 0 - for i := 0; i < len(b); i += MerkleChunkSize { - j := i + MerkleChunkSize - if j > len(b) { - j = len(b) - } - - _, err := fmt.Leaves[leafInd].Write(b[i:j]) - if err != nil { - return err - } - leafInd++ - } - - return nil -} - -// Write will write data to the leaves once MaxMerkleLeavesSize(64 KB) is reached. -// Since each 64KB is divided into 1024 pieces with 64 bytes each, once data len reaches -// 64KB then it will be written to leaf hashes. The remaining data that is not multiple of -// 64KB will be written to leaf hashes by Finalize() function. -// This can be used to write stream of data as well. -// fmt.Finalize() is required after data write is complete. -func (fmt *FixedMerkleTree) Write(b []byte) (int, error) { - - fmt.writeLock.Lock() - defer fmt.writeLock.Unlock() - if fmt.isFinal { - return 0, goError.New("cannot write. Tree is already finalized") - } - - for i, j := 0, MaxMerkleLeavesSize-fmt.writeCount; i < len(b); i, j = j, j+MaxMerkleLeavesSize { - if j > len(b) { - j = len(b) - } - prevWriteCount := fmt.writeCount - fmt.writeCount += int(j - i) - copy(fmt.writeBytes[prevWriteCount:fmt.writeCount], b[i:j]) - - if fmt.writeCount == MaxMerkleLeavesSize { - // data fragment reached 64KB, so send this slice to write to leaf hashes - err := fmt.writeToLeaves(fmt.writeBytes) - if err != nil { - return 0, err - } - fmt.writeCount = 0 // reset writeCount - } - } - return len(b), nil -} - -// GetMerkleRoot is only for interface compliance. -func (fmt *FixedMerkleTree) GetMerkleTree() MerkleTreeI { - return nil -} - -func (fmt *FixedMerkleTree) CalculateMerkleRoot() { - nodes := make([][]byte, len(fmt.Leaves)) - for i := 0; i < len(nodes); i++ { - nodes[i] = fmt.Leaves[i].GetHashBytes() - leafPool.Put(fmt.Leaves[i]) - } - - for i := 0; i < FixedMTDepth; i++ { - - newNodes := make([][]byte, (len(nodes)+1)/2) - nodeInd := 0 - for j := 0; j < len(nodes); j += 2 { - newNodes[nodeInd] = MHashBytes(nodes[j], nodes[j+1]) - nodeInd++ - } - nodes = newNodes - if len(nodes) == 1 { - break - } - } - - fmt.merkleRoot = nodes[0] -} - -// FixedMerklePath is used to verify existence of leaf hash for fixed merkle tree -type FixedMerklePath struct { - LeafHash []byte `json:"leaf_hash"` - RootHash []byte `json:"root_hash"` - Nodes [][]byte `json:"nodes"` - LeafInd int -} - -func (fp FixedMerklePath) VerifyMerklePath() bool { - leafInd := fp.LeafInd - hash := fp.LeafHash - for i := 0; i < len(fp.Nodes); i++ { - if leafInd&1 == 0 { - hash = MHashBytes(hash, fp.Nodes[i]) - } else { - hash = MHashBytes(fp.Nodes[i], hash) - } - leafInd = leafInd / 2 - } - return bytes.Equal(hash, fp.RootHash) -} - -// GetMerkleRoot get merkle root. -func (fmt *FixedMerkleTree) GetMerkleRoot() string { - if fmt.merkleRoot != nil { - return hex.EncodeToString(fmt.merkleRoot) - } - fmt.CalculateMerkleRoot() - return hex.EncodeToString(fmt.merkleRoot) -} - -// Reload reset and reload leaves from io.Reader -func (fmt *FixedMerkleTree) Reload(reader io.Reader) error { - - fmt.initLeaves() - - bytesBuf := bytes.NewBuffer(make([]byte, 0, MaxMerkleLeavesSize)) - for i := 0; ; i++ { - written, err := io.CopyN(bytesBuf, reader, MaxMerkleLeavesSize) - - if written > 0 { - _, err = fmt.Write(bytesBuf.Bytes()) - bytesBuf.Reset() - - if err != nil { - return err - } - - } - - if err != nil { - if errors.Is(err, io.EOF) { - break - } - - return err - } - - } - - return nil -} diff --git a/core/util/fixed_merkle_tree_test.go b/core/util/fixed_merkle_tree_test.go deleted file mode 100644 index e5c265012..000000000 --- a/core/util/fixed_merkle_tree_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package util - -import ( - "math/rand" - "testing" - - "fmt" - - "github.com/stretchr/testify/require" -) - -const ( - KB = 1024 -) - -func TestFixedMerkleTreeWrite(t *testing.T) { - for i := 0; i < 100; i++ { - var n int64 - for { - n = rand.Int63n(KB * KB) - if n != 0 { - break - } - } - - t.Run(fmt.Sprintf("Fmt test with dataSize: %d", n), func(t *testing.T) { - - b := make([]byte, n) - rand.Read(b) //nolint - - leaves := make([]Hashable, FixedMerkleLeaves) - for i := 0; i < len(leaves); i++ { - leaves[i] = getNewLeaf() - } - - for i := 0; i < len(b); i += MaxMerkleLeavesSize { - leafCount := 0 - endInd := i + MaxMerkleLeavesSize - if endInd > len(b) { - endInd = len(b) - } - - d := b[i:endInd] - for j := 0; j < len(d); j += MerkleChunkSize { - endInd := j + MerkleChunkSize - if endInd > len(d) { - endInd = len(d) - } - - _, err := leaves[leafCount].Write(d[j:endInd]) - require.NoError(t, err) - leafCount++ - } - } - - mt := MerkleTree{} - mt.ComputeTree(leaves) - - root := mt.GetRoot() - - ft := NewFixedMerkleTree() - _, err := ft.Write(b) - require.NoError(t, err) - err = ft.Finalize() - require.NoError(t, err) - - root1 := ft.GetMerkleRoot() - require.Equal(t, root, root1) - }) - } -} diff --git a/core/util/http_consensus_maps.go b/core/util/http_consensus_maps.go deleted file mode 100644 index 6f95f3b3a..000000000 --- a/core/util/http_consensus_maps.go +++ /dev/null @@ -1,93 +0,0 @@ -package util - -import ( - "crypto/sha1" - "encoding/hex" - "encoding/json" - "errors" - "net/http" - "sort" - "strings" -) - -var ErrNilHttpConsensusMaps = errors.New("nil_httpconsensusmaps") - -type HttpConsensusMaps struct { - ConsensusThresh int - MaxConsensus int - - WinMap map[string]json.RawMessage - WinMapConsensus map[string]int - - WinError string - WinInfo string -} - -func NewHttpConsensusMaps(consensusThresh int) *HttpConsensusMaps { - return &HttpConsensusMaps{ - ConsensusThresh: consensusThresh, - WinMapConsensus: make(map[string]int), - } -} - -func (c *HttpConsensusMaps) GetValue(name string) (json.RawMessage, bool) { - if c == nil || c.WinMap == nil { - return nil, false - } - v, ok := c.WinMap[name] - return v, ok -} - -func (c *HttpConsensusMaps) Add(statusCode int, respBody string) error { - if c == nil { - return ErrNilHttpConsensusMaps - } - if statusCode != http.StatusOK { - c.WinError = respBody - return nil - } - - m, hash, err := c.buildMap(respBody) - if err != nil { - return err - } - - c.WinMapConsensus[hash]++ - - if c.WinMapConsensus[hash] > c.MaxConsensus { - c.MaxConsensus = c.WinMapConsensus[hash] - c.WinMap = m - c.WinInfo = respBody - } - - return nil -} - -func (c *HttpConsensusMaps) buildMap(respBody string) (map[string]json.RawMessage, string, error) { - var m map[string]json.RawMessage - err := json.Unmarshal([]byte(respBody), &m) - if err != nil { - return nil, "", err - } - - keys := make([]string, 0, len(m)) - - for k := range m { - - keys = append(keys, k) - } - sort.Strings(keys) - - sb := strings.Builder{} - - for _, k := range keys { - sb.Write(m[k]) - sb.WriteString(":") - } - - h := sha1.New() - h.Write([]byte(sb.String())) - hash := h.Sum(nil) - - return m, hex.EncodeToString(hash), nil -} diff --git a/core/util/httpnet.go b/core/util/httpnet.go deleted file mode 100644 index bcc5f2b77..000000000 --- a/core/util/httpnet.go +++ /dev/null @@ -1,190 +0,0 @@ -package util - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "os" - "time" -) - -type GetRequest struct { - *PostRequest -} - -type GetResponse struct { - *PostResponse -} - -type PostRequest struct { - req *http.Request - Ctx context.Context - cncl context.CancelFunc - url string -} - -type PostResponse struct { - Url string - StatusCode int - Status string - Body string -} - -type HttpClient interface { - Do(req *http.Request) (*http.Response, error) -} - -var Client HttpClient - -func getEnvAny(names ...string) string { - for _, n := range names { - if val := os.Getenv(n); val != "" { - return val - } - } - return "" -} - -func (pfe *proxyFromEnv) initialize() { - pfe.HTTPProxy = getEnvAny("HTTP_PROXY", "http_proxy") - pfe.HTTPSProxy = getEnvAny("HTTPS_PROXY", "https_proxy") - pfe.NoProxy = getEnvAny("NO_PROXY", "no_proxy") - - if pfe.NoProxy != "" { - return - } - - if pfe.HTTPProxy != "" { - pfe.http, _ = url.Parse(pfe.HTTPProxy) - } - if pfe.HTTPSProxy != "" { - pfe.https, _ = url.Parse(pfe.HTTPSProxy) - } -} - -type proxyFromEnv struct { - HTTPProxy string - HTTPSProxy string - NoProxy string - - http, https *url.URL -} - -var envProxy proxyFromEnv - -func init() { - Client = &http.Client{ - Transport: transport, - } - envProxy.initialize() -} - -func httpDo(req *http.Request, ctx context.Context, cncl context.CancelFunc, f func(*http.Response, error) error) error { - c := make(chan error, 1) - - go func() { c <- f(Client.Do(req.WithContext(ctx))) }() - - select { - case <-ctx.Done(): - // Use the cancel function only after trying to get the result. - <-c // Wait for f to return. - return ctx.Err() - case err := <-c: - // Ensure that we call cncl after we are done with the response - defer cncl() // Move this here to ensure we cancel after processing - return err - } -} - -// NewHTTPGetRequest create a GetRequest instance with 60s timeout -func NewHTTPGetRequest(url string) (*GetRequest, error) { - var ctx, cancel = context.WithTimeout(context.Background(), 60*time.Second) - go func() { - //call cancel to avoid memory leak here - <-ctx.Done() - - cancel() - - }() - - return NewHTTPGetRequestContext(ctx, url) -} - -// NewHTTPGetRequestContext create a GetRequest with context and url -func NewHTTPGetRequestContext(ctx context.Context, url string) (*GetRequest, error) { - - req, err := http.NewRequest(http.MethodGet, url, nil) - if err != nil { - return nil, err - } - - req.Header.Set("Content-Type", "application/json; charset=utf-8") - req.Header.Set("Access-Control-Allow-Origin", "*") - - gr := new(GetRequest) - gr.PostRequest = &PostRequest{} - gr.url = url - gr.req = req - gr.Ctx, gr.cncl = context.WithCancel(ctx) - return gr, nil -} - -func NewHTTPPostRequest(url string, data interface{}) (*PostRequest, error) { - pr := &PostRequest{} - jsonByte, err := json.Marshal(data) - if err != nil { - return nil, err - } - req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(jsonByte)) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/json; charset=utf-8") - req.Header.Set("Access-Control-Allow-Origin", "*") - pr.url = url - pr.req = req - pr.Ctx, pr.cncl = context.WithTimeout(context.Background(), time.Second*60) - return pr, nil -} - -func (r *GetRequest) Get() (*GetResponse, error) { - response := &GetResponse{} - presp, err := r.Post() - if err != nil { - return nil, err // Return early if there's an error - } - response.PostResponse = presp - return response, nil -} - -func (r *PostRequest) Post() (*PostResponse, error) { - result := &PostResponse{} - err := httpDo(r.req, r.Ctx, r.cncl, func(resp *http.Response, err error) error { - if err != nil { - return err - } - if resp.Body != nil { - defer resp.Body.Close() - } else { - return fmt.Errorf("response body is nil") - } - - rspBy, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - result.Url = r.url - result.StatusCode = resp.StatusCode - result.Status = resp.Status - result.Body = string(rspBy) - return nil - }) - if err != nil { - return nil, err // Ensure you propagate the error - } - return result, nil -} diff --git a/core/util/merkle_tree.go b/core/util/merkle_tree.go deleted file mode 100644 index 93ac42e9f..000000000 --- a/core/util/merkle_tree.go +++ /dev/null @@ -1,148 +0,0 @@ -package util - -import ( - "fmt" -) - -/*MerkleTree - A data structure that implements MerkleTreeI interface */ -type MerkleTree struct { - tree []string - leavesCount int - levels int -} - -func VerifyMerklePath(hash string, path *MTPath, root string) bool { - mthash := hash - pathNodes := path.Nodes - pl := len(pathNodes) - idx := path.LeafIndex - for i := 0; i < pl; i++ { - if idx&1 == 1 { - mthash = MHash(pathNodes[i], mthash) - } else { - mthash = MHash(mthash, pathNodes[i]) - } - idx = (idx - idx&1) / 2 - } - return mthash == root -} - -func (mt *MerkleTree) computeSize(leaves int) (int, int) { - if leaves == 1 { - return 2, 2 - } - var tsize int - var levels int - for ll := leaves; ll > 1; ll = (ll + 1) / 2 { - tsize += ll - levels++ - } - tsize++ - levels++ - return tsize, levels -} - -/*ComputeTree - given the leaf nodes, compute the merkle tree */ -func (mt *MerkleTree) ComputeTree(hashes []Hashable) { - var tsize int - tsize, mt.levels = mt.computeSize(len(hashes)) - mt.leavesCount = len(hashes) - mt.tree = make([]string, tsize) - for idx, hashable := range hashes { - mt.tree[idx] = hashable.GetHash() - } - if len(hashes) == 1 { - mt.tree[1] = DecodeAndMHash(mt.tree[0], mt.tree[0]) - return - } - for pl0, plsize := 0, mt.leavesCount; plsize > 1; pl0, plsize = pl0+plsize, (plsize+1)/2 { - l0 := pl0 + plsize - for i, j := 0, 0; i < plsize; i, j = i+2, j+1 { - mt.tree[pl0+plsize+j] = DecodeAndMHash(mt.tree[pl0+i], mt.tree[pl0+i+1]) - } - if plsize&1 == 1 { - mt.tree[l0+plsize/2] = DecodeAndMHash(mt.tree[pl0+plsize-1], mt.tree[pl0+plsize-1]) - } - } -} - -/*GetRoot - get the root of the merkle tree */ -func (mt *MerkleTree) GetRoot() string { - return mt.tree[len(mt.tree)-1] -} - -/*GetTree - get the entire merkle tree */ -func (mt *MerkleTree) GetTree() []string { - return mt.tree -} - -/*SetTree - set the entire merkle tree */ -func (mt *MerkleTree) SetTree(leavesCount int, tree []string) error { - size, levels := mt.computeSize(leavesCount) - if size != len(tree) { - return fmt.Errorf("Merkle tree with leaves %v should have size %v but only %v is given", leavesCount, size, len(tree)) - } - mt.levels = levels - mt.tree = tree - mt.leavesCount = leavesCount - return nil -} - -/*GetLeafIndex - Get the index of the leaf node in the tree */ -func (mt *MerkleTree) GetLeafIndex(hash Hashable) int { - hs := hash.GetHash() - for i := 0; i < mt.leavesCount; i++ { - if mt.tree[i] == hs { - return i - } - } - return -1 -} - -/*GetPath - get the path that can be used to verify the merkle tree */ -func (mt *MerkleTree) GetPath(hash Hashable) *MTPath { - hidx := mt.GetLeafIndex(hash) - if hidx < 0 { - return &MTPath{} - } - return mt.GetPathByIndex(hidx) -} - -/*VerifyPath - given a leaf node and the path, verify that the node is part of the tree */ -func (mt *MerkleTree) VerifyPath(hash Hashable, path *MTPath) bool { - hs := hash.GetHash() - return VerifyMerklePath(hs, path, mt.GetRoot()) -} - -/*GetPathByIndex - get the path of a leaf node at index i */ -func (mt *MerkleTree) GetPathByIndex(idx int) *MTPath { - path := make([]string, mt.levels-1) - mpath := &MTPath{LeafIndex: idx} - if idx&1 == 1 { - path[0] = mt.tree[idx-1] - } else { - if idx+1 < mt.leavesCount { - path[0] = mt.tree[idx+1] - } else { - path[0] = mt.tree[idx] - } - } - for pl0, plsize, pi := 0, mt.leavesCount, 1; plsize > 2; pl0, plsize, pi = pl0+plsize, (plsize+1)/2, pi+1 { - l0 := pl0 + plsize - idx = (idx - idx&1) / 2 - if idx&1 == 1 { - //path = append(path, mt.tree[l0+idx-1]) - path[pi] = mt.tree[l0+idx-1] - } else { - if l0+idx+1 < l0+(plsize+1)/2 { - //path = append(path, mt.tree[l0+idx+1]) - path[pi] = mt.tree[l0+idx+1] - } else { - //path = append(path, mt.tree[l0+idx]) - path[pi] = mt.tree[l0+idx] - } - } - } - mpath.Nodes = path - return mpath -} diff --git a/core/util/merkle_tree_interface.go b/core/util/merkle_tree_interface.go deleted file mode 100644 index cb3e773e6..000000000 --- a/core/util/merkle_tree_interface.go +++ /dev/null @@ -1,83 +0,0 @@ -package util - -import ( - "encoding/hex" - - "github.com/0chain/gosdk/core/encryption" - "github.com/minio/sha256-simd" -) - -/*MerkleTreeI - a merkle tree interface required for constructing and providing verification */ -type MerkleTreeI interface { - //API to create a tree from leaf nodes - ComputeTree(hashes []Hashable) - GetRoot() string - GetTree() []string - - //API to load an existing tree - SetTree(leavesCount int, tree []string) error - - // API for verification when the leaf node is known - GetPath(hash Hashable) *MTPath // Server needs to provide this - VerifyPath(hash Hashable, path *MTPath) bool //This is only required by a client but useful for testing - - /* API for random verification when the leaf node is uknown - (verification of the data to hash used as leaf node is outside this API) */ - GetPathByIndex(idx int) *MTPath -} - -/*MTPath - The merkle tree path*/ -type MTPath struct { - Nodes []string `json:"nodes"` - LeafIndex int `json:"leaf_index"` -} - -/*Hash - the hashing used for the merkle tree construction */ -func Hash(text string) string { - return encryption.Hash(text) -} - -func MHashBytes(h1, h2 []byte) []byte { - buf := make([]byte, len(h1)+len(h2)) - copy(buf, h1) - copy(buf[len(h1):], h2) - hash := sha256.New() - _, _ = hash.Write(buf) - return hash.Sum(nil) -} - -/*MHash - merkle hashing of a pair of child hashes */ -func MHash(h1 string, h2 string) string { - return Hash(h1 + h2) -} - -// DecodeAndMHash will decode hex-encoded string to []byte format. -// This function should only be used with hex-encoded string otherwise the result will -// be obsolute. -func DecodeAndMHash(h1, h2 string) string { - b1, _ := hex.DecodeString(h1) - - b2, _ := hex.DecodeString(h2) - - b3 := MHashBytes(b1, b2) - return hex.EncodeToString(b3) -} - -type StringHashable struct { - Hash string -} - -func NewStringHashable(hash string) *StringHashable { - return &StringHashable{Hash: hash} -} - -func (sh *StringHashable) GetHash() string { - return sh.Hash -} -func (sh *StringHashable) GetHashBytes() []byte { - return []byte(sh.Hash) -} - -func (StringHashable) Write(_ []byte) (int, error) { - return 0, nil -} diff --git a/core/util/rand.go b/core/util/rand.go deleted file mode 100644 index 540c39bdb..000000000 --- a/core/util/rand.go +++ /dev/null @@ -1,115 +0,0 @@ -package util - -import ( - "errors" - "math/rand" - "time" -) - -// MinInt returns the minimum of two integers -// - x: first integer -// - y: second integer -func MinInt(x, y int) int { - if x < y { - return x - } - return y -} - -// MaxInt returns the maximum of two integers -// - x: first integer -// - y: second integer -func MaxInt(x, y int) int { - if x > y { - return x - } - return y -} - -// MinInt64 returns the minimum of two int64 -// - x: first int64 -// - y: second int64 -func MinInt64(x, y int64) int64 { - if x < y { - return x - } - return y -} - -// MaxInt64 returns the maximum of two int64 -// - x: first int64 -// - y: second int64 -func MaxInt64(x, y int64) int64 { - if x > y { - return x - } - return y -} - -// Shuffle returns a shuffled version of a string slice -// - in: input slice -func Shuffle(in []string) (shuffle []string) { - shuffle = make([]string, len(in)) - copy(shuffle, in) - var rnd = rand.New(rand.NewSource(time.Now().UnixNano())) - rnd.Shuffle(len(in), func(i, j int) { - shuffle[i], shuffle[j] = shuffle[j], shuffle[i] - }) - return -} - -// GetRandom returns n random slice from in -// If n > len(in), then this will return a shuffled version of in -func GetRandom(in []string, n int) []string { - n = MinInt(len(in), n) - out := make([]string, 0) - - rand.Seed(time.Now().UnixNano()) //nolint - perm := rand.Perm(len(in)) - for i := 0; i < n; i++ { - out = append(out, in[perm[i]]) - } - return out -} - -var ( - randGen = rand.New(rand.NewSource(time.Now().UnixNano())) - // ErrNoItem there is no item anymore - ErrNoItem = errors.New("rand: there is no item anymore") -) - -// Rand a progressive rand -type Rand struct { - items []int -} - -// Next get next random item -func (r *Rand) Next() (int, error) { - if len(r.items) > 0 { - i := randGen.Intn(len(r.items)) - - it := r.items[i] - - copy(r.items[i:], r.items[i+1:]) - r.items = r.items[:len(r.items)-1] - - return it, nil - } - - return -1, ErrNoItem - -} - -// NewRand create a ProgressiveRand instance -func NewRand(max int) Rand { - r := Rand{ - items: make([]int, max), - } - - for i := 0; i < max; i++ { - r.items[i] = i - } - - return r - -} diff --git a/core/util/rand_test.go b/core/util/rand_test.go deleted file mode 100644 index 04c7dc9bf..000000000 --- a/core/util/rand_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestGetRandomSlice(t *testing.T) { - s := []string{"hello", "world", "beuty"} - ns := GetRandom(s, 2) - if len(ns) != 2 { - t.Fatalf("Getrandom() failed") - } - ns = GetRandom(s, 4) - if len(ns) != 3 { - t.Fatalf("Getrandom() failed") - } - // Tests for when either len(in) = 0 or n = 0 - s = []string{} - ns = GetRandom(s, 2) - if len(ns) != 0 { - t.Fatalf("Getrandom() failed") - } - s = append(s, "hello") - ns = GetRandom(s, 0) - if len(ns) != 0 { - t.Fatalf("Getrandom() failed") - } -} - -func TestRand(t *testing.T) { - s := []string{"a", "b", "c", "d", "e", "f", "h", "i", "j", "k"} - - r := NewRand(len(s)) - - selected := make(map[int]string) - - for i := 0; i < len(s); i++ { - index, err := r.Next() - - require.Equal(t, nil, err) - - _, ok := selected[index] - - require.Equal(t, false, ok) - - selected[index] = s[index] - } - - for i := 0; i < len(s); i++ { - require.Equal(t, s[i], selected[i]) - } - - _, err := r.Next() - - require.Equal(t, ErrNoItem, err) - -} diff --git a/core/util/secure_value.go b/core/util/secure_value.go deleted file mode 100644 index aa41108ed..000000000 --- a/core/util/secure_value.go +++ /dev/null @@ -1,72 +0,0 @@ -package util - -import ( - "encoding/hex" - "strings" - - "github.com/0chain/gosdk/core/encryption" -) - -// Hashable anything that can provide it's hash -type Hashable interface { - // GetHash get the hash of the object - GetHash() string - - // GetHashBytes get the hash of the object as bytes - GetHashBytes() []byte - - // Write write the bytes to the hash - Write(b []byte) (int, error) -} - -/*Serializable interface */ -type Serializable interface { - Encode() []byte - Decode([]byte) error -} - -/*HashStringToBytes - convert a hex hash string to bytes */ -func HashStringToBytes(hash string) []byte { - hashBytes, err := hex.DecodeString(hash) - if err != nil { - return nil - } - return hashBytes -} - -/*SecureSerializableValueI an interface that makes a serializable value secure with hashing */ -type SecureSerializableValueI interface { - Serializable - Hashable -} - -/*SecureSerializableValue - a proxy persisted value that just tracks the encoded bytes of a persisted value */ -type SecureSerializableValue struct { - Buffer []byte -} - -/*GetHash - implement interface */ -func (spv *SecureSerializableValue) GetHash() string { - return ToHex(spv.GetHashBytes()) -} - -/*ToHex - converts a byte array to hex encoding with upper case */ -func ToHex(buf []byte) string { - return strings.ToUpper(hex.EncodeToString(buf)) -} - -/*GetHashBytes - implement interface */ -func (spv *SecureSerializableValue) GetHashBytes() []byte { - return encryption.RawHash(spv.Buffer) -} - -/*Encode - implement interface */ -func (spv *SecureSerializableValue) Encode() []byte { - return spv.Buffer -} - -/*Decode - implement interface */ -func (spv *SecureSerializableValue) Decode(buf []byte) error { - spv.Buffer = buf - return nil -} diff --git a/core/util/transport.go b/core/util/transport.go deleted file mode 100644 index 28c39947b..000000000 --- a/core/util/transport.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package util - -import ( - "net" - "net/http" - "time" -) - -// Run the HTTP request in a goroutine and pass the response to f. -var transport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - MaxIdleConns: 1000, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: 5, - ForceAttemptHTTP2: true, - - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, -} diff --git a/core/util/transport_wasm.go b/core/util/transport_wasm.go deleted file mode 100644 index 9e90f4f60..000000000 --- a/core/util/transport_wasm.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package util - -import ( - "net/http" - "time" -) - -// Run the HTTP request in a goroutine and pass the response to f. -var transport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - MaxIdleConns: 1000, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: 5, - ForceAttemptHTTP2: true, -} diff --git a/core/util/uint64.go b/core/util/uint64.go deleted file mode 100644 index 414293c25..000000000 --- a/core/util/uint64.go +++ /dev/null @@ -1,19 +0,0 @@ -package util - -import ( - "fmt" - "strconv" -) - -func ParseCoinStr(vs string) (uint64, error) { - if vs == "" { - return 0, nil - } - - v, err := strconv.ParseUint(vs, 10, 64) - if err != nil { - return 0, fmt.Errorf("invalid token value: %v, err: %v", vs, err) - } - - return v, nil -} diff --git a/core/util/uuid.go b/core/util/uuid.go deleted file mode 100644 index b64b41481..000000000 --- a/core/util/uuid.go +++ /dev/null @@ -1,24 +0,0 @@ -package util - -import ( - "github.com/google/uuid" -) - -// GetSHA1Uuid will give version 5 uuid. It depends on already existing uuid. -// The main idea is to synchronize uuid among blobbers. So for example, if -// a file is being uploaded to 4 blobbers then we require that file in each blobber -// have same uuid. All the goroutine that assigns uuid, calculates hashes and commits to blobber -// will use initial version 1 uuid and updates the uuid with recently calculated uuid so that -// the file will get same uuid in all blobbers. -func GetSHA1Uuid(u uuid.UUID, name string) uuid.UUID { - return uuid.NewSHA1(u, []byte(name)) -} - -// GetNewUUID will give new version1 uuid. It will panic if any error occurred -func GetNewUUID() uuid.UUID { - uid, err := uuid.NewUUID() - if err != nil { - panic("could not get new uuid. Error: " + err.Error()) - } - return uid -} diff --git a/core/util/validation_tree.go b/core/util/validation_tree.go deleted file mode 100644 index db97880a9..000000000 --- a/core/util/validation_tree.go +++ /dev/null @@ -1,342 +0,0 @@ -package util - -import ( - "bytes" - "encoding/hex" - "errors" - "fmt" - "hash" - "math" - "sync" - - "github.com/minio/sha256-simd" -) - -const ( - // Left tree node chile - Left = iota - - // Right tree node child - Right -) - -const ( - START_LENGTH = 64 - ADD_LENGTH = 320 -) - -// ValidationTree is a merkle tree that is used to validate the data -type ValidationTree struct { - writeLock sync.Mutex - writeCount int - dataSize int64 - writtenSize int64 - leafIndex int - leaves [][]byte - isFinalized bool - h hash.Hash - validationRoot []byte -} - -// GetLeaves returns the leaves of the validation tree -func (v *ValidationTree) GetLeaves() [][]byte { - return v.leaves -} - -// SetLeaves sets the leaves of the validation tree. -// - leaves: leaves of the validation tree, each leaf is in byte format -func (v *ValidationTree) SetLeaves(leaves [][]byte) { - v.leaves = leaves -} - -// GetDataSize returns the data size of the validation tree -func (v *ValidationTree) GetDataSize() int64 { - return v.dataSize -} - -// GetValidationRoot returns the validation root of the validation tree -func (v *ValidationTree) GetValidationRoot() []byte { - if len(v.validationRoot) > 0 { - return v.validationRoot - } - v.calculateRoot() - return v.validationRoot -} - -// Write writes the data to the validation tree -func (v *ValidationTree) Write(b []byte) (int, error) { - v.writeLock.Lock() - defer v.writeLock.Unlock() - - if v.isFinalized { - return 0, fmt.Errorf("tree is already finalized") - } - - if len(b) == 0 { - return 0, nil - } - - if v.dataSize > 0 && v.writtenSize+int64(len(b)) > v.dataSize { - return 0, fmt.Errorf("data size overflow. expected %d, got %d", v.dataSize, v.writtenSize+int64(len(b))) - } - - byteLen := len(b) - shouldContinue := true - // j is initialized to MaxMerkleLeavesSize - writeCount so as to make up MaxMerkleLeavesSize with previously - // read bytes. If previously it had written MaxMerkleLeavesSize - 1, then j will be initialized to 1 so - // in first iteration it will only read 1 byte and write it to v.h after which hash of v.h will be calculated - // and stored in v.Leaves and v.h will be reset. - for i, j := 0, MaxMerkleLeavesSize-v.writeCount; shouldContinue; i, j = j, j+MaxMerkleLeavesSize { - if j > byteLen { - j = byteLen - shouldContinue = false - } - - n, _ := v.h.Write(b[i:j]) - v.writeCount += n // update write count - if v.writeCount == MaxMerkleLeavesSize { - if v.leafIndex >= len(v.leaves) { - // increase leaves size - leaves := make([][]byte, len(v.leaves)+ADD_LENGTH) - copy(leaves, v.leaves) - v.leaves = leaves - } - v.leaves[v.leafIndex] = v.h.Sum(nil) - v.leafIndex++ - v.writeCount = 0 // reset writeCount - v.h.Reset() // reset hasher - } - } - v.writtenSize += int64(byteLen) - return byteLen, nil -} - -// CalculateDepth calculates the depth of the validation tree -func (v *ValidationTree) CalculateDepth() int { - return int(math.Ceil(math.Log2(float64(len(v.leaves))))) + 1 -} - -func (v *ValidationTree) calculateRoot() { - totalLeaves := len(v.leaves) - depth := v.CalculateDepth() - nodes := make([][]byte, totalLeaves) - copy(nodes, v.leaves) - h := sha256.New() - - for i := 0; i < depth; i++ { - if len(nodes) == 1 { - break - } - newNodes := make([][]byte, 0) - if len(nodes)%2 == 0 { - for j := 0; j < len(nodes); j += 2 { - h.Reset() - h.Write(nodes[j]) - h.Write(nodes[j+1]) - newNodes = append(newNodes, h.Sum(nil)) - } - } else { - for j := 0; j < len(nodes)-1; j += 2 { - h.Reset() - h.Write(nodes[j]) - h.Write(nodes[j+1]) - newNodes = append(newNodes, h.Sum(nil)) - } - h.Reset() - h.Write(nodes[len(nodes)-1]) - newNodes = append(newNodes, h.Sum(nil)) - } - nodes = newNodes - } - - v.validationRoot = nodes[0] -} - -// Finalize finalizes the validation tree, set isFinalized to true and calculate the root -func (v *ValidationTree) Finalize() error { - v.writeLock.Lock() - defer v.writeLock.Unlock() - - if v.isFinalized { - return errors.New("already finalized") - } - if v.dataSize > 0 && v.writtenSize != v.dataSize { - return fmt.Errorf("invalid size. Expected %d got %d", v.dataSize, v.writtenSize) - } - - v.isFinalized = true - - if v.writeCount > 0 { - if v.leafIndex == len(v.leaves) { - // increase leaves size - leaves := make([][]byte, len(v.leaves)+1) - copy(leaves, v.leaves) - v.leaves = leaves - } - v.leaves[v.leafIndex] = v.h.Sum(nil) - } else { - v.leafIndex-- - } - if v.leafIndex < len(v.leaves) { - v.leaves = v.leaves[:v.leafIndex+1] - } - return nil -} - -// NewValidationTree creates a new validation tree -// - dataSize is the size of the data -func NewValidationTree(dataSize int64) *ValidationTree { - totalLeaves := (dataSize + MaxMerkleLeavesSize - 1) / MaxMerkleLeavesSize - if totalLeaves == 0 { - totalLeaves = START_LENGTH - } - return &ValidationTree{ - dataSize: dataSize, - h: sha256.New(), - leaves: make([][]byte, totalLeaves), - } -} - -// MerklePathForMultiLeafVerification is used to verify multiple blocks with single instance of -// merkle path. Usually client would request with counter incremented by 10. So if the block size -// is 64KB and counter is incremented by 10 then client is requesting 640 KB of data. Blobber can then -// provide sinlge merkle path instead of sending 10 merkle paths. -type MerklePathForMultiLeafVerification struct { - // RootHash that was signed by the client - RootHash []byte - // Nodes contains a slice for each merkle node level. Each slice contains hash that will - // be concatenated with the calculated hash from the level below. - // It is used together with field Index [][]int - // Length of Nodes will be according to number of blocks requested. If whole data is requested then - // blobber will send nil for Nodes i.e. length of Nodes will become zero. - Nodes [][][]byte `json:"nodes"` - // Index slice that determines whether to concatenate hash to left or right. - // It should have maximum of length 2 and minimum of 0. It is used together with field Nodes [][][]byte - Index [][]int `json:"index"` - // DataSize is size of data received by the blobber for the respective file. - // It is not same as actual file size - DataSize int64 - totalLeaves int - requiredDepth int -} - -/* -VerifyMultipleBlocks will verify merkle path for continuous data which is multiple of 64KB blocks - -There can be at most 2 hashes in the input for each depth i.e. of the format below: -h1, data1, data2, data3, data4, h2 -Note that data1, data2, data3,... should be continuous data - -i#3 h14 -i#2 h12 h13 -i#1 h7 h8 h9 h10 -i#0 h0, h1, h2, h3, h4, h5, h6 - -Consider there are 7 leaves(0...6) as shown above. Now if client wants data from -1-3 then blobber needs to provide: - -1. One node from i#0, [h0]; data1 will generate h1,data2 will generate h2 and so on... -2. Zero node from i#1; h0 and h1 will generate h7 and h2 and h3 will generate h8 -3. One node from i#2, h[13]; h7 and h8 will generate h12. Now to get h14, we need h13 -which will be provided by blobber - -i#5 h37 -i#4 h35 h36 -i#3 h32 h33 h34 -i#2 h27 h28 h29 h30 h31 -i#1 h18 h19 h20 h21 h22 h23 h24 h25, h26 -i#0 h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, h14, h15, h16, h17 - -Consider there are 16 leaves(0..15) with total data = 16*64KB as shown above. -If client wants data from 3-10 then blobber needs to provide: -1. Two nodes from i#0, [h2, h11] -2. One node from i#1, [h16] -3. One node from i#2, [h27] - -If client had required data from 2-9 then blobber would have to provide: -1. Zero nodes from i#0 -2. Two nodes from i#1, [h16, h21] -3. One node from i#2, [h27] -*/ -func (m *MerklePathForMultiLeafVerification) VerifyMultipleBlocks(data []byte) error { - - hashes := make([][]byte, 0) - h := sha256.New() - // Calculate hashes from the data responded from the blobber. - for i := 0; i < len(data); i += MaxMerkleLeavesSize { - endIndex := i + MaxMerkleLeavesSize - if endIndex > len(data) { - endIndex = len(data) - } - h.Reset() - h.Write(data[i:endIndex]) - hashes = append(hashes, h.Sum(nil)) - } - - if m.requiredDepth == 0 { - m.calculateRequiredLevels() - } - for i := 0; i < m.requiredDepth-1; i++ { - if len(m.Nodes) > i { - if len(m.Index[i]) == 2 { // has both nodes to append for - hashes = append([][]byte{m.Nodes[i][0]}, hashes...) - hashes = append(hashes, m.Nodes[i][1]) - } else if len(m.Index[i]) == 1 { // hash single node to append for - if m.Index[i][0] == Right { // append to right - hashes = append(hashes, m.Nodes[i][0]) - } else { - hashes = append([][]byte{m.Nodes[i][0]}, hashes...) - } - } - } - - hashes = m.calculateIntermediateHashes(hashes) - - } - - if len(hashes) == 0 { - return fmt.Errorf("no hashes to verify, data is empty") - } - - if !bytes.Equal(m.RootHash, hashes[0]) { - return fmt.Errorf("calculated root %s; expected %s", - hex.EncodeToString(hashes[0]), - hex.EncodeToString(m.RootHash)) - } - return nil -} - -func (m *MerklePathForMultiLeafVerification) calculateIntermediateHashes(hashes [][]byte) [][]byte { - newHashes := make([][]byte, 0) - h := sha256.New() - if len(hashes)%2 == 0 { - for i := 0; i < len(hashes); i += 2 { - h.Reset() - h.Write(hashes[i]) - h.Write(hashes[i+1]) - newHashes = append(newHashes, h.Sum(nil)) - } - } else { - for i := 0; i < len(hashes)-1; i += 2 { - h.Reset() - h.Write(hashes[i]) - h.Write(hashes[i+1]) - newHashes = append(newHashes, h.Sum(nil)) - } - h.Reset() - h.Write(hashes[len(hashes)-1]) - newHashes = append(newHashes, h.Sum(nil)) - } - return newHashes -} - -func (m *MerklePathForMultiLeafVerification) calculateTotalLeaves() { - m.totalLeaves = int((m.DataSize + MaxMerkleLeavesSize - 1) / MaxMerkleLeavesSize) -} - -func (m *MerklePathForMultiLeafVerification) calculateRequiredLevels() { - if m.totalLeaves == 0 { - m.calculateTotalLeaves() - } - m.requiredDepth = int(math.Ceil(math.Log2(float64(m.totalLeaves)))) + 1 // Add root hash to be a level -} diff --git a/core/util/validation_tree_test.go b/core/util/validation_tree_test.go deleted file mode 100644 index 149aba444..000000000 --- a/core/util/validation_tree_test.go +++ /dev/null @@ -1,331 +0,0 @@ -package util - -import ( - "bytes" - "crypto/rand" - "errors" - "fmt" - "math" - "testing" - - "github.com/minio/sha256-simd" - "github.com/stretchr/testify/require" -) - -const ( - HashSize = 32 -) - -func TestValidationTreeWrite(t *testing.T) { - dataSizes := []int64{ - MaxMerkleLeavesSize, - MaxMerkleLeavesSize - 24*KB, - MaxMerkleLeavesSize * 2, - MaxMerkleLeavesSize * 3, - MaxMerkleLeavesSize*10 - 1, - } - - for _, s := range dataSizes { - data := make([]byte, s) - n, err := rand.Read(data) - require.NoError(t, err) - require.EqualValues(t, s, n) - - root := calculateValidationMerkleRoot(data) - - vt := NewValidationTree(s) - diff := 1 - i := len(data) - diff - - _, err = vt.Write(data[0:i]) - require.NoError(t, err) - vt.calculateRoot() - - require.False(t, bytes.Equal(root, vt.validationRoot)) - - _, err = vt.Write(data[i:]) - require.NoError(t, err) - - err = vt.Finalize() - require.NoError(t, err) - - vt.calculateRoot() - require.True(t, bytes.Equal(root, vt.validationRoot)) - - require.Error(t, vt.Finalize()) - } -} - -func TestValidationTreeCalculateDepth(t *testing.T) { - in := map[int]int{ - 1: 1, - 2: 2, - 3: 3, - 4: 3, - 10: 5, - 100: 8, - } - - for k, d := range in { - v := ValidationTree{leaves: make([][]byte, k)} - require.Equal(t, v.CalculateDepth(), d) - } -} - -func TestMerklePathVerificationForValidationTree(t *testing.T) { - - type input struct { - dataSize int64 - startInd int - endInd int - } - - tests := []*input{ - { - dataSize: 24 * KB, - startInd: 0, - endInd: 0, - }, - { - dataSize: 340 * KB, - startInd: 1, - endInd: 3, - }, - { - dataSize: 640 * KB, - startInd: 1, - endInd: 4, - }, - { - dataSize: 640*KB + 1, - startInd: 1, - endInd: 5, - }, - } - - for _, test := range tests { - t.Run(fmt.Sprintf("Data size: %d KB, startInd: %d, endInd:%d", - test.dataSize/KB, - test.startInd, - test.endInd, - ), func(t *testing.T) { - - b := make([]byte, test.dataSize) - n, err := rand.Read(b) - - require.NoError(t, err) - require.EqualValues(t, test.dataSize, n) - - root, nodes, indexes, data, err := calculateValidationRootAndNodes(b, test.startInd, test.endInd) - require.NoError(t, err) - - t.Logf("nodes len: %d; index len: %d, indexes: %v", len(nodes), len(indexes), indexes) - vp := MerklePathForMultiLeafVerification{ - RootHash: root, - Nodes: nodes, - Index: indexes, - DataSize: test.dataSize, - } - - err = vp.VerifyMultipleBlocks(data) - require.NoError(t, err) - - err = vp.VerifyMultipleBlocks(data[1:]) - require.Error(t, err) - }) - - } -} - -func calculateValidationMerkleRoot(data []byte) []byte { - hashes := make([][]byte, 0) - for i := 0; i < len(data); i += MaxMerkleLeavesSize { - j := i + MaxMerkleLeavesSize - if j > len(data) { - j = len(data) - } - h := sha256.New() - _, _ = h.Write(data[i:j]) - hashes = append(hashes, h.Sum(nil)) - } - - if len(hashes) == 1 { - return hashes[0] - } - for len(hashes) != 1 { - newHashes := make([][]byte, 0) - if len(hashes)%2 == 0 { - for i := 0; i < len(hashes); i += 2 { - h := sha256.New() - _, _ = h.Write(hashes[i]) - _, _ = h.Write(hashes[i+1]) - newHashes = append(newHashes, h.Sum(nil)) - } - } else { - for i := 0; i < len(hashes)-1; i += 2 { - h := sha256.New() - _, _ = h.Write(hashes[i]) - _, _ = h.Write(hashes[i+1]) - newHashes = append(newHashes, h.Sum(nil)) - } - h := sha256.New() - _, _ = h.Write(hashes[len(hashes)-1]) - newHashes = append(newHashes, h.Sum(nil)) - } - - hashes = newHashes - } - return hashes[0] -} - -func calculateValidationRootAndNodes(b []byte, startInd, endInd int) ( - root []byte, nodes [][][]byte, indexes [][]int, data []byte, err error, -) { - - totalLeaves := int(math.Ceil(float64(len(b)) / float64(MaxMerkleLeavesSize))) - depth := int(math.Ceil(math.Log2(float64(totalLeaves)))) + 1 - - if endInd >= totalLeaves { - endInd = totalLeaves - 1 - } - - hashes := make([][]byte, 0) - nodesData := make([]byte, 0) - h := sha256.New() - for i := 0; i < len(b); i += MaxMerkleLeavesSize { - j := i + MaxMerkleLeavesSize - if j > len(b) { - j = len(b) - } - - _, _ = h.Write(b[i:j]) - leafHash := h.Sum(nil) - hashes = append(hashes, leafHash) - h.Reset() - } - - if len(hashes) == 1 { - return hashes[0], nil, nil, b, nil - } - - for len(hashes) != 1 { - newHashes := make([][]byte, 0) - if len(hashes)%2 == 0 { - for i := 0; i < len(hashes); i += 2 { - h := sha256.New() - _, _ = h.Write(hashes[i]) - _, _ = h.Write(hashes[i+1]) - nodesData = append(nodesData, hashes[i]...) - nodesData = append(nodesData, hashes[i+1]...) - newHashes = append(newHashes, h.Sum(nil)) - } - } else { - for i := 0; i < len(hashes)-1; i += 2 { - h := sha256.New() - _, _ = h.Write(hashes[i]) - _, _ = h.Write(hashes[i+1]) - nodesData = append(nodesData, hashes[i]...) - nodesData = append(nodesData, hashes[i+1]...) - newHashes = append(newHashes, h.Sum(nil)) - } - h := sha256.New() - _, _ = h.Write(hashes[len(hashes)-1]) - nodesData = append(nodesData, hashes[len(hashes)-1]...) - newHashes = append(newHashes, h.Sum(nil)) - } - - hashes = newHashes - } - - nodes, indexes, err = getMerkleProofOfMultipleIndexes(nodesData, totalLeaves, depth, startInd, endInd) - if err != nil { - return nil, nil, nil, nil, err - } - - startOffset := startInd * 64 * KB - endOffset := startOffset + (endInd-startInd+1)*64*KB - if endOffset > len(b) { - endOffset = len(b) - } - - return hashes[0], nodes, indexes, b[startOffset:endOffset], nil -} - -func getMerkleProofOfMultipleIndexes(nodesData []byte, totalLeaves, depth, startInd, endInd int) ( - [][][]byte, [][]int, error) { - - if endInd >= totalLeaves { - endInd = totalLeaves - 1 - } - - if endInd < startInd { - return nil, nil, errors.New("end index cannot be lesser than start index") - } - - offsets, leftRightIndexes := getFileOffsetsAndNodeIndexes(totalLeaves, depth, startInd, endInd) - - offsetInd := 0 - nodeHashes := make([][][]byte, len(leftRightIndexes)) - for i, indexes := range leftRightIndexes { - for range indexes { - b := make([]byte, HashSize) - off := offsets[offsetInd] - n := copy(b, nodesData[off:off+HashSize]) - if n != HashSize { - return nil, nil, errors.New("invalid hash length") - } - nodeHashes[i] = append(nodeHashes[i], b) - offsetInd++ - } - } - return nodeHashes, leftRightIndexes, nil -} - -func getFileOffsetsAndNodeIndexes(totalLeaves, depth, startInd, endInd int) ([]int, [][]int) { - - nodeIndexes, leftRightIndexes := getNodeIndexes(totalLeaves, depth, startInd, endInd) - offsets := make([]int, 0) - totalNodes := 0 - curNodesTot := totalLeaves - for i := 0; i < len(nodeIndexes); i++ { - for _, ind := range nodeIndexes[i] { - offsetInd := ind + totalNodes - offsets = append(offsets, offsetInd*HashSize) - } - totalNodes += curNodesTot - curNodesTot = (curNodesTot + 1) / 2 - } - - return offsets, leftRightIndexes -} - -func getNodeIndexes(totalLeaves, depth, startInd, endInd int) ([][]int, [][]int) { - - indexes := make([][]int, 0) - leftRightIndexes := make([][]int, 0) - totalNodes := totalLeaves - for i := depth - 1; i >= 0; i-- { - if startInd == 0 && endInd == totalNodes-1 { - break - } - - nodeOffsets := make([]int, 0) - lftRtInd := make([]int, 0) - if startInd&1 == 1 { - nodeOffsets = append(nodeOffsets, startInd-1) - lftRtInd = append(lftRtInd, Left) - } - - if endInd != totalNodes-1 && endInd&1 == 0 { - nodeOffsets = append(nodeOffsets, endInd+1) - lftRtInd = append(lftRtInd, Right) - } - - indexes = append(indexes, nodeOffsets) - leftRightIndexes = append(leftRightIndexes, lftRtInd) - startInd = startInd / 2 - endInd = endInd / 2 - totalNodes = (totalNodes + 1) / 2 - } - return indexes, leftRightIndexes -} diff --git a/core/version/.emptydir b/core/version/.emptydir deleted file mode 100644 index e69de29bb..000000000 diff --git a/core/version/doc.go b/core/version/doc.go deleted file mode 100644 index 04305704b..000000000 --- a/core/version/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// AUTOGENERATED! Do not use. -// Provide current version of the SDK -package version \ No newline at end of file diff --git a/core/version/version.go b/core/version/version.go deleted file mode 100644 index fa0af25cc..000000000 --- a/core/version/version.go +++ /dev/null @@ -1,5 +0,0 @@ -//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ======== - -package version - -const VERSIONSTR = "v1.17.11-269-g7fd90660" diff --git a/core/zcncrypto/bls.go b/core/zcncrypto/bls.go deleted file mode 100644 index 80ea65a4e..000000000 --- a/core/zcncrypto/bls.go +++ /dev/null @@ -1,66 +0,0 @@ -package zcncrypto - -import "io" - -var BlsSignerInstance BlsSigner - -type BlsSigner interface { - SetRandFunc(randReader io.Reader) - FrSub(out Fr, x Fr, y Fr) - - NewFr() Fr - NewSecretKey() SecretKey - NewPublicKey() PublicKey - NewSignature() Signature - NewID() ID -} - -// Fr -- -type Fr interface { - Serialize() []byte - - SetLittleEndian(buf []byte) error -} - -type SecretKey interface { - SerializeToHexStr() string - DeserializeHexStr(s string) error - - Serialize() []byte - - GetLittleEndian() []byte - SetLittleEndian(buf []byte) error - - SetByCSPRNG() - - GetPublicKey() PublicKey - - Sign(m string) Signature - Add(rhs SecretKey) - - GetMasterSecretKey(k int) (msk []SecretKey, err error) - Set(msk []SecretKey, id ID) error -} - -type PublicKey interface { - SerializeToHexStr() string - DeserializeHexStr(s string) error - - Serialize() []byte -} - -type Signature interface { - SerializeToHexStr() string - DeserializeHexStr(s string) error - - Add(rhs Signature) - - Verify(pk PublicKey, m string) bool -} - -type ID interface { - SetHexString(s string) error - GetHexString() string - - SetDecString(s string) error -} diff --git a/core/zcncrypto/bls0chain_herumi.go b/core/zcncrypto/bls0chain_herumi.go deleted file mode 100644 index 39ba4a644..000000000 --- a/core/zcncrypto/bls0chain_herumi.go +++ /dev/null @@ -1,310 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package zcncrypto - -import ( - "bytes" - "encoding/hex" - "fmt" - "time" - - "github.com/0chain/errors" - "github.com/tyler-smith/go-bip39" - - "github.com/0chain/gosdk/core/encryption" -) - -func init() { - -} - -// HerumiScheme - a signature scheme for BLS0Chain Signature -type HerumiScheme struct { - PublicKey string `json:"public_key"` - PrivateKey string `json:"private_key"` - Mnemonic string `json:"mnemonic"` - - id ID - Ids string `json:"threshold_scheme_id"` -} - -// NewHerumiScheme - create a MiraclScheme object -func NewHerumiScheme() *HerumiScheme { - return &HerumiScheme{ - id: BlsSignerInstance.NewID(), - } -} - -// GenerateKeys generate fresh keys -func (b0 *HerumiScheme) GenerateKeys() (*Wallet, error) { - return b0.generateKeys("0chain-client-split-key") -} - -// GenerateKeysWithEth generate fresh keys based on eth wallet -func (b0 *HerumiScheme) GenerateKeysWithEth(mnemonic, password string) (*Wallet, error) { - if len(mnemonic) == 0 { - return nil, fmt.Errorf("Mnemonic phase is mandatory.") - } - b0.Mnemonic = mnemonic - - _, err := bip39.NewSeedWithErrorChecking(b0.Mnemonic, password) - if err != nil { - return nil, fmt.Errorf("Wrong mnemonic phase.") - } - - return b0.generateKeys(password) -} - -// RecoverKeys recovery keys from mnemonic -func (b0 *HerumiScheme) RecoverKeys(mnemonic string) (*Wallet, error) { - if mnemonic == "" { - return nil, errors.New("recover_keys", "Set mnemonic key failed") - } - if b0.PublicKey != "" || b0.PrivateKey != "" { - return nil, errors.New("recover_keys", "Cannot recover when there are keys") - } - b0.Mnemonic = mnemonic - return b0.GenerateKeys() -} - -func (b0 *HerumiScheme) GetMnemonic() string { - if b0 == nil { - return "" - } - - return b0.Mnemonic -} - -// SetPrivateKey set private key to sign -func (b0 *HerumiScheme) SetPrivateKey(privateKey string) error { - if b0.PublicKey != "" { - return errors.New("set_private_key", "cannot set private key when there is a public key") - } - if b0.PrivateKey != "" { - return errors.New("set_private_key", "private key already exists") - } - b0.PrivateKey = privateKey - //ToDo: b0.publicKey should be set here? - return nil -} - -func (b0 *HerumiScheme) GetPrivateKey() string { - return b0.PrivateKey -} - -func (b0 *HerumiScheme) SplitKeys(numSplits int) (*Wallet, error) { - if b0.PrivateKey == "" { - return nil, errors.New("split_keys", "primary private key not found") - } - primaryFr := BlsSignerInstance.NewFr() - primarySk := BlsSignerInstance.NewSecretKey() - err := primarySk.DeserializeHexStr(b0.PrivateKey) - if err != nil { - return nil, err - } - err = primaryFr.SetLittleEndian(primarySk.GetLittleEndian()) - - if err != nil { - return nil, err - } - - // New Wallet - w := &Wallet{} - w.Keys = make([]KeyPair, numSplits) - sk := BlsSignerInstance.NewSecretKey() - for i := 0; i < numSplits-1; i++ { - tmpSk := BlsSignerInstance.NewSecretKey() - tmpSk.SetByCSPRNG() - w.Keys[i].PrivateKey = tmpSk.SerializeToHexStr() - pub := tmpSk.GetPublicKey() - w.Keys[i].PublicKey = pub.SerializeToHexStr() - sk.Add(tmpSk) - } - aggregateSk := BlsSignerInstance.NewFr() - err = aggregateSk.SetLittleEndian(sk.GetLittleEndian()) - - if err != nil { - return nil, err - } - - //Subtract the aggregated private key from the primary private key to derive the last split private key - lastSk := BlsSignerInstance.NewFr() - BlsSignerInstance.FrSub(lastSk, primaryFr, aggregateSk) - - // Last key - lastSecretKey := BlsSignerInstance.NewSecretKey() - err = lastSecretKey.SetLittleEndian(lastSk.Serialize()) - if err != nil { - return nil, err - } - w.Keys[numSplits-1].PrivateKey = lastSecretKey.SerializeToHexStr() - w.Keys[numSplits-1].PublicKey = lastSecretKey.GetPublicKey().SerializeToHexStr() - - // Generate client ID and public - w.ClientKey = primarySk.GetPublicKey().SerializeToHexStr() - w.ClientID = encryption.Hash(primarySk.GetPublicKey().Serialize()) - w.Mnemonic = b0.Mnemonic - w.Version = CryptoVersion - w.DateCreated = time.Now().Format(time.RFC3339) - - return w, nil -} - -// Sign sign message -func (b0 *HerumiScheme) Sign(hash string) (string, error) { - sig, err := b0.rawSign(hash) - if err != nil { - return "", err - } - return sig.SerializeToHexStr(), nil -} - -// SetPublicKey - implement interface -func (b0 *HerumiScheme) SetPublicKey(publicKey string) error { - if b0.PrivateKey != "" { - return errors.New("set_public_key", "cannot set public key when there is a private key") - } - if b0.PublicKey != "" { - return errors.New("set_public_key", "public key already exists") - } - b0.PublicKey = publicKey - return nil -} - -// GetPublicKey - implement interface -func (b0 *HerumiScheme) GetPublicKey() string { - return b0.PublicKey -} - -// Verify - implement interface -func (b0 *HerumiScheme) Verify(signature, msg string) (bool, error) { - if b0.PublicKey == "" { - return false, errors.New("verify", "public key does not exists for verification") - } - sig := BlsSignerInstance.NewSignature() - pk := BlsSignerInstance.NewPublicKey() - err := sig.DeserializeHexStr(signature) - if err != nil { - return false, err - } - rawHash, err := hex.DecodeString(msg) - if err != nil { - return false, err - } - if rawHash == nil { - return false, errors.New("verify", "failed hash while signing") - } - err = pk.DeserializeHexStr(b0.PublicKey) - if err != nil { - return false, err - } - - return sig.Verify(pk, string(rawHash)), nil -} - -func (b0 *HerumiScheme) Add(signature, msg string) (string, error) { - sign := BlsSignerInstance.NewSignature() - err := sign.DeserializeHexStr(signature) - if err != nil { - return "", err - } - signature1, err := b0.rawSign(msg) - if err != nil { - return "", errors.Wrap(err, "BLS signing failed") - } - sign.Add(signature1) - return sign.SerializeToHexStr(), nil -} - -// GetPrivateKeyAsByteArray - converts private key into byte array -func (b0 *HerumiScheme) GetPrivateKeyAsByteArray() ([]byte, error) { - if len(b0.PrivateKey) == 0 { - return nil, errors.New("get_private_key_as_byte_array", "cannot convert empty private key to byte array") - } - privateKeyBytes, err := hex.DecodeString(b0.PrivateKey) - if err != nil { - return nil, err - } - return privateKeyBytes, nil -} - -// SetID sets ID in HexString format -func (b0 *HerumiScheme) SetID(id string) error { - if b0.id == nil { - b0.id = BlsSignerInstance.NewID() - } - b0.Ids = id - return b0.id.SetHexString(id) -} - -// GetID gets ID in hex string format -func (b0 *HerumiScheme) GetID() string { - if b0.id == nil { - b0.id = BlsSignerInstance.NewID() - } - return b0.id.GetHexString() -} - -func (b0 *HerumiScheme) generateKeys(password string) (*Wallet, error) { - // Check for recovery - if len(b0.Mnemonic) == 0 { - entropy, err := bip39.NewEntropy(256) - if err != nil { - return nil, errors.Wrap(err, "Generating entropy failed") - } - b0.Mnemonic, err = bip39.NewMnemonic(entropy) - if err != nil { - return nil, errors.Wrap(err, "Generating mnemonic failed") - } - } - - // Generate a Bip32 HD wallet for the mnemonic and a user supplied password - seed := bip39.NewSeed(b0.Mnemonic, password) - r := bytes.NewReader(seed) - BlsSignerInstance.SetRandFunc(r) - - // New Wallet - w := &Wallet{} - w.Keys = make([]KeyPair, 1) - - // Generate pair - sk := BlsSignerInstance.NewSecretKey() - sk.SetByCSPRNG() - w.Keys[0].PrivateKey = sk.SerializeToHexStr() - pub := sk.GetPublicKey() - w.Keys[0].PublicKey = pub.SerializeToHexStr() - - b0.PrivateKey = w.Keys[0].PrivateKey - b0.PublicKey = w.Keys[0].PublicKey - w.ClientKey = w.Keys[0].PublicKey - w.ClientID = encryption.Hash(pub.Serialize()) - w.Mnemonic = b0.Mnemonic - w.Version = CryptoVersion - w.DateCreated = time.Now().Format(time.RFC3339) - - // Revert the Random function to default - BlsSignerInstance.SetRandFunc(nil) - return w, nil -} - -func (b0 *HerumiScheme) rawSign(hash string) (Signature, error) { - sk := BlsSignerInstance.NewSecretKey() - if b0.PrivateKey == "" { - return nil, errors.New("raw_sign", "private key does not exists for signing") - } - rawHash, err := hex.DecodeString(hash) - if err != nil { - return nil, err - } - if rawHash == nil { - return nil, errors.New("raw_sign", "failed hash while signing") - } - sk.SetByCSPRNG() - err = sk.DeserializeHexStr(b0.PrivateKey) - if err != nil { - return nil, err - } - sig := sk.Sign(string(rawHash)) - return sig, nil -} diff --git a/core/zcncrypto/bls0chain_herumi_test.go b/core/zcncrypto/bls0chain_herumi_test.go deleted file mode 100644 index 221a8d0cc..000000000 --- a/core/zcncrypto/bls0chain_herumi_test.go +++ /dev/null @@ -1,188 +0,0 @@ -package zcncrypto - -import ( - "fmt" - "testing" - - "github.com/0chain/errors" - "github.com/stretchr/testify/require" - - "github.com/0chain/gosdk/core/encryption" -) - -var verifyPublickey = `e8a6cfa7b3076ae7e04764ffdfe341632a136b52953dfafa6926361dd9a466196faecca6f696774bbd64b938ff765dbc837e8766a5e2d8996745b2b94e1beb9e` -var signPrivatekey = `5e1fc9c03d53a8b9a63030acc2864f0c33dffddb3c276bf2b3c8d739269cc018` -var data = `TEST` -var blsWallet *Wallet - -func TestSignatureScheme(t *testing.T) { - sigScheme := &HerumiScheme{} - - w, err := sigScheme.GenerateKeys() - if err != nil { - t.Fatalf("Generate Key failed %s", errors.Top(err)) - } - if w.ClientID == "" || w.ClientKey == "" || len(w.Keys) != 1 || w.Mnemonic == "" { - t.Fatalf("Invalid keys generated") - } - blsWallet = w - -} - -func TestSSSignAndVerify(t *testing.T) { - signScheme := NewSignatureScheme("bls0chain") - err := signScheme.SetPrivateKey(signPrivatekey) - - require.NoError(t, err) - - hash := Sha3Sum256(data) - signature, err := signScheme.Sign(hash) - if err != nil { - t.Fatalf("BLS signing failed") - } - verifyScheme := NewSignatureScheme("bls0chain") - err = verifyScheme.SetPublicKey(verifyPublickey) - require.NoError(t, err) - if ok, err := verifyScheme.Verify(signature, hash); err != nil || !ok { - t.Fatalf("Verification failed\n") - } -} - -func TestSSA(t *testing.T) { - signScheme := NewSignatureScheme("bls0chain") - err := signScheme.SetPrivateKey("f482aa19d3a3f6cebcd4f8a99de292bcf4bf07e937be1350634086f4aa02e704") - - require.NoError(t, err) - - hash := Sha3Sum256("hello") - signature, err := signScheme.Sign(hash) - if err != nil { - t.Fatalf("BLS signing failed") - } - fmt.Println(signature) - // verifyScheme := NewSignatureScheme("bls0chain") - // err = verifyScheme.SetPublicKey(verifyPublickey) - // require.NoError(t, err) - // if ok, err := verifyScheme.Verify(signature, hash); err != nil || !ok { - // t.Fatalf("Verification failed\n") - // } -} - -func TestVerify(t *testing.T) { - sk := "a931522f9949ff26b22db98b26e59cc92258457965f13ce6113cc2b5d2165513" - hash := "eb82aa875b3298ae7e625d8d8f13475004a4942bd8fcd7285e8ab9ad20651872" - sm := NewSignatureScheme("bls0chain") - if err2 := sm.SetPrivateKey(sk); err2 != nil { - t.Error(err2) - } - sig, _ := sm.Sign(hash) - fmt.Println("now sig:", sig) - - pk := "47e94b6c5399f8c0005c6f3202dec43e37d171b0eff24d75cdcf14861f088106cf88df15b3335dcd0806365db4d1b3e70579a8bd82eb665c881ef2273d6bdd03" - verifyScheme := NewSignatureScheme("bls0chain") - if err := verifyScheme.SetPublicKey(pk); err != nil { - t.Error(err) - } - ok, err := verifyScheme.Verify(sig, hash) - require.NoError(t, err) - fmt.Println("verify result:", ok) -} - -func BenchmarkBLSSign(b *testing.B) { - sigScheme := NewSignatureScheme("bls0chain") - err := sigScheme.SetPrivateKey(signPrivatekey) - require.NoError(b, err) - for i := 0; i < b.N; i++ { - _, err := sigScheme.Sign(encryption.Hash(data)) - if err != nil { - b.Fatalf("BLS signing failed") - } - } -} - -func TestRecoveryKeys(t *testing.T) { - - sigScheme := &HerumiScheme{} - - w, err := sigScheme.RecoverKeys(testMnemonic) - if err != nil { - t.Fatalf("set Recover Keys failed") - } - - require.Equal(t, testHerumiPrivateKey, w.Keys[0].PrivateKey, "Recover key didn't match with private key") - require.Equal(t, testHerumiPublicKey, w.Keys[0].PublicKey, "Recover key didn't match with public key") -} - -func TestCombinedSignAndVerify(t *testing.T) { - sk0 := `c36f2f92b673cf057a32e8bd0ca88888e7ace40337b737e9c7459fdc4c521918` - sk1 := `704b6f489583bf1118432fcfb38e63fc2d4b61e524fb196cbd95413f8eb91c12` - primaryKey := `f72fd53ee85e84157d3106053754594f697e0bfca1f73f91a41f7bb0797d901acefd80fcc2da98aae690af0ee9c795d6590c1808f26490306433b4e9c42f7b1f` - - hash := Sha3Sum256(data) - // Create signatue for 1 - sig0 := NewSignatureScheme("bls0chain") - err := sig0.SetPrivateKey(sk0) - if err != nil { - t.Fatalf("Set private key failed - %s", errors.Top(err)) - } - signature, err := sig0.Sign(hash) - if err != nil { - t.Fatalf("BLS signing failed") - } - // Create signature for second - sig1 := NewSignatureScheme("bls0chain") - err = sig1.SetPrivateKey(sk1) - if err != nil { - t.Fatalf("Set private key failed - %s", errors.Top(err)) - } - addSig, err := sig1.Add(signature, hash) - - require.NoError(t, err) - - verifyScheme := NewSignatureScheme("bls0chain") - err = verifyScheme.SetPublicKey(primaryKey) - if err != nil { - t.Fatalf("Set public key failed") - } - if ok, err := verifyScheme.Verify(addSig, hash); err != nil || !ok { - t.Fatalf("Verification failed\n") - } -} - -func TestSplitKey(t *testing.T) { - primaryKeyStr := `872eac6370c72093535fa395ad41a08ee90c9d0d46df9461eb2515451f389d1b` - sig0 := NewSignatureScheme("bls0chain") - err := sig0.SetPrivateKey(primaryKeyStr) - if err != nil { - t.Fatalf("Set private key failed - %s", errors.Top(err)) - } - data = "823bb3dc0b80a6c86922a884e63908cb9e963ef488688b41e32cbf4d84471a1f" - hash := Sha3Sum256(data) - signature, err := sig0.Sign(hash) - if err != nil { - t.Fatalf("BLS signing failed") - } - numSplitKeys := int(2) - w, err := sig0.SplitKeys(numSplitKeys) - if err != nil { - t.Fatalf("Splitkeys key failed - %s", errors.Top(err)) - } - sigAggScheme := make([]SignatureScheme, numSplitKeys) - for i := 0; i < numSplitKeys; i++ { - sigAggScheme[i] = NewSignatureScheme("bls0chain") - err = sigAggScheme[i].SetPrivateKey(w.Keys[i].PrivateKey) - fmt.Println("seckey:", sigAggScheme[i].GetPrivateKey()) - - require.NoError(t, err) - } - var aggrSig string - for i := 1; i < numSplitKeys; i++ { - tmpSig, _ := sigAggScheme[i].Sign(hash) - fmt.Println("tmpSig:", tmpSig) - aggrSig, _ = sigAggScheme[0].Add(tmpSig, hash) - } - if aggrSig != signature { - t.Fatalf("split key signature failed") - } - fmt.Println("aggrSig:", aggrSig) -} diff --git a/core/zcncrypto/bls0chain_test.go b/core/zcncrypto/bls0chain_test.go deleted file mode 100644 index 77abeb500..000000000 --- a/core/zcncrypto/bls0chain_test.go +++ /dev/null @@ -1,65 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package zcncrypto - -import ( - "testing" - - "github.com/herumi/bls-go-binary/bls" - "github.com/stretchr/testify/require" -) - -const ( - testMnemonic = "silent tape impulse glimpse state craft sheriff embody bonus clay confirm column swift kingdom door stove mad switch chalk theory pause canoe insane struggle" - - testHerumiPublicKey = "fd2f78b5988719434d6a0782231962934fe1a6f805f98e1bff2c90399a765500ffff9a1cc8c5826feea66d738a7e74ffba7f7dd23e499b5817d8a88e68185f95" - testHerumiPublicKeyStr = "1 55769a39902cff1b8ef905f8a6e14f9362192382076a4d43198798b5782ffd 155f18688ea8d817589b493ed27d7fbaff747e8a736da6ee6f82c5c81c9affff e72525d5dda83d7b169653d3a78bd6d6e36cee1f9974d8f30cbfac33a18efb9 19c1c219dbd76990330f778f18d472f10494a6811bb46e36d21bfdf273c03220" - testHerumiPrivateKey = "baa512aee00f5ff9eafcd82a16fa81d450b2a1a1e35f638cb7e4c2caf01bc407" -) - -func TestGenerateKeys(t *testing.T) { - herumi := &HerumiScheme{} - - w1, err := herumi.RecoverKeys(testMnemonic) - - require.NoError(t, err) - - require.Equal(t, testHerumiPublicKey, w1.Keys[0].PublicKey) - - var pk1 bls.PublicKey - err = pk1.DeserializeHexStr(w1.Keys[0].PublicKey) - require.NoError(t, err) - - require.Equal(t, testHerumiPublicKeyStr, pk1.GetHexString()) - - require.NoError(t, err) - -} - -func TestSignAndVerify(t *testing.T) { - signScheme := &HerumiScheme{} - - w, err := signScheme.RecoverKeys(testMnemonic) - require.Nil(t, err) - - var pk = w.Keys[0].PublicKey - var pk1 bls.PublicKey - - err = pk1.DeserializeHexStr(pk) - require.Nil(t, err) - - require.NoError(t, err) - - hash := Sha3Sum256(data) - signature, err := signScheme.Sign(hash) - if err != nil { - t.Fatalf("BLS signing failed") - } - verifyScheme := &HerumiScheme{} - err = verifyScheme.SetPublicKey(w.Keys[0].PublicKey) - require.NoError(t, err) - if ok, err := verifyScheme.Verify(signature, hash); err != nil || !ok { - t.Fatalf("Verification failed\n") - } -} diff --git a/core/zcncrypto/bls0chain_wasm.go b/core/zcncrypto/bls0chain_wasm.go deleted file mode 100644 index a7592ed08..000000000 --- a/core/zcncrypto/bls0chain_wasm.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package zcncrypto - -import ( - "encoding/hex" - - "github.com/0chain/errors" -) - -var ( - Sign func(hash string) (string, error) -) - -// WasmScheme - a signature scheme for BLS0Chain Signature -type WasmScheme struct { - PublicKey string `json:"public_key"` - PrivateKey string `json:"private_key"` - Mnemonic string `json:"mnemonic"` - - id ID - Ids string `json:"threshold_scheme_id"` -} - -// NewWasmScheme - create a BLS0ChainScheme object -func NewWasmScheme() *WasmScheme { - return &WasmScheme{} -} - -func (b0 *WasmScheme) GenerateKeysWithEth(mnemonic, password string) (*Wallet, error) { - return nil, errors.New("wasm_not_support", "please generate keys by bls_wasm in js") -} - -// GenerateKeys - implement interface -func (b0 *WasmScheme) GenerateKeys() (*Wallet, error) { - return nil, errors.New("wasm_not_support", "please generate keys by bls_wasm in js") -} - -func (b0 *WasmScheme) RecoverKeys(mnemonic string) (*Wallet, error) { - return nil, errors.New("wasm_not_support", "please recover keys by bls_wasm in js") -} - -func (b0 *WasmScheme) GetMnemonic() string { - return "" -} - -// SetPrivateKey - implement interface -func (b0 *WasmScheme) SetPrivateKey(privateKey string) error { - return errors.New("wasm_not_support", "please set keys by bls_wasm in js") -} - -// SetPublicKey - implement interface -func (b0 *WasmScheme) SetPublicKey(publicKey string) error { - return errors.New("wasm_not_support", "please set keys by bls_wasm in js") -} - -// GetPublicKey - implement interface -func (b0 *WasmScheme) GetPublicKey() string { - return "please get key in js" -} - -func (b0 *WasmScheme) GetPrivateKey() string { - return "please get key in js" -} - -// Sign - implement interface -func (b0 *WasmScheme) Sign(hash string) (string, error) { - rawHash, err := hex.DecodeString(hash) - if err != nil { - return "", err - } - - if Sign != nil { - return Sign(string(rawHash)) - } - - return "", errors.New("wasm_not_initialized", "please init wasm sdk first") -} - -// Verify - implement interface -func (b0 *WasmScheme) Verify(signature, msg string) (bool, error) { - return false, errors.New("wasm_not_support", "please verify signature by bls_wasm in js") -} - -func (b0 *WasmScheme) Add(signature, msg string) (string, error) { - - return "", errors.New("wasm_not_support", "aggregate signature is not supported on wasm sdk") -} - -// SetID sets ID in HexString format -func (b0 *WasmScheme) SetID(id string) error { - return errors.New("wasm_not_support", "setid is not supported on wasm sdk") -} - -// GetID gets ID in hex string format -func (b0 *WasmScheme) GetID() string { - return "" -} - -// GetPrivateKeyAsByteArray - converts private key into byte array -func (b0 *WasmScheme) GetPrivateKeyAsByteArray() ([]byte, error) { - return nil, errors.New("wasm_not_support", "please get keys by bls_wasm in js") - -} - -func (b0 *WasmScheme) SplitKeys(numSplits int) (*Wallet, error) { - return nil, errors.New("wasm_not_support", "splitkeys is not supported on wasm sdk") -} diff --git a/core/zcncrypto/bls_herumi.go b/core/zcncrypto/bls_herumi.go deleted file mode 100644 index 54b4ce788..000000000 --- a/core/zcncrypto/bls_herumi.go +++ /dev/null @@ -1,210 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package zcncrypto - -import ( - "errors" - "io" - - "github.com/herumi/bls-go-binary/bls" -) - -func init() { - err := bls.Init(bls.CurveFp254BNb) - if err != nil { - panic(err) - } - BlsSignerInstance = &herumiBls{} -} - -type herumiBls struct { -} - -func (b *herumiBls) NewFr() Fr { - return &herumiFr{} -} -func (b *herumiBls) NewSecretKey() SecretKey { - return &herumiSecretKey{} -} - -func (b *herumiBls) NewPublicKey() PublicKey { - return &herumiPublicKey{ - PublicKey: &bls.PublicKey{}, - } -} - -func (b *herumiBls) NewSignature() Signature { - sg := &herumiSignature{ - Sign: &bls.Sign{}, - } - - return sg -} - -func (b *herumiBls) NewID() ID { - id := &herumiID{} - - return id -} - -func (b *herumiBls) SetRandFunc(randReader io.Reader) { - bls.SetRandFunc(randReader) -} - -func (b *herumiBls) FrSub(out Fr, x Fr, y Fr) { - o1, _ := out.(*herumiFr) - x1, _ := x.(*herumiFr) - y1, _ := y.(*herumiFr) - - bls.FrSub(&o1.Fr, &x1.Fr, &y1.Fr) -} - -type herumiFr struct { - bls.Fr -} - -func (fr *herumiFr) Serialize() []byte { - return fr.Fr.Serialize() -} - -func (fr *herumiFr) SetLittleEndian(buf []byte) error { - return fr.Fr.SetLittleEndian(buf) -} - -type herumiSecretKey struct { - bls.SecretKey -} - -func (sk *herumiSecretKey) SerializeToHexStr() string { - return sk.SecretKey.SerializeToHexStr() -} -func (sk *herumiSecretKey) DeserializeHexStr(s string) error { - return sk.SecretKey.DeserializeHexStr(s) -} - -func (sk *herumiSecretKey) Serialize() []byte { - return sk.SecretKey.Serialize() -} - -func (sk *herumiSecretKey) GetLittleEndian() []byte { - return sk.SecretKey.GetLittleEndian() -} -func (sk *herumiSecretKey) SetLittleEndian(buf []byte) error { - return sk.SecretKey.SetLittleEndian(buf) -} - -func (sk *herumiSecretKey) SetByCSPRNG() { - sk.SecretKey.SetByCSPRNG() -} - -func (sk *herumiSecretKey) GetPublicKey() PublicKey { - pk := sk.SecretKey.GetPublicKey() - return &herumiPublicKey{ - PublicKey: pk, - } -} - -func (sk *herumiSecretKey) Add(rhs SecretKey) { - i, _ := rhs.(*herumiSecretKey) - sk.SecretKey.Add(&i.SecretKey) -} - -func (sk *herumiSecretKey) Sign(m string) Signature { - sig := sk.SecretKey.Sign(m) - - return &herumiSignature{ - Sign: sig, - } -} - -func (sk *herumiSecretKey) GetMasterSecretKey(k int) ([]SecretKey, error) { - if k < 1 { - return nil, errors.New("cannot get master secret key for threshold less than 1") - } - - list := sk.SecretKey.GetMasterSecretKey(k) - - msk := make([]SecretKey, len(list)) - - for i, it := range list { - msk[i] = &herumiSecretKey{SecretKey: it} - - } - - return msk, nil -} - -func (sk *herumiSecretKey) Set(msk []SecretKey, id ID) error { - - blsMsk := make([]bls.SecretKey, len(msk)) - - for i, it := range msk { - k, ok := it.(*herumiSecretKey) - if !ok { - return errors.New("invalid herumi secret key") - } - - blsMsk[i] = k.SecretKey - } - - blsID, _ := id.(*herumiID) - - return sk.SecretKey.Set(blsMsk, &blsID.ID) -} - -type herumiPublicKey struct { - *bls.PublicKey -} - -func (pk *herumiPublicKey) SerializeToHexStr() string { - return pk.PublicKey.SerializeToHexStr() -} - -func (pk *herumiPublicKey) DeserializeHexStr(s string) error { - return pk.PublicKey.DeserializeHexStr(s) -} - -func (pk *herumiPublicKey) Serialize() []byte { - return pk.PublicKey.Serialize() -} - -type herumiSignature struct { - *bls.Sign -} - -// SerializeToHexStr -- -func (sg *herumiSignature) SerializeToHexStr() string { - return sg.Sign.SerializeToHexStr() -} - -func (sg *herumiSignature) DeserializeHexStr(s string) error { - return sg.Sign.DeserializeHexStr(s) -} - -func (sg *herumiSignature) Add(rhs Signature) { - sg2, _ := rhs.(*herumiSignature) - - sg.Sign.Add(sg2.Sign) -} - -func (sg *herumiSignature) Verify(pk PublicKey, m string) bool { - pub, _ := pk.(*herumiPublicKey) - - return sg.Sign.Verify(pub.PublicKey, m) -} - -type herumiID struct { - bls.ID -} - -func (id *herumiID) SetHexString(s string) error { - return id.ID.SetHexString(s) -} -func (id *herumiID) GetHexString() string { - return id.ID.GetHexString() -} - -func (id *herumiID) SetDecString(s string) error { - return id.ID.SetDecString(s) -} diff --git a/core/zcncrypto/ed255190chain.go b/core/zcncrypto/ed255190chain.go deleted file mode 100644 index 4c640712b..000000000 --- a/core/zcncrypto/ed255190chain.go +++ /dev/null @@ -1,179 +0,0 @@ -package zcncrypto - -import ( - "bytes" - "encoding/hex" - "time" - - "github.com/0chain/errors" - - "github.com/0chain/gosdk/core/encryption" - "github.com/tyler-smith/go-bip39" - "golang.org/x/crypto/ed25519" -) - -//ED255190chainScheme - a signature scheme based on ED25519 -type ED255190chainScheme struct { - privateKey []byte - publicKey []byte - mnemonic string -} - -// NewED255190chainScheme - create a ED255190chainScheme object -func NewED255190chainScheme() *ED255190chainScheme { - return &ED255190chainScheme{} -} - -//GenerateKeys - implement interface -func (ed *ED255190chainScheme) GenerateKeys() (*Wallet, error) { - // Check for recovery - if len(ed.mnemonic) == 0 { - entropy, err := bip39.NewEntropy(256) - if err != nil { - return nil, errors.New("generate_keys", "Getting entropy failed") - } - ed.mnemonic, err = bip39.NewMnemonic(entropy) - if err != nil { - return nil, errors.New("generate_keys", "Getting mnemonic failed") - } - } - - seed := bip39.NewSeed(ed.mnemonic, "0chain-client-ed25519-key") - r := bytes.NewReader(seed) - public, private, err := ed25519.GenerateKey(r) - if err != nil { - return nil, errors.Wrap(err, "Generate keys failed") - } - // New Wallet - w := &Wallet{} - w.Keys = make([]KeyPair, 1) - w.Keys[0].PublicKey = hex.EncodeToString(public) - w.Keys[0].PrivateKey = hex.EncodeToString(private) - w.ClientKey = w.Keys[0].PublicKey - w.ClientID = encryption.Hash([]byte(public)) - w.Mnemonic = ed.mnemonic - w.Version = CryptoVersion - w.DateCreated = time.Now().Format(time.RFC3339) - return w, nil -} - -//GenerateKeysWithEth - not implemented -func (ed *ED255190chainScheme) GenerateKeysWithEth(mnemonic, password string) (*Wallet, error) { - return nil, errors.New("", "Not supported for this scheme") -} - -func (ed *ED255190chainScheme) RecoverKeys(mnemonic string) (*Wallet, error) { - if mnemonic == "" { - return nil, errors.New("chain_scheme_recover_keys", "Set mnemonic key failed") - } - if len(ed.privateKey) > 0 || len(ed.publicKey) > 0 { - return nil, errors.New("chain_scheme_recover_keys", "Cannot recover when there are keys") - } - ed.mnemonic = mnemonic - return ed.GenerateKeys() -} - -func (b0 *ED255190chainScheme) GetMnemonic() string { - if b0 == nil { - return "" - } - - return b0.mnemonic -} - -func (ed *ED255190chainScheme) SetPrivateKey(privateKey string) error { - if len(ed.privateKey) > 0 { - return errors.New("set_private_key", "cannot set private key when there is a public key") - } - if len(ed.publicKey) > 0 { - return errors.New("set_private_key", "private key already exists") - } - var err error - ed.privateKey, err = hex.DecodeString(privateKey) - return err -} - -func (ed *ED255190chainScheme) SetPublicKey(publicKey string) error { - if len(ed.privateKey) > 0 { - return errors.New("set_public_key", "cannot set public key when there is a private key") - } - if len(ed.publicKey) > 0 { - return errors.New("set_public_key", "public key already exists") - } - var err error - ed.publicKey, err = hex.DecodeString(publicKey) - return err -} - -func (b0 *ED255190chainScheme) SplitKeys(numSplits int) (*Wallet, error) { - return nil, errors.New("chain_scheme_splitkeys", "not implemented") -} - -func (ed *ED255190chainScheme) Sign(hash string) (string, error) { - if len(ed.privateKey) == 0 { - return "", errors.New("chain_scheme_sign", "private key does not exists for signing") - } - rawHash, err := hex.DecodeString(hash) - if err != nil { - return "", err - } - if rawHash == nil { - return "", errors.New("chain_scheme_sign", "Failed hash while signing") - } - return hex.EncodeToString(ed25519.Sign(ed.privateKey, rawHash)), nil -} - -func (ed *ED255190chainScheme) Verify(signature, msg string) (bool, error) { - if len(ed.publicKey) == 0 { - return false, errors.New("chain_scheme_verify", "public key does not exists for verification") - } - sign, err := hex.DecodeString(signature) - if err != nil { - return false, err - } - data, err := hex.DecodeString(msg) - if err != nil { - return false, err - } - return ed25519.Verify(ed.publicKey, data, sign), nil -} - -func (ed *ED255190chainScheme) Add(signature, msg string) (string, error) { - return "", errors.New("chain_scheme_add", "Not supported by signature scheme") -} - -//GetPublicKey - implement interface -func (ed *ED255190chainScheme) GetPublicKey() string { - return hex.EncodeToString(ed.publicKey) -} - -//GetPrivateKey - implement interface -func (ed *ED255190chainScheme) GetPrivateKey() string { - return hex.EncodeToString(ed.privateKey) -} - -//SetID sets ID in HexString format -func (ed *ED255190chainScheme) SetID(id string) error { - // b0.Ids = id - // return b0.id.SetHexString(id) - return errors.New("chain_scheme_set_id", "it is not implemented yet") -} - -//GetID gets ID in hex string format -func (ed *ED255190chainScheme) GetID() string { - //return b0.id.GetHexString() - return "" -} - -// GetPrivateKeyAsByteArray - converts private key into byte array -func (ed *ED255190chainScheme) GetPrivateKeyAsByteArray() ([]byte, error) { - // if len(b0.PrivateKey) == 0 { - // return nil, errors.New("get_private_key_as_byte_array", "cannot convert empty private key to byte array") - // } - // privateKeyBytes, err := hex.DecodeString(b0.PrivateKey) - // if err != nil { - // return nil, err - // } - // return privateKeyBytes, nil - return nil, errors.New("chain_scheme_get_private_key_as_byte_array", "it is not implemented yet") -} diff --git a/core/zcncrypto/ed25519_test.go b/core/zcncrypto/ed25519_test.go deleted file mode 100644 index 5de8a40c9..000000000 --- a/core/zcncrypto/ed25519_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package zcncrypto - -import ( - "encoding/hex" - "testing" - - "github.com/0chain/errors" - "github.com/stretchr/testify/require" -) - -var edverifyPublickey = `b987071c14695caf340ea11560f5a3cb76ad1e709803a8b339826ab3964e470a` -var edsignPrivatekey = `62fc118369fb9dd1fa6065d4f8f765c52ac68ad5aced17a1e5c4f8b4301a9469b987071c14695caf340ea11560f5a3cb76ad1e709803a8b339826ab3964e470a` -var eddata = `TEST` - -//var edexpectedHash = `f4f08e9367e133dc42a4b9c9c665a9efbd4bf15db14d49c6ec51d0dc4c437ffb` -var edWallet *Wallet - -func TestEd25519GenerateKeys(t *testing.T) { - sigScheme := NewSignatureScheme("ed25519") - switch sigScheme.(type) { - case SignatureScheme: - // pass - default: - t.Fatalf("Signature scheme invalid") - } - w, err := sigScheme.GenerateKeys() - if err != nil { - t.Fatalf("Generate keys failed %s", errors.Top(err)) - } - if w.ClientID == "" || w.ClientKey == "" || len(w.Keys) != 1 || w.Mnemonic == "" { - t.Fatalf("Invalid keys generated") - } - edWallet = w -} - -func TestEd25519SignAndVerify(t *testing.T) { - signScheme := NewSignatureScheme("ed25519") - // Check failure without private key - _, err := signScheme.Sign(eddata) - if err == nil { - t.Fatalf("Sign passed without private key") - } - // Sign with valid private key - err = signScheme.SetPrivateKey(edsignPrivatekey) - require.NoError(t, err) - - signature, err := signScheme.Sign(hex.EncodeToString([]byte(eddata))) - if err != nil { - t.Fatalf("ed25519 signing failed") - } - verifyScheme := NewSignatureScheme("ed25519") - err = verifyScheme.SetPublicKey(edverifyPublickey) - require.NoError(t, err) - if ok, err := verifyScheme.Verify(signature, hex.EncodeToString([]byte(eddata))); err != nil || !ok { - t.Fatalf("Verification failed\n") - } -} - -func TestEd25519RecoveryKeys(t *testing.T) { - sigScheme := NewSignatureScheme("ed25519") - w, err := sigScheme.RecoverKeys(edWallet.Mnemonic) - if err != nil { - t.Fatalf("set Recover Keys failed") - } - if w.ClientID != edWallet.ClientID || w.ClientKey != edWallet.ClientKey { - t.Fatalf("Recover key didn't match with generated keys") - } -} - -func BenchmarkE25519Signandverify(b *testing.B) { - sigScheme := NewSignatureScheme("ed25519") - err := sigScheme.SetPrivateKey(edsignPrivatekey) - require.NoError(b, err) - for i := 0; i < b.N; i++ { - signature, err := sigScheme.Sign(eddata) - if err != nil { - b.Fatalf("BLS signing failed") - } - verifyScheme := NewSignatureScheme("ed25519") - err = verifyScheme.SetPublicKey(edverifyPublickey) - require.NoError(b, err) - if ok, err := verifyScheme.Verify(signature, eddata); err != nil || !ok { - b.Fatalf("Verification failed\n") - } - } -} diff --git a/core/zcncrypto/factory.go b/core/zcncrypto/factory.go deleted file mode 100644 index d528d1dc5..000000000 --- a/core/zcncrypto/factory.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build !js && !wasm -// +build !js,!wasm - -package zcncrypto - -import ( - "encoding/hex" - "encoding/json" - "fmt" - - "github.com/0chain/errors" -) - -// NewSignatureScheme creates an instance for using signature functions -// - sigScheme signature scheme to be used -func NewSignatureScheme(sigScheme string) SignatureScheme { - switch sigScheme { - case "ed25519": - return NewED255190chainScheme() - case "bls0chain": - return NewHerumiScheme() - default: - panic(fmt.Sprintf("unknown signature scheme: %v", sigScheme)) - } -} - -// UnmarshalSignatureSchemes unmarshal SignatureScheme from json string -func UnmarshalSignatureSchemes(sigScheme string, obj interface{}) ([]SignatureScheme, error) { - switch sigScheme { - - case "bls0chain": - - if obj == nil { - return nil, nil - } - - buf, err := json.Marshal(obj) - if err != nil { - return nil, err - } - - var list []*HerumiScheme - - if err := json.Unmarshal(buf, &list); err != nil { - return nil, err - } - - ss := make([]SignatureScheme, len(list)) - - for i, v := range list { - // bls.ID from json - err = v.SetID(v.Ids) - if err != nil { - return nil, err - } - ss[i] = v - } - - return ss, nil - - default: - panic(fmt.Sprintf("unknown signature scheme: %v", sigScheme)) - } -} - -// GenerateThresholdKeyShares given a signature scheme will generate threshold sig keys -func GenerateThresholdKeyShares(t, n int, originalKey SignatureScheme) ([]SignatureScheme, error) { - b0ss, ok := originalKey.(*HerumiScheme) - if !ok { - return nil, errors.New("bls0_generate_threshold_key_shares", "Invalid encryption scheme") - } - - b0original := BlsSignerInstance.NewSecretKey() - b0PrivateKeyBytes, err := b0ss.GetPrivateKeyAsByteArray() - if err != nil { - return nil, err - } - - err = b0original.SetLittleEndian(b0PrivateKeyBytes) - if err != nil { - return nil, err - } - - polynomial, err := b0original.GetMasterSecretKey(t) - if err != nil { - return nil, err - } - - var shares []SignatureScheme - for i := 1; i <= n; i++ { - id := BlsSignerInstance.NewID() - err = id.SetDecString(fmt.Sprint(i)) - if err != nil { - return nil, err - } - - sk := BlsSignerInstance.NewSecretKey() - err = sk.Set(polynomial, id) - if err != nil { - return nil, err - } - - share := &HerumiScheme{} - share.PrivateKey = hex.EncodeToString(sk.GetLittleEndian()) - share.PublicKey = sk.GetPublicKey().SerializeToHexStr() - - share.id = id - share.Ids = id.GetHexString() - - shares = append(shares, share) - } - - return shares, nil -} diff --git a/core/zcncrypto/factory_wasm.go b/core/zcncrypto/factory_wasm.go deleted file mode 100644 index bb8dae7d1..000000000 --- a/core/zcncrypto/factory_wasm.go +++ /dev/null @@ -1,65 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package zcncrypto - -import ( - "encoding/json" - "fmt" - - "github.com/0chain/errors" -) - -// NewSignatureScheme creates an instance for using signature functions -func NewSignatureScheme(sigScheme string) SignatureScheme { - switch sigScheme { - case "ed25519": - return NewED255190chainScheme() - case "bls0chain": - return NewWasmScheme() - default: - panic(fmt.Sprintf("unknown signature scheme: %v", sigScheme)) - } -} - -// UnmarshalSignatureSchemes unmarshal SignatureScheme from json string -func UnmarshalSignatureSchemes(sigScheme string, obj interface{}) ([]SignatureScheme, error) { - switch sigScheme { - - case "bls0chain": - - if obj == nil { - return nil, nil - } - - buf, err := json.Marshal(obj) - if err != nil { - return nil, err - } - - var list []*WasmScheme - - if err := json.Unmarshal(buf, &list); err != nil { - return nil, err - } - - ss := make([]SignatureScheme, len(list)) - - for i, v := range list { - // bls.ID from json - v.SetID(v.Ids) - ss[i] = v - } - - return ss, nil - - default: - panic(fmt.Sprintf("unknown signature scheme: %v", sigScheme)) - } -} - -//GenerateThresholdKeyShares given a signature scheme will generate threshold sig keys -func GenerateThresholdKeyShares(t, n int, originalKey SignatureScheme) ([]SignatureScheme, error) { - - return nil, errors.New("wasm_not_supported", "GenerateThresholdKeyShares") -} diff --git a/core/zcncrypto/signature_scheme.go b/core/zcncrypto/signature_scheme.go deleted file mode 100644 index c81bbe4d7..000000000 --- a/core/zcncrypto/signature_scheme.go +++ /dev/null @@ -1,112 +0,0 @@ -// Provides low-level functions and types to work with different cryptographic schemes with a unified interface and provide cryptographic operations. -package zcncrypto - -import ( - "encoding/json" - "fmt" - "os" - - "github.com/0chain/errors" - "github.com/0chain/gosdk/core/encryption" - "github.com/tyler-smith/go-bip39" -) - -// CryptoVersion - version of the crypto library -const CryptoVersion = "1.0" - -// KeyPair private and publickey -type KeyPair struct { - PublicKey string `json:"public_key"` - PrivateKey string `json:"private_key"` -} - -// Wallet represents client wallet information -type Wallet struct { - ClientID string `json:"client_id"` - ClientKey string `json:"client_key"` - PeerPublicKey string `json:"peer_public_key"` // Peer public key exists only in split wallet for web only. - Keys []KeyPair `json:"keys"` - Mnemonic string `json:"mnemonics"` - Version string `json:"version"` - DateCreated string `json:"date_created"` - Nonce int64 `json:"nonce"` - IsSplit bool `json:"is_split"` -} - -// SignatureScheme - an encryption scheme for signing and verifying messages -type SignatureScheme interface { - // Generate fresh keys - GenerateKeys() (*Wallet, error) - // Generate fresh keys based on eth wallet - GenerateKeysWithEth(mnemonic, password string) (*Wallet, error) - - // Generate keys from mnemonic for recovery - RecoverKeys(mnemonic string) (*Wallet, error) - GetMnemonic() string - - // Signing - Set private key to sign - SetPrivateKey(privateKey string) error - Sign(hash string) (string, error) - - // Signature verification - Set public key to verify - SetPublicKey(publicKey string) error - GetPublicKey() string - GetPrivateKey() string - Verify(signature string, msg string) (bool, error) - - // Combine signature for schemes BLS - Add(signature, msg string) (string, error) - - // implement SplitSignatureScheme - - SplitKeys(numSplits int) (*Wallet, error) - - GetPrivateKeyAsByteArray() ([]byte, error) - - // // implement ThresholdSignatureScheme - - SetID(id string) error - GetID() string -} - -// Marshal returns json string -func (w *Wallet) Marshal() (string, error) { - ws, err := json.Marshal(w) - if err != nil { - return "", errors.New("wallet_marshal", "Invalid Wallet") - } - return string(ws), nil -} - -func (w *Wallet) Sign(hash, scheme string) (string, error) { - sigScheme := NewSignatureScheme(scheme) - err := sigScheme.SetPrivateKey(w.Keys[0].PrivateKey) - if err != nil { - return "", err - } - return sigScheme.Sign(hash) -} - -// SetSplitKeys sets split keys and wipes out mnemonic and original primary keys -func (w *Wallet) SetSplitKeys(sw *Wallet) { - *w = *sw -} - -func (w *Wallet) SaveTo(file string) error { - d, err := json.Marshal(w) - if err != nil { - return err - } - - fmt.Println("Saving wallet to file: ", string(d)) - - return os.WriteFile(file, d, 0644) -} - -func IsMnemonicValid(mnemonic string) bool { - return bip39.IsMnemonicValid(mnemonic) -} - -func Sha3Sum256(data string) string { - return encryption.Hash(data) -} diff --git a/dev/blobber/handlers.go b/dev/blobber/handlers.go deleted file mode 100644 index cc52edee9..000000000 --- a/dev/blobber/handlers.go +++ /dev/null @@ -1,98 +0,0 @@ -package blobber - -import ( - "encoding/json" - "net/http" - - "github.com/0chain/gosdk/dev/blobber/model" - "github.com/gorilla/mux" -) - -func uploadAndUpdateFile(w http.ResponseWriter, req *http.Request) { - uploadMeta := req.FormValue("uploadMeta") - - var form *model.UploadFormData - err := json.Unmarshal([]byte(uploadMeta), &form) - - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - //nolint: errcheck - json.NewEncoder(w).Encode(&model.UploadResult{ - Filename: form.Filename, - ValidationRoot: form.ValidationRoot, - FixedMerkleRoot: form.FixedMerkleRoot, - }) - -} - -func getReference(w http.ResponseWriter, req *http.Request) { - - var vars = mux.Vars(req) - - alloctionID := vars["allocation"] - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - result, ok := referencePathResults[alloctionID] - - if ok { - buf, _ := json.Marshal(result) - //nolint: errcheck - w.Write(buf) - return - } - - rootRefs := `{"meta_data":{"chunk_size":0,"created_at":0,"hash":"","lookup_hash":"","name":"/","num_of_blocks":0,"path":"/","path_hash":"","size":0,"type":"d","updated_at":0},"Ref":{"ID":0,"Type":"d","AllocationID":"` + vars["allocation"] + `","LookupHash":"","Name":"/","Path":"/","Hash":"","NumBlocks":0,"PathHash":"","ParentPath":"","PathLevel":1,"CustomMeta":"","ValidationRoot":"","Size":0,"FixedMerkleRoot":"","ActualFileSize":0,"ActualFileHash":"","MimeType":"","WriteMarker":"","ThumbnailSize":0,"ThumbnailHash":"","ActualThumbnailSize":0,"ActualThumbnailHash":"","EncryptedKey":"","Children":null,"OnCloud":false,"CreatedAt":0,"UpdatedAt":0,"ChunkSize":0},"latest_write_marker":null}` - - //nolint: errcheck - w.Write([]byte(rootRefs)) -} - -func commitWrite(w http.ResponseWriter, req *http.Request) { - - // var vars = mux.Vars(req) - - writeMarker := &model.WriteMarker{} - err := json.Unmarshal([]byte(req.FormValue("write_marker")), writeMarker) - - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - result := &model.CommitResult{} - result.AllocationRoot = writeMarker.AllocationRoot - result.Success = true - result.WriteMarker = writeMarker - - err = json.NewEncoder(w).Encode(result) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } -} - -func mockRespone(w http.ResponseWriter, statusCode int, respBody []byte) { - w.Header().Set("Content-Type", "application/json") - if respBody != nil { - _, err := w.Write(respBody) - if err != nil { - statusCode = http.StatusInternalServerError - } - } - - w.WriteHeader(statusCode) -} - -func rollback(w http.ResponseWriter, _ *http.Request) { - mockRespone(w, http.StatusOK, nil) -} - -func latestWriteMarker(w http.ResponseWriter, _ *http.Request) { - latestByte := `{"latest_write_marker":null,"prev_write_marker":null}` - mockRespone(w, http.StatusOK, []byte(latestByte)) -} diff --git a/dev/blobber/init.go b/dev/blobber/init.go deleted file mode 100644 index aea5b669d..000000000 --- a/dev/blobber/init.go +++ /dev/null @@ -1,29 +0,0 @@ -package blobber - -import ( - "net/http" - - "github.com/0chain/gosdk/dev/mock" - "github.com/gorilla/mux" -) - -func RegisterHandlers(r *mux.Router, m mock.ResponseMap) { - r.HandleFunc("/v1/file/upload/{allocation}", uploadAndUpdateFile).Methods(http.MethodPut, http.MethodPost) - r.HandleFunc("/v1/file/referencepath/{allocation}", getReference).Methods(http.MethodGet) - r.HandleFunc("/v1/file/latestwritemarker/{allocation}", latestWriteMarker).Methods(http.MethodGet) - r.HandleFunc("/v1/connection/commit/{allocation}", commitWrite).Methods(http.MethodPost) - r.HandleFunc("/v1/connection/rollback/{allocation}", rollback).Methods(http.MethodPost) - - r.HandleFunc("/v1/writemarker/lock/{allocation}", mock.WithResponse(m)).Methods(http.MethodPost) - r.HandleFunc("/v1/writemarker/lock/{allocation}", mock.WithResponse(m)).Methods(http.MethodDelete) - r.HandleFunc("/v1/hashnode/root/{allocation}", mock.WithResponse(m)).Methods(http.MethodGet) - - r.HandleFunc("/v1/file/meta/{allocation}", mock.WithResponse(m)).Methods(http.MethodPost) - - r.NotFoundHandler = Handle404(m) -} - -// Handle404 ... -func Handle404(m mock.ResponseMap) http.Handler { - return http.HandlerFunc(mock.WithResponse(m)) -} diff --git a/dev/blobber/model/commit_result.go b/dev/blobber/model/commit_result.go deleted file mode 100644 index 702b6f535..000000000 --- a/dev/blobber/model/commit_result.go +++ /dev/null @@ -1,10 +0,0 @@ -package model - -type CommitResult struct { - AllocationRoot string `json:"allocation_root"` - WriteMarker *WriteMarker `json:"write_marker"` - Success bool `json:"success"` - ErrorMessage string `json:"error_msg,omitempty"` - // Changes []*allocation.AllocationChange `json:"-"` - //Result []*UploadResult `json:"result"` -} diff --git a/dev/blobber/model/ref.go b/dev/blobber/model/ref.go deleted file mode 100644 index 75759b027..000000000 --- a/dev/blobber/model/ref.go +++ /dev/null @@ -1,179 +0,0 @@ -package model - -import ( - "context" - "math" - "reflect" - "strconv" - "strings" - - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/pathutil" -) - -const ( - // FileRef represents a file - FILE = "f" - - // FileRef represents a directory - DIRECTORY = "d" - - CHUNK_SIZE = 64 * 1024 - - DIR_LIST_TAG = "dirlist" - FILE_LIST_TAG = "filelist" -) - -type Ref struct { - Type string `gorm:"column:type" dirlist:"type" filelist:"type"` - AllocationID string `gorm:"column:allocation_id"` - LookupHash string `gorm:"column:lookup_hash" dirlist:"lookup_hash" filelist:"lookup_hash"` - Name string `gorm:"column:name" dirlist:"name" filelist:"name"` - Path string `gorm:"column:path" dirlist:"path" filelist:"path"` - Hash string `gorm:"column:hash" dirlist:"hash" filelist:"hash"` - NumBlocks int64 `gorm:"column:num_of_blocks" dirlist:"num_of_blocks" filelist:"num_of_blocks"` - PathHash string `gorm:"column:path_hash" dirlist:"path_hash" filelist:"path_hash"` - ParentPath string `gorm:"column:parent_path"` - PathLevel int `gorm:"column:level"` - ValidationRoot string `gorm:"column:validation_root" filelist:"validation_root"` - Size int64 `gorm:"column:size" dirlist:"size" filelist:"size"` - FixedMerkleRoot string `gorm:"column:fixed_merkle_root" filelist:"fixed_merkle_root"` - ActualFileSize int64 `gorm:"column:actual_file_size" filelist:"actual_file_size"` - ActualFileHash string `gorm:"column:actual_file_hash" filelist:"actual_file_hash"` - - Children []*Ref `gorm:"-"` - childrenLoaded bool - - ChunkSize int64 `gorm:"column:chunk_size" dirlist:"chunk_size" filelist:"chunk_size"` -} - -func (r *Ref) CalculateHash(ctx context.Context) (string, error) { - if r.Type == DIRECTORY { - return r.CalculateDirHash(ctx) - } - return r.CalculateFileHash(ctx) -} - -// GetListingData reflect and convert all fields into map[string]interface{} -func (r *Ref) GetListingData(ctx context.Context) map[string]interface{} { - if r == nil { - return make(map[string]interface{}) - } - - if r.Type == FILE { - return GetListingFieldsMap(*r, FILE_LIST_TAG) - } - return GetListingFieldsMap(*r, DIR_LIST_TAG) -} - -func GetListingFieldsMap(refEntity interface{}, tagName string) map[string]interface{} { - result := make(map[string]interface{}) - t := reflect.TypeOf(refEntity) - v := reflect.ValueOf(refEntity) - // Iterate over all available fields and read the tag value - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - - // Get the field tag value - tag := field.Tag.Get(tagName) - // Skip if tag is not defined or ignored - if !field.Anonymous && (tag == "" || tag == "-") { - continue - } - - if field.Anonymous { - listMap := GetListingFieldsMap(v.FieldByName(field.Name).Interface(), tagName) - if len(listMap) > 0 { - for k, v := range listMap { - result[k] = v - } - - } - } else { - fieldValue := v.FieldByName(field.Name).Interface() - if fieldValue == nil { - continue - } - result[tag] = fieldValue - } - - } - return result -} - -func GetSubDirsFromPath(p string) []string { - path := p - parent, cur := pathutil.Split(path) - subDirs := make([]string, 0) - for len(cur) > 0 { - if cur == "." { - break - } - subDirs = append([]string{cur}, subDirs...) - parent, cur = pathutil.Split(parent) - } - return subDirs -} - -func (r *Ref) CalculateDirHash(ctx context.Context) (string, error) { - // empty directory, return hash directly - if len(r.Children) == 0 && !r.childrenLoaded { - return r.Hash, nil - } - childHashes := make([]string, len(r.Children)) - childPathHashes := make([]string, len(r.Children)) - var refNumBlocks int64 - var size int64 - for index, childRef := range r.Children { - _, err := childRef.CalculateHash(ctx) - if err != nil { - return "", err - } - childHashes[index] = childRef.Hash - childPathHashes[index] = childRef.PathHash - refNumBlocks += childRef.NumBlocks - size += childRef.Size - } - - r.Hash = encryption.Hash(strings.Join(childHashes, ":")) - r.NumBlocks = refNumBlocks - r.Size = size - r.PathHash = encryption.Hash(strings.Join(childPathHashes, ":")) - r.PathLevel = len(GetSubDirsFromPath(r.Path)) + 1 - r.LookupHash = GetReferenceLookup(r.AllocationID, r.Path) - - return r.Hash, nil -} - -// GetReferenceLookup hash(allocationID + ":" + path) which is used to lookup the file reference in the db. -// - allocationID is the allocation ID. -// - path is the path of the file. -func GetReferenceLookup(allocationID string, path string) string { - return encryption.Hash(allocationID + ":" + path) -} - -func (fr *Ref) CalculateFileHash(ctx context.Context) (string, error) { - fr.Hash = encryption.Hash(fr.GetFileHashData()) - fr.NumBlocks = int64(math.Ceil(float64(fr.Size*1.0) / float64(fr.ChunkSize))) - fr.PathHash = GetReferenceLookup(fr.AllocationID, fr.Path) - fr.PathLevel = len(GetSubDirsFromPath(fr.Path)) + 1 - fr.LookupHash = GetReferenceLookup(fr.AllocationID, fr.Path) - - return fr.Hash, nil -} - -func (fr *Ref) GetFileHashData() string { - hashArray := make([]string, 0, 11) - hashArray = append(hashArray, fr.AllocationID) - hashArray = append(hashArray, fr.Type) - hashArray = append(hashArray, fr.Name) - hashArray = append(hashArray, fr.Path) - hashArray = append(hashArray, strconv.FormatInt(fr.Size, 10)) - hashArray = append(hashArray, fr.ValidationRoot) - hashArray = append(hashArray, fr.FixedMerkleRoot) - hashArray = append(hashArray, strconv.FormatInt(fr.ActualFileSize, 10)) - hashArray = append(hashArray, fr.ActualFileHash) - hashArray = append(hashArray, strconv.FormatInt(fr.ChunkSize, 10)) - - return strings.Join(hashArray, ":") -} diff --git a/dev/blobber/model/reference_path.go b/dev/blobber/model/reference_path.go deleted file mode 100644 index aac5c365b..000000000 --- a/dev/blobber/model/reference_path.go +++ /dev/null @@ -1,7 +0,0 @@ -package model - -type ReferencePath struct { - Meta map[string]interface{} `json:"meta_data"` - List []*ReferencePath `json:"list,omitempty"` - Ref *Ref -} diff --git a/dev/blobber/model/reference_path_result.go b/dev/blobber/model/reference_path_result.go deleted file mode 100644 index 9f346b715..000000000 --- a/dev/blobber/model/reference_path_result.go +++ /dev/null @@ -1,35 +0,0 @@ -package model - -import "context" - -type ReferencePathResult struct { - *ReferencePath - LatestWM *WriteMarker `json:"latest_write_marker"` -} - -func BuildReferencePathResult(rootRef *Ref) *ReferencePathResult { - rootRef.CalculateHash(context.TODO()) //nolint - - refPath := &ReferencePath{Ref: rootRef} - - refsToProcess := []*ReferencePath{refPath} - - //convert Ref tree to ReferencePath tree - for len(refsToProcess) > 0 { - refToProcess := refsToProcess[0] - refToProcess.Meta = refToProcess.Ref.GetListingData(context.TODO()) - if len(refToProcess.Ref.Children) > 0 { - refToProcess.List = make([]*ReferencePath, len(refToProcess.Ref.Children)) - } - for idx, child := range refToProcess.Ref.Children { - childRefPath := &ReferencePath{Ref: child} - refToProcess.List[idx] = childRefPath - refsToProcess = append(refsToProcess, childRefPath) - } - refsToProcess = refsToProcess[1:] - } - - return &ReferencePathResult{ - ReferencePath: refPath, - } -} diff --git a/dev/blobber/model/upload_form_data.go b/dev/blobber/model/upload_form_data.go deleted file mode 100644 index 89f1554f0..000000000 --- a/dev/blobber/model/upload_form_data.go +++ /dev/null @@ -1,38 +0,0 @@ -package model - -// UploadFormData form data of upload -type UploadFormData struct { - ConnectionID string `json:"connection_id,omitempty"` - // Filename remote file name - Filename string `json:"filename,omitempty"` - // Path remote path - Path string `json:"filepath,omitempty"` - - // ValidationRoot of shard data (encoded,encrypted) where leaf is sha256 hash of 64KB data - ValidationRoot string `json:"validation_root,omitempty"` - // Hash hash of shard thumbnail (encoded,encrypted) - ThumbnailContentHash string `json:"thumbnail_content_hash,omitempty"` - - // FixedMerkleRoot merkle root of shard data (encoded, encrypted) - FixedMerkleRoot string `json:"fixed_merkle_root,omitempty"` - - // ActualHash hash of orignial file (unencoded, unencrypted) - ActualHash string `json:"actual_hash,omitempty"` - // ActualSize total bytes of orignial file (unencoded, unencrypted) - ActualSize int64 `json:"actual_size,omitempty"` - // ActualThumbnailSize total bytes of orignial thumbnail (unencoded, unencrypted) - ActualThumbSize int64 `json:"actual_thumb_size,omitempty"` - // ActualThumbnailHash hash of orignial thumbnail (unencoded, unencrypted) - ActualThumbHash string `json:"actual_thumb_hash,omitempty"` - - MimeType string `json:"mimetype,omitempty"` - CustomMeta string `json:"custom_meta,omitempty"` - EncryptedKey string `json:"encrypted_key,omitempty"` - - IsFinal bool `json:"is_final,omitempty"` // current chunk is last or not - ChunkHash string `json:"chunk_hash"` // hash of current chunk - ChunkIndex int `json:"chunk_index,omitempty"` // the seq of current chunk. all chunks MUST be uploaded one by one because of streaming merkle hash - ChunkSize int64 `json:"chunk_size,omitempty"` // the size of a chunk. 64*1024 is default - UploadOffset int64 `json:"upload_offset,omitempty"` // It is next position that new incoming chunk should be append to - -} diff --git a/dev/blobber/model/upload_result.go b/dev/blobber/model/upload_result.go deleted file mode 100644 index 41a2f9855..000000000 --- a/dev/blobber/model/upload_result.go +++ /dev/null @@ -1,8 +0,0 @@ -package model - -type UploadResult struct { - Filename string `json:"filename"` - ShardSize int64 `json:"size"` - ValidationRoot string `json:"validation_root,omitempty"` - FixedMerkleRoot string `json:"fixed_merkle_root,omitempty"` -} diff --git a/dev/blobber/model/write_marker.go b/dev/blobber/model/write_marker.go deleted file mode 100644 index 73506457a..000000000 --- a/dev/blobber/model/write_marker.go +++ /dev/null @@ -1,22 +0,0 @@ -package model - -import ( - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/marker" -) - -type WriteMarker struct { - AllocationRoot string `gorm:"column:allocation_root;primary_key" json:"allocation_root"` - PreviousAllocationRoot string `gorm:"column:prev_allocation_root" json:"prev_allocation_root"` - AllocationID string `gorm:"column:allocation_id" json:"allocation_id"` - Size int64 `gorm:"column:size" json:"size"` - BlobberID string `gorm:"column:blobber_id" json:"blobber_id"` - Timestamp common.Timestamp `gorm:"column:timestamp" json:"timestamp"` - ClientID string `gorm:"column:client_id" json:"client_id"` - Signature string `gorm:"column:signature" json:"signature"` -} - -type LatestPrevWriteMarker struct { - LatestWM *marker.WriteMarker `json:"latest_write_marker"` - PrevWM *marker.WriteMarker `json:"prev_write_marker"` -} diff --git a/dev/blobber/ref.go b/dev/blobber/ref.go deleted file mode 100644 index 955744785..000000000 --- a/dev/blobber/ref.go +++ /dev/null @@ -1,23 +0,0 @@ -package blobber - -import ( - "sync" - - "github.com/0chain/gosdk/dev/blobber/model" -) - -var referencePathResults = make(map[string]*model.ReferencePathResult) -var referencePathResultsMutex sync.Mutex - -func MockReferencePathResult(allocationId string, rootRef *model.Ref) func() { - result := model.BuildReferencePathResult(rootRef) - referencePathResultsMutex.Lock() - defer referencePathResultsMutex.Unlock() - referencePathResults[allocationId] = result - - return func() { - referencePathResultsMutex.Lock() - defer referencePathResultsMutex.Unlock() - delete(referencePathResults, allocationId) - } -} diff --git a/dev/mock/response.go b/dev/mock/response.go deleted file mode 100644 index ebce8f451..000000000 --- a/dev/mock/response.go +++ /dev/null @@ -1,34 +0,0 @@ -package mock - -import "net/http" - -type ResponseMap map[string]Response - -type Response struct { - StatusCode int - Body []byte -} - -// WithResponse mock respone -func WithResponse(m ResponseMap) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - defer w.Header().Set("Content-Type", "application/json") - - if m != nil { - key := r.Method + ":" + r.URL.Path - resp, ok := m[key] - - if ok { - - w.WriteHeader(resp.StatusCode) - if resp.Body != nil { - w.Write(resp.Body) //nolint: errcheck - } - - return - } - } - - w.WriteHeader(http.StatusNotFound) - } -} diff --git a/dev/server.go b/dev/server.go deleted file mode 100644 index 3349bc937..000000000 --- a/dev/server.go +++ /dev/null @@ -1,36 +0,0 @@ -// Providers tools for local development - do not use. -package dev - -import ( - "net/http/httptest" - - "github.com/0chain/gosdk/dev/blobber" - "github.com/0chain/gosdk/dev/mock" - "github.com/gorilla/mux" -) - -// Server a local dev server to mock server APIs -type Server struct { - *httptest.Server - *mux.Router -} - -// NewServer create a local dev server -func NewServer() *Server { - router := mux.NewRouter() - s := &Server{ - Router: router, - Server: httptest.NewServer(router), - } - - return s -} - -// NewBlobberServer create a local dev blobber server -func NewBlobberServer(m mock.ResponseMap) *Server { - s := NewServer() - - blobber.RegisterHandlers(s.Router, m) - - return s -} diff --git a/go.mod b/go.mod index 23e1cebfa..2c24d6ca9 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,7 @@ require ( ) require ( + github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/andybalholm/brotli v1.0.5 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect diff --git a/go.sum b/go.sum index 91dc05e8c..b74883881 100644 --- a/go.sum +++ b/go.sum @@ -44,6 +44,8 @@ github.com/0chain/common v1.18.3 h1:42dYOv2KyMTSanuS67iDtfv+ErbSRqR8NJ3MG72MwaI= github.com/0chain/common v1.18.3/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= +github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e h1:TskvG+KrEWp4obrELJk1QRX3tjnsr1mlBapeb1fV2cU= +github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= diff --git a/mobilesdk/sdk/common.go b/mobilesdk/sdk/common.go index 5a189b757..189b81f4f 100644 --- a/mobilesdk/sdk/common.go +++ b/mobilesdk/sdk/common.go @@ -4,7 +4,7 @@ package sdk import ( - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/encryption" ) // GetLookupHash get lookup hash with allocation id and path. diff --git a/mobilesdk/sdk/keys.go b/mobilesdk/sdk/keys.go index ebfd49562..d95debe3f 100644 --- a/mobilesdk/sdk/keys.go +++ b/mobilesdk/sdk/keys.go @@ -3,7 +3,7 @@ package sdk import ( "encoding/json" - "github.com/0chain/gosdk/core/zcncrypto" + "github.com/0chain/gosdk_common/core/zcncrypto" ) // SplitKeys split keys by private key, return json string of wallet diff --git a/mobilesdk/sdk/sdk.go b/mobilesdk/sdk/sdk.go index f5dd299c8..f246b431c 100644 --- a/mobilesdk/sdk/sdk.go +++ b/mobilesdk/sdk/sdk.go @@ -13,19 +13,19 @@ import ( "context" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/sys" "github.com/pkg/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/core/version" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/conf" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/core/version" + "github.com/0chain/gosdk_common/sdk" + l "github.com/0chain/gosdk_common/zboxcore/logger" - "github.com/0chain/gosdk/mobilesdk/zbox" - "github.com/0chain/gosdk/mobilesdk/zboxapi" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/mobilesdk/zbox" + "github.com/0chain/gosdk_common/mobilesdk/zboxapi" + "github.com/0chain/gosdk_common/zcncore" ) var nonce = int64(0) diff --git a/mobilesdk/sdk/sign.go b/mobilesdk/sdk/sign.go index 5cef0dadc..b444b1b3b 100644 --- a/mobilesdk/sdk/sign.go +++ b/mobilesdk/sdk/sign.go @@ -3,10 +3,10 @@ package sdk import ( "errors" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/zcncrypto" - _ "github.com/0chain/gosdk/core/client" //import it to initialize sys.Sign + _ "github.com/0chain/gosdk_common/core/client" //import it to initialize sys.Sign + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/core/zcncrypto" ) var ErrInvalidSignatureScheme = errors.New("invalid_signature_scheme") diff --git a/mobilesdk/zbox/allocation.go b/mobilesdk/zbox/allocation.go index 97f986087..14ea8fc73 100644 --- a/mobilesdk/zbox/allocation.go +++ b/mobilesdk/zbox/allocation.go @@ -6,10 +6,10 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/blockchain" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/blockchain" ) var ErrInvalidAllocation = errors.New("zbox: invalid allocation") diff --git a/mobilesdk/zbox/models.go b/mobilesdk/zbox/models.go index 13f55e39f..d617a09fc 100644 --- a/mobilesdk/zbox/models.go +++ b/mobilesdk/zbox/models.go @@ -1,7 +1,7 @@ package zbox import ( - "github.com/0chain/gosdk/core/transaction" + "github.com/0chain/gosdk_common/core/transaction" ) type StatusCallbackMocked interface { diff --git a/mobilesdk/zbox/storage.go b/mobilesdk/zbox/storage.go index bb8ca5028..fbbef06df 100644 --- a/mobilesdk/zbox/storage.go +++ b/mobilesdk/zbox/storage.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/0chain/gosdk/constants" + "github.com/0chain/gosdk_common/constants" "github.com/0chain/gosdk/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/sdk" diff --git a/mobilesdk/zbox/streaming.go b/mobilesdk/zbox/streaming.go index eab889540..2eff586df 100644 --- a/mobilesdk/zbox/streaming.go +++ b/mobilesdk/zbox/streaming.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/transaction" + "github.com/0chain/gosdk_common/core/transaction" "github.com/0chain/gosdk/zboxcore/sdk" ) diff --git a/mobilesdk/zboxapi/client.go b/mobilesdk/zboxapi/client.go index 81470dd83..9fa9f1271 100644 --- a/mobilesdk/zboxapi/client.go +++ b/mobilesdk/zboxapi/client.go @@ -13,9 +13,9 @@ import ( "context" "errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/zboxapi" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/zboxapi" "go.uber.org/zap" ) diff --git a/mobilesdk/zcn/transaction_query.go b/mobilesdk/zcn/transaction_query.go index 981f2755d..c5d081254 100644 --- a/mobilesdk/zcn/transaction_query.go +++ b/mobilesdk/zcn/transaction_query.go @@ -4,7 +4,7 @@ package zcn import ( - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) // GetUserLockedTotal get total token user locked diff --git a/mobilesdk/zcn/writepool.go b/mobilesdk/zcn/writepool.go index e69513a65..c1b1254a8 100644 --- a/mobilesdk/zcn/writepool.go +++ b/mobilesdk/zcn/writepool.go @@ -4,8 +4,9 @@ package zcn import ( - "github.com/0chain/gosdk/zboxcore/sdk" "strconv" + + "github.com/0chain/gosdk_common/sdk" ) // WritePoolLock locks given number of tokes for given duration in read pool. diff --git a/sdks/blobber/blobber.go b/sdks/blobber/blobber.go deleted file mode 100644 index e13d9016b..000000000 --- a/sdks/blobber/blobber.go +++ /dev/null @@ -1,23 +0,0 @@ -package blobber - -import ( - "github.com/0chain/gosdk/sdks" -) - -// Blobber blobber sdk client instance -type Blobber struct { - BaseURLs []string - *sdks.ZBox -} - -// New create an sdk client instance given its configuration -// - zbox zbox sdk client instance -// - baseURLs base urls of the blobber -func New(zbox *sdks.ZBox, baseURLs ...string) *Blobber { - b := &Blobber{ - BaseURLs: baseURLs, - ZBox: zbox, - } - - return b -} diff --git a/sdks/blobber/doc.go b/sdks/blobber/doc.go deleted file mode 100644 index 58580152e..000000000 --- a/sdks/blobber/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Provides sdk functions to be used by the blobber. -package blobber \ No newline at end of file diff --git a/sdks/blobber/endpoints.go b/sdks/blobber/endpoints.go deleted file mode 100644 index 319887d0e..000000000 --- a/sdks/blobber/endpoints.go +++ /dev/null @@ -1,12 +0,0 @@ -package blobber - -const ( - // EndpointWriteMarkerLock api endpoint of WriteMarkerLock - EndpointWriteMarkerLock = "/v1/writemarker/lock/" - - // EndpointRootHashnode api endpoint of getting root hashnode of an allocation - EndpointRootHashnode = "/v1/hashnode/root/" - - // EndpointFileMeta api endpoint of file meta - EndpointFileMeta = "/v1/file/meta/" -) diff --git a/sdks/client.go b/sdks/client.go deleted file mode 100644 index 7305a52c0..000000000 --- a/sdks/client.go +++ /dev/null @@ -1,51 +0,0 @@ -package sdks - -import ( - "net/http" - "net/url" - - "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/client" -) - -// Client a client instance of restful api -type Client struct { - ClientID string - ClientPublicKey string - BaseURL string -} - -// create client instance -func NewClient(clientID, clientPublicKey, baseURL string) (Client, error) { - u, err := url.Parse(baseURL) - - c := Client{ - ClientID: clientID, - ClientPublicKey: clientPublicKey, - } - - if err != nil { - return c, errors.Throw(constants.ErrInvalidParameter, "baseURL") - } - - c.BaseURL = u.String() - - return c, nil -} - -func (c *Client) SignRequest(req *http.Request, allocation string) error { - - req.Header.Set("X-App-Client-ID", c.ClientID) - req.Header.Set("X-App-Client-Key", c.ClientPublicKey) - - sign, err := sys.Sign(encryption.Hash(allocation), client.SignatureScheme(), client.GetClientSysKeys()) - if err != nil { - return err - } - req.Header.Set("X-App-Client-Signature", sign) - - return nil -} diff --git a/sdks/doc.go b/sdks/doc.go deleted file mode 100644 index 1cb024dab..000000000 --- a/sdks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Miscellaneous provider-related SDKs. -package sdks \ No newline at end of file diff --git a/sdks/request.go b/sdks/request.go deleted file mode 100644 index 11d03fc5d..000000000 --- a/sdks/request.go +++ /dev/null @@ -1,21 +0,0 @@ -package sdks - -import ( - "io" -) - -// Request request payload -type Request struct { - - //AllocationID optional. allocation id - AllocationID string - //ConnectionID optional. session id - ConnectionID string - - // ContentType content-type in header - ContentType string - // Body form data - Body io.Reader - // QueryString query string - QueryString map[string]string -} diff --git a/sdks/zbox.go b/sdks/zbox.go deleted file mode 100644 index 31bf6b9e3..000000000 --- a/sdks/zbox.go +++ /dev/null @@ -1,146 +0,0 @@ -package sdks - -import ( - "encoding/json" - "fmt" - "io" - "net" - "net/http" - "net/url" - - "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/core/client" -) - -// ZBox sdk client instance -type ZBox struct { - // ClientID client id - ClientID string - // ClientKey client key - ClientKey string - // SignatureScheme signature scheme - SignatureScheme string - - // Wallet wallet - Wallet *zcncrypto.Wallet - - // NewRequest create http request - NewRequest func(method, url string, body io.Reader) (*http.Request, error) -} - -// New create an sdk client instance given its configuration -// - clientID client id of the using client -// - clientKey client key of the using client -// - signatureScheme signature scheme for transaction encryption -// - wallet wallet of the using client -func New(clientID, clientKey, signatureScheme string, wallet *zcncrypto.Wallet) *ZBox { - s := &ZBox{ - ClientID: clientID, - ClientKey: clientKey, - SignatureScheme: signatureScheme, - Wallet: wallet, - NewRequest: http.NewRequest, - } - - return s -} - -// InitWallet init wallet from json -// - js json string of wallet -func (z *ZBox) InitWallet(js string) error { - return json.Unmarshal([]byte(js), &z.Wallet) -} - -// SignRequest sign request with client_id, client_key and sign by adding headers to the request -// - req http request -// - allocationID allocation id -func (z *ZBox) SignRequest(req *http.Request, allocationID string) error { - - if req == nil { - return errors.Throw(constants.ErrInvalidParameter, "req") - } - - req.Header.Set("X-App-Client-ID", z.ClientID) - req.Header.Set("X-App-Client-Key", z.ClientKey) - - hash := encryption.Hash(allocationID) - - sign, err := sys.Sign(hash, z.SignatureScheme, client.GetClientSysKeys()) - if err != nil { - return err - } - - // ClientSignatureHeader represents http request header contains signature. - req.Header.Set("X-App-Client-Signature", sign) - - return nil -} - -// CreateTransport create http.Transport with default dial timeout -func (z *ZBox) CreateTransport() *http.Transport { - return &http.Transport{ - Dial: (&net.Dialer{ - Timeout: resty.DefaultDialTimeout, - }).Dial, - TLSHandshakeTimeout: resty.DefaultDialTimeout, - } -} - -// BuildUrls build full request url given base urls, query string, path format and path args -// - baseURLs base urls -// - queryString query string -// - pathFormat path format -// - pathArgs path args -func (z *ZBox) BuildUrls(baseURLs []string, queryString map[string]string, pathFormat string, pathArgs ...interface{}) []string { - - requestURL := pathFormat - if len(pathArgs) > 0 { - requestURL = fmt.Sprintf(pathFormat, pathArgs...) - } - - if len(queryString) > 0 { - requestQuery := make(url.Values) - for k, v := range queryString { - requestQuery.Add(k, v) - } - - requestURL += "?" + requestQuery.Encode() - } - - list := make([]string, len(baseURLs)) - for k, v := range baseURLs { - list[k] = v + requestURL - } - - return list -} - -// DoPost do post request with request and handle -// - req request instance -// - handle handle function for the response -func (z *ZBox) DoPost(req *Request, handle resty.Handle) *resty.Resty { - - opts := make([]resty.Option, 0, 5) - - opts = append(opts, resty.WithRetry(resty.DefaultRetry)) - opts = append(opts, resty.WithRequestInterceptor(func(r *http.Request) error { - return z.SignRequest(r, req.AllocationID) //nolint - })) - - if len(req.ContentType) > 0 { - opts = append(opts, resty.WithHeader(map[string]string{ - "Content-Type": req.ContentType, - })) - } - - opts = append(opts, resty.WithTransport(z.CreateTransport())) - - r := resty.New(opts...).Then(handle) - - return r -} diff --git a/wasmsdk/README.md b/wasmsdk/README.md index c4b52b221..58365f118 100644 --- a/wasmsdk/README.md +++ b/wasmsdk/README.md @@ -3,7 +3,7 @@ # wasmsdk ```go -import "github.com/0chain/gosdk/wasmsdk" +import "github.com/0chain/gosdk_common/wasmsdk" ``` ## Index diff --git a/wasmsdk/allocation.go b/wasmsdk/allocation.go index 25aae7861..d42011e36 100644 --- a/wasmsdk/allocation.go +++ b/wasmsdk/allocation.go @@ -13,9 +13,9 @@ import ( "sync" "syscall/js" - "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" ) const TOKEN_UNIT int64 = 1e10 diff --git a/wasmsdk/auth_txn.go b/wasmsdk/auth_txn.go index cd34f925c..42bac292a 100644 --- a/wasmsdk/auth_txn.go +++ b/wasmsdk/auth_txn.go @@ -7,9 +7,9 @@ import ( "fmt" "syscall/js" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/zcncore" ) type AuthCallbackFunc func(msg string) string diff --git a/wasmsdk/blobber.go b/wasmsdk/blobber.go index 487e05457..bbe1229ac 100644 --- a/wasmsdk/blobber.go +++ b/wasmsdk/blobber.go @@ -15,19 +15,19 @@ import ( "syscall/js" "time" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/sys" "github.com/hack-pad/safejs" - "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/hack-pad/go-webworkers/worker" ) diff --git a/wasmsdk/bridge.go b/wasmsdk/bridge.go index f0f655e12..789de9e13 100644 --- a/wasmsdk/bridge.go +++ b/wasmsdk/bridge.go @@ -4,11 +4,11 @@ import ( "context" "encoding/base64" "encoding/json" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/zcnbridge" - "github.com/0chain/gosdk/zcnbridge/errors" - "github.com/0chain/gosdk/zcnbridge/log" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge/errors" + "github.com/0chain/gosdk_common/zcnbridge/log" + "github.com/0chain/gosdk_common/zcncore" "github.com/ethereum/go-ethereum/ethclient" "path" "strconv" diff --git a/wasmsdk/cache.go b/wasmsdk/cache.go index 9089015b3..9e0d8c9e1 100644 --- a/wasmsdk/cache.go +++ b/wasmsdk/cache.go @@ -8,9 +8,9 @@ import ( "errors" "time" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/wasmsdk/jsbridge" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" lru "github.com/hashicorp/golang-lru/v2" ) diff --git a/wasmsdk/common.go b/wasmsdk/common.go index ba2bfe408..98079e9d4 100644 --- a/wasmsdk/common.go +++ b/wasmsdk/common.go @@ -7,8 +7,8 @@ import ( "errors" "syscall/js" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" ) // PrintError is to print to stderr diff --git a/wasmsdk/demo/main.go b/wasmsdk/demo/main.go index 64934403a..02c903934 100644 --- a/wasmsdk/demo/main.go +++ b/wasmsdk/demo/main.go @@ -7,8 +7,8 @@ import ( "net/http" "sync" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zcncore" "github.com/uptrace/bunrouter" ) diff --git a/wasmsdk/ethwallet.go b/wasmsdk/ethwallet.go index bc2dbc40b..a04097962 100644 --- a/wasmsdk/ethwallet.go +++ b/wasmsdk/ethwallet.go @@ -8,7 +8,7 @@ import ( "sync" "syscall/js" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) // JS does not have int64 so we must take a string instead of int64. diff --git a/wasmsdk/jsbridge/file_reader.go b/wasmsdk/jsbridge/file_reader.go index 17b27a1e7..21b783917 100644 --- a/wasmsdk/jsbridge/file_reader.go +++ b/wasmsdk/jsbridge/file_reader.go @@ -8,7 +8,7 @@ import ( "io" "syscall/js" - "github.com/0chain/gosdk/core/common" + "github.com/0chain/gosdk_common/core/common" "github.com/valyala/bytebufferpool" ) diff --git a/wasmsdk/jsbridge/file_writer.go b/wasmsdk/jsbridge/file_writer.go index 81b69a0c6..3cb1cfa85 100644 --- a/wasmsdk/jsbridge/file_writer.go +++ b/wasmsdk/jsbridge/file_writer.go @@ -8,7 +8,7 @@ import ( "io/fs" "syscall/js" - "github.com/0chain/gosdk/core/common" + "github.com/0chain/gosdk_common/core/common" "github.com/valyala/bytebufferpool" ) diff --git a/wasmsdk/jsbridge/template_data.go b/wasmsdk/jsbridge/template_data.go index cc3c2c7d7..3592a9216 100644 --- a/wasmsdk/jsbridge/template_data.go +++ b/wasmsdk/jsbridge/template_data.go @@ -13,7 +13,7 @@ import ( "syscall/js" "text/template" - "github.com/0chain/gosdk/core/version" + "github.com/0chain/gosdk_common/core/version" ) //go:embed zcnworker.js.tpl diff --git a/wasmsdk/player_file.go b/wasmsdk/player_file.go index 82de0d4c8..866e99001 100644 --- a/wasmsdk/player_file.go +++ b/wasmsdk/player_file.go @@ -7,8 +7,8 @@ import ( "context" "fmt" - "github.com/0chain/gosdk/zboxcore/marker" - "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/zboxcore/marker" ) type FilePlayer struct { diff --git a/wasmsdk/player_stream.go b/wasmsdk/player_stream.go index 51c844e20..fa81be29d 100644 --- a/wasmsdk/player_stream.go +++ b/wasmsdk/player_stream.go @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/zboxcore/marker" ) type StreamPlayer struct { diff --git a/wasmsdk/proxy.go b/wasmsdk/proxy.go index 5ad947fd4..fec80855b 100644 --- a/wasmsdk/proxy.go +++ b/wasmsdk/proxy.go @@ -13,13 +13,13 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/version" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/core/version" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/zcncore" "github.com/hack-pad/safejs" diff --git a/wasmsdk/sdk.go b/wasmsdk/sdk.go index 07f9974ad..beddff136 100644 --- a/wasmsdk/sdk.go +++ b/wasmsdk/sdk.go @@ -8,13 +8,13 @@ import ( "encoding/json" "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/imageutil" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/screstapi" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/imageutil" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/core/screstapi" + "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk_common/zcncore" "io" "os" diff --git a/wasmsdk/statusbar.go b/wasmsdk/statusbar.go index 526e2e4f7..000cc20fc 100644 --- a/wasmsdk/statusbar.go +++ b/wasmsdk/statusbar.go @@ -7,8 +7,8 @@ import ( "path" "sync" - "github.com/0chain/gosdk/core/sys" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/sys" "gopkg.in/cheggaaa/pb.v1" ) diff --git a/wasmsdk/tokenrate.go b/wasmsdk/tokenrate.go index dd5897657..456206331 100644 --- a/wasmsdk/tokenrate.go +++ b/wasmsdk/tokenrate.go @@ -3,7 +3,7 @@ package main import ( "context" - "github.com/0chain/gosdk/core/tokenrate" + "github.com/0chain/gosdk_common/core/tokenrate" ) // getUSDRate gets the USD rate for the given crypto symbol diff --git a/wasmsdk/wallet.go b/wasmsdk/wallet.go index 278a0913f..edbaaf52f 100644 --- a/wasmsdk/wallet.go +++ b/wasmsdk/wallet.go @@ -10,9 +10,9 @@ import ( "os" "strconv" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" ) func setWallet(clientID, clientKey, peerPublicKey, publicKey, privateKey, mnemonic string, isSplit bool) error { diff --git a/wasmsdk/wallet_base.go b/wasmsdk/wallet_base.go index 3f7e1be44..eb30044d7 100644 --- a/wasmsdk/wallet_base.go +++ b/wasmsdk/wallet_base.go @@ -1,7 +1,7 @@ package main import ( - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) // Split keys from the primary master key diff --git a/wasmsdk/zbox.go b/wasmsdk/zbox.go index 1d4497eb7..880f5811e 100644 --- a/wasmsdk/zbox.go +++ b/wasmsdk/zbox.go @@ -7,7 +7,7 @@ import ( "context" "errors" - "github.com/0chain/gosdk/zboxapi" + "github.com/0chain/gosdk_common/zboxapi" ) var ( diff --git a/wasmsdk/zcn.go b/wasmsdk/zcn.go index f0272e4b5..259f1d907 100644 --- a/wasmsdk/zcn.go +++ b/wasmsdk/zcn.go @@ -4,8 +4,8 @@ package main import ( - "github.com/0chain/gosdk/core/screstapi" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/screstapi" + "github.com/0chain/gosdk_common/zcncore" ) type Balance struct { diff --git a/winsdk/allocation.go b/winsdk/allocation.go index f121c2a1f..2379ad94a 100644 --- a/winsdk/allocation.go +++ b/winsdk/allocation.go @@ -9,9 +9,9 @@ import ( import ( "encoding/json" - "github.com/0chain/gosdk/zboxapi" "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zboxapi" + "github.com/0chain/gosdk_common/zcncore" ) // GetAllocation get allocation info diff --git a/winsdk/cache.go b/winsdk/cache.go index b5d4c918f..f3dc5213a 100644 --- a/winsdk/cache.go +++ b/winsdk/cache.go @@ -6,8 +6,8 @@ import ( "errors" "time" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/zboxcore/marker" lru "github.com/hashicorp/golang-lru/v2" ) diff --git a/winsdk/helper.go b/winsdk/helper.go index 867ab2677..af594f190 100644 --- a/winsdk/helper.go +++ b/winsdk/helper.go @@ -12,8 +12,8 @@ import ( "os" "path/filepath" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/zboxcore/marker" ) func getZcnWorkDir() (string, error) { diff --git a/winsdk/sdk.go b/winsdk/sdk.go index d26afb7fa..0c27be908 100644 --- a/winsdk/sdk.go +++ b/winsdk/sdk.go @@ -14,18 +14,18 @@ import ( "os" "path" - "github.com/0chain/gosdk/zboxapi" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk/zboxcore/zboxutil" - "github.com/0chain/gosdk/zcncore" - - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxapi" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zcncore" + + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/conf" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/core/zcncrypto" ) var log logger.Logger diff --git a/winsdk/storage.go b/winsdk/storage.go index d8463c0f0..cdfbaa392 100644 --- a/winsdk/storage.go +++ b/winsdk/storage.go @@ -14,9 +14,9 @@ import ( "os" "time" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/sdk" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/marker" ) // GetFileStats get file stats of blobbers diff --git a/winsdk/wallet.go b/winsdk/wallet.go index 51762ea61..8a4c7e3f3 100644 --- a/winsdk/wallet.go +++ b/winsdk/wallet.go @@ -11,9 +11,9 @@ import ( "os" "path/filepath" - "github.com/0chain/gosdk/core/screstapi" + "github.com/0chain/gosdk_common/core/screstapi" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) // CreateWallet - create a new wallet, and save it to ~/.zcn/wallet.json diff --git a/winsdk/zboxapi.go b/winsdk/zboxapi.go index 49898944f..ce2caac71 100644 --- a/winsdk/zboxapi.go +++ b/winsdk/zboxapi.go @@ -13,9 +13,9 @@ import ( "encoding/json" "errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/zboxapi" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/zboxapi" ) var ( diff --git a/zboxapi/sdk.go b/zboxapi/sdk.go index 270e18c63..98deaf44b 100644 --- a/zboxapi/sdk.go +++ b/zboxapi/sdk.go @@ -12,12 +12,12 @@ import ( "strconv" "time" - "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk_common/core/client" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/resty" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/core/resty" ) var log logger.Logger diff --git a/zboxcore/allocationchange/change.go b/zboxcore/allocationchange/change.go index cfd8ffb33..7e577034a 100644 --- a/zboxcore/allocationchange/change.go +++ b/zboxcore/allocationchange/change.go @@ -2,7 +2,7 @@ package allocationchange import ( "github.com/0chain/common/core/util/wmpt" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/fileref" ) type change struct { diff --git a/zboxcore/allocationchange/copyobject.go b/zboxcore/allocationchange/copyobject.go index 2454cf3b6..fd6b40ed0 100644 --- a/zboxcore/allocationchange/copyobject.go +++ b/zboxcore/allocationchange/copyobject.go @@ -4,10 +4,10 @@ import ( "strings" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/google/uuid" ) diff --git a/zboxcore/allocationchange/createdir.go b/zboxcore/allocationchange/createdir.go index 345e5cbaf..2968702eb 100644 --- a/zboxcore/allocationchange/createdir.go +++ b/zboxcore/allocationchange/createdir.go @@ -5,9 +5,9 @@ import ( "path" "strings" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/google/uuid" ) diff --git a/zboxcore/allocationchange/deletefile.go b/zboxcore/allocationchange/deletefile.go index ae9896c0c..79b99c37b 100644 --- a/zboxcore/allocationchange/deletefile.go +++ b/zboxcore/allocationchange/deletefile.go @@ -4,8 +4,8 @@ import ( "path" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/fileref" ) type DeleteFileChange struct { diff --git a/zboxcore/allocationchange/moveobject.go b/zboxcore/allocationchange/moveobject.go index b913f527b..cc98f8179 100644 --- a/zboxcore/allocationchange/moveobject.go +++ b/zboxcore/allocationchange/moveobject.go @@ -5,10 +5,10 @@ import ( "strings" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/google/uuid" ) diff --git a/zboxcore/allocationchange/newfile.go b/zboxcore/allocationchange/newfile.go index 53e572a37..cc5edc080 100644 --- a/zboxcore/allocationchange/newfile.go +++ b/zboxcore/allocationchange/newfile.go @@ -7,11 +7,11 @@ import ( "strings" zError "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/google/uuid" ) diff --git a/zboxcore/allocationchange/renameobject.go b/zboxcore/allocationchange/renameobject.go index dc5471a65..8f621418e 100644 --- a/zboxcore/allocationchange/renameobject.go +++ b/zboxcore/allocationchange/renameobject.go @@ -4,9 +4,9 @@ import ( "path" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/zboxcore/fileref" ) type RenameFileChange struct { diff --git a/zboxcore/allocationchange/updatefile.go b/zboxcore/allocationchange/updatefile.go index 4e3ad8ab8..2d5f11064 100644 --- a/zboxcore/allocationchange/updatefile.go +++ b/zboxcore/allocationchange/updatefile.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/zboxcore/fileref" ) type UpdateFileChange struct { diff --git a/zboxcore/blockchain/entity.go b/zboxcore/blockchain/entity.go index 0d4a53d17..1efb9e86f 100644 --- a/zboxcore/blockchain/entity.go +++ b/zboxcore/blockchain/entity.go @@ -4,7 +4,7 @@ package blockchain import ( "sync/atomic" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/zboxcore/marker" ) // StakePoolSettings information. diff --git a/zboxcore/encoder/erasurecode.go b/zboxcore/encoder/erasurecode.go index cb22fd151..95aafea94 100644 --- a/zboxcore/encoder/erasurecode.go +++ b/zboxcore/encoder/erasurecode.go @@ -7,7 +7,7 @@ import ( "errors" - l "github.com/0chain/gosdk/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/klauspost/reedsolomon" ) diff --git a/zboxcore/encryption/pre_test.go b/zboxcore/encryption/pre_test.go index 6681b420f..99a198d31 100644 --- a/zboxcore/encryption/pre_test.go +++ b/zboxcore/encryption/pre_test.go @@ -5,7 +5,7 @@ import ( "encoding/base64" "testing" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/stretchr/testify/require" "go.dedis.ch/kyber/v3/group/edwards25519" ) diff --git a/zboxcore/fileref/fileref.go b/zboxcore/fileref/fileref.go index 3f226777a..0ef12a96b 100644 --- a/zboxcore/fileref/fileref.go +++ b/zboxcore/fileref/fileref.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/encryption" lru "github.com/hashicorp/golang-lru/v2" ) diff --git a/zboxcore/fileref/hashnode.go b/zboxcore/fileref/hashnode.go index 7426aa28d..a19b3c742 100644 --- a/zboxcore/fileref/hashnode.go +++ b/zboxcore/fileref/hashnode.go @@ -4,7 +4,7 @@ import ( "strconv" "strings" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/encryption" ) // Hashnode ref node in hash tree diff --git a/zboxcore/fileref/hashnode_test.go b/zboxcore/fileref/hashnode_test.go index f1e81c5c0..6d065b57f 100644 --- a/zboxcore/fileref/hashnode_test.go +++ b/zboxcore/fileref/hashnode_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/encryption" "github.com/stretchr/testify/require" ) diff --git a/zboxcore/logger/logger.go b/zboxcore/logger/logger.go index 0a78ddab7..2b91e54dd 100644 --- a/zboxcore/logger/logger.go +++ b/zboxcore/logger/logger.go @@ -2,7 +2,7 @@ package logger import ( - "github.com/0chain/gosdk/core/logger" + "github.com/0chain/gosdk_common/core/logger" ) // Logger global logger instance diff --git a/zboxcore/marker/authticket.go b/zboxcore/marker/authticket.go index fd2bc9819..ed3705bc5 100644 --- a/zboxcore/marker/authticket.go +++ b/zboxcore/marker/authticket.go @@ -3,8 +3,8 @@ package marker import ( "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" ) // AuthTicket authentication ticket for file sharing. diff --git a/zboxcore/marker/deletetoken.go b/zboxcore/marker/deletetoken.go index 4b9a37dda..66de70561 100644 --- a/zboxcore/marker/deletetoken.go +++ b/zboxcore/marker/deletetoken.go @@ -3,8 +3,8 @@ package marker import ( "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" ) type DeleteToken struct { diff --git a/zboxcore/marker/readmarker.go b/zboxcore/marker/readmarker.go index 53db55ccd..8989b50e5 100644 --- a/zboxcore/marker/readmarker.go +++ b/zboxcore/marker/readmarker.go @@ -4,10 +4,10 @@ import ( "fmt" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/client" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/sys" ) type ReadMarker struct { diff --git a/zboxcore/marker/writemarker.go b/zboxcore/marker/writemarker.go index 55a4ad3b4..c292708a0 100644 --- a/zboxcore/marker/writemarker.go +++ b/zboxcore/marker/writemarker.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/sys" ) type WriteMarker struct { diff --git a/zboxcore/mocks/AllocationChange.go b/zboxcore/mocks/AllocationChange.go index 383bab66f..ea2c4bec4 100644 --- a/zboxcore/mocks/AllocationChange.go +++ b/zboxcore/mocks/AllocationChange.go @@ -3,7 +3,7 @@ package mocks import ( - fileref "github.com/0chain/gosdk/zboxcore/fileref" + fileref "github.com/0chain/gosdk_common/zboxcore/fileref" mock "github.com/stretchr/testify/mock" ) diff --git a/zboxcore/mocks/EncryptionScheme.go b/zboxcore/mocks/EncryptionScheme.go index 1fb2ed8be..b62dbdef0 100644 --- a/zboxcore/mocks/EncryptionScheme.go +++ b/zboxcore/mocks/EncryptionScheme.go @@ -3,7 +3,7 @@ package mocks import ( - encryption "github.com/0chain/gosdk/zboxcore/encryption" + encryption "github.com/0chain/gosdk_common/zboxcore/encryption" mock "github.com/stretchr/testify/mock" ) diff --git a/zboxcore/mocks/RefEntity.go b/zboxcore/mocks/RefEntity.go index f3479f8c2..1de18edc5 100644 --- a/zboxcore/mocks/RefEntity.go +++ b/zboxcore/mocks/RefEntity.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/0chain/gosdk/core/common" + common "github.com/0chain/gosdk_common/core/common" mock "github.com/stretchr/testify/mock" ) diff --git a/zboxcore/sdk/allocation.go b/zboxcore/sdk/allocation.go index 1162f2342..6c9ca5bb0 100644 --- a/zboxcore/sdk/allocation.go +++ b/zboxcore/sdk/allocation.go @@ -22,23 +22,23 @@ import ( "sync/atomic" "time" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/transaction" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/transaction" "github.com/0chain/common/core/currency" "github.com/0chain/errors" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/mitchellh/go-homedir" "go.uber.org/zap" ) diff --git a/zboxcore/sdk/allocation_file_delete_test.go b/zboxcore/sdk/allocation_file_delete_test.go index 057db9d51..462434598 100644 --- a/zboxcore/sdk/allocation_file_delete_test.go +++ b/zboxcore/sdk/allocation_file_delete_test.go @@ -8,13 +8,13 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/mocks" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/resty" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/mocks" "github.com/stretchr/testify/require" ) diff --git a/zboxcore/sdk/allocation_file_test.go b/zboxcore/sdk/allocation_file_test.go index a21cca7d4..6a02c2b71 100644 --- a/zboxcore/sdk/allocation_file_test.go +++ b/zboxcore/sdk/allocation_file_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "net/http" "os" @@ -14,16 +13,18 @@ import ( "testing" "time" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/pathutil" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/zcncrypto" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/pathutil" + "github.com/0chain/gosdk_common/core/resty" + "github.com/0chain/gosdk_common/core/zcncrypto" "github.com/hitenjain14/fasthttp" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/allocation_test.go b/zboxcore/sdk/allocation_test.go index a2cf5b8c5..af720790f 100644 --- a/zboxcore/sdk/allocation_test.go +++ b/zboxcore/sdk/allocation_test.go @@ -17,22 +17,22 @@ import ( "testing" "time" - "github.com/0chain/gosdk/zboxcore/mocks" + "github.com/0chain/gosdk_common/zboxcore/mocks" - encrypt "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/dev/blobber" - "github.com/0chain/gosdk/dev/blobber/model" - "github.com/0chain/gosdk/zboxcore/encryption" + encrypt "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/dev/blobber" + "github.com/0chain/gosdk_common/dev/blobber/model" + "github.com/0chain/gosdk_common/zboxcore/encryption" "golang.org/x/crypto/sha3" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/sys" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/authticket.go b/zboxcore/sdk/authticket.go index 40a71ccb2..f0db33749 100644 --- a/zboxcore/sdk/authticket.go +++ b/zboxcore/sdk/authticket.go @@ -5,8 +5,8 @@ import ( "encoding/json" "github.com/0chain/errors" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/marker" ) type AuthTicket struct { diff --git a/zboxcore/sdk/blobber_operations.go b/zboxcore/sdk/blobber_operations.go index fa15777d9..93f44ade1 100644 --- a/zboxcore/sdk/blobber_operations.go +++ b/zboxcore/sdk/blobber_operations.go @@ -8,10 +8,10 @@ import ( "math" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/0chain/gosdk_common/zboxcore/logger" "go.uber.org/zap" ) diff --git a/zboxcore/sdk/blockdownloadworker.go b/zboxcore/sdk/blockdownloadworker.go index 19fa22f27..f2387550c 100644 --- a/zboxcore/sdk/blockdownloadworker.go +++ b/zboxcore/sdk/blockdownloadworker.go @@ -10,14 +10,14 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - zlogger "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + zlogger "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/hitenjain14/fasthttp" "golang.org/x/sync/semaphore" ) diff --git a/zboxcore/sdk/chunked_upload.go b/zboxcore/sdk/chunked_upload.go index 1408fa539..6ee3c9a6f 100644 --- a/zboxcore/sdk/chunked_upload.go +++ b/zboxcore/sdk/chunked_upload.go @@ -16,18 +16,18 @@ import ( "errors" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - coreEncryption "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/util" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + coreEncryption "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/encryption" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/google/uuid" "github.com/klauspost/reedsolomon" ) diff --git a/zboxcore/sdk/chunked_upload_bench_test.go b/zboxcore/sdk/chunked_upload_bench_test.go index 6c4195628..4e6026357 100644 --- a/zboxcore/sdk/chunked_upload_bench_test.go +++ b/zboxcore/sdk/chunked_upload_bench_test.go @@ -8,10 +8,10 @@ import ( "testing" "testing/fstest" - "github.com/0chain/gosdk/dev" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/dev" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/logger" ) type nopeChunkedUploadProgressStorer struct { diff --git a/zboxcore/sdk/chunked_upload_blobber.go b/zboxcore/sdk/chunked_upload_blobber.go index 8a60737b2..5106ae968 100644 --- a/zboxcore/sdk/chunked_upload_blobber.go +++ b/zboxcore/sdk/chunked_upload_blobber.go @@ -14,14 +14,14 @@ import ( "github.com/0chain/errors" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/hitenjain14/fasthttp" "github.com/valyala/bytebufferpool" "golang.org/x/sync/errgroup" diff --git a/zboxcore/sdk/chunked_upload_chunk_reader.go b/zboxcore/sdk/chunked_upload_chunk_reader.go index a54159b3c..b37ec76b6 100644 --- a/zboxcore/sdk/chunked_upload_chunk_reader.go +++ b/zboxcore/sdk/chunked_upload_chunk_reader.go @@ -7,10 +7,10 @@ import ( "sync" "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/zboxcore/encryption" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/klauspost/reedsolomon" "github.com/valyala/bytebufferpool" ) diff --git a/zboxcore/sdk/chunked_upload_chunk_reader_bench_test.go b/zboxcore/sdk/chunked_upload_chunk_reader_bench_test.go index d1962d869..dbfff5a5f 100644 --- a/zboxcore/sdk/chunked_upload_chunk_reader_bench_test.go +++ b/zboxcore/sdk/chunked_upload_chunk_reader_bench_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/0chain/gosdk/zboxcore/encryption" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/encryption" "github.com/klauspost/reedsolomon" ) diff --git a/zboxcore/sdk/chunked_upload_chunk_reader_test.go b/zboxcore/sdk/chunked_upload_chunk_reader_test.go index 1533b5cea..e06e62334 100644 --- a/zboxcore/sdk/chunked_upload_chunk_reader_test.go +++ b/zboxcore/sdk/chunked_upload_chunk_reader_test.go @@ -5,8 +5,8 @@ import ( "math" "testing" - "github.com/0chain/gosdk/zboxcore/encryption" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/encryption" "github.com/klauspost/reedsolomon" "github.com/stretchr/testify/require" ) diff --git a/zboxcore/sdk/chunked_upload_form_builder.go b/zboxcore/sdk/chunked_upload_form_builder.go index 6781d311b..691a47f2d 100644 --- a/zboxcore/sdk/chunked_upload_form_builder.go +++ b/zboxcore/sdk/chunked_upload_form_builder.go @@ -11,8 +11,8 @@ import ( "mime/multipart" "sync" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" "golang.org/x/crypto/sha3" ) diff --git a/zboxcore/sdk/chunked_upload_hasher.go b/zboxcore/sdk/chunked_upload_hasher.go index 6ba4aebd8..488d3ed9e 100644 --- a/zboxcore/sdk/chunked_upload_hasher.go +++ b/zboxcore/sdk/chunked_upload_hasher.go @@ -7,8 +7,8 @@ import ( "sync" "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/util" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/util" ) // Hasher interface to gather all hasher related functions. diff --git a/zboxcore/sdk/chunked_upload_model.go b/zboxcore/sdk/chunked_upload_model.go index d5fb3d42f..35c7234bc 100644 --- a/zboxcore/sdk/chunked_upload_model.go +++ b/zboxcore/sdk/chunked_upload_model.go @@ -10,11 +10,11 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/common" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/encryption" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/google/uuid" "github.com/klauspost/reedsolomon" "golang.org/x/crypto/sha3" diff --git a/zboxcore/sdk/chunked_upload_process_js.go b/zboxcore/sdk/chunked_upload_process_js.go index 782400775..fc9693102 100644 --- a/zboxcore/sdk/chunked_upload_process_js.go +++ b/zboxcore/sdk/chunked_upload_process_js.go @@ -19,11 +19,11 @@ import ( "github.com/0chain/errors" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/wasmsdk/jsbridge" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/wasmsdk/jsbridge" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/hack-pad/go-webworkers/worker" "github.com/hack-pad/safejs" "github.com/hitenjain14/fasthttp" diff --git a/zboxcore/sdk/chunked_upload_progress_storer.go b/zboxcore/sdk/chunked_upload_progress_storer.go index a21bc4a1d..19575d3fa 100644 --- a/zboxcore/sdk/chunked_upload_progress_storer.go +++ b/zboxcore/sdk/chunked_upload_progress_storer.go @@ -9,10 +9,10 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/logger" ) // ChunkedUploadProgressStorer load and save upload progress diff --git a/zboxcore/sdk/chunked_upload_web_streaming.go b/zboxcore/sdk/chunked_upload_web_streaming.go index ea09ae558..c1f4cef21 100644 --- a/zboxcore/sdk/chunked_upload_web_streaming.go +++ b/zboxcore/sdk/chunked_upload_web_streaming.go @@ -11,7 +11,7 @@ import ( "strings" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/logger" ) // Converting the video file to fmp4 format for web streaming diff --git a/zboxcore/sdk/commitworker.go b/zboxcore/sdk/commitworker.go index 262d98b0d..172ceaab2 100644 --- a/zboxcore/sdk/commitworker.go +++ b/zboxcore/sdk/commitworker.go @@ -18,15 +18,15 @@ import ( "github.com/0chain/common/core/util/wmpt" "github.com/0chain/errors" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/minio/sha256-simd" ) diff --git a/zboxcore/sdk/common.go b/zboxcore/sdk/common.go index 3f9b698b6..9a2acf989 100644 --- a/zboxcore/sdk/common.go +++ b/zboxcore/sdk/common.go @@ -13,11 +13,11 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) func getObjectTreeFromBlobber(ctx context.Context, allocationID, allocationTx, sig string, remoteFilePath string, blobber *blockchain.StorageNode, clientId ...string) (fileref.RefEntity, error) { diff --git a/zboxcore/sdk/copyworker.go b/zboxcore/sdk/copyworker.go index 9d77f2425..49ff94d53 100644 --- a/zboxcore/sdk/copyworker.go +++ b/zboxcore/sdk/copyworker.go @@ -18,16 +18,16 @@ import ( "github.com/google/uuid" "go.uber.org/zap" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) type CopyRequest struct { diff --git a/zboxcore/sdk/copyworker_test.go b/zboxcore/sdk/copyworker_test.go index f795ce51b..f9023bcd6 100644 --- a/zboxcore/sdk/copyworker_test.go +++ b/zboxcore/sdk/copyworker_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "mime" "mime/multipart" @@ -14,14 +13,16 @@ import ( "sync" "testing" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/dev" - devMock "github.com/0chain/gosdk/dev/mock" - "github.com/0chain/gosdk/sdks/blobber" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/dev" + devMock "github.com/0chain/gosdk_common/dev/mock" + "github.com/0chain/gosdk_common/sdks/blobber" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/deleteworker.go b/zboxcore/sdk/deleteworker.go index 243e88c5b..b70fdd755 100644 --- a/zboxcore/sdk/deleteworker.go +++ b/zboxcore/sdk/deleteworker.go @@ -18,14 +18,14 @@ import ( thrown "github.com/0chain/errors" "github.com/google/uuid" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) type DeleteRequest struct { diff --git a/zboxcore/sdk/deleteworker_test.go b/zboxcore/sdk/deleteworker_test.go index 75ef89f51..02b124bdd 100644 --- a/zboxcore/sdk/deleteworker_test.go +++ b/zboxcore/sdk/deleteworker_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "net/http" "strconv" @@ -13,12 +12,14 @@ import ( "testing" "time" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/resty" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/dirworker.go b/zboxcore/sdk/dirworker.go index a1b4ef26f..e7324dbed 100644 --- a/zboxcore/sdk/dirworker.go +++ b/zboxcore/sdk/dirworker.go @@ -14,14 +14,14 @@ import ( "github.com/0chain/common/core/util/wmpt" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/google/uuid" ) diff --git a/zboxcore/sdk/download_progress_storer.go b/zboxcore/sdk/download_progress_storer.go index dce3ace95..22b1ac05d 100644 --- a/zboxcore/sdk/download_progress_storer.go +++ b/zboxcore/sdk/download_progress_storer.go @@ -9,7 +9,7 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/sys" ) type DownloadProgressStorer interface { diff --git a/zboxcore/sdk/downloader.go b/zboxcore/sdk/downloader.go index b2aa4062f..13e658c0b 100644 --- a/zboxcore/sdk/downloader.go +++ b/zboxcore/sdk/downloader.go @@ -5,8 +5,8 @@ import ( "errors" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/fileref" ) // Downloader downloader for file, blocks and thumbnail diff --git a/zboxcore/sdk/downloader_option.go b/zboxcore/sdk/downloader_option.go index 0dca50557..4679267f8 100644 --- a/zboxcore/sdk/downloader_option.go +++ b/zboxcore/sdk/downloader_option.go @@ -1,6 +1,6 @@ package sdk -import "github.com/0chain/gosdk/core/sys" +import "github.com/0chain/gosdk_common/core/sys" const DefaultBlocksPerMarker int = 100 diff --git a/zboxcore/sdk/downloadworker.go b/zboxcore/sdk/downloadworker.go index 78f1e5f80..ae95d3d46 100644 --- a/zboxcore/sdk/downloadworker.go +++ b/zboxcore/sdk/downloadworker.go @@ -20,17 +20,17 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - encrypt "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + encrypt "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/encryption" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/klauspost/reedsolomon" "go.dedis.ch/kyber/v3/group/edwards25519" "golang.org/x/sync/errgroup" diff --git a/zboxcore/sdk/filemetaworker.go b/zboxcore/sdk/filemetaworker.go index 54975705a..407ea589c 100644 --- a/zboxcore/sdk/filemetaworker.go +++ b/zboxcore/sdk/filemetaworker.go @@ -11,11 +11,11 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) type fileMetaResponse struct { diff --git a/zboxcore/sdk/filemetaworker_test.go b/zboxcore/sdk/filemetaworker_test.go index dc5ecdc89..1ba350fb0 100644 --- a/zboxcore/sdk/filemetaworker_test.go +++ b/zboxcore/sdk/filemetaworker_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "mime" "mime/multipart" @@ -15,13 +14,15 @@ import ( "testing" "time" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/filerefsworker.go b/zboxcore/sdk/filerefsworker.go index aa684c670..3d5804b42 100644 --- a/zboxcore/sdk/filerefsworker.go +++ b/zboxcore/sdk/filerefsworker.go @@ -13,12 +13,12 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" ) type ObjectTreeResult struct { diff --git a/zboxcore/sdk/filestatsworker.go b/zboxcore/sdk/filestatsworker.go index 81f9c3b3a..ceaba9805 100644 --- a/zboxcore/sdk/filestatsworker.go +++ b/zboxcore/sdk/filestatsworker.go @@ -11,10 +11,10 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) // FileStats - file stats structure diff --git a/zboxcore/sdk/filestatsworker_test.go b/zboxcore/sdk/filestatsworker_test.go index d9c7e6ba4..3fa4baaa6 100644 --- a/zboxcore/sdk/filestatsworker_test.go +++ b/zboxcore/sdk/filestatsworker_test.go @@ -4,7 +4,8 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" + + "github.com/0chain/gosdk_common/zboxcore/mocks" "io" "mime" @@ -15,12 +16,12 @@ import ( "testing" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/zboxcore/sdk/listworker.go b/zboxcore/sdk/listworker.go index a46e30f9b..de122ee48 100644 --- a/zboxcore/sdk/listworker.go +++ b/zboxcore/sdk/listworker.go @@ -12,12 +12,12 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" ) const CHUNK_SIZE = 64 * 1024 diff --git a/zboxcore/sdk/listworker_test.go b/zboxcore/sdk/listworker_test.go index 511608b47..a6240ef2a 100644 --- a/zboxcore/sdk/listworker_test.go +++ b/zboxcore/sdk/listworker_test.go @@ -5,7 +5,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "net/http" "strconv" @@ -13,12 +12,14 @@ import ( "sync" "testing" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/live_upload_reader.go b/zboxcore/sdk/live_upload_reader.go index 019293018..77827ff4a 100644 --- a/zboxcore/sdk/live_upload_reader.go +++ b/zboxcore/sdk/live_upload_reader.go @@ -9,7 +9,7 @@ import ( "syscall" "time" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/sys" "github.com/h2non/filetype" ) diff --git a/zboxcore/sdk/m3u8.go b/zboxcore/sdk/m3u8.go index 3accec4c1..bcc21d06c 100644 --- a/zboxcore/sdk/m3u8.go +++ b/zboxcore/sdk/m3u8.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/sys" ) // #EXTM3U diff --git a/zboxcore/sdk/moveworker.go b/zboxcore/sdk/moveworker.go index 2bceac689..1b553e2f7 100644 --- a/zboxcore/sdk/moveworker.go +++ b/zboxcore/sdk/moveworker.go @@ -19,15 +19,15 @@ import ( "github.com/google/uuid" "go.uber.org/zap" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) type MoveRequest struct { diff --git a/zboxcore/sdk/multi_operation_worker.go b/zboxcore/sdk/multi_operation_worker.go index de797d145..343974204 100644 --- a/zboxcore/sdk/multi_operation_worker.go +++ b/zboxcore/sdk/multi_operation_worker.go @@ -14,12 +14,12 @@ import ( "github.com/0chain/errors" "github.com/remeh/sizedwaitgroup" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" - l "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/util" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/google/uuid" diff --git a/zboxcore/sdk/playlist.go b/zboxcore/sdk/playlist.go index 8e1b424a4..8eb9d6845 100644 --- a/zboxcore/sdk/playlist.go +++ b/zboxcore/sdk/playlist.go @@ -7,13 +7,13 @@ import ( "net/url" "strings" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/resty" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/resty" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" ) type PlaylistFile struct { diff --git a/zboxcore/sdk/reader.go b/zboxcore/sdk/reader.go index ae005b369..226d25b7d 100644 --- a/zboxcore/sdk/reader.go +++ b/zboxcore/sdk/reader.go @@ -10,8 +10,8 @@ import ( "sync" "github.com/0chain/errors" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/marker" ) const ( diff --git a/zboxcore/sdk/renameworker.go b/zboxcore/sdk/renameworker.go index 644bfcc75..c9d7a25d4 100644 --- a/zboxcore/sdk/renameworker.go +++ b/zboxcore/sdk/renameworker.go @@ -18,15 +18,15 @@ import ( "github.com/google/uuid" "go.uber.org/zap" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) type RenameRequest struct { diff --git a/zboxcore/sdk/renameworker_test.go b/zboxcore/sdk/renameworker_test.go index ad992bc4a..0902ec5b6 100644 --- a/zboxcore/sdk/renameworker_test.go +++ b/zboxcore/sdk/renameworker_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "mime" "mime/multipart" @@ -14,14 +13,16 @@ import ( "sync" "testing" + "github.com/0chain/gosdk_common/zboxcore/mocks" + "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/dev" - devMock "github.com/0chain/gosdk/dev/mock" - "github.com/0chain/gosdk/sdks/blobber" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/fileref" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/dev" + devMock "github.com/0chain/gosdk_common/dev/mock" + "github.com/0chain/gosdk_common/sdks/blobber" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/fileref" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/sdk/repairCallback.go b/zboxcore/sdk/repairCallback.go index 1e122e848..0c70c4614 100644 --- a/zboxcore/sdk/repairCallback.go +++ b/zboxcore/sdk/repairCallback.go @@ -3,7 +3,7 @@ package sdk import ( "sync" - l "github.com/0chain/gosdk/zboxcore/logger" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) var ( diff --git a/zboxcore/sdk/repairworker.go b/zboxcore/sdk/repairworker.go index 319e23411..e8002467d 100644 --- a/zboxcore/sdk/repairworker.go +++ b/zboxcore/sdk/repairworker.go @@ -7,11 +7,11 @@ import ( "io" "sync" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" "go.uber.org/zap" ) diff --git a/zboxcore/sdk/rollback.go b/zboxcore/sdk/rollback.go index 6d1607c44..278862be1 100644 --- a/zboxcore/sdk/rollback.go +++ b/zboxcore/sdk/rollback.go @@ -19,11 +19,11 @@ import ( "github.com/0chain/common/core/common" thrown "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/zboxcore/blockchain" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" "github.com/minio/sha256-simd" "go.uber.org/zap" ) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index a8e3934fb..15db4bdec 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -11,19 +11,19 @@ import ( "github.com/0chain/common/core/currency" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/screstapi" + "github.com/0chain/gosdk_common/core/logger" + "github.com/0chain/gosdk_common/core/screstapi" "gopkg.in/natefinch/lumberjack.v2" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/core/version" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/encryption" - l "github.com/0chain/gosdk/zboxcore/logger" - "github.com/0chain/gosdk/zboxcore/marker" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/0chain/gosdk_common/core/version" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/encryption" + l "github.com/0chain/gosdk_common/zboxcore/logger" + "github.com/0chain/gosdk_common/zboxcore/marker" ) const STORAGE_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7" diff --git a/zboxcore/sdk/sharerequest.go b/zboxcore/sdk/sharerequest.go index b232028a2..b879cffe8 100644 --- a/zboxcore/sdk/sharerequest.go +++ b/zboxcore/sdk/sharerequest.go @@ -8,12 +8,12 @@ import ( "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/fileref" - "github.com/0chain/gosdk/zboxcore/marker" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/encryption" + "github.com/0chain/gosdk_common/zboxcore/fileref" + "github.com/0chain/gosdk_common/zboxcore/marker" ) type ShareRequest struct { diff --git a/zboxcore/sdk/sync.go b/zboxcore/sdk/sync.go index 375f7f074..c264124d0 100644 --- a/zboxcore/sdk/sync.go +++ b/zboxcore/sdk/sync.go @@ -12,10 +12,10 @@ import ( "strings" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" ) // For sync app diff --git a/zboxcore/sdk/upload_worker.go b/zboxcore/sdk/upload_worker.go index 285443c1e..ff6492882 100644 --- a/zboxcore/sdk/upload_worker.go +++ b/zboxcore/sdk/upload_worker.go @@ -9,12 +9,12 @@ import ( "strings" "github.com/0chain/common/core/util/wmpt" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/sys" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/fileref" - l "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/core/sys" + "github.com/0chain/gosdk_common/zboxcore/fileref" + l "github.com/0chain/gosdk_common/zboxcore/logger" "github.com/google/uuid" "go.uber.org/zap" ) diff --git a/zboxcore/sdk/writemarker_mutex.go b/zboxcore/sdk/writemarker_mutex.go index b0458f94c..221c9b5e1 100644 --- a/zboxcore/sdk/writemarker_mutex.go +++ b/zboxcore/sdk/writemarker_mutex.go @@ -10,10 +10,10 @@ import ( "time" "github.com/0chain/errors" - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/zboxcore/blockchain" - "github.com/0chain/gosdk/zboxcore/logger" "github.com/0chain/gosdk/zboxcore/zboxutil" + "github.com/0chain/gosdk_common/constants" + "github.com/0chain/gosdk_common/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/logger" ) type WMLockStatus int diff --git a/zboxcore/sdk/writemarker_mutex_test.go b/zboxcore/sdk/writemarker_mutex_test.go index 21af54bb6..e62f6f792 100644 --- a/zboxcore/sdk/writemarker_mutex_test.go +++ b/zboxcore/sdk/writemarker_mutex_test.go @@ -3,7 +3,6 @@ package sdk import ( "bytes" "context" - "github.com/0chain/gosdk/zboxcore/mocks" "io" "net/http" "strconv" @@ -12,7 +11,9 @@ import ( "testing" "time" - "github.com/0chain/gosdk/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/mocks" + + "github.com/0chain/gosdk_common/zboxcore/blockchain" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/stretchr/testify/mock" diff --git a/zboxcore/zboxutil/download_buffer.go b/zboxcore/zboxutil/download_buffer.go index 661fec10d..4623a4770 100644 --- a/zboxcore/zboxutil/download_buffer.go +++ b/zboxcore/zboxutil/download_buffer.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/0chain/gosdk/core/sys" + "github.com/0chain/gosdk_common/core/sys" "github.com/valyala/bytebufferpool" ) diff --git a/zboxcore/zboxutil/http.go b/zboxcore/zboxutil/http.go index d8a474fe0..55165ca94 100644 --- a/zboxcore/zboxutil/http.go +++ b/zboxcore/zboxutil/http.go @@ -16,9 +16,9 @@ import ( "github.com/hashicorp/golang-lru/v2/simplelru" "github.com/0chain/errors" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/logger" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/encryption" + "github.com/0chain/gosdk_common/core/logger" lru "github.com/hashicorp/golang-lru/v2" "github.com/hitenjain14/fasthttp" ) diff --git a/zboxcore/zboxutil/util.go b/zboxcore/zboxutil/util.go index 9241501c4..db5ee0937 100644 --- a/zboxcore/zboxutil/util.go +++ b/zboxcore/zboxutil/util.go @@ -19,7 +19,7 @@ import ( thrown "github.com/0chain/errors" "github.com/0chain/gosdk/zboxcore/allocationchange" - "github.com/0chain/gosdk/zboxcore/blockchain" + "github.com/0chain/gosdk_common/zboxcore/blockchain" "github.com/h2non/filetype" "github.com/hitenjain14/fasthttp" "github.com/lithammer/shortuuid/v3" diff --git a/zcnbridge/README.MD b/zcnbridge/README.MD deleted file mode 100644 index ecf6af832..000000000 --- a/zcnbridge/README.MD +++ /dev/null @@ -1,970 +0,0 @@ - - -# zcnbridge - -```go -import "github.com/0chain/gosdk/zcnbridge" -``` - -## Index - -- [Constants](<#constants>) -- [Variables](<#variables>) -- [func AccountExists\(homedir, address string\) bool](<#AccountExists>) -- [func ConfirmEthereumTransaction\(hash string, times int, duration time.Duration\) \(int, error\)](<#ConfirmEthereumTransaction>) -- [func ConvertIntToHex\(value int64\) string](<#ConvertIntToHex>) -- [func CreateKeyStorage\(homedir, password string\) error](<#CreateKeyStorage>) -- [func DeleteAccount\(homedir, address string\) bool](<#DeleteAccount>) -- [func EncodePackInt64\(key string, param int64\) common.Hash](<#EncodePackInt64>) -- [func GetAuthorizer\(id string, cb zcncore.GetInfoCallback\) \(err error\)](<#GetAuthorizer>) -- [func GetAuthorizers\(active bool, cb zcncore.GetInfoCallback\) \(err error\)](<#GetAuthorizers>) -- [func GetGlobalConfig\(cb zcncore.GetInfoCallback\) \(err error\)](<#GetGlobalConfig>) -- [func GetTransactionStatus\(hash string\) \(int, error\)](<#GetTransactionStatus>) -- [func ImportAccount\(homedir, mnemonic, password string, accountAddrIndex ...AccountAddressIndex\) \(string, error\)](<#ImportAccount>) -- [func ListStorageAccounts\(homedir string\) \[\]common.Address](<#ListStorageAccounts>) -- [type AccountAddressIndex](<#AccountAddressIndex>) -- [type AlchemyGasEstimationRequest](<#AlchemyGasEstimationRequest>) -- [type AuthorizerNode](<#AuthorizerNode>) -- [type AuthorizerNodesResponse](<#AuthorizerNodesResponse>) -- [type AuthorizerResponse](<#AuthorizerResponse>) -- [type BancorTokenDetails](<#BancorTokenDetails>) -- [type BridgeClient](<#BridgeClient>) - - [func NewBridgeClient\(bridgeAddress, tokenAddress, authorizersAddress, uniswapAddress, ethereumAddress, ethereumNodeURL, password string, gasLimit uint64, consensusThreshold float64, ethereumClient EthereumClient, transactionProvider transaction.TransactionProvider, keyStore KeyStore\) \*BridgeClient](<#NewBridgeClient>) - - [func SetupBridgeClientSDK\(cfg \*BridgeSDKConfig\) \*BridgeClient](<#SetupBridgeClientSDK>) - - [func \(b \*BridgeClient\) AddEthereumAuthorizer\(ctx context.Context, address common.Address\) \(\*types.Transaction, error\)](<#BridgeClient.AddEthereumAuthorizer>) - - [func \(b \*BridgeClient\) AddEthereumAuthorizers\(configDir string\)](<#BridgeClient.AddEthereumAuthorizers>) - - [func \(b \*BridgeClient\) ApproveUSDCSwap\(ctx context.Context, source uint64\) \(\*types.Transaction, error\)](<#BridgeClient.ApproveUSDCSwap>) - - [func \(b \*BridgeClient\) BurnWZCN\(ctx context.Context, amountTokens uint64\) \(\*types.Transaction, error\)](<#BridgeClient.BurnWZCN>) - - [func \(b \*BridgeClient\) BurnZCN\(ctx context.Context, amount, txnfee uint64\) \(transaction.Transaction, error\)](<#BridgeClient.BurnZCN>) - - [func \(b \*BridgeClient\) CreateSignedTransactionFromKeyStore\(client EthereumClient, gasLimitUnits uint64\) \*bind.TransactOpts](<#BridgeClient.CreateSignedTransactionFromKeyStore>) - - [func \(b \*BridgeClient\) EstimateBurnWZCNGasAmount\(ctx context.Context, from, to, amountTokens string\) \(float64, error\)](<#BridgeClient.EstimateBurnWZCNGasAmount>) - - [func \(b \*BridgeClient\) EstimateGasPrice\(ctx context.Context\) \(float64, error\)](<#BridgeClient.EstimateGasPrice>) - - [func \(b \*BridgeClient\) EstimateMintWZCNGasAmount\(ctx context.Context, from, to, zcnTransactionRaw, amountToken string, nonceRaw int64, signaturesRaw \[\]\[\]byte\) \(float64, error\)](<#BridgeClient.EstimateMintWZCNGasAmount>) - - [func \(b \*BridgeClient\) GetETHSwapAmount\(ctx context.Context, source uint64\) \(\*big.Int, error\)](<#BridgeClient.GetETHSwapAmount>) - - [func \(b \*BridgeClient\) GetTokenBalance\(\) \(\*big.Int, error\)](<#BridgeClient.GetTokenBalance>) - - [func \(b \*BridgeClient\) GetUserNonceMinted\(ctx context.Context, rawEthereumAddress string\) \(\*big.Int, error\)](<#BridgeClient.GetUserNonceMinted>) - - [func \(b \*BridgeClient\) IncreaseBurnerAllowance\(ctx context.Context, allowanceAmount uint64\) \(\*types.Transaction, error\)](<#BridgeClient.IncreaseBurnerAllowance>) - - [func \(b \*BridgeClient\) MintWZCN\(ctx context.Context, payload \*ethereum.MintPayload\) \(\*types.Transaction, error\)](<#BridgeClient.MintWZCN>) - - [func \(b \*BridgeClient\) MintZCN\(ctx context.Context, payload \*zcnsc.MintPayload\) \(string, error\)](<#BridgeClient.MintZCN>) - - [func \(b \*BridgeClient\) NFTConfigGetAddress\(ctx context.Context, key string\) \(string, string, error\)](<#BridgeClient.NFTConfigGetAddress>) - - [func \(b \*BridgeClient\) NFTConfigGetUint256\(ctx context.Context, key string, keyParam ...int64\) \(string, int64, error\)](<#BridgeClient.NFTConfigGetUint256>) - - [func \(b \*BridgeClient\) NFTConfigSetAddress\(ctx context.Context, key, address string\) \(\*types.Transaction, error\)](<#BridgeClient.NFTConfigSetAddress>) - - [func \(b \*BridgeClient\) NFTConfigSetUint256\(ctx context.Context, key string, value int64\) \(\*types.Transaction, error\)](<#BridgeClient.NFTConfigSetUint256>) - - [func \(b \*BridgeClient\) NFTConfigSetUint256Raw\(ctx context.Context, key common.Hash, value int64\) \(\*types.Transaction, error\)](<#BridgeClient.NFTConfigSetUint256Raw>) - - [func \(b \*BridgeClient\) QueryEthereumBurnEvents\(startNonce string\) \(\[\]\*ethereum.BurnEvent, error\)](<#BridgeClient.QueryEthereumBurnEvents>) - - [func \(b \*BridgeClient\) QueryEthereumMintPayload\(zchainBurnHash string\) \(\*ethereum.MintPayload, error\)](<#BridgeClient.QueryEthereumMintPayload>) - - [func \(b \*BridgeClient\) QueryZChainMintPayload\(ethBurnHash string\) \(\*zcnsc.MintPayload, error\)](<#BridgeClient.QueryZChainMintPayload>) - - [func \(b \*BridgeClient\) RemoveEthereumAuthorizer\(ctx context.Context, address common.Address\) \(\*types.Transaction, error\)](<#BridgeClient.RemoveEthereumAuthorizer>) - - [func \(b \*BridgeClient\) ResetUserNonceMinted\(ctx context.Context\) \(\*types.Transaction, error\)](<#BridgeClient.ResetUserNonceMinted>) - - [func \(b \*BridgeClient\) SignWithEthereumChain\(message string\) \(\[\]byte, error\)](<#BridgeClient.SignWithEthereumChain>) - - [func \(b \*BridgeClient\) SwapETH\(ctx context.Context, source uint64, target uint64\) \(\*types.Transaction, error\)](<#BridgeClient.SwapETH>) - - [func \(b \*BridgeClient\) SwapUSDC\(ctx context.Context, source uint64, target uint64\) \(\*types.Transaction, error\)](<#BridgeClient.SwapUSDC>) - - [func \(b \*BridgeClient\) VerifyZCNTransaction\(ctx context.Context, hash string\) \(transaction.Transaction, error\)](<#BridgeClient.VerifyZCNTransaction>) -- [type BridgeSDKConfig](<#BridgeSDKConfig>) -- [type DetailedAccount](<#DetailedAccount>) -- [type EthereumBurnEvents](<#EthereumBurnEvents>) - - [func \(r \*EthereumBurnEvents\) Data\(\) interface\{\}](<#EthereumBurnEvents.Data>) - - [func \(r \*EthereumBurnEvents\) Error\(\) error](<#EthereumBurnEvents.Error>) - - [func \(r \*EthereumBurnEvents\) GetAuthorizerID\(\) string](<#EthereumBurnEvents.GetAuthorizerID>) - - [func \(r \*EthereumBurnEvents\) SetAuthorizerID\(id string\)](<#EthereumBurnEvents.SetAuthorizerID>) -- [type EthereumClient](<#EthereumClient>) -- [type GasEstimationRequest](<#GasEstimationRequest>) -- [type GasPriceEstimationResult](<#GasPriceEstimationResult>) -- [type JobError](<#JobError>) - - [func \(e \*JobError\) MarshalJSON\(\) \(\[\]byte, error\)](<#JobError.MarshalJSON>) - - [func \(e \*JobError\) UnmarshalJSON\(buf \[\]byte\) error](<#JobError.UnmarshalJSON>) -- [type JobResult](<#JobResult>) -- [type JobStatus](<#JobStatus>) -- [type KeyStore](<#KeyStore>) - - [func NewKeyStore\(path string\) KeyStore](<#NewKeyStore>) -- [type ProofEthereumBurn](<#ProofEthereumBurn>) -- [type ProofZCNBurn](<#ProofZCNBurn>) - - [func \(r \*ProofZCNBurn\) Data\(\) interface\{\}](<#ProofZCNBurn.Data>) - - [func \(r \*ProofZCNBurn\) Error\(\) error](<#ProofZCNBurn.Error>) - - [func \(r \*ProofZCNBurn\) GetAuthorizerID\(\) string](<#ProofZCNBurn.GetAuthorizerID>) - - [func \(r \*ProofZCNBurn\) SetAuthorizerID\(id string\)](<#ProofZCNBurn.SetAuthorizerID>) -- [type WZCNBurnEvent](<#WZCNBurnEvent>) - - [func \(r \*WZCNBurnEvent\) Data\(\) interface\{\}](<#WZCNBurnEvent.Data>) - - [func \(r \*WZCNBurnEvent\) Error\(\) error](<#WZCNBurnEvent.Error>) - - [func \(r \*WZCNBurnEvent\) GetAuthorizerID\(\) string](<#WZCNBurnEvent.GetAuthorizerID>) - - [func \(r \*WZCNBurnEvent\) SetAuthorizerID\(id string\)](<#WZCNBurnEvent.SetAuthorizerID>) - - -## Constants - - - -```go -const ( - TenderlyProvider = iota - AlchemyProvider - UnknownProvider -) -``` - - - -```go -const ( - UniswapRouterAddress = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" - UsdcTokenAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" - WethTokenAddress = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" -) -``` - - - -```go -const ( - EthereumWalletStorageDir = "wallets" -) -``` - -## Variables - - - -```go -var ( - DefaultClientIDEncoder = func(id string) []byte { - result, err := hex.DecodeString(id) - if err != nil { - Logger.Fatal(err) - } - return result - } -) -``` - - - -```go -var Logger logger.Logger -``` - - -## func [AccountExists]() - -```go -func AccountExists(homedir, address string) bool -``` - -AccountExists checks if account exists - - -## func [ConfirmEthereumTransaction]() - -```go -func ConfirmEthereumTransaction(hash string, times int, duration time.Duration) (int, error) -``` - - - - -## func [ConvertIntToHex]() - -```go -func ConvertIntToHex(value int64) string -``` - -ConvertIntToHex converts given int value to hex string. - - -## func [CreateKeyStorage]() - -```go -func CreateKeyStorage(homedir, password string) error -``` - -CreateKeyStorage create, restore or unlock key storage - - -## func [DeleteAccount]() - -```go -func DeleteAccount(homedir, address string) bool -``` - -DeleteAccount deletes account from wallet - - -## func [EncodePackInt64]() - -```go -func EncodePackInt64(key string, param int64) common.Hash -``` - -EncodePackInt do abi.encodedPack\(string, int\), it is used for setting plan id for royalty - - -## func [GetAuthorizer]() - -```go -func GetAuthorizer(id string, cb zcncore.GetInfoCallback) (err error) -``` - -GetAuthorizer returned authorizer by ID - - -## func [GetAuthorizers]() - -```go -func GetAuthorizers(active bool, cb zcncore.GetInfoCallback) (err error) -``` - -GetAuthorizers Returns all or only active authorizers - - -## func [GetGlobalConfig]() - -```go -func GetGlobalConfig(cb zcncore.GetInfoCallback) (err error) -``` - -GetGlobalConfig Returns global config - - -## func [GetTransactionStatus]() - -```go -func GetTransactionStatus(hash string) (int, error) -``` - - - - -## func [ImportAccount]() - -```go -func ImportAccount(homedir, mnemonic, password string, accountAddrIndex ...AccountAddressIndex) (string, error) -``` - -ImportAccount imports account using mnemonic - - -## func [ListStorageAccounts]() - -```go -func ListStorageAccounts(homedir string) []common.Address -``` - -ListStorageAccounts List available accounts - - -## type [AccountAddressIndex]() - - - -```go -type AccountAddressIndex struct { - AccountIndex int - AddressIndex int - Bip32 bool -} -``` - - -## type [AlchemyGasEstimationRequest]() - -AlchemyGasEstimationRequest describes request used for Alchemy enhanced JSON\-RPC API. - -```go -type AlchemyGasEstimationRequest struct { - From string `json:"from"` - To string `json:"to"` - Value string `json:"value"` - Data string `json:"data"` -} -``` - - -## type [AuthorizerNode]() - - - -```go -type AuthorizerNode struct { - ID string `json:"id"` - URL string `json:"url"` -} -``` - - -## type [AuthorizerNodesResponse]() - - - -```go -type AuthorizerNodesResponse struct { - Nodes []*AuthorizerNode `json:"nodes"` -} -``` - - -## type [AuthorizerResponse]() - - - -```go -type AuthorizerResponse struct { - AuthorizerID string `json:"id"` - URL string `json:"url"` - - // Configuration - Fee common.Balance `json:"fee"` - - // Geolocation - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - - // Stats - LastHealthCheck int64 `json:"last_health_check"` - - // stake_pool_settings - DelegateWallet string `json:"delegate_wallet"` - MinStake common.Balance `json:"min_stake"` - MaxStake common.Balance `json:"max_stake"` - NumDelegates int `json:"num_delegates"` - ServiceCharge float64 `json:"service_charge"` -} -``` - - -## type [BancorTokenDetails]() - -BancorTokenDetails describes Bancor ZCN zcntoken pool details - -```go -type BancorTokenDetails struct { - Data struct { - Rate struct { - ETH string `json:"eth"` - BNT string `json:"bnt"` - USDC string `json:"usd"` - EURC string `json:"eur"` - } - } `json:"data"` -} -``` - - -## type [BridgeClient]() - - - -```go -type BridgeClient struct { - BridgeAddress, - TokenAddress, - AuthorizersAddress, - UniswapAddress, - NFTConfigAddress, - EthereumAddress, - EthereumNodeURL, - Password string - - BancorAPIURL string - - ConsensusThreshold float64 - GasLimit uint64 - // contains filtered or unexported fields -} -``` - - -### func [NewBridgeClient]() - -```go -func NewBridgeClient(bridgeAddress, tokenAddress, authorizersAddress, uniswapAddress, ethereumAddress, ethereumNodeURL, password string, gasLimit uint64, consensusThreshold float64, ethereumClient EthereumClient, transactionProvider transaction.TransactionProvider, keyStore KeyStore) *BridgeClient -``` - -NewBridgeClient creates BridgeClient with the given parameters. - - -### func [SetupBridgeClientSDK]() - -```go -func SetupBridgeClientSDK(cfg *BridgeSDKConfig) *BridgeClient -``` - -SetupBridgeClientSDK initializes new bridge client. Meant to be used from standalone application with 0chain SDK initialized. - - -### func \(\*BridgeClient\) [AddEthereumAuthorizer]() - -```go -func (b *BridgeClient) AddEthereumAuthorizer(ctx context.Context, address common.Address) (*types.Transaction, error) -``` - -AddEthereumAuthorizer Adds authorizer to Ethereum bridge. Only contract deployer can call this method - - -### func \(\*BridgeClient\) [AddEthereumAuthorizers]() - -```go -func (b *BridgeClient) AddEthereumAuthorizers(configDir string) -``` - - - - -### func \(\*BridgeClient\) [ApproveUSDCSwap]() - -```go -func (b *BridgeClient) ApproveUSDCSwap(ctx context.Context, source uint64) (*types.Transaction, error) -``` - -ApproveUSDCSwap provides opportunity to approve swap operation for ERC20 tokens - - -### func \(\*BridgeClient\) [BurnWZCN]() - -```go -func (b *BridgeClient) BurnWZCN(ctx context.Context, amountTokens uint64) (*types.Transaction, error) -``` - -BurnWZCN Burns WZCN tokens on behalf of the 0ZCN client amountTokens \- ZCN tokens clientID \- 0ZCN client ERC20 signature: "burn\(uint256,bytes\)" - - -### func \(\*BridgeClient\) [BurnZCN]() - -```go -func (b *BridgeClient) BurnZCN(ctx context.Context, amount, txnfee uint64) (transaction.Transaction, error) -``` - -BurnZCN burns ZCN tokens before conversion from ZCN to WZCN as a first step - - -### func \(\*BridgeClient\) [CreateSignedTransactionFromKeyStore]() - -```go -func (b *BridgeClient) CreateSignedTransactionFromKeyStore(client EthereumClient, gasLimitUnits uint64) *bind.TransactOpts -``` - - - - -### func \(\*BridgeClient\) [EstimateBurnWZCNGasAmount]() - -```go -func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to, amountTokens string) (float64, error) -``` - -EstimateBurnWZCNGasAmount performs gas amount estimation for the given wzcn burn transaction. - - -### func \(\*BridgeClient\) [EstimateGasPrice]() - -```go -func (b *BridgeClient) EstimateGasPrice(ctx context.Context) (float64, error) -``` - -EstimateGasPrice performs gas estimation for the given transaction. - - -### func \(\*BridgeClient\) [EstimateMintWZCNGasAmount]() - -```go -func (b *BridgeClient) EstimateMintWZCNGasAmount(ctx context.Context, from, to, zcnTransactionRaw, amountToken string, nonceRaw int64, signaturesRaw [][]byte) (float64, error) -``` - -EstimateMintWZCNGasAmount performs gas amount estimation for the given wzcn mint transaction. - - -### func \(\*BridgeClient\) [GetETHSwapAmount]() - -```go -func (b *BridgeClient) GetETHSwapAmount(ctx context.Context, source uint64) (*big.Int, error) -``` - -GetETHSwapAmount retrieves ETH swap amount from the given source. - - -### func \(\*BridgeClient\) [GetTokenBalance]() - -```go -func (b *BridgeClient) GetTokenBalance() (*big.Int, error) -``` - -GetTokenBalance returns balance of the current client for the zcntoken address - - -### func \(\*BridgeClient\) [GetUserNonceMinted]() - -```go -func (b *BridgeClient) GetUserNonceMinted(ctx context.Context, rawEthereumAddress string) (*big.Int, error) -``` - -GetUserNonceMinted Returns nonce for a specified Ethereum address - - -### func \(\*BridgeClient\) [IncreaseBurnerAllowance]() - -```go -func (b *BridgeClient) IncreaseBurnerAllowance(ctx context.Context, allowanceAmount uint64) (*types.Transaction, error) -``` - -IncreaseBurnerAllowance Increases allowance for bridge contract address to transfer ERC\-20 tokens on behalf of the zcntoken owner to the Burn TokenPool During the burn the script transfers amount from zcntoken owner to the bridge burn zcntoken pool Example: owner wants to burn some amount. The contract will transfer some amount from owner address to the pool. So the owner must call IncreaseAllowance of the WZCN zcntoken with 2 parameters: spender address which is the bridge contract and amount to be burned \(transferred\) Token signature: "increaseApproval\(address,uint256\)" - - -### func \(\*BridgeClient\) [MintWZCN]() - -```go -func (b *BridgeClient) MintWZCN(ctx context.Context, payload *ethereum.MintPayload) (*types.Transaction, error) -``` - -MintWZCN Mint ZCN tokens on behalf of the 0ZCN client payload: received from authorizers - - -### func \(\*BridgeClient\) [MintZCN]() - -```go -func (b *BridgeClient) MintZCN(ctx context.Context, payload *zcnsc.MintPayload) (string, error) -``` - -MintZCN mints ZCN tokens after receiving proof\-of\-burn of WZCN tokens - - -### func \(\*BridgeClient\) [NFTConfigGetAddress]() - -```go -func (b *BridgeClient) NFTConfigGetAddress(ctx context.Context, key string) (string, string, error) -``` - - - - -### func \(\*BridgeClient\) [NFTConfigGetUint256]() - -```go -func (b *BridgeClient) NFTConfigGetUint256(ctx context.Context, key string, keyParam ...int64) (string, int64, error) -``` - - - - -### func \(\*BridgeClient\) [NFTConfigSetAddress]() - -```go -func (b *BridgeClient) NFTConfigSetAddress(ctx context.Context, key, address string) (*types.Transaction, error) -``` - - - - -### func \(\*BridgeClient\) [NFTConfigSetUint256]() - -```go -func (b *BridgeClient) NFTConfigSetUint256(ctx context.Context, key string, value int64) (*types.Transaction, error) -``` - -NFTConfigSetUint256 call setUint256 method of NFTConfig contract - - -### func \(\*BridgeClient\) [NFTConfigSetUint256Raw]() - -```go -func (b *BridgeClient) NFTConfigSetUint256Raw(ctx context.Context, key common.Hash, value int64) (*types.Transaction, error) -``` - - - - -### func \(\*BridgeClient\) [QueryEthereumBurnEvents]() - -```go -func (b *BridgeClient) QueryEthereumBurnEvents(startNonce string) ([]*ethereum.BurnEvent, error) -``` - -QueryEthereumBurnEvents gets ethereum burn events - - -### func \(\*BridgeClient\) [QueryEthereumMintPayload]() - -```go -func (b *BridgeClient) QueryEthereumMintPayload(zchainBurnHash string) (*ethereum.MintPayload, error) -``` - -QueryEthereumMintPayload gets burn ticket and creates mint payload to be minted in the Ethereum chain zchainBurnHash \- Ethereum burn transaction hash - - -### func \(\*BridgeClient\) [QueryZChainMintPayload]() - -```go -func (b *BridgeClient) QueryZChainMintPayload(ethBurnHash string) (*zcnsc.MintPayload, error) -``` - -QueryZChainMintPayload gets burn ticket and creates mint payload to be minted in the ZChain ethBurnHash \- Ethereum burn transaction hash - - -### func \(\*BridgeClient\) [RemoveEthereumAuthorizer]() - -```go -func (b *BridgeClient) RemoveEthereumAuthorizer(ctx context.Context, address common.Address) (*types.Transaction, error) -``` - -RemoveEthereumAuthorizer Removes authorizer from Ethereum bridge. Only contract deployer can call this method - - -### func \(\*BridgeClient\) [ResetUserNonceMinted]() - -```go -func (b *BridgeClient) ResetUserNonceMinted(ctx context.Context) (*types.Transaction, error) -``` - -ResetUserNonceMinted Resets nonce for a specified Ethereum address - - -### func \(\*BridgeClient\) [SignWithEthereumChain]() - -```go -func (b *BridgeClient) SignWithEthereumChain(message string) ([]byte, error) -``` - -SignWithEthereumChain signs the digest with Ethereum chain signer taking key from the current user key storage - - -### func \(\*BridgeClient\) [SwapETH]() - -```go -func (b *BridgeClient) SwapETH(ctx context.Context, source uint64, target uint64) (*types.Transaction, error) -``` - -SwapETH provides opportunity to perform zcn token swap operation using ETH as source token. - - -### func \(\*BridgeClient\) [SwapUSDC]() - -```go -func (b *BridgeClient) SwapUSDC(ctx context.Context, source uint64, target uint64) (*types.Transaction, error) -``` - -SwapUSDC provides opportunity to perform zcn token swap operation using USDC as source token. - - -### func \(\*BridgeClient\) [VerifyZCNTransaction]() - -```go -func (b *BridgeClient) VerifyZCNTransaction(ctx context.Context, hash string) (transaction.Transaction, error) -``` - -VerifyZCNTransaction verifies 0CHain transaction - - -## type [BridgeSDKConfig]() - - - -```go -type BridgeSDKConfig struct { - LogLevel *string - LogPath *string - ConfigChainFile *string - ConfigDir *string - Development *bool -} -``` - - -## type [DetailedAccount]() - -DetailedAccount describes detailed account - -```go -type DetailedAccount struct { - EthereumAddress, - PublicKey, - PrivateKey accounts.Account -} -``` - - -## type [EthereumBurnEvents]() - -EthereumBurnEvents represents burn events returned by authorizers - -```go -type EthereumBurnEvents struct { - AuthorizerID string `json:"authorizer_id,omitempty"` - BurnEvents []struct { - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - TransactionHash string `json:"transaction_hash"` - } `json:"burn_events"` -} -``` - - -### func \(\*EthereumBurnEvents\) [Data]() - -```go -func (r *EthereumBurnEvents) Data() interface{} -``` - - - - -### func \(\*EthereumBurnEvents\) [Error]() - -```go -func (r *EthereumBurnEvents) Error() error -``` - - - - -### func \(\*EthereumBurnEvents\) [GetAuthorizerID]() - -```go -func (r *EthereumBurnEvents) GetAuthorizerID() string -``` - - - - -### func \(\*EthereumBurnEvents\) [SetAuthorizerID]() - -```go -func (r *EthereumBurnEvents) SetAuthorizerID(id string) -``` - - - - -## type [EthereumClient]() - -EthereumClient describes Ethereum JSON\-RPC client generealized interface - -```go -type EthereumClient interface { - bind.ContractBackend - - ChainID(ctx context.Context) (*big.Int, error) -} -``` - - -## type [GasEstimationRequest]() - -GasEstimationRequest describes request used for Alchemy enhanced JSON\-RPC API. - -```go -type GasEstimationRequest struct { - From string `json:"from"` - To string `json:"to"` - Value string `json:"value"` -} -``` - - -## type [GasPriceEstimationResult]() - -GasPriceEstimationResult represents result of the gas price estimation operation execution. - -```go -type GasPriceEstimationResult struct { - Value float64 `json:"value"` -} -``` - - -## type [JobError]() - -JobError result of internal request wrapped in authorizer job - -```go -type JobError struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*JobError\) [MarshalJSON]() - -```go -func (e *JobError) MarshalJSON() ([]byte, error) -``` - - - - -### func \(\*JobError\) [UnmarshalJSON]() - -```go -func (e *JobError) UnmarshalJSON(buf []byte) error -``` - - - - -## type [JobResult]() - -JobResult = Authorizer task result, it wraps actual result of the query inside authorizer - -```go -type JobResult interface { - // Error = Status of Authorizer job on authorizer server - Error() error - // Data returns the actual result - Data() interface{} - // SetAuthorizerID Assigns authorizer ID to the Job - SetAuthorizerID(ID string) - // GetAuthorizerID returns authorizer ID - GetAuthorizerID() string -} -``` - - -## type [JobStatus]() - -JobStatus = Ethereum transaction status - -```go -type JobStatus uint -``` - - -## type [KeyStore]() - -KeyStore is a wrapper, which exposes Ethereum KeyStore methods used by DEX bridge. - -```go -type KeyStore interface { - Find(accounts.Account) (accounts.Account, error) - TimedUnlock(accounts.Account, string, time.Duration) error - SignHash(account accounts.Account, hash []byte) ([]byte, error) - GetEthereumKeyStore() *keystore.KeyStore -} -``` - - -### func [NewKeyStore]() - -```go -func NewKeyStore(path string) KeyStore -``` - -NewKeyStore creates new KeyStore wrapper instance - - -## type [ProofEthereumBurn]() - -ProofEthereumBurn Authorizer returns this type for Ethereum transaction - -```go -type ProofEthereumBurn struct { - TxnID string `json:"ethereum_txn_id"` - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - ReceivingClientID string `json:"receiving_client_id"` // 0ZCN address - Signature string `json:"signature"` -} -``` - - -## type [ProofZCNBurn]() - -ProofZCNBurn Authorizer returns this type for ZCN transaction - -```go -type ProofZCNBurn struct { - AuthorizerID string `json:"authorizer_id,omitempty"` - TxnID string `json:"0chain_txn_id"` - To string `json:"to"` - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - Signature []byte `json:"signature"` -} -``` - - -### func \(\*ProofZCNBurn\) [Data]() - -```go -func (r *ProofZCNBurn) Data() interface{} -``` - - - - -### func \(\*ProofZCNBurn\) [Error]() - -```go -func (r *ProofZCNBurn) Error() error -``` - - - - -### func \(\*ProofZCNBurn\) [GetAuthorizerID]() - -```go -func (r *ProofZCNBurn) GetAuthorizerID() string -``` - - - - -### func \(\*ProofZCNBurn\) [SetAuthorizerID]() - -```go -func (r *ProofZCNBurn) SetAuthorizerID(id string) -``` - - - - -## type [WZCNBurnEvent]() - -WZCNBurnEvent returned from burn ticket handler of: /v1/ether/burnticket/get - -```go -type WZCNBurnEvent struct { - // AuthorizerID Authorizer ID - AuthorizerID string `json:"authorizer_id,omitempty"` - // BurnTicket Returns burn ticket - BurnTicket *ProofEthereumBurn `json:"ticket,omitempty"` - // Err gives error of job on server side - Err *JobError `json:"err,omitempty"` - // Status gives job status on server side (authoriser) - Status JobStatus `json:"status,omitempty"` -} -``` - - -### func \(\*WZCNBurnEvent\) [Data]() - -```go -func (r *WZCNBurnEvent) Data() interface{} -``` - - - - -### func \(\*WZCNBurnEvent\) [Error]() - -```go -func (r *WZCNBurnEvent) Error() error -``` - - - - -### func \(\*WZCNBurnEvent\) [GetAuthorizerID]() - -```go -func (r *WZCNBurnEvent) GetAuthorizerID() string -``` - - - - -### func \(\*WZCNBurnEvent\) [SetAuthorizerID]() - -```go -func (r *WZCNBurnEvent) SetAuthorizerID(id string) -``` - - - -Generated by [gomarkdoc]() diff --git a/zcnbridge/authorizer/doc.go b/zcnbridge/authorizer/doc.go deleted file mode 100644 index 1f6be900b..000000000 --- a/zcnbridge/authorizer/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Methods and types to interact with the authorizer nodes. -// Authorizer nodes are the nodes that authorize the burn operations, whether on to be able to perform corresponding mint operations. -package authorizer \ No newline at end of file diff --git a/zcnbridge/authorizer/proofBurnTicket.go b/zcnbridge/authorizer/proofBurnTicket.go deleted file mode 100644 index 706687d64..000000000 --- a/zcnbridge/authorizer/proofBurnTicket.go +++ /dev/null @@ -1,88 +0,0 @@ -package authorizer - -import ( - "encoding/json" - "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/zcncrypto" - - "github.com/0chain/gosdk/zcnbridge" - - "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/zcnbridge/errors" -) - -type ProofOfBurn struct { - TxnID string `json:"0chain_txn_id"` - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - EthereumAddress string `json:"ethereum_address"` - Signature []byte `json:"signature,omitempty"` -} - -func (pb *ProofOfBurn) Encode() []byte { - return encryption.RawHash(pb) -} - -func (pb *ProofOfBurn) Decode(input []byte) error { - return json.Unmarshal(input, pb) -} - -func (pb *ProofOfBurn) Verify() (err error) { - switch { - case pb.TxnID == "": - err = errors.NewError("failed to verify proof of burn ticket", "0chain txn id is required") - case pb.Nonce == 0: - err = errors.NewError("failed to verify proof of burn ticket", "Nonce is required") - case pb.Amount == 0: - err = errors.NewError("failed to verify proof of burn ticket", "Amount is required") - case pb.EthereumAddress == "": - err = errors.NewError("failed to verify proof of burn ticket", "Receiving client id is required") - } - return -} - -func (pb *ProofOfBurn) UnsignedMessage() string { - return fmt.Sprintf("%v:%v:%v:%v", pb.TxnID, pb.Amount, pb.Nonce, pb.EthereumAddress) -} - -func (pb *ProofOfBurn) SignWithEthereum(b *zcnbridge.BridgeClient) (err error) { - sig, err := b.SignWithEthereumChain(pb.UnsignedMessage()) - if err != nil { - return errors.Wrap("signature_ethereum", "failed to sign proof-of-burn ticket", err) - } - pb.Signature = sig - - return -} - -// Sign can sign if chain config is initialized -func (pb *ProofOfBurn) Sign() (err error) { - hash := zcncrypto.Sha3Sum256(pb.UnsignedMessage()) - sig, err := client.Sign(hash) - if err != nil { - return errors.Wrap("signature_0chain", "failed to sign proof-of-burn ticket using walletString ID ", err) - } - pb.Signature = []byte(sig) - - return -} - -// SignWith0Chain can sign with the provided walletString -func (pb *ProofOfBurn) SignWith0Chain(w *zcncrypto.Wallet) (err error) { - hash := zcncrypto.Sha3Sum256(pb.UnsignedMessage()) - config, err := conf.GetClientConfig() - - if err != nil { - return errors.Wrap("signature_0chain", "failed to get client config", err) - } - - sig, err := w.Sign(hash, config.SignatureScheme) - if err != nil { - return errors.Wrap("signature_0chain", "failed to sign proof-of-burn ticket using walletString ID "+w.ClientID, err) - } - pb.Signature = []byte(sig) - - return -} diff --git a/zcnbridge/authorizer/proofBurnTicket_test.go b/zcnbridge/authorizer/proofBurnTicket_test.go deleted file mode 100644 index 1bf7aac01..000000000 --- a/zcnbridge/authorizer/proofBurnTicket_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package authorizer_test - -import ( - "encoding/json" - "testing" - - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zcnbridge/authorizer" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" -) - -const walletString = `{ - "client_id": "39ac4c04401762778de45d00c51934b2ff15d8168722585daa422195a1ebc5d5", - "client_key": "9cf22d230343a68a149a2ccea1137846dd6d0fe653985eb8bebfbe2583ab0e1e2281b78218f480a50cac78cd0c716c3aafa8d741af813a94ca0a5b4e0b8e7a22", - "keys": [ - { - "public_key": "9cf22d230343a68a149a2ccea1137846dd6d0fe653985eb8bebfbe2583ab0e1e2281b78218f480a50cac78cd0c716c3aafa8d741af813a94ca0a5b4e0b8e7a22", - "private_key": "9c6c9022bdbd05670c07eae339dbb5491b1c035c2287a83c56581c505b824623" - } - ], - "mnemonics": "fortune guitar marine bachelor ocean raven hunt silver pass hurt industry forget cradle shuffle render used used order chat shallow aerobic cry exercise junior", - "version": "1.0", - "date_created": "2022-07-17T16:12:25+05:00", - "nonce": 0 -} -` - -type TicketTestSuite struct { - suite.Suite - w *zcncrypto.Wallet -} - -func TestTicketTestSuite(t *testing.T) { - suite.Run(t, new(TicketTestSuite)) -} - -func (suite *TicketTestSuite) SetupTest() { - w := &zcncrypto.Wallet{} - err := json.Unmarshal([]byte(walletString), w) - require.NoError(suite.T(), err) - suite.w = w -} - -func (suite *TicketTestSuite) TestBasicSignature() { - hash := zcncrypto.Sha3Sum256("test") - signScheme := zcncrypto.NewSignatureScheme("bls0chain") - err := signScheme.SetPrivateKey(suite.w.Keys[0].PrivateKey) - require.NoError(suite.T(), err) - sign, err := signScheme.Sign(hash) - require.NoError(suite.T(), err) - require.NotEmpty(suite.T(), sign) -} - -func (suite *TicketTestSuite) TestTicketSignature() { - pb := &authorizer.ProofOfBurn{ - TxnID: "TxnID", - Nonce: 100, - Amount: 10, - EthereumAddress: "0xBEEF", - Signature: nil, - } - - conf.InitClientConfig(&conf.Config{ - SignatureScheme: constants.BLS0CHAIN.String(), - }) - err := pb.SignWith0Chain(suite.w) - require.NoError(suite.T(), err) - require.NotEmpty(suite.T(), pb.Signature) -} diff --git a/zcnbridge/authorizer_response.go b/zcnbridge/authorizer_response.go deleted file mode 100644 index 2253b3439..000000000 --- a/zcnbridge/authorizer_response.go +++ /dev/null @@ -1,124 +0,0 @@ -package zcnbridge - -import ( - "encoding/json" - "errors" -) - -type ( - // JobStatus = Ethereum transaction status - JobStatus uint - // JobResult = Authorizer task result, it wraps actual result of the query inside authorizer - JobResult interface { - // Error = Status of Authorizer job on authorizer server - Error() error - // Data returns the actual result - Data() interface{} - // SetAuthorizerID Assigns authorizer ID to the Job - SetAuthorizerID(ID string) - // GetAuthorizerID returns authorizer ID - GetAuthorizerID() string - } - // JobError result of internal request wrapped in authorizer job - JobError struct { - error - } - - // EthereumBurnEvents represents burn events returned by authorizers - EthereumBurnEvents struct { - AuthorizerID string `json:"authorizer_id,omitempty"` - BurnEvents []struct { - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - TransactionHash string `json:"transaction_hash"` - } `json:"burn_events"` - } - - // ProofEthereumBurn Authorizer returns this type for Ethereum transaction - ProofEthereumBurn struct { - TxnID string `json:"ethereum_txn_id"` - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - ReceivingClientID string `json:"receiving_client_id"` // 0ZCN address - Signature string `json:"signature"` - } - - // ProofZCNBurn Authorizer returns this type for ZCN transaction - ProofZCNBurn struct { - AuthorizerID string `json:"authorizer_id,omitempty"` - TxnID string `json:"0chain_txn_id"` - To string `json:"to"` - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - Signature []byte `json:"signature"` - } -) - -func (e *JobError) UnmarshalJSON(buf []byte) error { - e.error = errors.New(string(buf)) - return nil -} - -func (e *JobError) MarshalJSON() ([]byte, error) { - return json.Marshal(e.Error()) -} - -// WZCNBurnEvent returned from burn ticket handler of: /v1/ether/burnticket/get -type WZCNBurnEvent struct { - // AuthorizerID Authorizer ID - AuthorizerID string `json:"authorizer_id,omitempty"` - // BurnTicket Returns burn ticket - BurnTicket *ProofEthereumBurn `json:"ticket,omitempty"` - // Err gives error of job on server side - Err *JobError `json:"err,omitempty"` - // Status gives job status on server side (authoriser) - Status JobStatus `json:"status,omitempty"` -} - -func (r *WZCNBurnEvent) GetAuthorizerID() string { - return r.AuthorizerID -} - -func (r *WZCNBurnEvent) SetAuthorizerID(id string) { - r.AuthorizerID = id -} - -func (r *WZCNBurnEvent) Error() error { - return r.Err -} - -func (r *WZCNBurnEvent) Data() interface{} { - return r.BurnTicket -} - -func (r *EthereumBurnEvents) GetAuthorizerID() string { - return r.AuthorizerID -} - -func (r *EthereumBurnEvents) SetAuthorizerID(id string) { - r.AuthorizerID = id -} - -func (r *EthereumBurnEvents) Error() error { - return nil -} - -func (r *EthereumBurnEvents) Data() interface{} { - return r -} - -func (r *ProofZCNBurn) GetAuthorizerID() string { - return r.AuthorizerID -} - -func (r *ProofZCNBurn) SetAuthorizerID(id string) { - r.AuthorizerID = id -} - -func (r *ProofZCNBurn) Error() error { - return nil -} - -func (r *ProofZCNBurn) Data() interface{} { - return r -} diff --git a/zcnbridge/authorizers_query.go b/zcnbridge/authorizers_query.go deleted file mode 100644 index ffd1b04ce..000000000 --- a/zcnbridge/authorizers_query.go +++ /dev/null @@ -1,351 +0,0 @@ -package zcnbridge - -import ( - "encoding/json" - "fmt" - coreClient "github.com/0chain/gosdk/core/client" - "io" - "math" - "net/http" - "strings" - "sync" - - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zcnbridge/errors" - "github.com/0chain/gosdk/zcnbridge/ethereum" - h "github.com/0chain/gosdk/zcnbridge/http" - "github.com/0chain/gosdk/zcnbridge/log" - "github.com/0chain/gosdk/zcnbridge/wallet" - "github.com/0chain/gosdk/zcnbridge/zcnsc" - "go.uber.org/zap" -) - -type ( - // authorizerResponse is HTTP client response event - authorizerResponse struct { - // AuthorizerID is authorizer where the job was performed - AuthorizerID string - // event is server job event - event JobResult - // error describes an error occurred during event processing on client side during the call to server - error - } - - requestHandler struct { - path string - values map[string]string - bodyDecoder func([]byte) (JobResult, error) - } - - responseChannelType chan *authorizerResponse - eventsChannelType chan []JobResult -) - -var ( - client *http.Client -) - -// QueryEthereumMintPayload gets burn ticket and creates mint payload to be minted in the Ethereum chain -// zchainBurnHash - Ethereum burn transaction hash -func (b *BridgeClient) QueryEthereumMintPayload(zchainBurnHash string) (*ethereum.MintPayload, error) { - client = h.CleanClient() - authorizers, err := getAuthorizers(true) - - if err != nil || len(authorizers) == 0 { - return nil, errors.Wrap("get_authorizers", "failed to get authorizers", err) - } - - var ( - totalWorkers = len(authorizers) - values = map[string]string{ - "hash": zchainBurnHash, - } - ) - - handler := &requestHandler{ - path: wallet.BurnNativeTicketPath, - values: values, - bodyDecoder: func(body []byte) (JobResult, error) { - ev := &ProofZCNBurn{} - err := json.Unmarshal(body, ev) - return ev, err - }, - } - - thresh := b.ConsensusThreshold - results := queryAllAuthorizers(authorizers, handler) - numSuccess := len(results) - quorum := math.Ceil((float64(numSuccess) * 100) / float64(totalWorkers)) - - if numSuccess > 0 && quorum >= thresh { - burnTicket, ok := results[0].(*ProofZCNBurn) - if !ok { - return nil, errors.Wrap("type_cast", "failed to convert to *proofEthereumBurn", err) - } - - var sigs []*ethereum.AuthorizerSignature - for _, result := range results { - ticket := result.(*ProofZCNBurn) - sig := ðereum.AuthorizerSignature{ - ID: ticket.GetAuthorizerID(), - Signature: ticket.Signature, - } - sigs = append(sigs, sig) - } - - payload := ðereum.MintPayload{ - ZCNTxnID: burnTicket.TxnID, - Amount: burnTicket.Amount, - To: burnTicket.To, - Nonce: burnTicket.Nonce, - Signatures: sigs, - } - - return payload, nil - } - - text := fmt.Sprintf("failed to reach the quorum. #Success: %d from #Total: %d", numSuccess, totalWorkers) - return nil, errors.New("get_burn_ticket", text) -} - -// QueryEthereumBurnEvents gets ethereum burn events -func (b *BridgeClient) QueryEthereumBurnEvents(startNonce string) ([]*ethereum.BurnEvent, error) { - client = h.CleanClient() - authorizers, err := getAuthorizers(true) - - if err != nil || len(authorizers) == 0 { - return nil, errors.Wrap("get_authorizers", "failed to get authorizers", err) - } - - var ( - totalWorkers = len(authorizers) - values = map[string]string{ - "clientid": coreClient.Id(), - "ethereumaddress": b.EthereumAddress, - "startnonce": startNonce, - } - ) - - handler := &requestHandler{ - path: wallet.BurnWzcnBurnEventsPath, - values: values, - bodyDecoder: func(body []byte) (JobResult, error) { - ev := &EthereumBurnEvents{} - err := json.Unmarshal(body, ev) - return ev, err - }, - } - - thresh := b.ConsensusThreshold - results := queryAllAuthorizers(authorizers, handler) - numSuccess := len(results) - quorum := math.Ceil((float64(numSuccess) * 100) / float64(totalWorkers)) - - if numSuccess > 0 && quorum >= thresh { - burnEvents, ok := results[0].(*EthereumBurnEvents) - if !ok { - return nil, errors.Wrap("type_cast", "failed to convert to *ethereumBurnEvents", err) - } - - result := make([]*ethereum.BurnEvent, 0) - - for _, burnEvent := range burnEvents.BurnEvents { - result = append(result, ðereum.BurnEvent{ - Nonce: burnEvent.Nonce, - Amount: burnEvent.Amount, - TransactionHash: burnEvent.TransactionHash, - }) - } - - return result, nil - } - - text := fmt.Sprintf("failed to reach the quorum. #Success: %d from #Total: %d", numSuccess, totalWorkers) - return nil, errors.New("get_burn_events", text) -} - -// QueryZChainMintPayload gets burn ticket and creates mint payload to be minted in the ZChain -// ethBurnHash - Ethereum burn transaction hash -func (b *BridgeClient) QueryZChainMintPayload(ethBurnHash string) (*zcnsc.MintPayload, error) { - client = h.CleanClient() - authorizers, err := getAuthorizers(true) - log.Logger.Info("Got authorizers", zap.Int("amount", len(authorizers))) - - if err != nil || len(authorizers) == 0 { - return nil, errors.Wrap("get_authorizers", "failed to get authorizers", err) - } - - var ( - totalWorkers = len(authorizers) - values = map[string]string{ - "hash": ethBurnHash, - "clientid": coreClient.Id(), - } - ) - - handler := &requestHandler{ - path: wallet.BurnWzcnTicketPath, - values: values, - bodyDecoder: func(body []byte) (JobResult, error) { - ev := &WZCNBurnEvent{} - err := json.Unmarshal(body, ev) - return ev, err - }, - } - - thresh := b.ConsensusThreshold - results := queryAllAuthorizers(authorizers, handler) - numSuccess := len(results) - quorum := math.Ceil((float64(numSuccess) * 100) / float64(totalWorkers)) - - if numSuccess > 0 && quorum >= thresh { - burnTicket, ok := results[0].Data().(*ProofEthereumBurn) - if !ok { - return nil, errors.Wrap("type_cast", "failed to convert to *proofEthereumBurn", err) - } - - var sigs []*zcnsc.AuthorizerSignature - for _, result := range results { - ticket := result.Data().(*ProofEthereumBurn) - sig := &zcnsc.AuthorizerSignature{ - ID: result.GetAuthorizerID(), - Signature: ticket.Signature, - } - sigs = append(sigs, sig) - } - - payload := &zcnsc.MintPayload{ - EthereumTxnID: burnTicket.TxnID, - Amount: common.Balance(burnTicket.Amount), - Nonce: burnTicket.Nonce, - Signatures: sigs, - ReceivingClientID: burnTicket.ReceivingClientID, - } - - return payload, nil - } - - text := fmt.Sprintf("failed to reach the quorum. #Success: %d from #Total: %d", numSuccess, totalWorkers) - return nil, errors.New("get_burn_ticket", text) -} - -func queryAllAuthorizers(authorizers []*AuthorizerNode, handler *requestHandler) []JobResult { - var ( - totalWorkers = len(authorizers) - eventsChannel = make(eventsChannelType) - responseChannel = make(responseChannelType, totalWorkers) - ) - defer close(eventsChannel) - - var wg sync.WaitGroup - - for _, authorizer := range authorizers { - wg.Add(1) - go queryAuthorizer(authorizer, handler, responseChannel) - } - - go handleResponse(responseChannel, eventsChannel, &wg) - - wg.Wait() - close(responseChannel) - results := <-eventsChannel - - return results -} - -func handleResponse(responseChannel responseChannelType, eventsChannel eventsChannelType, wg *sync.WaitGroup) { - var events []JobResult - for job := range responseChannel { - if job.error == nil { - event := job.event - event.SetAuthorizerID(job.AuthorizerID) - events = append(events, event) - } - wg.Done() - } - eventsChannel <- events -} - -func queryAuthorizer(au *AuthorizerNode, request *requestHandler, responseChannel responseChannelType) { - Logger.Info("Query from authorizer", zap.String("ID", au.ID), zap.String("URL", au.URL)) - ticketURL := strings.TrimSuffix(au.URL, "/") + request.path - - req, err := http.NewRequest("GET", ticketURL, nil) - if err != nil { - log.Logger.Error("failed to create request", zap.Error(err)) - return - } - - q := req.URL.Query() - for k, v := range request.values { - q.Add(k, v) - } - req.URL.RawQuery = q.Encode() - Logger.Info(req.URL.String()) - resp, body := readResponse(client.Do(req)) - resp.AuthorizerID = au.ID - - if resp.error != nil { - Logger.Error( - "failed to process response", - zap.Error(resp.error), - zap.String("node.id", au.ID), - zap.String("node.url", au.URL), - ) - } - - event, errEvent := request.bodyDecoder(body) - event.SetAuthorizerID(au.ID) - - if errEvent != nil { - err := errors.Wrap("decode_message_body", "failed to decode message body", errEvent) - log.Logger.Error( - "failed to decode event body", - zap.Error(err), - zap.String("node.id", au.ID), - zap.String("node.url", au.URL), - zap.String("body", string(body)), - ) - } - - resp.event = event - - responseChannel <- resp -} - -func readResponse(response *http.Response, err error) (res *authorizerResponse, body []byte) { - res = &authorizerResponse{} - if err != nil { - err = errors.Wrap("authorizer_post_process", "failed to call the authorizer", err) - Logger.Error("request response error", zap.Error(err)) - } - - if response == nil { - res.error = err - Logger.Error("response is empty", zap.Error(err)) - return res, nil - } - - if response.StatusCode >= 400 { - err = errors.Wrap("authorizer_post_process", fmt.Sprintf("error %d", response.StatusCode), err) - Logger.Error("request response status", zap.Error(err)) - } - - body, er := io.ReadAll(response.Body) - log.Logger.Debug("response", zap.String("response", string(body))) - defer response.Body.Close() - - if er != nil || len(body) == 0 { - var errstrings []string - er = errors.Wrap("authorizer_post_process", "failed to read body", er) - if err != nil { - errstrings = append(errstrings, err.Error()) - } - errstrings = append(errstrings, er.Error()) - err = fmt.Errorf(strings.Join(errstrings, ":")) - } - - res.error = err - - return res, body -} diff --git a/zcnbridge/bridge.go b/zcnbridge/bridge.go deleted file mode 100644 index fd3f0eeed..000000000 --- a/zcnbridge/bridge.go +++ /dev/null @@ -1,1157 +0,0 @@ -package zcnbridge - -import ( - "context" - "encoding/hex" - "fmt" - coreClient "github.com/0chain/gosdk/core/client" - "math/big" - "strings" - "time" - - "github.com/0chain/gosdk/zcnbridge/ethereum/uniswapnetwork" - "github.com/0chain/gosdk/zcnbridge/ethereum/uniswaprouter" - - "github.com/ybbus/jsonrpc/v3" - - "github.com/0chain/gosdk/zcnbridge/ethereum/zcntoken" - hdw "github.com/0chain/gosdk/zcncore/ethhdwallet" - "github.com/spf13/viper" - - "gopkg.in/natefinch/lumberjack.v2" - - "github.com/0chain/gosdk/core/logger" - coreTransaction "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/zcnbridge/ethereum" - "github.com/0chain/gosdk/zcnbridge/ethereum/authorizers" - "github.com/0chain/gosdk/zcnbridge/ethereum/bridge" - "github.com/0chain/gosdk/zcnbridge/ethereum/nftconfig" - "github.com/0chain/gosdk/zcnbridge/wallet" - "github.com/0chain/gosdk/zcnbridge/zcnsc" - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/pkg/errors" - "go.uber.org/zap" -) - -var Logger logger.Logger -var defaultLogLevel = logger.DEBUG - -func init() { - Logger.Init(defaultLogLevel, "zcnbridge-sdk") - - Logger.SetLevel(logger.DEBUG) - ioWriter := &lumberjack.Logger{ - Filename: "bridge.log", - MaxSize: 100, // MB - MaxBackups: 5, // number of backups - MaxAge: 28, //days - LocalTime: false, - Compress: false, // disabled by default - } - Logger.SetLogFile(ioWriter, true) -} - -var ( - DefaultClientIDEncoder = func(id string) []byte { - result, err := hex.DecodeString(id) - if err != nil { - Logger.Fatal(err) - } - return result - } -) - -// CreateSignedTransactionFromKeyStore creates signed transaction from key store -// - client - Ethereum client -// - gasLimitUnits - gas limit in units -func (b *BridgeClient) CreateSignedTransactionFromKeyStore(client EthereumClient, gasLimitUnits uint64) *bind.TransactOpts { - var ( - signerAddress = common.HexToAddress(b.EthereumAddress) - password = b.Password - ) - - signer := accounts.Account{ - Address: signerAddress, - } - - signerAcc, err := b.keyStore.Find(signer) - if err != nil { - Logger.Fatal(errors.Wrapf(err, "signer: %s", signerAddress.Hex())) - } - - chainID, err := client.ChainID(context.Background()) - if err != nil { - Logger.Fatal(errors.Wrap(err, "failed to get chain ID")) - } - - nonce, err := client.PendingNonceAt(context.Background(), signerAddress) - if err != nil { - Logger.Fatal(err) - } - - gasPriceWei, err := client.SuggestGasPrice(context.Background()) - if err != nil { - Logger.Fatal(err) - } - - err = b.keyStore.TimedUnlock(signer, password, time.Second*2) - if err != nil { - Logger.Fatal(err) - } - - opts, err := bind.NewKeyStoreTransactorWithChainID(b.keyStore.GetEthereumKeyStore(), signerAcc, chainID) - if err != nil { - Logger.Fatal(err) - } - - opts.Nonce = big.NewInt(int64(nonce)) - opts.GasLimit = gasLimitUnits // in units - opts.GasPrice = gasPriceWei // wei - - return opts -} - -// AddEthereumAuthorizer Adds authorizer to Ethereum bridge. Only contract deployer can call this method -// - ctx go context instance to run the transaction -// - address Ethereum address of the authorizer -func (b *BridgeClient) AddEthereumAuthorizer(ctx context.Context, address common.Address) (*types.Transaction, error) { - instance, transactOpts, err := b.prepareAuthorizers(ctx, "addAuthorizers", address) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - tran, err := instance.AddAuthorizers(transactOpts, address) - if err != nil { - msg := "failed to execute AddAuthorizers transaction to Id = %s with amount = %s" - return nil, errors.Wrapf(err, msg, coreClient.Id(), address.String()) - } - - return tran, err -} - -// RemoveEthereumAuthorizer Removes authorizer from Ethereum bridge. Only contract deployer can call this method -// - ctx go context instance to run the transaction -// - address Ethereum address of the authorizer -func (b *BridgeClient) RemoveEthereumAuthorizer(ctx context.Context, address common.Address) (*types.Transaction, error) { - instance, transactOpts, err := b.prepareAuthorizers(ctx, "removeAuthorizers", address) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - tran, err := instance.RemoveAuthorizers(transactOpts, address) - if err != nil { - msg := "failed to execute RemoveAuthorizers transaction to Id = %s with amount = %s" - return nil, errors.Wrapf(err, msg, coreClient.Id(), address.String()) - } - - return tran, err -} - -// AddEthereumAuthorizers add bridge authorizers to the Ethereum authorizers contract -// - configDir - configuration directory -func (b *BridgeClient) AddEthereumAuthorizers(configDir string) { - cfg := viper.New() - cfg.AddConfigPath(configDir) - cfg.SetConfigName("authorizers") - if err := cfg.ReadInConfig(); err != nil { - fmt.Println(err) - return - } - - mnemonics := cfg.GetStringSlice("authorizers") - - for _, mnemonic := range mnemonics { - wallet, err := hdw.NewFromMnemonic(mnemonic) - if err != nil { - fmt.Printf("failed to read mnemonic: %v", err) - continue - } - - pathD := hdw.MustParseDerivationPath("m/44'/60'/0'/0/0") - account, err := wallet.Derive(pathD, true) - if err != nil { - fmt.Println(err) - continue - } - - transaction, err := b.AddEthereumAuthorizer(context.TODO(), account.Address) - if err != nil || transaction == nil { - fmt.Printf("AddAuthorizer error: %v, Address: %s", err, account.Address.Hex()) - continue - } - - status, err := ConfirmEthereumTransaction(transaction.Hash().String(), 100, time.Second*10) - if err != nil { - fmt.Println(err) - } - - if status == 1 { - fmt.Printf("Authorizer has been added: %s\n", mnemonic) - } else { - fmt.Printf("Authorizer has failed to be added: %s\n", mnemonic) - } - } -} - -func (b *BridgeClient) prepareNFTConfig(ctx context.Context, method string, params ...interface{}) (*nftconfig.NFTConfig, *bind.TransactOpts, error) { - // To (contract) - contractAddress := common.HexToAddress(b.NFTConfigAddress) - - // Get ABI of the contract - abi, err := nftconfig.NFTConfigMetaData.GetAbi() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to get nftconfig ABI") - } - - // Pack the method argument - pack, err := abi.Pack(method, params...) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to pack arguments") - } - - from := common.HexToAddress(b.EthereumAddress) - - // Gas limits in units - gasLimitUnits, err := b.ethereumClient.EstimateGas(ctx, eth.CallMsg{ - To: &contractAddress, - From: from, - Data: pack, - }) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to estimate gas") - } - - // Update gas limits + 10% - gasLimitUnits = addPercents(gasLimitUnits, 10).Uint64() - - transactOpts := b.CreateSignedTransactionFromKeyStore(b.ethereumClient, gasLimitUnits) - - // NFTConfig instance - cfg, err := nftconfig.NewNFTConfig(contractAddress, b.ethereumClient) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to create nftconfig instance") - } - - return cfg, transactOpts, nil -} - -// EncodePackInt do abi.encodedPack(string, int), it is used for setting plan id for royalty -// - key key for the plan -// - param plan id -func EncodePackInt64(key string, param int64) common.Hash { - return crypto.Keccak256Hash( - []byte(key), - common.LeftPadBytes(big.NewInt(param).Bytes(), 32), - ) -} - -// NFTConfigSetUint256 sets a uint256 field in the NFT config, given the key as a string -// - ctx go context instance to run the transaction -// - key key for this field -// - value value to set -func (b *BridgeClient) NFTConfigSetUint256(ctx context.Context, key string, value int64) (*types.Transaction, error) { - kkey := crypto.Keccak256Hash([]byte(key)) - return b.NFTConfigSetUint256Raw(ctx, kkey, value) -} - -// NFTConfigSetUint256Raw sets a uint256 field in the NFT config, given the key as a Keccak256 hash -// - ctx go context instance to run the transaction -// - key key for this field (hased) -// - value value to set -func (b *BridgeClient) NFTConfigSetUint256Raw(ctx context.Context, key common.Hash, value int64) (*types.Transaction, error) { - if value < 0 { - return nil, errors.New("value must be greater than zero") - } - - v := big.NewInt(value) - Logger.Debug("NFT config setUint256", zap.String("key", key.String()), zap.Any("value", v)) - instance, transactOpts, err := b.prepareNFTConfig(ctx, "setUint256", key, v) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - tran, err := instance.SetUint256(transactOpts, key, v) - if err != nil { - msg := "failed to execute setUint256 transaction to Id = %s with key = %s, value = %v" - return nil, errors.Wrapf(err, msg, coreClient.Id(), key, v) - } - - return tran, err -} - -// NFTConfigGetUint256 retrieves a uint256 field in the NFT config, given the key as a string -// - ctx go context instance to run the transaction -// - key key for this field -// - keyParam additional key parameter, only the first item is used -func (b *BridgeClient) NFTConfigGetUint256(ctx context.Context, key string, keyParam ...int64) (string, int64, error) { - kkey := crypto.Keccak256Hash([]byte(key)) - if len(keyParam) > 0 { - kkey = EncodePackInt64(key, keyParam[0]) - } - - contractAddress := common.HexToAddress(b.NFTConfigAddress) - - cfg, err := nftconfig.NewNFTConfig(contractAddress, b.ethereumClient) - if err != nil { - return "", 0, errors.Wrap(err, "failed to create NFT config instance") - } - - v, err := cfg.GetUint256(nil, kkey) - if err != nil { - Logger.Error("NFTConfig GetUint256 FAILED", zap.Error(err)) - msg := "failed to execute getUint256 call, key = %s" - return "", 0, errors.Wrapf(err, msg, kkey) - } - return kkey.String(), v.Int64(), err -} - -// NFTConfigSetAddress sets an address field in the NFT config, given the key as a string -// - ctx go context instance to run the transaction -// - key key for this field -// - address address to set -func (b *BridgeClient) NFTConfigSetAddress(ctx context.Context, key, address string) (*types.Transaction, error) { - kkey := crypto.Keccak256Hash([]byte(key)) - // return b.NFTConfigSetAddress(ctx, kkey, address) - - Logger.Debug("NFT config setAddress", - zap.String("key", kkey.String()), - zap.String("address", address)) - - addr := common.HexToAddress(address) - instance, transactOpts, err := b.prepareNFTConfig(ctx, "setAddress", kkey, addr) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - tran, err := instance.SetAddress(transactOpts, kkey, addr) - if err != nil { - msg := "failed to execute setAddress transaction to Id = %s with key = %s, value = %v" - return nil, errors.Wrapf(err, msg, coreClient.Id(), key, address) - } - - return tran, err -} - -// NFTConfigGetAddress retrieves an address field in the NFT config, given the key as a string -// - ctx go context instance to run the transaction -// - key key for this field -func (b *BridgeClient) NFTConfigGetAddress(ctx context.Context, key string) (string, string, error) { - kkey := crypto.Keccak256Hash([]byte(key)) - - contractAddress := common.HexToAddress(b.NFTConfigAddress) - - cfg, err := nftconfig.NewNFTConfig(contractAddress, b.ethereumClient) - if err != nil { - return "", "", errors.Wrap(err, "failed to create NFT config instance") - } - - v, err := cfg.GetAddress(nil, kkey) - if err != nil { - Logger.Error("NFTConfig GetAddress FAILED", zap.Error(err)) - msg := "failed to execute getAddress call, key = %s" - return "", "", errors.Wrapf(err, msg, kkey) - } - return kkey.String(), v.String(), err -} - -// IncreaseBurnerAllowance Increases allowance for bridge contract address to transfer -// ERC-20 tokens on behalf of the zcntoken owner to the Burn TokenPool -// During the burn the script transfers amount from zcntoken owner to the bridge burn zcntoken pool -// Example: owner wants to burn some amount. -// The contract will transfer some amount from owner address to the pool. -// So the owner must call IncreaseAllowance of the WZCN zcntoken with 2 parameters: -// spender address which is the bridge contract and amount to be burned (transferred) -// Token signature: "increaseApproval(address,uint256)" -// - ctx go context instance to run the transaction -// - allowanceAmount amount to increase -// -//nolint:funlen -func (b *BridgeClient) IncreaseBurnerAllowance(ctx context.Context, allowanceAmount uint64) (*types.Transaction, error) { - if allowanceAmount <= 0 { - return nil, errors.New("amount must be greater than zero") - } - - // 1. Data Parameter (spender) - spenderAddress := common.HexToAddress(b.BridgeAddress) - - // 2. Data Parameter (amount) - amount := big.NewInt(int64(allowanceAmount)) - - tokenAddress := common.HexToAddress(b.TokenAddress) - - tokenInstance, transactOpts, err := b.prepareToken(ctx, "increaseApproval", tokenAddress, spenderAddress, amount) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare zcntoken") - } - - Logger.Info( - "Starting IncreaseApproval", - zap.String("zcntoken", tokenAddress.String()), - zap.String("spender", spenderAddress.String()), - zap.Int64("amount", amount.Int64()), - ) - - tran, err := tokenInstance.IncreaseApproval(transactOpts, spenderAddress, amount) - if err != nil { - Logger.Error( - "IncreaseApproval FAILED", - zap.String("zcntoken", tokenAddress.String()), - zap.String("spender", spenderAddress.String()), - zap.Int64("amount", amount.Int64()), - zap.Error(err)) - - return nil, errors.Wrapf(err, "failed to send `IncreaseApproval` transaction") - } - - Logger.Info( - "Posted IncreaseApproval", - zap.String("hash", tran.Hash().String()), - zap.String("zcntoken", tokenAddress.String()), - zap.String("spender", spenderAddress.String()), - zap.Int64("amount", amount.Int64()), - ) - - return tran, nil -} - -// GetTokenBalance returns balance of the current client for the zcntoken address -func (b *BridgeClient) GetTokenBalance() (*big.Int, error) { - // 1. Token address parameter - of := common.HexToAddress(b.TokenAddress) - - // 2. User's Ethereum wallet address parameter - from := common.HexToAddress(b.EthereumAddress) - - tokenInstance, err := zcntoken.NewToken(of, b.ethereumClient) - if err != nil { - return nil, errors.Wrap(err, "failed to initialize zcntoken instance") - } - - wei, err := tokenInstance.BalanceOf(&bind.CallOpts{}, from) - if err != nil { - return nil, errors.Wrapf(err, "failed to call `BalanceOf` for %s", b.EthereumAddress) - } - - return wei, nil -} - -// SignWithEthereumChain signs the digest with Ethereum chain signer taking key from the current user key storage -// - message message to sign -func (b *BridgeClient) SignWithEthereumChain(message string) ([]byte, error) { - hash := crypto.Keccak256Hash([]byte(message)) - - signer := accounts.Account{ - Address: common.HexToAddress(b.EthereumAddress), - } - - signerAcc, err := b.keyStore.Find(signer) - if err != nil { - Logger.Fatal(err) - } - - signature, err := b.keyStore.SignHash(signerAcc, hash.Bytes()) - if err != nil { - return nil, err - } - - if err != nil { - return []byte{}, errors.Wrap(err, "failed to sign the message") - } - - return signature, nil -} - -// GetUserNonceMinted Returns nonce for a specified Ethereum address -// - ctx go context instance to run the transaction -// - rawEthereumAddress Ethereum address -func (b *BridgeClient) GetUserNonceMinted(ctx context.Context, rawEthereumAddress string) (*big.Int, error) { - ethereumAddress := common.HexToAddress(rawEthereumAddress) - - contractAddress := common.HexToAddress(b.BridgeAddress) - - bridgeInstance, err := bridge.NewBridge(contractAddress, b.ethereumClient) - if err != nil { - return nil, errors.Wrap(err, "failed to create bridge instance") - } - - var nonce *big.Int - - nonce, err = bridgeInstance.GetUserNonceMinted(nil, ethereumAddress) - if err != nil { - Logger.Error("GetUserNonceMinted FAILED", zap.Error(err)) - msg := "failed to execute GetUserNonceMinted call, ethereumAddress = %s" - return nil, errors.Wrapf(err, msg, rawEthereumAddress) - } - - return nonce, err -} - -// ResetUserNonceMinted Resets nonce for a specified Ethereum address -// - ctx go context instance to run the transaction -func (b *BridgeClient) ResetUserNonceMinted(ctx context.Context) (*types.Transaction, error) { - bridgeInstance, transactOpts, err := b.prepareBridge(ctx, b.EthereumAddress, "resetUserNonceMinted") - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - tran, err := bridgeInstance.ResetUserNonceMinted(transactOpts) - if err != nil { - Logger.Error("ResetUserNonceMinted FAILED", zap.Error(err)) - msg := "failed to execute ResetUserNonceMinted call, ethereumAddress = %s" - return nil, errors.Wrapf(err, msg, b.EthereumAddress) - } - - Logger.Info( - "Posted ResetUserMintedNonce", - zap.String("ethereumWallet", b.EthereumAddress), - ) - - return tran, err -} - -// MintWZCN Mint ZCN tokens on behalf of the 0ZCN client -// - ctx go context instance to run the transaction -// - payload received from authorizers -// -// ERC20 signature: "mint(address,uint256,bytes,uint256,bytes[])" -func (b *BridgeClient) MintWZCN(ctx context.Context, payload *ethereum.MintPayload) (*types.Transaction, error) { - if DefaultClientIDEncoder == nil { - return nil, errors.New("DefaultClientIDEncoder must be setup") - } - - // 1. Burned amount parameter - amount := new(big.Int) - amount.SetInt64(payload.Amount) // wei - - // 2. Transaction ID Parameter of burn operation (zcnTxd string as []byte) - zcnTxd := DefaultClientIDEncoder(payload.ZCNTxnID) - - // 3. Nonce Parameter generated during burn operation - nonce := new(big.Int) - nonce.SetInt64(payload.Nonce) - - // 4. Signature - // For requirements from ERC20 authorizer, the signature length must be 65 - var sigs [][]byte - for _, signature := range payload.Signatures { - sigs = append(sigs, signature.Signature) - } - - // 5. To Ethereum address - - toAddress := common.HexToAddress(payload.To) - - bridgeInstance, transactOpts, err := b.prepareBridge(ctx, payload.To, "mint", toAddress, amount, zcnTxd, nonce, sigs) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - Logger.Info( - "Staring Mint WZCN", - zap.Int64("amount", amount.Int64()), - zap.String("zcnTxd", string(zcnTxd)), - zap.String("nonce", nonce.String())) - - var tran *types.Transaction - tran, err = bridgeInstance.Mint(transactOpts, toAddress, amount, zcnTxd, nonce, sigs) - if err != nil { - Logger.Error("Mint WZCN FAILED", zap.Error(err)) - msg := "failed to execute MintWZCN transaction, amount = %s, ZCN TrxID = %s" - return nil, errors.Wrapf(err, msg, amount, zcnTxd) - } - - Logger.Info( - "Posted Mint WZCN", - zap.String("hash", tran.Hash().String()), - zap.Int64("amount", amount.Int64()), - zap.String("zcnTxd", string(zcnTxd)), - zap.String("nonce", nonce.String()), - ) - - return tran, err -} - -// BurnWZCN Burns WZCN tokens on behalf of the 0ZCN client -// - ctx go context instance to run the transaction -// - amountTokens amount of tokens to burn -// -// ERC20 signature: "burn(uint256,bytes)" -func (b *BridgeClient) BurnWZCN(ctx context.Context, amountTokens uint64) (*types.Transaction, error) { - if DefaultClientIDEncoder == nil { - return nil, errors.New("DefaultClientIDEncoder must be setup") - } - - // 1. Data Parameter (amount to burn) - clientID := DefaultClientIDEncoder(coreClient.Id()) - - // 2. Data Parameter (signature) - amount := new(big.Int) - amount.SetInt64(int64(amountTokens)) - - bridgeInstance, transactOpts, err := b.prepareBridge(ctx, b.EthereumAddress, "burn", amount, clientID) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare bridge") - } - - Logger.Info( - "Staring Burn WZCN", - zap.Int64("amount", amount.Int64()), - ) - - tran, err := bridgeInstance.Burn(transactOpts, amount, clientID) - if err != nil { - msg := "failed to execute Burn WZCN transaction to Id = %s with amount = %s" - return nil, errors.Wrapf(err, msg, coreClient.Id(), amount) - } - - Logger.Info( - "Posted Burn WZCN", - zap.String("clientID", coreClient.Id()), - zap.Int64("amount", amount.Int64()), - ) - - return tran, err -} - -// MintZCN mints ZCN tokens after receiving proof-of-burn of WZCN tokens -// - ctx go context instance to run the transaction -// - payload received from authorizers -func (b *BridgeClient) MintZCN(payload *zcnsc.MintPayload) (string, error) { - Logger.Info( - "Starting MINT smart contract", - zap.String("sc address", wallet.ZCNSCSmartContractAddress), - zap.String("function", wallet.MintFunc), - zap.Int64("mint amount", int64(payload.Amount))) - - hash, _, _, _, err := coreTransaction.SmartContractTxn(wallet.ZCNSCSmartContractAddress, coreTransaction.SmartContractTxnData{ - Name: wallet.MintFunc, - InputArgs: payload, - }, true) - - if err != nil { - return "", errors.Wrap(err, fmt.Sprintf("failed to execute smart contract, hash = %s", hash)) - } - - Logger.Info( - "Mint ZCN transaction", - zap.String("hash", hash), - zap.Int64("mint amount", int64(payload.Amount))) - - return hash, nil -} - -// BurnZCN burns ZCN tokens before conversion from ZCN to WZCN as a first step -// - ctx go context instance to run the transaction -// - amount amount of tokens to burn -// - txnfee transaction fee -func (b *BridgeClient) BurnZCN(amount uint64) (string, string, error) { - payload := zcnsc.BurnPayload{ - EthereumAddress: b.EthereumAddress, - } - Logger.Info( - "Starting BURN smart contract", - zap.String("sc address", wallet.ZCNSCSmartContractAddress), - zap.String("function", wallet.BurnFunc), - zap.Uint64("burn amount", amount), - ) - - hash, out, _, _, err := coreTransaction.SmartContractTxnValue(wallet.ZCNSCSmartContractAddress, coreTransaction.SmartContractTxnData{ - Name: wallet.BurnFunc, - InputArgs: payload, - }, amount, true) - if err != nil { - Logger.Error("Burn ZCN transaction FAILED", zap.Error(err)) - return hash, out, errors.Wrap(err, fmt.Sprintf("failed to execute smart contract, hash = %s", hash)) - } - - Logger.Info( - "Burn ZCN transaction", - zap.String("hash", hash), - zap.Uint64("burn amount", amount), - zap.Uint64("amount", amount), - ) - - return hash, out, nil -} - -// ApproveUSDCSwap provides opportunity to approve swap operation for ERC20 tokens -// - ctx go context instance to run the transaction -// - source source amount -func (b *BridgeClient) ApproveUSDCSwap(ctx context.Context, source uint64) (*types.Transaction, error) { - // 1. USDC token smart contract address - tokenAddress := common.HexToAddress(UsdcTokenAddress) - - // 2. Swap source amount parameter. - sourceInt := big.NewInt(int64(source)) - - // 3. User's Ethereum wallet address parameter - spenderAddress := common.HexToAddress(b.UniswapAddress) - - tokenInstance, transactOpts, err := b.prepareToken(ctx, "approve", tokenAddress, spenderAddress, sourceInt) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare usdctoken") - } - - Logger.Info( - "Starting ApproveUSDCSwap", - zap.String("usdctoken", tokenAddress.String()), - zap.String("spender", spenderAddress.String()), - zap.Int64("source", sourceInt.Int64()), - ) - - var tran *types.Transaction - - tran, err = tokenInstance.Approve(transactOpts, spenderAddress, sourceInt) - if err != nil { - return nil, errors.Wrap(err, "failed to execute approve transaction") - } - - return tran, nil -} - -// GetETHSwapAmount retrieves ETH swap amount from the given source. -// - ctx go context instance to run the transaction -// - source source amount -func (b *BridgeClient) GetETHSwapAmount(ctx context.Context, source uint64) (*big.Int, error) { - // 1. Uniswap smart contract address - contractAddress := common.HexToAddress(UniswapRouterAddress) - - // 2. User's Ethereum wallet address parameter - from := common.HexToAddress(b.EthereumAddress) - - // 3. Swap source amount parameter. - sourceInt := big.NewInt(int64(source)) - - // 3. Swap path parameter. - path := []common.Address{ - common.HexToAddress(WethTokenAddress), - common.HexToAddress(b.TokenAddress)} - - uniswapRouterInstance, err := uniswaprouter.NewUniswaprouter(contractAddress, b.ethereumClient) - if err != nil { - return nil, errors.Wrap(err, "failed to initialize uniswaprouter instance") - } - - Logger.Info( - "Starting GetETHSwapAmount", - zap.Uint64("source", source)) - - var result []*big.Int - - result, err = uniswapRouterInstance.GetAmountsIn(&bind.CallOpts{From: from}, sourceInt, path) - if err != nil { - Logger.Error("GetAmountsIn FAILED", zap.Error(err)) - msg := "failed to execute GetAmountsIn call, ethereumAddress = %s" - - return nil, errors.Wrapf(err, msg, from) - } - - return result[0], nil -} - -// SwapETH provides opportunity to perform zcn token swap operation using ETH as source token. -// - ctx go context instance to run the transaction -// - source source amount -// - target target amount -func (b *BridgeClient) SwapETH(ctx context.Context, source uint64, target uint64) (*types.Transaction, error) { - // 1. Swap source amount parameter. - sourceInt := big.NewInt(int64(source)) - - // 2. Swap target amount parameter. - targetInt := big.NewInt(int64(target)) - - uniswapNetworkInstance, transactOpts, err := b.prepareUniswapNetwork( - ctx, sourceInt, "swapETHForZCNExactAmountOut", targetInt) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare uniswapnetwork") - } - - Logger.Info( - "Starting SwapETH", - zap.Uint64("source", source), - zap.Uint64("target", target)) - - var tran *types.Transaction - - tran, err = uniswapNetworkInstance.SwapETHForZCNExactAmountOut(transactOpts, targetInt) - if err != nil { - return nil, errors.Wrap(err, "failed to execute swapETHForZCNExactAmountOut transaction") - } - - return tran, nil -} - -// SwapUSDC provides opportunity to perform zcn token swap operation using USDC as source token. -// - ctx go context instance to run the transaction -// - source source amount -// - target target amount -func (b *BridgeClient) SwapUSDC(ctx context.Context, source uint64, target uint64) (*types.Transaction, error) { - // 1. Swap target amount parameter. - sourceInt := big.NewInt(int64(source)) - - // 2. Swap source amount parameter. - targetInt := big.NewInt(int64(target)) - - uniswapNetworkInstance, transactOpts, err := b.prepareUniswapNetwork( - ctx, big.NewInt(0), "swapUSDCForZCNExactAmountOut", targetInt, sourceInt) - if err != nil { - return nil, errors.Wrap(err, "failed to prepare uniswapnetwork") - } - - Logger.Info( - "Starting SwapUSDC", - zap.Uint64("source", source), - zap.Uint64("target", target)) - - var tran *types.Transaction - - tran, err = uniswapNetworkInstance.SwapUSDCForZCNExactAmountOut(transactOpts, targetInt, sourceInt) - if err != nil { - return nil, errors.Wrap(err, "failed to execute swapUSDCForZCNExactAmountOut transaction") - } - - return tran, nil -} - -// prepareUniswapNetwork performs uniswap network smart contract preparation actions. -func (b *BridgeClient) prepareUniswapNetwork(ctx context.Context, value *big.Int, method string, params ...interface{}) (*uniswapnetwork.Uniswap, *bind.TransactOpts, error) { - // 1. Uniswap smart contract address - contractAddress := common.HexToAddress(b.UniswapAddress) - - // 2. To address parameter. - to := common.HexToAddress(b.TokenAddress) - - // 3. From address parameter. - from := common.HexToAddress(b.EthereumAddress) - - abi, err := uniswapnetwork.UniswapMetaData.GetAbi() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to get uniswaprouter abi") - } - - var pack []byte - - pack, err = abi.Pack(method, params...) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to pack arguments") - } - - opts := eth.CallMsg{ - To: &to, - From: from, - Data: pack, - } - - if value.Int64() != 0 { - opts.Value = value - } - - transactOpts := b.CreateSignedTransactionFromKeyStore(b.ethereumClient, 0) - if value.Int64() != 0 { - transactOpts.Value = value - } - - var uniswapNetworkInstance *uniswapnetwork.Uniswap - - uniswapNetworkInstance, err = uniswapnetwork.NewUniswap(contractAddress, b.ethereumClient) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to initialize uniswapnetwork instance") - } - - return uniswapNetworkInstance, transactOpts, nil -} - -func (b *BridgeClient) prepareToken(ctx context.Context, method string, tokenAddress common.Address, params ...interface{}) (*zcntoken.Token, *bind.TransactOpts, error) { - abi, err := zcntoken.TokenMetaData.GetAbi() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to get zcntoken abi") - } - - pack, err := abi.Pack(method, params...) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to pack arguments") - } - - from := common.HexToAddress(b.EthereumAddress) - - gasLimitUnits, err := b.ethereumClient.EstimateGas(ctx, eth.CallMsg{ - To: &tokenAddress, - From: from, - Data: pack, - }) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to estimate gas limit") - } - - gasLimitUnits = addPercents(gasLimitUnits, 10).Uint64() - - transactOpts := b.CreateSignedTransactionFromKeyStore(b.ethereumClient, gasLimitUnits) - - var tokenInstance *zcntoken.Token - - tokenInstance, err = zcntoken.NewToken(tokenAddress, b.ethereumClient) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to initialize zcntoken instance") - } - - return tokenInstance, transactOpts, nil -} - -func (b *BridgeClient) prepareAuthorizers(ctx context.Context, method string, params ...interface{}) (*authorizers.Authorizers, *bind.TransactOpts, error) { - // To (contract) - contractAddress := common.HexToAddress(b.AuthorizersAddress) - - // Get ABI of the contract - abi, err := authorizers.AuthorizersMetaData.GetAbi() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to get ABI") - } - - // Pack the method argument - pack, err := abi.Pack(method, params...) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to pack arguments") - } - - from := common.HexToAddress(b.EthereumAddress) - - // Gas limits in units - gasLimitUnits, err := b.ethereumClient.EstimateGas(ctx, eth.CallMsg{ - To: &contractAddress, - From: from, - Data: pack, - }) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to estimate gas") - } - - // Update gas limits + 10% - gasLimitUnits = addPercents(gasLimitUnits, 10).Uint64() - - transactOpts := b.CreateSignedTransactionFromKeyStore(b.ethereumClient, gasLimitUnits) - - // Authorizers instance - authorizersInstance, err := authorizers.NewAuthorizers(contractAddress, b.ethereumClient) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to create authorizers instance") - } - - return authorizersInstance, transactOpts, nil -} - -func (b *BridgeClient) prepareBridge(ctx context.Context, ethereumAddress, method string, params ...interface{}) (*bridge.Bridge, *bind.TransactOpts, error) { - // To (contract) - contractAddress := common.HexToAddress(b.BridgeAddress) - - //Get ABI of the contract - abi, err := bridge.BridgeMetaData.GetAbi() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to get ABI") - } - - //Pack the method argument - pack, err := abi.Pack(method, params...) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to pack arguments") - } - - //Gas limits in units - fromAddress := common.HexToAddress(ethereumAddress) - - gasLimitUnits, err := b.ethereumClient.EstimateGas(ctx, eth.CallMsg{ - To: &contractAddress, - From: fromAddress, - Data: pack, - }) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to estimate gas") - } - - //Update gas limits + 10% - gasLimitUnits = addPercents(gasLimitUnits, 10).Uint64() - - transactOpts := b.CreateSignedTransactionFromKeyStore(b.ethereumClient, gasLimitUnits) - - // BridgeClient instance - bridgeInstance, err := bridge.NewBridge(contractAddress, b.ethereumClient) - if err != nil { - return nil, nil, errors.Wrap(err, "failed to create bridge instance") - } - - return bridgeInstance, transactOpts, nil -} - -// getProviderType validates the provider url and exposes pre-defined type definition. -func (b *BridgeClient) getProviderType() int { - if strings.Contains(b.EthereumNodeURL, "g.alchemy.com") { - return AlchemyProvider - } else if strings.Contains(b.EthereumNodeURL, "rpc.tenderly.co") { - return TenderlyProvider - } else { - return UnknownProvider - } -} - -// estimateTenderlyGasAmount performs gas amount estimation for the given transaction using Tenderly provider. -func (b *BridgeClient) estimateTenderlyGasAmount(ctx context.Context, from, to string, value int64) (float64, error) { - return 8000000, nil -} - -// estimateAlchemyGasAmount performs gas amount estimation for the given transaction using Alchemy provider -func (b *BridgeClient) estimateAlchemyGasAmount(ctx context.Context, from, to, data string, value int64) (float64, error) { - client := jsonrpc.NewClient(b.EthereumNodeURL) - - valueHex := ConvertIntToHex(value) - - resp, err := client.Call(ctx, "eth_estimateGas", &AlchemyGasEstimationRequest{ - From: from, - To: to, - Value: valueHex, - Data: data}) - if err != nil { - return 0, errors.Wrap(err, "gas price estimation failed") - } - - if resp.Error != nil { - return 0, errors.Wrap(errors.New(resp.Error.Error()), "gas price estimation failed") - } - - gasAmountRaw, ok := resp.Result.(string) - if !ok { - return 0, errors.New("failed to parse gas amount") - } - - gasAmountInt := new(big.Float) - gasAmountInt.SetString(gasAmountRaw) - - gasAmountFloat, _ := gasAmountInt.Float64() - - return gasAmountFloat, nil -} - -// EstimateBurnWZCNGasAmount performs gas amount estimation for the given wzcn burn transaction. -// - ctx go context instance to run the transaction -// - from source address -// - to target address -// - amountTokens amount of tokens to burn -func (b *BridgeClient) EstimateBurnWZCNGasAmount(ctx context.Context, from, to, amountTokens string) (float64, error) { - switch b.getProviderType() { - case AlchemyProvider: - abi, err := bridge.BridgeMetaData.GetAbi() - if err != nil { - return 0, errors.Wrap(err, "failed to get ABI") - } - - clientID := DefaultClientIDEncoder(coreClient.Id()) - - amount := new(big.Int) - amount.SetString(amountTokens, 10) - - var packRaw []byte - packRaw, err = abi.Pack("burn", amount, clientID) - if err != nil { - return 0, errors.Wrap(err, "failed to pack arguments") - } - - pack := "0x" + hex.EncodeToString(packRaw) - - return b.estimateAlchemyGasAmount(ctx, from, to, pack, 0) - case TenderlyProvider: - return b.estimateTenderlyGasAmount(ctx, from, to, 0) - } - - return 0, errors.New("used json-rpc does not allow to estimate gas amount") -} - -// EstimateMintWZCNGasAmount performs gas amount estimation for the given wzcn mint transaction. -// - ctx go context instance to run the transaction -// - from source address -// - to target address -// - zcnTransactionRaw zcn transaction (hashed) -// - amountToken amount of tokens to mint -// - nonceRaw nonce -// - signaturesRaw authorizer signatures -func (b *BridgeClient) EstimateMintWZCNGasAmount( - ctx context.Context, from, to, zcnTransactionRaw, amountToken string, nonceRaw int64, signaturesRaw [][]byte) (float64, error) { - switch b.getProviderType() { - case AlchemyProvider: - amount := new(big.Int) - amount.SetString(amountToken, 10) - - zcnTransaction := DefaultClientIDEncoder(zcnTransactionRaw) - - nonce := new(big.Int) - nonce.SetInt64(nonceRaw) - - fromRaw := common.HexToAddress(from) - - abi, err := bridge.BridgeMetaData.GetAbi() - if err != nil { - return 0, errors.Wrap(err, "failed to get ABI") - } - - var packRaw []byte - packRaw, err = abi.Pack("mint", fromRaw, amount, zcnTransaction, nonce, signaturesRaw) - if err != nil { - return 0, errors.Wrap(err, "failed to pack arguments") - } - - pack := "0x" + hex.EncodeToString(packRaw) - - return b.estimateAlchemyGasAmount(ctx, from, to, pack, 0) - case TenderlyProvider: - return b.estimateTenderlyGasAmount(ctx, from, to, 0) - } - - return 0, errors.New("used json-rpc does not allow to estimate gas amount") -} - -// estimateTenderlyGasPrice performs gas estimation for the given transaction using Tenderly API. -func (b *BridgeClient) estimateTenderlyGasPrice(ctx context.Context) (float64, error) { - return 1, nil -} - -// estimateAlchemyGasPrice performs gas estimation for the given transaction using Alchemy enhanced API returning -// approximate final gas fee. -func (b *BridgeClient) estimateAlchemyGasPrice(ctx context.Context) (float64, error) { - client := jsonrpc.NewClient(b.EthereumNodeURL) - - resp, err := client.Call(ctx, "eth_gasPrice") - if err != nil { - return 0, errors.Wrap(err, "gas price estimation failed") - } - - if resp.Error != nil { - return 0, errors.Wrap(errors.New(resp.Error.Error()), "gas price estimation failed") - } - - gasPriceRaw, ok := resp.Result.(string) - if !ok { - return 0, errors.New("failed to parse gas price") - } - - gasPriceInt := new(big.Float) - gasPriceInt.SetString(gasPriceRaw) - - gasPriceFloat, _ := gasPriceInt.Float64() - - return gasPriceFloat, nil -} - -// EstimateGasPrice performs gas estimation for the given transaction. -// - ctx go context instance to run the transaction -func (b *BridgeClient) EstimateGasPrice(ctx context.Context) (float64, error) { - switch b.getProviderType() { - case AlchemyProvider: - return b.estimateAlchemyGasPrice(ctx) - case TenderlyProvider: - return b.estimateTenderlyGasPrice(ctx) - } - - return 0, errors.New("used json-rpc does not allow to estimate gas price") -} diff --git a/zcnbridge/bridge_helper.go b/zcnbridge/bridge_helper.go deleted file mode 100644 index 724b2d4e4..000000000 --- a/zcnbridge/bridge_helper.go +++ /dev/null @@ -1,105 +0,0 @@ -package zcnbridge - -import ( - "fmt" - "math/big" - "time" - - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/zcncore" - "github.com/pkg/errors" -) - -// AlchemyGasEstimationRequest describes request used for Alchemy enhanced JSON-RPC API. -type AlchemyGasEstimationRequest struct { - From string `json:"from"` - To string `json:"to"` - Value string `json:"value"` - Data string `json:"data"` -} - -// GasEstimationRequest describes request used for Alchemy enhanced JSON-RPC API. -type GasEstimationRequest struct { - From string `json:"from"` - To string `json:"to"` - Value string `json:"value"` -} - -// GasPriceEstimationResult represents result of the gas price estimation operation execution. -type GasPriceEstimationResult struct { - Value float64 `json:"value"` -} - -// BancorTokenDetails describes Bancor ZCN zcntoken pool details -type BancorTokenDetails struct { - Data struct { - Rate struct { - ETH string `json:"eth"` - BNT string `json:"bnt"` - USDC string `json:"usd"` - EURC string `json:"eur"` - } - } `json:"data"` -} - -func GetTransactionStatus(hash string) (int, error) { - _, err := zcncore.GetEthClient() - if err != nil { - return -1, err - } - - return zcncore.CheckEthHashStatus(hash), nil -} - -// ConfirmEthereumTransaction confirms Ethereum transaction by hash. -// - hash is the transaction hash to confirm. -// - times is the number of times to try confirming the transaction. -// - duration is the duration to wait between each confirmation attempt. -func ConfirmEthereumTransaction(hash string, times int, duration time.Duration) (int, error) { - var ( - res = 0 - err error - ) - - if hash == "" { - return -1, errors.New("transaction hash should not be empty") - } - - for i := 0; i < times; i++ { - res, err = GetTransactionStatus(hash) - if err != nil { - Logger.Info(fmt.Sprintf("confirmation of Ethereum transaction %s [ERROR]", hash)) - return -1, err - } - if res == 1 { - Logger.Info(fmt.Sprintf("confirmation of Ethereum transaction %s [OK]", hash)) - return res, nil - } - if res == 0 { - Logger.Info(fmt.Sprintf("confirmation of Ethereum transaction %s [FAILED]", hash)) - return res, nil - } - Logger.Info(fmt.Sprintf("Try confirming Ethereum transaction %s # %d", hash, i)) - sys.Sleep(duration) - } - - Logger.Info(fmt.Sprintf("Verification of transaction %s is still pending after %d efforts, try checking it later", hash, times)) - - return res, nil -} - -func addPercents(gasLimitUnits uint64, percents int) *big.Int { - gasLimitBig := big.NewInt(int64(gasLimitUnits)) - factorBig := big.NewInt(int64(percents)) - deltaBig := gasLimitBig.Div(gasLimitBig, factorBig) - - origin := big.NewInt(int64(gasLimitUnits)) - gasLimitBig = origin.Add(origin, deltaBig) - - return gasLimitBig -} - -// ConvertIntToHex converts given int value to hex string. -func ConvertIntToHex(value int64) string { - return fmt.Sprintf("%#x", value) -} diff --git a/zcnbridge/bridge_test.go b/zcnbridge/bridge_test.go deleted file mode 100644 index 98801539b..000000000 --- a/zcnbridge/bridge_test.go +++ /dev/null @@ -1,639 +0,0 @@ -package zcnbridge - -import ( - "context" - "encoding/hex" - "encoding/json" - coreClient "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zcnbridge/ethereum/uniswapnetwork" - "github.com/ethereum/go-ethereum/accounts/abi" - "log" - "math/big" - "os" - "path" - "strconv" - "testing" - "time" - - "github.com/0chain/gosdk/zcnbridge/ethereum/zcntoken" - - sdkcommon "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zcnbridge/ethereum" - "github.com/0chain/gosdk/zcnbridge/ethereum/authorizers" - binding "github.com/0chain/gosdk/zcnbridge/ethereum/bridge" - bridgemocks "github.com/0chain/gosdk/zcnbridge/mocks" - "github.com/0chain/gosdk/zcnbridge/zcnsc" - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/spf13/viper" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" -) - -const ( - ethereumAddress = "0xD8c9156e782C68EE671C09b6b92de76C97948432" - - alchemyEthereumNodeURL = "https://eth-mainnet.g.alchemy.com/v2/9VanLUbRE0pLmDHwCHGJlhs9GHosrfD9" - tenderlyEthereumNodeURL = "https://rpc.tenderly.co/fork/835ecb4e-1f60-4129-adc2-b0c741193839" - infuraEthereumNodeURL = "https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c" - - password = "02289b9" - - authorizerDelegatedAddress = "0xa149B58b7e1390D152383BB03dBc79B390F648e2" - - bridgeAddress = "0x7bbbEa24ac1751317D7669f05558632c4A9113D7" - tokenAddress = "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78" - authorizersAddress = "0xEAe8229c0E457efBA1A1769e7F8c20110fF68E61" - uniswapAddress = "0x4c12C2FeEDD86267d17dB64BaB2cFD12cD8611f5" - - zcnTxnID = "b26abeb31fcee5d2e75b26717722938a06fa5ce4a5b5e68ddad68357432caace" - amount = 1 - txnFee = 1 - nonce = 1 - - ethereumTxnID = "0x3b59971c2aa294739cd73912f0c5a7996aafb796238cf44408b0eb4af0fbac82" //nolint:unused - - clientId = "d6e9b3222434faa043c683d1a939d6a0fa2818c4d56e794974d64a32005330d3" -) - -var ( - uniswapSmartContractCode = "60806040526004361061002d5760003560e01c806318ae74a41461003957806397a40b341461006957610034565b3661003457005b600080fd5b610053600480360381019061004e9190610781565b6100a6565b60405161006091906107bd565b60405180910390f35b34801561007557600080fd5b50610090600480360381019061008b91906107d8565b61017e565b60405161009d91906107bd565b60405180910390f35b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fb3bdb4134856100ef61061a565b33426040518663ffffffff1660e01b81526004016101109493929190610917565b60006040518083038185885af115801561012e573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f820116820180604052508101906101589190610ad1565b90508060018151811061016e5761016d610b1a565b5b6020026020010151915050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016101df93929190610b49565b6020604051808303816000875af11580156101fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102229190610bb8565b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b81526004016102a0929190610be5565b6020604051808303816000875af11580156102bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e39190610bb8565b506060600367ffffffffffffffff81111561030157610300610979565b5b60405190808252806020026020018201604052801561032f5781602001602082028036833780820191505090505b50905073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488160008151811061035b5761035a610b1a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106103be576103bd610b1a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073b9ef770b6a5e12e45983c5d80545258aa38f3b788160028151811061042157610420610b1a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee86868533426040518663ffffffff1660e01b81526004016104bf959493929190610c0e565b6000604051808303816000875af11580156104de573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105079190610ad1565b9050838160008151811061051e5761051d610b1a565b5b602002602001015110156105f457600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338360008151811061057f5761057e610b1a565b5b6020026020010151876105929190610c97565b6040518363ffffffff1660e01b81526004016105af929190610be5565b6020604051808303816000875af11580156105ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f29190610bb8565b505b8060028151811061060857610607610b1a565b5b60200260200101519250505092915050565b60606000600267ffffffffffffffff81111561063957610638610979565b5b6040519080825280602002602001820160405280156106675781602001602082028036833780820191505090505b50905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160008151811061069357610692610b1a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073b9ef770b6a5e12e45983c5d80545258aa38f3b78816001815181106106f6576106f5610b1a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508091505090565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61075e8161074b565b811461076957600080fd5b50565b60008135905061077b81610755565b92915050565b60006020828403121561079757610796610741565b5b60006107a58482850161076c565b91505092915050565b6107b78161074b565b82525050565b60006020820190506107d260008301846107ae565b92915050565b600080604083850312156107ef576107ee610741565b5b60006107fd8582860161076c565b925050602061080e8582860161076c565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061086f82610844565b9050919050565b61087f81610864565b82525050565b60006108918383610876565b60208301905092915050565b6000602082019050919050565b60006108b582610818565b6108bf8185610823565b93506108ca83610834565b8060005b838110156108fb5781516108e28882610885565b97506108ed8361089d565b9250506001810190506108ce565b5085935050505092915050565b61091181610864565b82525050565b600060808201905061092c60008301876107ae565b818103602083015261093e81866108aa565b905061094d6040830185610908565b61095a60608301846107ae565b95945050505050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6109b182610968565b810181811067ffffffffffffffff821117156109d0576109cf610979565b5b80604052505050565b60006109e3610737565b90506109ef82826109a8565b919050565b600067ffffffffffffffff821115610a0f57610a0e610979565b5b602082029050602081019050919050565b600080fd5b600081519050610a3481610755565b92915050565b6000610a4d610a48846109f4565b6109d9565b90508083825260208201905060208402830185811115610a7057610a6f610a20565b5b835b81811015610a995780610a858882610a25565b845260208401935050602081019050610a72565b5050509392505050565b600082601f830112610ab857610ab7610963565b5b8151610ac8848260208601610a3a565b91505092915050565b600060208284031215610ae757610ae6610741565b5b600082015167ffffffffffffffff811115610b0557610b04610746565b5b610b1184828501610aa3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000606082019050610b5e6000830186610908565b610b6b6020830185610908565b610b7860408301846107ae565b949350505050565b60008115159050919050565b610b9581610b80565b8114610ba057600080fd5b50565b600081519050610bb281610b8c565b92915050565b600060208284031215610bce57610bcd610741565b5b6000610bdc84828501610ba3565b91505092915050565b6000604082019050610bfa6000830185610908565b610c0760208301846107ae565b9392505050565b600060a082019050610c2360008301886107ae565b610c3060208301876107ae565b8181036040830152610c4281866108aa565b9050610c516060830185610908565b610c5e60808301846107ae565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ca28261074b565b9150610cad8361074b565b9250828203905081811115610cc557610cc4610c68565b5b9291505056fea26469706673582212207de082f4e5f623e928f9b99a8e233f194bacc23969b40ea49a470ecfd2a1fb8464736f6c63430008140033" -) - -var ( - testKeyStoreLocation = path.Join(".", EthereumWalletStorageDir) -) - -var ( - ethereumSignatures = []*ethereum.AuthorizerSignature{ - { - ID: "0x2ec8F26ccC678c9faF0Df20208aEE3AF776160CD", - Signature: []byte("0xEAe8229c0E457efBA1A1769e7F8c20110fF68E61"), - }, - } - - zcnScSignatures = []*zcnsc.AuthorizerSignature{ //nolint:unused - { - ID: "0x2ec8F26ccC678c9faF0Df20208aEE3AF776160CD", - Signature: "0xEAe8229c0E457efBA1A1769e7F8c20110fF68E61", - }, - } -) - -type ethereumClientMock struct { - mock.TestingT -} - -func (ecm *ethereumClientMock) Cleanup(callback func()) { - callback() -} - -type transactionMock struct { //nolint:unused - mock.TestingT -} - -func (tem *transactionMock) Cleanup(callback func()) { //nolint:unused - callback() -} - -type transactionProviderMock struct { //nolint:unused - mock.TestingT -} - -func (tem *transactionProviderMock) Cleanup(callback func()) { //nolint:unused - callback() -} - -type keyStoreMock struct { - mock.TestingT -} - -func (ksm *keyStoreMock) Cleanup(callback func()) { - callback() -} - -type authorizerConfigTarget struct { - Fee sdkcommon.Balance `json:"fee"` -} - -type authorizerNodeTarget struct { - ID string `json:"id"` - PublicKey string `json:"public_key"` - URL string `json:"url"` - Config *authorizerConfigTarget `json:"config"` -} - -type authorizerConfigSource struct { - Fee string `json:"fee"` -} - -type authorizerNodeSource struct { - ID string `json:"id"` - Config *authorizerConfigSource `json:"config"` -} - -func (an *authorizerNodeTarget) decode(input []byte) error { - var objMap map[string]*json.RawMessage - err := json.Unmarshal(input, &objMap) - if err != nil { - return err - } - - id, ok := objMap["id"] - if ok { - var idStr *string - err = json.Unmarshal(*id, &idStr) - if err != nil { - return err - } - an.ID = *idStr - } - - pk, ok := objMap["public_key"] - if ok { - var pkStr *string - err = json.Unmarshal(*pk, &pkStr) - if err != nil { - return err - } - an.PublicKey = *pkStr - } - - url, ok := objMap["url"] - if ok { - var urlStr *string - err = json.Unmarshal(*url, &urlStr) - if err != nil { - return err - } - an.URL = *urlStr - } - - rawCfg, ok := objMap["config"] - if ok { - var cfg = &authorizerConfigTarget{} - err = cfg.decode(*rawCfg) - if err != nil { - return err - } - - an.Config = cfg - } - - return nil -} - -func (c *authorizerConfigTarget) decode(input []byte) (err error) { - const ( - Fee = "fee" - ) - - var objMap map[string]*json.RawMessage - err = json.Unmarshal(input, &objMap) - if err != nil { - return err - } - - fee, ok := objMap[Fee] - if ok { - var feeStr *string - err = json.Unmarshal(*fee, &feeStr) - if err != nil { - return err - } - - var balance, err = strconv.ParseInt(*feeStr, 10, 64) - if err != nil { - return err - } - - c.Fee = sdkcommon.Balance(balance) - } - - return nil -} - -func getEthereumClient(t mock.TestingT) *bridgemocks.EthereumClient { - return bridgemocks.NewEthereumClient(ðereumClientMock{t}) -} - -func getBridgeClient(ethereumNodeURL string, ethereumClient EthereumClient, keyStore KeyStore) *BridgeClient { - cfg := viper.New() - - tempConfigFile, err := os.CreateTemp(".", "config.yaml") - if err != nil { - log.Fatalln(err) - } - - defer func(name string) { - err := os.Remove(name) - if err != nil { - log.Fatalln(err) - } - }(tempConfigFile.Name()) - - cfg.SetConfigFile(tempConfigFile.Name()) - - cfg.SetDefault("bridge.bridge_address", bridgeAddress) - cfg.SetDefault("bridge.token_address", tokenAddress) - cfg.SetDefault("bridge.authorizers_address", authorizersAddress) - cfg.SetDefault("bridge.uniswap_address", uniswapAddress) - cfg.SetDefault("bridge.ethereum_address", ethereumAddress) - cfg.SetDefault("bridge.password", password) - cfg.SetDefault("bridge.gas_limit", 0) - cfg.SetDefault("bridge.consensus_threshold", 0) - - return NewBridgeClient( - cfg.GetString("bridge.bridge_address"), - cfg.GetString("bridge.token_address"), - cfg.GetString("bridge.authorizers_address"), - cfg.GetString("bridge.uniswap_address"), - cfg.GetString("bridge.ethereum_address"), - ethereumNodeURL, - cfg.GetString("bridge.password"), - cfg.GetUint64("bridge.gas_limit"), - cfg.GetFloat64("bridge.consensus_threshold"), - - ethereumClient, - keyStore, - ) -} - -func prepareEthereumClientGeneralMockCalls(ethereumClient *mock.Mock) { - ethereumClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(400000), nil) - ethereumClient.On("ChainID", mock.Anything).Return(big.NewInt(400000), nil) - ethereumClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(nonce), nil) - ethereumClient.On("SuggestGasPrice", mock.Anything).Return(big.NewInt(400000), nil) - ethereumClient.On("SendTransaction", mock.Anything, mock.Anything).Return(nil) -} - -func prepareTransactionGeneralMockCalls(transaction *mock.Mock) { //nolint:unused - transaction.On("ExecuteSmartContract", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(zcnTxnID, nil) - transaction.On("Verify", mock.Anything).Return(nil) -} - -func getKeyStore(t mock.TestingT) *bridgemocks.KeyStore { - return bridgemocks.NewKeyStore(&keyStoreMock{t}) -} - -func prepareKeyStoreGeneralMockCalls(keyStore *bridgemocks.KeyStore) { - ks := keystore.NewKeyStore(testKeyStoreLocation, keystore.StandardScryptN, keystore.StandardScryptP) - - keyStore.On("Find", mock.Anything).Return(accounts.Account{Address: common.HexToAddress(ethereumAddress)}, nil) - keyStore.On("TimedUnlock", mock.Anything, mock.Anything, mock.Anything).Run( - func(args mock.Arguments) { - err := ks.TimedUnlock(args.Get(0).(accounts.Account), args.Get(1).(string), args.Get(2).(time.Duration)) - if err != nil { - log.Fatalln(err) - } - }, - ).Return(nil) - keyStore.On("SignHash", mock.Anything, mock.Anything).Return([]byte(ethereumAddress), nil) - - keyStore.On("GetEthereumKeyStore").Return(ks) -} - -func Test_ZCNBridge(t *testing.T) { - ethereumClient := getEthereumClient(t) - prepareEthereumClientGeneralMockCalls(ðereumClient.Mock) - - keyStore := getKeyStore(t) - prepareKeyStoreGeneralMockCalls(keyStore) - - bridgeClient := getBridgeClient(alchemyEthereumNodeURL, ethereumClient, keyStore) - - t.Run("should update authorizer config.", func(t *testing.T) { - source := &authorizerNodeSource{ - ID: "12345678", - Config: &authorizerConfigSource{ - Fee: "999", - }, - } - target := &authorizerNodeTarget{} - - bytes, err := json.Marshal(source) - require.NoError(t, err) - - err = target.decode(bytes) - require.NoError(t, err) - - require.Equal(t, "", target.URL) - require.Equal(t, "", target.PublicKey) - require.Equal(t, "12345678", target.ID) - require.Equal(t, sdkcommon.Balance(999), target.Config.Fee) - }) - - t.Run("should check configuration formating in MintWZCN", func(t *testing.T) { - _, err := bridgeClient.MintWZCN(context.Background(), ðereum.MintPayload{ - ZCNTxnID: zcnTxnID, - Amount: amount, - To: ethereumAddress, - Nonce: nonce, - Signatures: ethereumSignatures, - }) - require.NoError(t, err) - - var sigs [][]byte - for _, signature := range ethereumSignatures { - sigs = append(sigs, signature.Signature) - } - - to := common.HexToAddress(bridgeAddress) - fromAddress := common.HexToAddress(ethereumAddress) - - rawAbi, err := binding.BridgeMetaData.GetAbi() - require.NoError(t, err) - - pack, err := rawAbi.Pack("mint", common.HexToAddress(ethereumAddress), - big.NewInt(amount), - DefaultClientIDEncoder(zcnTxnID), - big.NewInt(nonce), - sigs) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: fromAddress, - Data: pack, - }, - )) - }) - - t.Run("should check configuration formating in BurnWZCN", func(t *testing.T) { - coreClient.SetWallet(zcncrypto.Wallet{ - ClientID: clientId, - }) - _, err := bridgeClient.BurnWZCN(context.Background(), amount) - require.NoError(t, err) - - to := common.HexToAddress(bridgeAddress) - fromAddress := common.HexToAddress(ethereumAddress) - - rawAbi, err := binding.BridgeMetaData.GetAbi() - require.NoError(t, err) - - pack, err := rawAbi.Pack("burn", big.NewInt(amount), DefaultClientIDEncoder(coreClient.Id())) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: fromAddress, - Data: pack, - }, - )) - }) - - //TODO:JAYASHTODO - //t.Run("should check configuration used by MintZCN", func(t *testing.T) { - // payload := &zcnsc.MintPayload{ - // EthereumTxnID: ethereumTxnID, - // Amount: sdkcommon.Balance(amount), - // Nonce: nonce, - // Signatures: zcnScSignatures, - // ReceivingClientID: clientId, - // } - // - // _, err := bridgeClient.MintZCN(context.Background(), payload) - // require.NoError(t, err) - // - // require.True(t, tx.AssertCalled( - // t, - // "ExecuteSmartContract", - // context.Background(), - // wallet.ZCNSCSmartContractAddress, - // wallet.MintFunc, - // payload, - // uint64(0), - // )) - //}) - // - //t.Run("should check configuration used by BurnZCN", func(t *testing.T) { - // _, _, err := bridgeClient.BurnZCN(amount) - // require.NoError(t, err) - // - // require.True(t, tx.AssertCalled( - // t, - // "ExecuteSmartContract", - // context.Background(), - // wallet.ZCNSCSmartContractAddress, - // wallet.BurnFunc, - // zcnsc.BurnPayload{ - // EthereumAddress: ethereumAddress, - // }, - // uint64(amount), - // )) - //}) - - t.Run("should check configuration used by AddEthereumAuthorizer", func(t *testing.T) { - _, err := bridgeClient.AddEthereumAuthorizer(context.Background(), common.HexToAddress(authorizerDelegatedAddress)) - require.NoError(t, err) - - to := common.HexToAddress(authorizersAddress) - fromAddress := common.HexToAddress(ethereumAddress) - - rawAbi, err := authorizers.AuthorizersMetaData.GetAbi() - require.NoError(t, err) - - pack, err := rawAbi.Pack("addAuthorizers", common.HexToAddress(authorizerDelegatedAddress)) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: fromAddress, - Data: pack, - }, - )) - }) - - t.Run("should check configuration used by RemoveAuthorizer", func(t *testing.T) { - _, err := bridgeClient.RemoveEthereumAuthorizer(context.Background(), common.HexToAddress(authorizerDelegatedAddress)) - require.NoError(t, err) - - to := common.HexToAddress(authorizersAddress) - fromAddress := common.HexToAddress(ethereumAddress) - - rawAbi, err := authorizers.AuthorizersMetaData.GetAbi() - require.NoError(t, err) - - pack, err := rawAbi.Pack("removeAuthorizers", common.HexToAddress(authorizerDelegatedAddress)) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: fromAddress, - Data: pack, - }, - )) - }) - - t.Run("should check configuration used by IncreaseBurnerAllowance", func(t *testing.T) { - _, err := bridgeClient.IncreaseBurnerAllowance(context.Background(), amount) - require.NoError(t, err) - - spenderAddress := common.HexToAddress(bridgeAddress) - - to := common.HexToAddress(tokenAddress) - fromAddress := common.HexToAddress(ethereumAddress) - - rawAbi, err := zcntoken.TokenMetaData.GetAbi() - require.NoError(t, err) - - pack, err := rawAbi.Pack("increaseApproval", spenderAddress, big.NewInt(amount)) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: fromAddress, - Data: pack, - }, - )) - }) - - t.Run("should check configuration used by SwapETH", func(t *testing.T) { - uniswapSmartContractCodeRaw, err := hex.DecodeString(uniswapSmartContractCode) - require.NoError(t, err) - - ethereumClient.On("PendingCodeAt", mock.Anything, mock.Anything).Return(uniswapSmartContractCodeRaw, nil) - - _, err = bridgeClient.SwapETH(context.Background(), amount, amount) - require.NoError(t, err) - - // 1. To address parameter. - to := common.HexToAddress(bridgeClient.UniswapAddress) - - // 2. From address parameter. - from := common.HexToAddress(bridgeClient.EthereumAddress) - - // 3. Swap amount parameter - swapAmount := big.NewInt(amount) - - var rawAbi *abi.ABI - - rawAbi, err = uniswapnetwork.UniswapMetaData.GetAbi() - require.NoError(t, err) - - var pack []byte - - pack, err = rawAbi.Pack("swapETHForZCNExactAmountOut", swapAmount) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: from, - Data: pack, - Value: swapAmount, - GasPrice: big.NewInt(400000), - }, - )) - }) - - t.Run("should check configuration used by SwapUSDC", func(t *testing.T) { - uniswapSmartContractCodeRaw, err := hex.DecodeString(uniswapSmartContractCode) - require.NoError(t, err) - - ethereumClient.On("PendingCodeAt", mock.Anything, mock.Anything).Return(uniswapSmartContractCodeRaw, nil) - - _, err = bridgeClient.SwapUSDC(context.Background(), amount, amount) - require.NoError(t, err) - - // 1. To address parameter. - to := common.HexToAddress(bridgeClient.UniswapAddress) - - // 2. From address parameter. - from := common.HexToAddress(bridgeClient.EthereumAddress) - - // 3. Swap amount parameter - swapAmount := big.NewInt(amount) - - var rawAbi *abi.ABI - - rawAbi, err = uniswapnetwork.UniswapMetaData.GetAbi() - require.NoError(t, err) - - var pack []byte - - pack, err = rawAbi.Pack("swapUSDCForZCNExactAmountOut", swapAmount, swapAmount) - require.NoError(t, err) - - require.True(t, ethereumClient.AssertCalled( - t, - "EstimateGas", - context.Background(), - eth.CallMsg{ - To: &to, - From: from, - Data: pack, - Value: big.NewInt(0), - GasPrice: big.NewInt(400000), - }, - )) - }) - - t.Run("should check configuration used by CreateSignedTransactionFromKeyStore", func(t *testing.T) { - bridgeClient.CreateSignedTransactionFromKeyStore(ethereumClient, 400000) - - require.True(t, ethereumClient.AssertCalled( - t, - "PendingNonceAt", - context.Background(), - common.HexToAddress(ethereumAddress))) - - require.True(t, keyStore.AssertCalled( - t, - "TimedUnlock", - accounts.Account{ - Address: common.HexToAddress(ethereumAddress), - }, - password, - time.Second*2, - )) - }) - - t.Run("should check if gas price estimation works with correct alchemy ethereum node url", func(t *testing.T) { - bridgeClient = getBridgeClient(alchemyEthereumNodeURL, ethereumClient, keyStore) - - _, err := bridgeClient.EstimateGasPrice(context.Background()) - require.Contains(t, err.Error(), "Must be authenticated!") - }) - - t.Run("should check if gas price estimation works with correct tenderly ethereum node url", func(t *testing.T) { - bridgeClient = getBridgeClient(tenderlyEthereumNodeURL, ethereumClient, keyStore) - - _, err := bridgeClient.EstimateGasPrice(context.Background()) - require.NoError(t, err) - }) - - t.Run("should check if gas price estimation works with incorrect ethereum node url", func(t *testing.T) { - bridgeClient = getBridgeClient(infuraEthereumNodeURL, ethereumClient, keyStore) - - _, err := bridgeClient.EstimateGasPrice(context.Background()) - require.Error(t, err) - }) -} diff --git a/zcnbridge/config.go b/zcnbridge/config.go deleted file mode 100644 index ba08a38fb..000000000 --- a/zcnbridge/config.go +++ /dev/null @@ -1,169 +0,0 @@ -package zcnbridge - -import ( - "context" - "fmt" - "math/big" - "path" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - - "github.com/0chain/gosdk/zcnbridge/log" - "github.com/ethereum/go-ethereum/ethclient" - - "github.com/spf13/viper" -) - -const ( - TenderlyProvider = iota - AlchemyProvider - UnknownProvider -) - -const ( - EthereumWalletStorageDir = "wallets" -) - -const ( - UniswapRouterAddress = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" - UsdcTokenAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" - WethTokenAddress = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" -) - -// BridgeSDKConfig describes the configuration for the bridge SDK. -type BridgeSDKConfig struct { - LogLevel *string - LogPath *string - ConfigChainFile *string - ConfigDir *string - Development *bool -} - -// EthereumClient describes Ethereum JSON-RPC client generealized interface -type EthereumClient interface { - bind.ContractBackend - - ChainID(ctx context.Context) (*big.Int, error) -} - -// BridgeClient is a wrapper, which exposes Ethereum KeyStore methods used by DEX bridge. -type BridgeClient struct { - keyStore KeyStore - ethereumClient EthereumClient - - BridgeAddress, - TokenAddress, - AuthorizersAddress, - UniswapAddress, - NFTConfigAddress, - EthereumAddress, - EthereumNodeURL, - Password string - - BancorAPIURL string - - ConsensusThreshold float64 - GasLimit uint64 -} - -// NewBridgeClient creates BridgeClient with the given parameters. -// - bridgeAddress is the address of the bridge smart contract on the Ethereum network. -// - tokenAddress is the address of the token smart contract on the Ethereum network. -// - authorizersAddress is the address of the authorizers smart contract on the Ethereum network. -// - authorizersAddress is the address of the authorizers smart contract on the Ethereum network. -// - uniswapAddress is the address of the user's ethereum wallet (on UniSwap). -// - ethereumAddress is the address of the user's ethereum wallet. -// - ethereumNodeURL is the URL of the Ethereum node. -// - password is the password for the user's ethereum wallet. -// - gasLimit is the gas limit for the transactions. -// - consensusThreshold is the consensus threshold, the minimum percentage of authorizers that need to agree on a transaction. -// - ethereumClient is the Ethereum JSON-RPC client. -// - transactionProvider provider interface for the transaction entity. -// - keyStore is the Ethereum KeyStore instance. -func NewBridgeClient( - bridgeAddress, - tokenAddress, - authorizersAddress, - uniswapAddress, - ethereumAddress, - ethereumNodeURL, - password string, - gasLimit uint64, - consensusThreshold float64, - ethereumClient EthereumClient, - keyStore KeyStore) *BridgeClient { - address := common.HexToAddress(ethereumAddress).Hex() - return &BridgeClient{ - BridgeAddress: bridgeAddress, - TokenAddress: tokenAddress, - AuthorizersAddress: authorizersAddress, - UniswapAddress: uniswapAddress, - EthereumAddress: address, - EthereumNodeURL: ethereumNodeURL, - Password: password, - GasLimit: gasLimit, - ConsensusThreshold: consensusThreshold, - ethereumClient: ethereumClient, - keyStore: keyStore, - } -} - -func initChainConfig(sdkConfig *BridgeSDKConfig) *viper.Viper { - cfg := readConfig(sdkConfig, func() string { - return *sdkConfig.ConfigChainFile - }) - - log.Logger.Info(fmt.Sprintf("Chain config has been initialized from %s", cfg.ConfigFileUsed())) - - return cfg -} - -func readConfig(sdkConfig *BridgeSDKConfig, getConfigName func() string) *viper.Viper { - cfg := viper.New() - cfg.AddConfigPath(*sdkConfig.ConfigDir) - cfg.SetConfigName(getConfigName()) - cfg.SetConfigType("yaml") - err := cfg.ReadInConfig() - if err != nil { - log.Logger.Fatal(fmt.Errorf("%w: can't read config", err).Error()) - } - return cfg -} - -// SetupBridgeClientSDK initializes new bridge client. -// Meant to be used from standalone application with 0chain SDK initialized. -// - cfg is the configuration for the bridge SDK. -func SetupBridgeClientSDK(cfg *BridgeSDKConfig) *BridgeClient { - log.InitLogging(*cfg.Development, *cfg.LogPath, *cfg.LogLevel) - - chainCfg := initChainConfig(cfg) - - ethereumNodeURL := chainCfg.GetString("ethereum_node_url") - - ethereumClient, err := ethclient.Dial(ethereumNodeURL) - if err != nil { - Logger.Error(err) - } - - homedir := path.Dir(chainCfg.ConfigFileUsed()) - if homedir == "" { - log.Logger.Fatal("err happened during home directory retrieval") - } - - keyStore := NewKeyStore(path.Join(homedir, EthereumWalletStorageDir)) - - return NewBridgeClient( - chainCfg.GetString("bridge.bridge_address"), - chainCfg.GetString("bridge.token_address"), - chainCfg.GetString("bridge.authorizers_address"), - chainCfg.GetString("bridge.uniswap_address"), - chainCfg.GetString("bridge.ethereum_address"), - ethereumNodeURL, - chainCfg.GetString("bridge.password"), - chainCfg.GetUint64("bridge.gas_limit"), - chainCfg.GetFloat64("bridge.consensus_threshold"), - ethereumClient, - keyStore, - ) -} diff --git a/zcnbridge/crypto/hash.go b/zcnbridge/crypto/hash.go deleted file mode 100644 index de4dc4304..000000000 --- a/zcnbridge/crypto/hash.go +++ /dev/null @@ -1,46 +0,0 @@ -// Methods and types to support cryptographic operations. -package crypto - -import ( - "encoding/hex" - - "golang.org/x/crypto/sha3" -) - -const HashLength = 32 - -type HashBytes [HashLength]byte - -// Hash computes hash of the given data using RawHash and returns result as hex decoded string. -func Hash(data interface{}) string { - return hex.EncodeToString(RawHash(data)) -} - -// RawHash computes SHA3-256 hash depending on data type and returns the hash bytes. -// -// RawHash panics if data type is unknown. -// -// Known types: -// -// - []byte -// -// - HashBytes -// -// - string -func RawHash(data interface{}) []byte { - var databuf []byte - switch dataImpl := data.(type) { - case []byte: - databuf = dataImpl - case HashBytes: - databuf = dataImpl[:] - case string: - databuf = []byte(dataImpl) - default: - panic("unknown type") - } - hash := sha3.New256() - hash.Write(databuf) - var buf []byte - return hash.Sum(buf) -} diff --git a/zcnbridge/doc.go b/zcnbridge/doc.go deleted file mode 100644 index 241d25f3d..000000000 --- a/zcnbridge/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Methods and types to interact with the Bridge protocol. -// Bridge protocol defines how clients can exchange tokens between 0chain and Ethereum blockchains. -// It defines the functionality to Mint/Burn native or ERC20 Züs tokens. -package zcnbridge \ No newline at end of file diff --git a/zcnbridge/errors/errors.go b/zcnbridge/errors/errors.go deleted file mode 100644 index 2737754ee..000000000 --- a/zcnbridge/errors/errors.go +++ /dev/null @@ -1,109 +0,0 @@ -// Error struct and functions. -package errors - -import ( - "errors" - "fmt" - "os" -) - -const ( - delim = ": " -) - -type ( - // Error type for a new application error. - Error struct { - Code string `json:"code,omitempty"` - Msg string `json:"msg"` - } -) - -type ( - // ErrWrapper implements error wrapper interface. - ErrWrapper struct { - code string - text string - wrap error - } -) - -// Error implements error interface. -func (e *ErrWrapper) Error() string { - return e.code + delim + e.text -} - -// Unwrap implements error unwrap interface. -func (e *ErrWrapper) Unwrap() error { - return e.wrap -} - -// Wrap implements error wrapper interface. -func (e *ErrWrapper) Wrap(err error) *ErrWrapper { - return Wrap(e.code, e.text, err) -} - -// Any reports whether an error in error's chain -// matches to any error provided in list. -func Any(err error, targets ...error) bool { - for _, target := range targets { - if errors.Is(err, target) { - return true - } - } - - return false -} - -// ExitErr prints error to os.Stderr and call os.Exit with given code. -func ExitErr(text string, err error, code int) { - text = Wrap("exit", text, err).Error() - _, _ = os.Stderr.Write([]byte(text)) - os.Exit(code) -} - -// ExitMsg prints message to os.Stderr and call os.Exit with given code. -func ExitMsg(text string, code int) { - text = New("exit", text).Error() - _, _ = os.Stderr.Write([]byte(text)) - os.Exit(code) -} - -// Is checks if error is equal to target error. -// - err: error to check -// - target: target error to compare -func Is(err, target error) bool { - return errors.Is(err, target) -} - -// New returns constructed error wrapper interface. -func New(code, text string) *ErrWrapper { - return &ErrWrapper{code: code, text: text} -} - -// Wrap wraps given error into a new error with format. -func Wrap(code, text string, err error) *ErrWrapper { - wrapper := &ErrWrapper{code: code, text: text} - if err != nil && !errors.Is(wrapper, err) { - wrapper.wrap = err - wrapper.text += delim + err.Error() - } - - return wrapper -} - -func (err *Error) Error() string { - return fmt.Sprintf("%s: %s", err.Code, err.Msg) -} - -// NewError create a new error instance given a code and a message. -// - code: error code -// - msg: error message -func NewError(code string, msg string) *Error { - return &Error{Code: code, Msg: msg} -} - -/*NewErrorf - create a new error with format */ -func NewErrorf(code string, format string, args ...interface{}) *Error { - return &Error{Code: code, Msg: fmt.Sprintf(format, args...)} -} diff --git a/zcnbridge/errors/errors_test.go b/zcnbridge/errors/errors_test.go deleted file mode 100644 index ab92ee410..000000000 --- a/zcnbridge/errors/errors_test.go +++ /dev/null @@ -1,243 +0,0 @@ -package errors - -import ( - "reflect" - "testing" -) - -const ( - testCode = "test_code" - testText = "test text" - wrapCode = "wrap_code" - wrapText = "wrap text" -) - -func Test_errWrapper_Error(t *testing.T) { - t.Parallel() - - tests := [1]struct { - name string - err error - want string - }{ - { - name: "OK", - err: Wrap(wrapCode, wrapText, New(testCode, testText)), - want: wrapCode + delim + wrapText + delim + testCode + delim + testText, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := test.err.Error(); got != test.want { - t.Errorf("Error() got: %v | want: %v", got, test.want) - } - }) - } -} - -func Test_errWrapper_Unwrap(t *testing.T) { - t.Parallel() - - err := New(testCode, testText) - - tests := [1]struct { - name string - wrapper *ErrWrapper - want error - }{ - { - name: "OK", - wrapper: Wrap(wrapCode, wrapText, err), - want: err, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := test.wrapper.Unwrap(); !reflect.DeepEqual(got, test.want) { - t.Errorf("Unwrap() got: %#v | want: %#v", got, test.want) - } - }) - } -} - -func Test_errWrapper_Wrap(t *testing.T) { - t.Parallel() - - err := New(testCode, testText) - - tests := [1]struct { - name string - error error - wrapper *ErrWrapper - want *ErrWrapper - }{ - { - name: "OK", - error: New(testCode, testText), - wrapper: New(wrapCode, wrapText), - want: &ErrWrapper{code: wrapCode, text: wrapText + delim + err.Error(), wrap: err}, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := test.wrapper.Wrap(test.error); !reflect.DeepEqual(got, test.want) { - t.Errorf("Wrap() got: %#v | want: %#v", got, test.want) - } - }) - } -} - -func Test_errAny(t *testing.T) { - t.Parallel() - - testErr := New(testCode, testText) - wrapErr := Wrap(wrapCode, wrapText, testErr) - - tests := [2]struct { - name string - list []error - wrapErr error - want bool - }{ - { - name: "TRUE", - list: []error{testErr}, - wrapErr: wrapErr, - want: true, - }, - { - name: "FALSE", - list: []error{testErr}, - wrapErr: Wrap(wrapCode, wrapText, New(testCode, testText)), - want: false, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := Any(test.wrapErr, test.list...); got != test.want { - t.Errorf("errIs() got: %v | want: %v", got, test.want) - } - }) - } -} - -func Test_errIs(t *testing.T) { - t.Parallel() - - testErr := New(testCode, testText) - wrapErr := Wrap(wrapCode, wrapText, testErr) - - tests := [2]struct { - name string - testErr error - wrapErr error - want bool - }{ - { - name: "TRUE", - testErr: testErr, - wrapErr: wrapErr, - want: true, - }, - { - name: "FALSE", - testErr: testErr, - wrapErr: Wrap(wrapCode, wrapText, New(testCode, testText)), - want: false, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := Is(test.wrapErr, test.testErr); got != test.want { - t.Errorf("errIs() got: %v | want: %v", got, test.want) - } - }) - } -} - -func Test_errNew(t *testing.T) { - t.Parallel() - - tests := [1]struct { - name string - code string - text string - want *ErrWrapper - }{ - { - name: "Equal", - code: testCode, - text: testText, - want: &ErrWrapper{code: testCode, text: testText}, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := New(test.code, test.text); !reflect.DeepEqual(got, test.want) { - t.Errorf("errNew() got: %#v | want: %#v", got, test.want) - } - }) - } -} - -func Test_errWrap(t *testing.T) { - t.Parallel() - - tests := [2]struct { - name string - code string - text string - wrap error - want string - }{ - { - name: "OK", - code: wrapCode, - text: wrapText, - wrap: New(testCode, testText), - want: wrapCode + delim + wrapText + delim + testCode + delim + testText, - }, - { - name: "nil_Wrap_OK", - code: wrapCode, - text: wrapText, - wrap: nil, - want: wrapCode + delim + wrapText, - }, - } - - for idx := range tests { - test := tests[idx] - t.Run(test.name, func(t *testing.T) { - t.Parallel() - - if got := Wrap(test.code, test.text, test.wrap).Error(); got != test.want { - t.Errorf("errWrap() got: %#v | want: %#v", got, test.want) - } - }) - } -} diff --git a/zcnbridge/ethereum/authorizers/authorizers.go b/zcnbridge/ethereum/authorizers/authorizers.go deleted file mode 100644 index 600816d4d..000000000 --- a/zcnbridge/ethereum/authorizers/authorizers.go +++ /dev/null @@ -1,639 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package authorizers - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// AuthorizersMetaData contains all meta data concerning the Authorizers contract. -var AuthorizersMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"authorizerCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"authorizers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isAuthorizer\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"message_\",\"type\":\"bytes32\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures_\",\"type\":\"bytes[]\"}],\"name\":\"authorize\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"txid_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"nonce_\",\"type\":\"uint256\"}],\"name\":\"messageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"authorizer_\",\"type\":\"address\"}],\"name\":\"addAuthorizers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"authorizer_\",\"type\":\"address\"}],\"name\":\"removeAuthorizers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6080604052600060025534801561001557600080fd5b5061001f33610024565b610074565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610f33806100836000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b1461012e578063c85501bb14610149578063e304688f14610151578063f2fde38b14610174578063f36bf4011461018757600080fd5b806309c7a20f146100a35780630b249ae4146100e757806343ab2c9e14610108578063715018a61461011d5780637ac3d68d14610125575b600080fd5b6100cd6100b1366004610c17565b6001602081905260009182526040909120805491015460ff1682565b604080519283529015156020830152015b60405180910390f35b6100fa6100f5366004610c39565b61019a565b6040519081526020016100de565b61011b610116366004610c17565b6101dd565b005b61011b6103bd565b6100fa60025481565b6000546040516001600160a01b0390911681526020016100de565b6100fa6103d1565b61016461015f366004610cc8565b61040a565b60405190151581526020016100de565b61011b610182366004610c17565b6106f6565b61011b610195366004610c17565b61076c565b60006101d386868686866040516020016101b8959493929190610d47565b60405160208183030381529060405280519060200120610887565b9695505050505050565b6101e56108da565b6001600160a01b0381166102145760405162461bcd60e51b815260040161020b90610d7b565b60405180910390fd5b6001600160a01b0381166000908152600160208190526040909120015460ff161561029a5760405162461bcd60e51b815260206004820152603060248201527f417574686f72697a657220776974682074686520676976656e2061646472657360448201526f7320616c72656164792065786973747360801b606482015260840161020b565b6003541561035b576040518060400160405280600360016003805490506102c19190610dd5565b815481106102d1576102d1610dec565b600091825260208083209190910154835260019281018390526001600160a01b03851682528281526040909120835181559201519101805460ff1916911515919091179055600380548061032757610327610e02565b600190038181906000526020600020016000905590556001600260008282546103509190610e18565b909155506103ba9050565b604080518082018252600280548252600160208084018281526001600160a01b038716600090815291839052948120935184559351928101805460ff1916931515939093179092558054919290916103b4908490610e18565b90915550505b50565b6103c56108da565b6103cf6000610934565b565b60006003600160025460026103e69190610e30565b6103f09190610dd5565b6103fa9190610e4f565b610405906001610e18565b905090565b6000806002541161046b5760405162461bcd60e51b815260206004820152602560248201527f4e6f20617574686f72697a657220686173206265656e2072656769737465726560448201526419081e595d60da1b606482015260840161020b565b6104736103d1565b8210156104cd5760405162461bcd60e51b815260206004820152602260248201527f416d6f756e74206f66207369676e617475726573206973206e6f7420656e6f756044820152610ced60f31b606482015260840161020b565b600060025467ffffffffffffffff8111156104ea576104ea610e71565b604051908082528060200260200182016040528015610513578160200160208202803683370190505b50905060005b838110156106ea57600061059086868481811061053857610538610dec565b905060200281019061054a9190610e87565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061058a92508b91506108879050565b90610984565b6001600160a01b0381166000908152600160208190526040909120015490915060ff166105ff5760405162461bcd60e51b815260206004820152601f60248201527f476976656e206d657373616765206973206e6f7420617574686f72697a656400604482015260640161020b565b6001600160a01b0381166000908152600160205260409020548351849190811061062b5761062b610dec565b6020026020010151156106985760405162461bcd60e51b815260206004820152602f60248201527f476976656e207369676e61747572657320636f6e7461696e206475706c69636160448201526e74656420617574686f72697a65727360881b606482015260840161020b565b6001600160a01b038116600090815260016020819052604090912054845185919081106106c7576106c7610dec565b9115156020928302919091019091015250806106e281610ece565b915050610519565b50600195945050505050565b6106fe6108da565b6001600160a01b0381166107635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161020b565b6103ba81610934565b6107746108da565b6001600160a01b03811661079a5760405162461bcd60e51b815260040161020b90610d7b565b6001600160a01b0381166000908152600160208190526040909120015460ff1661081f5760405162461bcd60e51b815260206004820152603060248201527f417574686f72697a657220776974682074686520676976656e2061646472657360448201526f1cc8191bd95cc81b9bdd08195e1a5cdd60821b606482015260840161020b565b6001600160a01b03811660009081526001602081905260408220808201805460ff19169055546003805480840182559084527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b015560028054919290916103b4908490610dd5565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000546001600160a01b031633146103cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600061099385856109a8565b915091506109a0816109ed565b509392505050565b60008082516041036109de5760208301516040840151606085015160001a6109d287828585610b37565b945094505050506109e6565b506000905060025b9250929050565b6000816004811115610a0157610a01610ee7565b03610a095750565b6001816004811115610a1d57610a1d610ee7565b03610a6a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161020b565b6002816004811115610a7e57610a7e610ee7565b03610acb5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161020b565b6003816004811115610adf57610adf610ee7565b036103ba5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161020b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610b6e5750600090506003610bf2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610bc2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610beb57600060019250925050610bf2565b9150600090505b94509492505050565b80356001600160a01b0381168114610c1257600080fd5b919050565b600060208284031215610c2957600080fd5b610c3282610bfb565b9392505050565b600080600080600060808688031215610c5157600080fd5b610c5a86610bfb565b945060208601359350604086013567ffffffffffffffff80821115610c7e57600080fd5b818801915088601f830112610c9257600080fd5b813581811115610ca157600080fd5b896020828501011115610cb357600080fd5b96999598505060200195606001359392505050565b600080600060408486031215610cdd57600080fd5b83359250602084013567ffffffffffffffff80821115610cfc57600080fd5b818601915086601f830112610d1057600080fd5b813581811115610d1f57600080fd5b8760208260051b8501011115610d3457600080fd5b6020830194508093505050509250925092565b6bffffffffffffffffffffffff198660601b1681528460148201528284603483013760349201918201526054019392505050565b60208082526024908201527f496e76616c696420617574686f72697a6572206164647265737320776173206760408201526334bb32b760e11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015610de757610de7610dbf565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60008219821115610e2b57610e2b610dbf565b500190565b6000816000190483118215151615610e4a57610e4a610dbf565b500290565b600082610e6c57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052604160045260246000fd5b6000808335601e19843603018112610e9e57600080fd5b83018035915067ffffffffffffffff821115610eb957600080fd5b6020019150368190038213156109e657600080fd5b600060018201610ee057610ee0610dbf565b5060010190565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220d36512e87ac563a1b5880c9eb0c665cc8b3875c8c66d26ea6aa50ec191d4719364736f6c634300080f0033", -} - -// AuthorizersABI is the input ABI used to generate the binding from. -// Deprecated: Use AuthorizersMetaData.ABI instead. -var AuthorizersABI = AuthorizersMetaData.ABI - -// AuthorizersBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use AuthorizersMetaData.Bin instead. -var AuthorizersBin = AuthorizersMetaData.Bin - -// DeployAuthorizers deploys a new Ethereum contract, binding an instance of Authorizers to it. -func DeployAuthorizers(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Authorizers, error) { - parsed, err := AuthorizersMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AuthorizersBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Authorizers{AuthorizersCaller: AuthorizersCaller{contract: contract}, AuthorizersTransactor: AuthorizersTransactor{contract: contract}, AuthorizersFilterer: AuthorizersFilterer{contract: contract}}, nil -} - -// Authorizers is an auto generated Go binding around an Ethereum contract. -type Authorizers struct { - AuthorizersCaller // Read-only binding to the contract - AuthorizersTransactor // Write-only binding to the contract - AuthorizersFilterer // Log filterer for contract events -} - -// AuthorizersCaller is an auto generated read-only Go binding around an Ethereum contract. -type AuthorizersCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AuthorizersTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AuthorizersTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AuthorizersFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AuthorizersFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AuthorizersSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AuthorizersSession struct { - Contract *Authorizers // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AuthorizersCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AuthorizersCallerSession struct { - Contract *AuthorizersCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AuthorizersTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AuthorizersTransactorSession struct { - Contract *AuthorizersTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AuthorizersRaw is an auto generated low-level Go binding around an Ethereum contract. -type AuthorizersRaw struct { - Contract *Authorizers // Generic contract binding to access the raw methods on -} - -// AuthorizersCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AuthorizersCallerRaw struct { - Contract *AuthorizersCaller // Generic read-only contract binding to access the raw methods on -} - -// AuthorizersTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AuthorizersTransactorRaw struct { - Contract *AuthorizersTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAuthorizers creates a new instance of Authorizers, bound to a specific deployed contract. -func NewAuthorizers(address common.Address, backend bind.ContractBackend) (*Authorizers, error) { - contract, err := bindAuthorizers(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Authorizers{AuthorizersCaller: AuthorizersCaller{contract: contract}, AuthorizersTransactor: AuthorizersTransactor{contract: contract}, AuthorizersFilterer: AuthorizersFilterer{contract: contract}}, nil -} - -// NewAuthorizersCaller creates a new read-only instance of Authorizers, bound to a specific deployed contract. -func NewAuthorizersCaller(address common.Address, caller bind.ContractCaller) (*AuthorizersCaller, error) { - contract, err := bindAuthorizers(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AuthorizersCaller{contract: contract}, nil -} - -// NewAuthorizersTransactor creates a new write-only instance of Authorizers, bound to a specific deployed contract. -func NewAuthorizersTransactor(address common.Address, transactor bind.ContractTransactor) (*AuthorizersTransactor, error) { - contract, err := bindAuthorizers(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AuthorizersTransactor{contract: contract}, nil -} - -// NewAuthorizersFilterer creates a new log filterer instance of Authorizers, bound to a specific deployed contract. -func NewAuthorizersFilterer(address common.Address, filterer bind.ContractFilterer) (*AuthorizersFilterer, error) { - contract, err := bindAuthorizers(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AuthorizersFilterer{contract: contract}, nil -} - -// bindAuthorizers binds a generic wrapper to an already deployed contract. -func bindAuthorizers(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(AuthorizersABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Authorizers *AuthorizersRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Authorizers.Contract.AuthorizersCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Authorizers *AuthorizersRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Authorizers.Contract.AuthorizersTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Authorizers *AuthorizersRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Authorizers.Contract.AuthorizersTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Authorizers *AuthorizersCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Authorizers.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Authorizers *AuthorizersTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Authorizers.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Authorizers *AuthorizersTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Authorizers.Contract.contract.Transact(opts, method, params...) -} - -// Authorize is a free data retrieval call binding the contract method 0xe304688f. -// -// Solidity: function authorize(bytes32 message_, bytes[] signatures_) view returns(bool) -func (_Authorizers *AuthorizersCaller) Authorize(opts *bind.CallOpts, message_ [32]byte, signatures_ [][]byte) (bool, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "authorize", message_, signatures_) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Authorize is a free data retrieval call binding the contract method 0xe304688f. -// -// Solidity: function authorize(bytes32 message_, bytes[] signatures_) view returns(bool) -func (_Authorizers *AuthorizersSession) Authorize(message_ [32]byte, signatures_ [][]byte) (bool, error) { - return _Authorizers.Contract.Authorize(&_Authorizers.CallOpts, message_, signatures_) -} - -// Authorize is a free data retrieval call binding the contract method 0xe304688f. -// -// Solidity: function authorize(bytes32 message_, bytes[] signatures_) view returns(bool) -func (_Authorizers *AuthorizersCallerSession) Authorize(message_ [32]byte, signatures_ [][]byte) (bool, error) { - return _Authorizers.Contract.Authorize(&_Authorizers.CallOpts, message_, signatures_) -} - -// AuthorizerCount is a free data retrieval call binding the contract method 0x7ac3d68d. -// -// Solidity: function authorizerCount() view returns(uint256) -func (_Authorizers *AuthorizersCaller) AuthorizerCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "authorizerCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// AuthorizerCount is a free data retrieval call binding the contract method 0x7ac3d68d. -// -// Solidity: function authorizerCount() view returns(uint256) -func (_Authorizers *AuthorizersSession) AuthorizerCount() (*big.Int, error) { - return _Authorizers.Contract.AuthorizerCount(&_Authorizers.CallOpts) -} - -// AuthorizerCount is a free data retrieval call binding the contract method 0x7ac3d68d. -// -// Solidity: function authorizerCount() view returns(uint256) -func (_Authorizers *AuthorizersCallerSession) AuthorizerCount() (*big.Int, error) { - return _Authorizers.Contract.AuthorizerCount(&_Authorizers.CallOpts) -} - -// Authorizers is a free data retrieval call binding the contract method 0x09c7a20f. -// -// Solidity: function authorizers(address ) view returns(uint256 index, bool isAuthorizer) -func (_Authorizers *AuthorizersCaller) Authorizers(opts *bind.CallOpts, arg0 common.Address) (struct { - Index *big.Int - IsAuthorizer bool -}, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "authorizers", arg0) - - outstruct := new(struct { - Index *big.Int - IsAuthorizer bool - }) - if err != nil { - return *outstruct, err - } - - outstruct.Index = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.IsAuthorizer = *abi.ConvertType(out[1], new(bool)).(*bool) - - return *outstruct, err - -} - -// Authorizers is a free data retrieval call binding the contract method 0x09c7a20f. -// -// Solidity: function authorizers(address ) view returns(uint256 index, bool isAuthorizer) -func (_Authorizers *AuthorizersSession) Authorizers(arg0 common.Address) (struct { - Index *big.Int - IsAuthorizer bool -}, error) { - return _Authorizers.Contract.Authorizers(&_Authorizers.CallOpts, arg0) -} - -// Authorizers is a free data retrieval call binding the contract method 0x09c7a20f. -// -// Solidity: function authorizers(address ) view returns(uint256 index, bool isAuthorizer) -func (_Authorizers *AuthorizersCallerSession) Authorizers(arg0 common.Address) (struct { - Index *big.Int - IsAuthorizer bool -}, error) { - return _Authorizers.Contract.Authorizers(&_Authorizers.CallOpts, arg0) -} - -// MessageHash is a free data retrieval call binding the contract method 0x0b249ae4. -// -// Solidity: function messageHash(address to_, uint256 amount_, bytes txid_, uint256 nonce_) pure returns(bytes32) -func (_Authorizers *AuthorizersCaller) MessageHash(opts *bind.CallOpts, to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int) ([32]byte, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "messageHash", to_, amount_, txid_, nonce_) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// MessageHash is a free data retrieval call binding the contract method 0x0b249ae4. -// -// Solidity: function messageHash(address to_, uint256 amount_, bytes txid_, uint256 nonce_) pure returns(bytes32) -func (_Authorizers *AuthorizersSession) MessageHash(to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int) ([32]byte, error) { - return _Authorizers.Contract.MessageHash(&_Authorizers.CallOpts, to_, amount_, txid_, nonce_) -} - -// MessageHash is a free data retrieval call binding the contract method 0x0b249ae4. -// -// Solidity: function messageHash(address to_, uint256 amount_, bytes txid_, uint256 nonce_) pure returns(bytes32) -func (_Authorizers *AuthorizersCallerSession) MessageHash(to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int) ([32]byte, error) { - return _Authorizers.Contract.MessageHash(&_Authorizers.CallOpts, to_, amount_, txid_, nonce_) -} - -// MinThreshold is a free data retrieval call binding the contract method 0xc85501bb. -// -// Solidity: function minThreshold() view returns(uint256) -func (_Authorizers *AuthorizersCaller) MinThreshold(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "minThreshold") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MinThreshold is a free data retrieval call binding the contract method 0xc85501bb. -// -// Solidity: function minThreshold() view returns(uint256) -func (_Authorizers *AuthorizersSession) MinThreshold() (*big.Int, error) { - return _Authorizers.Contract.MinThreshold(&_Authorizers.CallOpts) -} - -// MinThreshold is a free data retrieval call binding the contract method 0xc85501bb. -// -// Solidity: function minThreshold() view returns(uint256) -func (_Authorizers *AuthorizersCallerSession) MinThreshold() (*big.Int, error) { - return _Authorizers.Contract.MinThreshold(&_Authorizers.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Authorizers *AuthorizersCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Authorizers.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Authorizers *AuthorizersSession) Owner() (common.Address, error) { - return _Authorizers.Contract.Owner(&_Authorizers.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Authorizers *AuthorizersCallerSession) Owner() (common.Address, error) { - return _Authorizers.Contract.Owner(&_Authorizers.CallOpts) -} - -// AddAuthorizers is a paid mutator transaction binding the contract method 0x43ab2c9e. -// -// Solidity: function addAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersTransactor) AddAuthorizers(opts *bind.TransactOpts, authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.contract.Transact(opts, "addAuthorizers", authorizer_) -} - -// AddAuthorizers is a paid mutator transaction binding the contract method 0x43ab2c9e. -// -// Solidity: function addAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersSession) AddAuthorizers(authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.AddAuthorizers(&_Authorizers.TransactOpts, authorizer_) -} - -// AddAuthorizers is a paid mutator transaction binding the contract method 0x43ab2c9e. -// -// Solidity: function addAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersTransactorSession) AddAuthorizers(authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.AddAuthorizers(&_Authorizers.TransactOpts, authorizer_) -} - -// RemoveAuthorizers is a paid mutator transaction binding the contract method 0xf36bf401. -// -// Solidity: function removeAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersTransactor) RemoveAuthorizers(opts *bind.TransactOpts, authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.contract.Transact(opts, "removeAuthorizers", authorizer_) -} - -// RemoveAuthorizers is a paid mutator transaction binding the contract method 0xf36bf401. -// -// Solidity: function removeAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersSession) RemoveAuthorizers(authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.RemoveAuthorizers(&_Authorizers.TransactOpts, authorizer_) -} - -// RemoveAuthorizers is a paid mutator transaction binding the contract method 0xf36bf401. -// -// Solidity: function removeAuthorizers(address authorizer_) returns() -func (_Authorizers *AuthorizersTransactorSession) RemoveAuthorizers(authorizer_ common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.RemoveAuthorizers(&_Authorizers.TransactOpts, authorizer_) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Authorizers *AuthorizersTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Authorizers.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Authorizers *AuthorizersSession) RenounceOwnership() (*types.Transaction, error) { - return _Authorizers.Contract.RenounceOwnership(&_Authorizers.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Authorizers *AuthorizersTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Authorizers.Contract.RenounceOwnership(&_Authorizers.TransactOpts) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Authorizers *AuthorizersTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Authorizers.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Authorizers *AuthorizersSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.TransferOwnership(&_Authorizers.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Authorizers *AuthorizersTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Authorizers.Contract.TransferOwnership(&_Authorizers.TransactOpts, newOwner) -} - -// AuthorizersOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Authorizers contract. -type AuthorizersOwnershipTransferredIterator struct { - Event *AuthorizersOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AuthorizersOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AuthorizersOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AuthorizersOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AuthorizersOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AuthorizersOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AuthorizersOwnershipTransferred represents a OwnershipTransferred event raised by the Authorizers contract. -type AuthorizersOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Authorizers *AuthorizersFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AuthorizersOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Authorizers.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &AuthorizersOwnershipTransferredIterator{contract: _Authorizers.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Authorizers *AuthorizersFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AuthorizersOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Authorizers.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AuthorizersOwnershipTransferred) - if err := _Authorizers.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Authorizers *AuthorizersFilterer) ParseOwnershipTransferred(log types.Log) (*AuthorizersOwnershipTransferred, error) { - event := new(AuthorizersOwnershipTransferred) - if err := _Authorizers.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/zcnbridge/ethereum/bridge/bridge.go b/zcnbridge/ethereum/bridge/bridge.go deleted file mode 100644 index 1e02f0404..000000000 --- a/zcnbridge/ethereum/bridge/bridge.go +++ /dev/null @@ -1,1032 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bridge - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BridgeMetaData contains all meta data concerning the Bridge contract. -var BridgeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"contractIAuthorizers\",\"name\":\"authorizers_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"clientId\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"Burned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes\",\"name\":\"clientId\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"BurnedFullIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"txid\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"Minted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userNonceMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"}],\"name\":\"getUserNonceMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"resetUserNonceMinted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"clientId_\",\"type\":\"bytes\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"txid_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"nonce_\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures_\",\"type\":\"bytes[]\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60806040526000600455600060055534801561001a57600080fd5b50604051610e2e380380610e2e833981016040819052610039916100e6565b806100433361007e565b600180546001600160a01b039283166001600160a01b0319918216178255600291909155600380549490921693169290921790915550610120565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146100e357600080fd5b50565b600080604083850312156100f957600080fd5b8251610104816100ce565b6020840151909250610115816100ce565b809150509250929050565b610cff8061012f6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80639e2aa15c1161005b5780639e2aa15c146100f8578063e563e52614610100578063f2fde38b14610129578063fe9d93031461013c57600080fd5b8063062f950e1461008d57806356f6dd62146100c0578063715018a6146100d55780638da5cb5b146100dd575b600080fd5b6100ad61009b36600461093f565b60076020526000908152604090205481565b6040519081526020015b60405180910390f35b6100d36100ce3660046109aa565b61014f565b005b6100d36102ee565b6000546040516001600160a01b0390911681526020016100b7565b6100d3610302565b6100ad61010e36600461093f565b6001600160a01b031660009081526007602052604090205490565b6100d361013736600461093f565b610350565b6100d361014a366004610a6e565b6103c6565b6001600160a01b038716600090815260076020526040902054879084908190610179906001610ad0565b146101f15760405162461bcd60e51b815260206004820152603e60248201527f50726f7669646564206e6f6e6365206d7573742062652031206772656174657260448201527f207468616e207468652070726576696f7573206275726e206e6f6e63652e000060648201526084015b60405180910390fd5b600060405180608001604052808b6001600160a01b031681526020018a815260200189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250505060209091018890526001546040516302c926b960e21b815292935090916001600160a01b0390911690630b249ae490610290908e908e908e908e908e90600401610b11565b6020604051808303816000875af11580156102af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d39190610b4b565b90506102e18282888861040c565b5050505050505050505050565b6102f6610684565b61030060006106de565b565b61030a610684565b60005b600554811161034d576000818152600660209081526040808320546001600160a01b0316835260079091528120558061034581610b64565b91505061030d565b50565b610358610684565b6001600160a01b0381166103bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101e8565b61034d816106de565b610407338484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061072e92505050565b505050565b6104146108cc565b60015460405163e304688f60e01b81528491849184916001600160a01b03169063e304688f9061044c90869086908690600401610b7d565b6020604051808303816000875af115801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190610c25565b6104e75760405162461bcd60e51b815260206004820152602360248201527f476976656e207369676e61747572657320617265206e6f7420617574686f72696044820152621e995960ea1b60648201526084016101e8565b6003548751602089015160405163a9059cbb60e01b81526001600160a01b039283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015610541573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105659190610c25565b6105bd5760405162461bcd60e51b815260206004820152602360248201527f4272696467653a207472616e73666572206f7574206f6620706f6f6c206661696044820152621b195960ea1b60648201526084016101e8565b606087015187516001600160a01b039081166000908152600760209081526040808320949094558a51600580548452600690925293822080546001600160a01b03191694909316939093179091558154919061061883610b64565b9190505550866060015187600001516001600160a01b03167fe04478a4154dc31a079fa36b9ee1af057f492a47c1524ac67f2ea4c214c3de9289602001518a60400151604051610669929190610c73565b60405180910390a350505061067e6001600255565b50505050565b6000546001600160a01b031633146103005760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101e8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107366108cc565b6003546040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201859052909116906323b872dd906064016020604051808303816000875af115801561078f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b39190610c25565b61080e5760405162461bcd60e51b815260206004820152602660248201527f4272696467653a207472616e7366657220696e746f206275726e20706f6f6c2060448201526519985a5b195960d21b60648201526084016101e8565b60045461081c906001610ad0565b60048190556040516001600160a01b038516907f2b1155a5de2441854f3781130b980daa499b3412053ee40fcde076774bb12df29061085e9086908690610c73565b60405180910390a3600454816040516108779190610cad565b6040518091039020846001600160a01b03167ff92c63d6a65a604ac5f7ddd105b1934f80b49d81059edec60935b8f0b3ea29f3856040516108ba91815260200190565b60405180910390a46104076001600255565b600280540361091d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101e8565b60028055565b80356001600160a01b038116811461093a57600080fd5b919050565b60006020828403121561095157600080fd5b61095a82610923565b9392505050565b60008083601f84011261097357600080fd5b50813567ffffffffffffffff81111561098b57600080fd5b6020830191508360208285010111156109a357600080fd5b9250929050565b600080600080600080600060a0888a0312156109c557600080fd5b6109ce88610923565b965060208801359550604088013567ffffffffffffffff808211156109f257600080fd5b6109fe8b838c01610961565b909750955060608a0135945060808a0135915080821115610a1e57600080fd5b818a0191508a601f830112610a3257600080fd5b813581811115610a4157600080fd5b8b60208260051b8501011115610a5657600080fd5b60208301945080935050505092959891949750929550565b600080600060408486031215610a8357600080fd5b83359250602084013567ffffffffffffffff811115610aa157600080fd5b610aad86828701610961565b9497909650939450505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610ae357610ae3610aba565b500190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b0386168152846020820152608060408201526000610b39608083018587610ae8565b90508260608301529695505050505050565b600060208284031215610b5d57600080fd5b5051919050565b600060018201610b7657610b76610aba565b5060010190565b60006040820185835260206040818501528185835260608501905060608660051b86010192508660005b87811015610c1757868503605f190183528135368a9003601e19018112610bcd57600080fd5b8901848101903567ffffffffffffffff811115610be957600080fd5b803603821315610bf857600080fd5b610c03878284610ae8565b965050509183019190830190600101610ba7565b509298975050505050505050565b600060208284031215610c3757600080fd5b8151801515811461095a57600080fd5b60005b83811015610c62578181015183820152602001610c4a565b8381111561067e5750506000910152565b8281526040602082015260008251806040840152610c98816060850160208701610c47565b601f01601f1916919091016060019392505050565b60008251610cbf818460208701610c47565b919091019291505056fea2646970667358221220593b31edb9b383d640436fd13816dc16719b624f004e4f16867b6170fd6a70a864736f6c634300080f0033", -} - -// BridgeABI is the input ABI used to generate the binding from. -// Deprecated: Use BridgeMetaData.ABI instead. -var BridgeABI = BridgeMetaData.ABI - -// BridgeBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use BridgeMetaData.Bin instead. -var BridgeBin = BridgeMetaData.Bin - -// DeployBridge deploys a new Ethereum contract, binding an instance of Bridge to it. -func DeployBridge(auth *bind.TransactOpts, backend bind.ContractBackend, token_ common.Address, authorizers_ common.Address) (common.Address, *types.Transaction, *Bridge, error) { - parsed, err := BridgeMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BridgeBin), backend, token_, authorizers_) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Bridge{BridgeCaller: BridgeCaller{contract: contract}, BridgeTransactor: BridgeTransactor{contract: contract}, BridgeFilterer: BridgeFilterer{contract: contract}}, nil -} - -// Bridge is an auto generated Go binding around an Ethereum contract. -type Bridge struct { - BridgeCaller // Read-only binding to the contract - BridgeTransactor // Write-only binding to the contract - BridgeFilterer // Log filterer for contract events -} - -// BridgeCaller is an auto generated read-only Go binding around an Ethereum contract. -type BridgeCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BridgeTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BridgeFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BridgeSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BridgeSession struct { - Contract *Bridge // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BridgeCallerSession struct { - Contract *BridgeCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BridgeTransactorSession struct { - Contract *BridgeTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BridgeRaw is an auto generated low-level Go binding around an Ethereum contract. -type BridgeRaw struct { - Contract *Bridge // Generic contract binding to access the raw methods on -} - -// BridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BridgeCallerRaw struct { - Contract *BridgeCaller // Generic read-only contract binding to access the raw methods on -} - -// BridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BridgeTransactorRaw struct { - Contract *BridgeTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBridge creates a new instance of Bridge, bound to a specific deployed contract. -func NewBridge(address common.Address, backend bind.ContractBackend) (*Bridge, error) { - contract, err := bindBridge(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Bridge{BridgeCaller: BridgeCaller{contract: contract}, BridgeTransactor: BridgeTransactor{contract: contract}, BridgeFilterer: BridgeFilterer{contract: contract}}, nil -} - -// NewBridgeCaller creates a new read-only instance of Bridge, bound to a specific deployed contract. -func NewBridgeCaller(address common.Address, caller bind.ContractCaller) (*BridgeCaller, error) { - contract, err := bindBridge(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BridgeCaller{contract: contract}, nil -} - -// NewBridgeTransactor creates a new write-only instance of Bridge, bound to a specific deployed contract. -func NewBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*BridgeTransactor, error) { - contract, err := bindBridge(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BridgeTransactor{contract: contract}, nil -} - -// NewBridgeFilterer creates a new log filterer instance of Bridge, bound to a specific deployed contract. -func NewBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*BridgeFilterer, error) { - contract, err := bindBridge(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BridgeFilterer{contract: contract}, nil -} - -// bindBridge binds a generic wrapper to an already deployed contract. -func bindBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BridgeABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Bridge *BridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Bridge.Contract.BridgeCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Bridge *BridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Bridge.Contract.BridgeTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Bridge *BridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Bridge.Contract.BridgeTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Bridge *BridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Bridge.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Bridge *BridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Bridge.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Bridge *BridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Bridge.Contract.contract.Transact(opts, method, params...) -} - -// GetUserNonceMinted is a free data retrieval call binding the contract method 0xe563e526. -// -// Solidity: function getUserNonceMinted(address to_) view returns(uint256) -func (_Bridge *BridgeCaller) GetUserNonceMinted(opts *bind.CallOpts, to_ common.Address) (*big.Int, error) { - var out []interface{} - err := _Bridge.contract.Call(opts, &out, "getUserNonceMinted", to_) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetUserNonceMinted is a free data retrieval call binding the contract method 0xe563e526. -// -// Solidity: function getUserNonceMinted(address to_) view returns(uint256) -func (_Bridge *BridgeSession) GetUserNonceMinted(to_ common.Address) (*big.Int, error) { - return _Bridge.Contract.GetUserNonceMinted(&_Bridge.CallOpts, to_) -} - -// GetUserNonceMinted is a free data retrieval call binding the contract method 0xe563e526. -// -// Solidity: function getUserNonceMinted(address to_) view returns(uint256) -func (_Bridge *BridgeCallerSession) GetUserNonceMinted(to_ common.Address) (*big.Int, error) { - return _Bridge.Contract.GetUserNonceMinted(&_Bridge.CallOpts, to_) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Bridge *BridgeCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Bridge.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Bridge *BridgeSession) Owner() (common.Address, error) { - return _Bridge.Contract.Owner(&_Bridge.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Bridge *BridgeCallerSession) Owner() (common.Address, error) { - return _Bridge.Contract.Owner(&_Bridge.CallOpts) -} - -// UserNonceMinted is a free data retrieval call binding the contract method 0x062f950e. -// -// Solidity: function userNonceMinted(address ) view returns(uint256) -func (_Bridge *BridgeCaller) UserNonceMinted(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var out []interface{} - err := _Bridge.contract.Call(opts, &out, "userNonceMinted", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// UserNonceMinted is a free data retrieval call binding the contract method 0x062f950e. -// -// Solidity: function userNonceMinted(address ) view returns(uint256) -func (_Bridge *BridgeSession) UserNonceMinted(arg0 common.Address) (*big.Int, error) { - return _Bridge.Contract.UserNonceMinted(&_Bridge.CallOpts, arg0) -} - -// UserNonceMinted is a free data retrieval call binding the contract method 0x062f950e. -// -// Solidity: function userNonceMinted(address ) view returns(uint256) -func (_Bridge *BridgeCallerSession) UserNonceMinted(arg0 common.Address) (*big.Int, error) { - return _Bridge.Contract.UserNonceMinted(&_Bridge.CallOpts, arg0) -} - -// Burn is a paid mutator transaction binding the contract method 0xfe9d9303. -// -// Solidity: function burn(uint256 amount_, bytes clientId_) returns() -func (_Bridge *BridgeTransactor) Burn(opts *bind.TransactOpts, amount_ *big.Int, clientId_ []byte) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "burn", amount_, clientId_) -} - -// Burn is a paid mutator transaction binding the contract method 0xfe9d9303. -// -// Solidity: function burn(uint256 amount_, bytes clientId_) returns() -func (_Bridge *BridgeSession) Burn(amount_ *big.Int, clientId_ []byte) (*types.Transaction, error) { - return _Bridge.Contract.Burn(&_Bridge.TransactOpts, amount_, clientId_) -} - -// Burn is a paid mutator transaction binding the contract method 0xfe9d9303. -// -// Solidity: function burn(uint256 amount_, bytes clientId_) returns() -func (_Bridge *BridgeTransactorSession) Burn(amount_ *big.Int, clientId_ []byte) (*types.Transaction, error) { - return _Bridge.Contract.Burn(&_Bridge.TransactOpts, amount_, clientId_) -} - -// Mint is a paid mutator transaction binding the contract method 0x56f6dd62. -// -// Solidity: function mint(address to_, uint256 amount_, bytes txid_, uint256 nonce_, bytes[] signatures_) returns() -func (_Bridge *BridgeTransactor) Mint(opts *bind.TransactOpts, to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int, signatures_ [][]byte) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "mint", to_, amount_, txid_, nonce_, signatures_) -} - -// Mint is a paid mutator transaction binding the contract method 0x56f6dd62. -// -// Solidity: function mint(address to_, uint256 amount_, bytes txid_, uint256 nonce_, bytes[] signatures_) returns() -func (_Bridge *BridgeSession) Mint(to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int, signatures_ [][]byte) (*types.Transaction, error) { - return _Bridge.Contract.Mint(&_Bridge.TransactOpts, to_, amount_, txid_, nonce_, signatures_) -} - -// Mint is a paid mutator transaction binding the contract method 0x56f6dd62. -// -// Solidity: function mint(address to_, uint256 amount_, bytes txid_, uint256 nonce_, bytes[] signatures_) returns() -func (_Bridge *BridgeTransactorSession) Mint(to_ common.Address, amount_ *big.Int, txid_ []byte, nonce_ *big.Int, signatures_ [][]byte) (*types.Transaction, error) { - return _Bridge.Contract.Mint(&_Bridge.TransactOpts, to_, amount_, txid_, nonce_, signatures_) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Bridge *BridgeTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Bridge *BridgeSession) RenounceOwnership() (*types.Transaction, error) { - return _Bridge.Contract.RenounceOwnership(&_Bridge.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Bridge *BridgeTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Bridge.Contract.RenounceOwnership(&_Bridge.TransactOpts) -} - -// ResetUserNonceMinted is a paid mutator transaction binding the contract method 0x9e2aa15c. -// -// Solidity: function resetUserNonceMinted() returns() -func (_Bridge *BridgeTransactor) ResetUserNonceMinted(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "resetUserNonceMinted") -} - -// ResetUserNonceMinted is a paid mutator transaction binding the contract method 0x9e2aa15c. -// -// Solidity: function resetUserNonceMinted() returns() -func (_Bridge *BridgeSession) ResetUserNonceMinted() (*types.Transaction, error) { - return _Bridge.Contract.ResetUserNonceMinted(&_Bridge.TransactOpts) -} - -// ResetUserNonceMinted is a paid mutator transaction binding the contract method 0x9e2aa15c. -// -// Solidity: function resetUserNonceMinted() returns() -func (_Bridge *BridgeTransactorSession) ResetUserNonceMinted() (*types.Transaction, error) { - return _Bridge.Contract.ResetUserNonceMinted(&_Bridge.TransactOpts) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Bridge *BridgeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Bridge *BridgeSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Bridge.Contract.TransferOwnership(&_Bridge.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Bridge *BridgeTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Bridge.Contract.TransferOwnership(&_Bridge.TransactOpts, newOwner) -} - -// BridgeBurnedIterator is returned from FilterBurned and is used to iterate over the raw logs and unpacked data for Burned events raised by the Bridge contract. -type BridgeBurnedIterator struct { - Event *BridgeBurned // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BridgeBurnedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BridgeBurned) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BridgeBurned) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BridgeBurnedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BridgeBurnedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BridgeBurned represents a Burned event raised by the Bridge contract. -type BridgeBurned struct { - From common.Address - Amount *big.Int - ClientId []byte - Nonce *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBurned is a free log retrieval operation binding the contract event 0x2b1155a5de2441854f3781130b980daa499b3412053ee40fcde076774bb12df2. -// -// Solidity: event Burned(address indexed from, uint256 amount, bytes clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) FilterBurned(opts *bind.FilterOpts, from []common.Address, nonce []*big.Int) (*BridgeBurnedIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.FilterLogs(opts, "Burned", fromRule, nonceRule) - if err != nil { - return nil, err - } - return &BridgeBurnedIterator{contract: _Bridge.contract, event: "Burned", logs: logs, sub: sub}, nil -} - -// WatchBurned is a free log subscription operation binding the contract event 0x2b1155a5de2441854f3781130b980daa499b3412053ee40fcde076774bb12df2. -// -// Solidity: event Burned(address indexed from, uint256 amount, bytes clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) WatchBurned(opts *bind.WatchOpts, sink chan<- *BridgeBurned, from []common.Address, nonce []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.WatchLogs(opts, "Burned", fromRule, nonceRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BridgeBurned) - if err := _Bridge.contract.UnpackLog(event, "Burned", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBurned is a log parse operation binding the contract event 0x2b1155a5de2441854f3781130b980daa499b3412053ee40fcde076774bb12df2. -// -// Solidity: event Burned(address indexed from, uint256 amount, bytes clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) ParseBurned(log types.Log) (*BridgeBurned, error) { - event := new(BridgeBurned) - if err := _Bridge.contract.UnpackLog(event, "Burned", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BridgeBurnedFullIndexIterator is returned from FilterBurnedFullIndex and is used to iterate over the raw logs and unpacked data for BurnedFullIndex events raised by the Bridge contract. -type BridgeBurnedFullIndexIterator struct { - Event *BridgeBurnedFullIndex // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BridgeBurnedFullIndexIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BridgeBurnedFullIndex) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BridgeBurnedFullIndex) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BridgeBurnedFullIndexIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BridgeBurnedFullIndexIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BridgeBurnedFullIndex represents a BurnedFullIndex event raised by the Bridge contract. -type BridgeBurnedFullIndex struct { - From common.Address - Amount *big.Int - ClientId common.Hash - Nonce *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBurnedFullIndex is a free log retrieval operation binding the contract event 0xf92c63d6a65a604ac5f7ddd105b1934f80b49d81059edec60935b8f0b3ea29f3. -// -// Solidity: event BurnedFullIndex(address indexed from, uint256 amount, bytes indexed clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) FilterBurnedFullIndex(opts *bind.FilterOpts, from []common.Address, clientId [][]byte, nonce []*big.Int) (*BridgeBurnedFullIndexIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - - var clientIdRule []interface{} - for _, clientIdItem := range clientId { - clientIdRule = append(clientIdRule, clientIdItem) - } - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.FilterLogs(opts, "BurnedFullIndex", fromRule, clientIdRule, nonceRule) - if err != nil { - return nil, err - } - return &BridgeBurnedFullIndexIterator{contract: _Bridge.contract, event: "BurnedFullIndex", logs: logs, sub: sub}, nil -} - -// WatchBurnedFullIndex is a free log subscription operation binding the contract event 0xf92c63d6a65a604ac5f7ddd105b1934f80b49d81059edec60935b8f0b3ea29f3. -// -// Solidity: event BurnedFullIndex(address indexed from, uint256 amount, bytes indexed clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) WatchBurnedFullIndex(opts *bind.WatchOpts, sink chan<- *BridgeBurnedFullIndex, from []common.Address, clientId [][]byte, nonce []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - - var clientIdRule []interface{} - for _, clientIdItem := range clientId { - clientIdRule = append(clientIdRule, clientIdItem) - } - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.WatchLogs(opts, "BurnedFullIndex", fromRule, clientIdRule, nonceRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BridgeBurnedFullIndex) - if err := _Bridge.contract.UnpackLog(event, "BurnedFullIndex", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBurnedFullIndex is a log parse operation binding the contract event 0xf92c63d6a65a604ac5f7ddd105b1934f80b49d81059edec60935b8f0b3ea29f3. -// -// Solidity: event BurnedFullIndex(address indexed from, uint256 amount, bytes indexed clientId, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) ParseBurnedFullIndex(log types.Log) (*BridgeBurnedFullIndex, error) { - event := new(BridgeBurnedFullIndex) - if err := _Bridge.contract.UnpackLog(event, "BurnedFullIndex", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BridgeMintedIterator is returned from FilterMinted and is used to iterate over the raw logs and unpacked data for Minted events raised by the Bridge contract. -type BridgeMintedIterator struct { - Event *BridgeMinted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BridgeMintedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BridgeMinted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BridgeMinted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BridgeMintedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BridgeMintedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BridgeMinted represents a Minted event raised by the Bridge contract. -type BridgeMinted struct { - To common.Address - Amount *big.Int - Txid []byte - Nonce *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMinted is a free log retrieval operation binding the contract event 0xe04478a4154dc31a079fa36b9ee1af057f492a47c1524ac67f2ea4c214c3de92. -// -// Solidity: event Minted(address indexed to, uint256 amount, bytes txid, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) FilterMinted(opts *bind.FilterOpts, to []common.Address, nonce []*big.Int) (*BridgeMintedIterator, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.FilterLogs(opts, "Minted", toRule, nonceRule) - if err != nil { - return nil, err - } - return &BridgeMintedIterator{contract: _Bridge.contract, event: "Minted", logs: logs, sub: sub}, nil -} - -// WatchMinted is a free log subscription operation binding the contract event 0xe04478a4154dc31a079fa36b9ee1af057f492a47c1524ac67f2ea4c214c3de92. -// -// Solidity: event Minted(address indexed to, uint256 amount, bytes txid, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) WatchMinted(opts *bind.WatchOpts, sink chan<- *BridgeMinted, to []common.Address, nonce []*big.Int) (event.Subscription, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - var nonceRule []interface{} - for _, nonceItem := range nonce { - nonceRule = append(nonceRule, nonceItem) - } - - logs, sub, err := _Bridge.contract.WatchLogs(opts, "Minted", toRule, nonceRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BridgeMinted) - if err := _Bridge.contract.UnpackLog(event, "Minted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMinted is a log parse operation binding the contract event 0xe04478a4154dc31a079fa36b9ee1af057f492a47c1524ac67f2ea4c214c3de92. -// -// Solidity: event Minted(address indexed to, uint256 amount, bytes txid, uint256 indexed nonce) -func (_Bridge *BridgeFilterer) ParseMinted(log types.Log) (*BridgeMinted, error) { - event := new(BridgeMinted) - if err := _Bridge.contract.UnpackLog(event, "Minted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BridgeOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Bridge contract. -type BridgeOwnershipTransferredIterator struct { - Event *BridgeOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BridgeOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BridgeOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BridgeOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BridgeOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BridgeOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BridgeOwnershipTransferred represents a OwnershipTransferred event raised by the Bridge contract. -type BridgeOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Bridge *BridgeFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BridgeOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Bridge.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BridgeOwnershipTransferredIterator{contract: _Bridge.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Bridge *BridgeFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BridgeOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Bridge.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BridgeOwnershipTransferred) - if err := _Bridge.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Bridge *BridgeFilterer) ParseOwnershipTransferred(log types.Log) (*BridgeOwnershipTransferred, error) { - event := new(BridgeOwnershipTransferred) - if err := _Bridge.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/zcnbridge/ethereum/doc.go b/zcnbridge/ethereum/doc.go deleted file mode 100644 index 7e2f0203a..000000000 --- a/zcnbridge/ethereum/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Methods and types to interact with Züs smart contracts on the Ethereum blockchain (Züs ERC20 tokens). -// All sub-packages are autogenerated. -package ethereum diff --git a/zcnbridge/ethereum/mint_payload.go b/zcnbridge/ethereum/mint_payload.go deleted file mode 100644 index 4ca566ff1..000000000 --- a/zcnbridge/ethereum/mint_payload.go +++ /dev/null @@ -1,29 +0,0 @@ -package ethereum - -import "encoding/json" - -// BurnEvent represents received WZCN burn event. -type BurnEvent struct { - Nonce int64 `json:"nonce"` - Amount int64 `json:"amount"` - TransactionHash string `json:"hash"` -} - -// MintPayload Payload to submit to the ethereum bridge contract -type MintPayload struct { - ZCNTxnID string `json:"zcn_txn_id"` - Amount int64 `json:"amount"` - To string `json:"to"` - Nonce int64 `json:"nonce"` - Signatures []*AuthorizerSignature `json:"signatures"` -} - -type AuthorizerSignature struct { - ID string `json:"authorizer_id"` - Signature []byte `json:"signature"` -} - -func (mp *MintPayload) Encode() []byte { - buff, _ := json.Marshal(mp) - return buff -} diff --git a/zcnbridge/ethereum/nftconfig/nftconfig.go b/zcnbridge/ethereum/nftconfig/nftconfig.go deleted file mode 100644 index 2961f9fce..000000000 --- a/zcnbridge/ethereum/nftconfig/nftconfig.go +++ /dev/null @@ -1,656 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package nftconfig - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// NFTConfigMetaData contains all meta data concerning the NFTConfig contract. -var NFTConfigMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"ConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setUint256\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"value\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getUint256\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true}]", -} - -// NFTConfigABI is the input ABI used to generate the binding from. -// Deprecated: Use NFTConfigMetaData.ABI instead. -var NFTConfigABI = NFTConfigMetaData.ABI - -// NFTConfig is an auto generated Go binding around an Ethereum contract. -type NFTConfig struct { - NFTConfigCaller // Read-only binding to the contract - NFTConfigTransactor // Write-only binding to the contract - NFTConfigFilterer // Log filterer for contract events -} - -// NFTConfigCaller is an auto generated read-only Go binding around an Ethereum contract. -type NFTConfigCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// NFTConfigTransactor is an auto generated write-only Go binding around an Ethereum contract. -type NFTConfigTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// NFTConfigFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type NFTConfigFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// NFTConfigSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type NFTConfigSession struct { - Contract *NFTConfig // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// NFTConfigCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type NFTConfigCallerSession struct { - Contract *NFTConfigCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// NFTConfigTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type NFTConfigTransactorSession struct { - Contract *NFTConfigTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// NFTConfigRaw is an auto generated low-level Go binding around an Ethereum contract. -type NFTConfigRaw struct { - Contract *NFTConfig // Generic contract binding to access the raw methods on -} - -// NFTConfigCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type NFTConfigCallerRaw struct { - Contract *NFTConfigCaller // Generic read-only contract binding to access the raw methods on -} - -// NFTConfigTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type NFTConfigTransactorRaw struct { - Contract *NFTConfigTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewNFTConfig creates a new instance of NFTConfig, bound to a specific deployed contract. -func NewNFTConfig(address common.Address, backend bind.ContractBackend) (*NFTConfig, error) { - contract, err := bindNFTConfig(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &NFTConfig{NFTConfigCaller: NFTConfigCaller{contract: contract}, NFTConfigTransactor: NFTConfigTransactor{contract: contract}, NFTConfigFilterer: NFTConfigFilterer{contract: contract}}, nil -} - -// NewNFTConfigCaller creates a new read-only instance of NFTConfig, bound to a specific deployed contract. -func NewNFTConfigCaller(address common.Address, caller bind.ContractCaller) (*NFTConfigCaller, error) { - contract, err := bindNFTConfig(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &NFTConfigCaller{contract: contract}, nil -} - -// NewNFTConfigTransactor creates a new write-only instance of NFTConfig, bound to a specific deployed contract. -func NewNFTConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*NFTConfigTransactor, error) { - contract, err := bindNFTConfig(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &NFTConfigTransactor{contract: contract}, nil -} - -// NewNFTConfigFilterer creates a new log filterer instance of NFTConfig, bound to a specific deployed contract. -func NewNFTConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*NFTConfigFilterer, error) { - contract, err := bindNFTConfig(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &NFTConfigFilterer{contract: contract}, nil -} - -// bindNFTConfig binds a generic wrapper to an already deployed contract. -func bindNFTConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(NFTConfigABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_NFTConfig *NFTConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _NFTConfig.Contract.NFTConfigCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_NFTConfig *NFTConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _NFTConfig.Contract.NFTConfigTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_NFTConfig *NFTConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _NFTConfig.Contract.NFTConfigTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_NFTConfig *NFTConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _NFTConfig.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_NFTConfig *NFTConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _NFTConfig.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_NFTConfig *NFTConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _NFTConfig.Contract.contract.Transact(opts, method, params...) -} - -// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. -// -// Solidity: function getAddress(bytes32 key) view returns(address) -func (_NFTConfig *NFTConfigCaller) GetAddress(opts *bind.CallOpts, key [32]byte) (common.Address, error) { - var out []interface{} - err := _NFTConfig.contract.Call(opts, &out, "getAddress", key) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. -// -// Solidity: function getAddress(bytes32 key) view returns(address) -func (_NFTConfig *NFTConfigSession) GetAddress(key [32]byte) (common.Address, error) { - return _NFTConfig.Contract.GetAddress(&_NFTConfig.CallOpts, key) -} - -// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. -// -// Solidity: function getAddress(bytes32 key) view returns(address) -func (_NFTConfig *NFTConfigCallerSession) GetAddress(key [32]byte) (common.Address, error) { - return _NFTConfig.Contract.GetAddress(&_NFTConfig.CallOpts, key) -} - -// GetUint256 is a free data retrieval call binding the contract method 0x33598b00. -// -// Solidity: function getUint256(bytes32 key) view returns(uint256) -func (_NFTConfig *NFTConfigCaller) GetUint256(opts *bind.CallOpts, key [32]byte) (*big.Int, error) { - var out []interface{} - err := _NFTConfig.contract.Call(opts, &out, "getUint256", key) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetUint256 is a free data retrieval call binding the contract method 0x33598b00. -// -// Solidity: function getUint256(bytes32 key) view returns(uint256) -func (_NFTConfig *NFTConfigSession) GetUint256(key [32]byte) (*big.Int, error) { - return _NFTConfig.Contract.GetUint256(&_NFTConfig.CallOpts, key) -} - -// GetUint256 is a free data retrieval call binding the contract method 0x33598b00. -// -// Solidity: function getUint256(bytes32 key) view returns(uint256) -func (_NFTConfig *NFTConfigCallerSession) GetUint256(key [32]byte) (*big.Int, error) { - return _NFTConfig.Contract.GetUint256(&_NFTConfig.CallOpts, key) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_NFTConfig *NFTConfigCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _NFTConfig.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_NFTConfig *NFTConfigSession) Owner() (common.Address, error) { - return _NFTConfig.Contract.Owner(&_NFTConfig.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_NFTConfig *NFTConfigCallerSession) Owner() (common.Address, error) { - return _NFTConfig.Contract.Owner(&_NFTConfig.CallOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_NFTConfig *NFTConfigTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _NFTConfig.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_NFTConfig *NFTConfigSession) RenounceOwnership() (*types.Transaction, error) { - return _NFTConfig.Contract.RenounceOwnership(&_NFTConfig.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_NFTConfig *NFTConfigTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _NFTConfig.Contract.RenounceOwnership(&_NFTConfig.TransactOpts) -} - -// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. -// -// Solidity: function setAddress(bytes32 key, address value) returns() -func (_NFTConfig *NFTConfigTransactor) SetAddress(opts *bind.TransactOpts, key [32]byte, value common.Address) (*types.Transaction, error) { - return _NFTConfig.contract.Transact(opts, "setAddress", key, value) -} - -// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. -// -// Solidity: function setAddress(bytes32 key, address value) returns() -func (_NFTConfig *NFTConfigSession) SetAddress(key [32]byte, value common.Address) (*types.Transaction, error) { - return _NFTConfig.Contract.SetAddress(&_NFTConfig.TransactOpts, key, value) -} - -// SetAddress is a paid mutator transaction binding the contract method 0xca446dd9. -// -// Solidity: function setAddress(bytes32 key, address value) returns() -func (_NFTConfig *NFTConfigTransactorSession) SetAddress(key [32]byte, value common.Address) (*types.Transaction, error) { - return _NFTConfig.Contract.SetAddress(&_NFTConfig.TransactOpts, key, value) -} - -// SetUint256 is a paid mutator transaction binding the contract method 0x4f3029c2. -// -// Solidity: function setUint256(bytes32 key, uint256 value) returns() -func (_NFTConfig *NFTConfigTransactor) SetUint256(opts *bind.TransactOpts, key [32]byte, value *big.Int) (*types.Transaction, error) { - return _NFTConfig.contract.Transact(opts, "setUint256", key, value) -} - -// SetUint256 is a paid mutator transaction binding the contract method 0x4f3029c2. -// -// Solidity: function setUint256(bytes32 key, uint256 value) returns() -func (_NFTConfig *NFTConfigSession) SetUint256(key [32]byte, value *big.Int) (*types.Transaction, error) { - return _NFTConfig.Contract.SetUint256(&_NFTConfig.TransactOpts, key, value) -} - -// SetUint256 is a paid mutator transaction binding the contract method 0x4f3029c2. -// -// Solidity: function setUint256(bytes32 key, uint256 value) returns() -func (_NFTConfig *NFTConfigTransactorSession) SetUint256(key [32]byte, value *big.Int) (*types.Transaction, error) { - return _NFTConfig.Contract.SetUint256(&_NFTConfig.TransactOpts, key, value) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_NFTConfig *NFTConfigTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _NFTConfig.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_NFTConfig *NFTConfigSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _NFTConfig.Contract.TransferOwnership(&_NFTConfig.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_NFTConfig *NFTConfigTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _NFTConfig.Contract.TransferOwnership(&_NFTConfig.TransactOpts, newOwner) -} - -// NFTConfigConfigUpdatedIterator is returned from FilterConfigUpdated and is used to iterate over the raw logs and unpacked data for ConfigUpdated events raised by the NFTConfig contract. -type NFTConfigConfigUpdatedIterator struct { - Event *NFTConfigConfigUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *NFTConfigConfigUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(NFTConfigConfigUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(NFTConfigConfigUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *NFTConfigConfigUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *NFTConfigConfigUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// NFTConfigConfigUpdated represents a ConfigUpdated event raised by the NFTConfig contract. -type NFTConfigConfigUpdated struct { - Key [32]byte - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterConfigUpdated is a free log retrieval operation binding the contract event 0xac2ccce3de9c0816ae772598f7f65fe69f9893b637f7c490497378cbb3ea043e. -// -// Solidity: event ConfigUpdated(bytes32 indexed key, uint256 previous, uint256 updated) -func (_NFTConfig *NFTConfigFilterer) FilterConfigUpdated(opts *bind.FilterOpts, key [][32]byte) (*NFTConfigConfigUpdatedIterator, error) { - - var keyRule []interface{} - for _, keyItem := range key { - keyRule = append(keyRule, keyItem) - } - - logs, sub, err := _NFTConfig.contract.FilterLogs(opts, "ConfigUpdated", keyRule) - if err != nil { - return nil, err - } - return &NFTConfigConfigUpdatedIterator{contract: _NFTConfig.contract, event: "ConfigUpdated", logs: logs, sub: sub}, nil -} - -// WatchConfigUpdated is a free log subscription operation binding the contract event 0xac2ccce3de9c0816ae772598f7f65fe69f9893b637f7c490497378cbb3ea043e. -// -// Solidity: event ConfigUpdated(bytes32 indexed key, uint256 previous, uint256 updated) -func (_NFTConfig *NFTConfigFilterer) WatchConfigUpdated(opts *bind.WatchOpts, sink chan<- *NFTConfigConfigUpdated, key [][32]byte) (event.Subscription, error) { - - var keyRule []interface{} - for _, keyItem := range key { - keyRule = append(keyRule, keyItem) - } - - logs, sub, err := _NFTConfig.contract.WatchLogs(opts, "ConfigUpdated", keyRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(NFTConfigConfigUpdated) - if err := _NFTConfig.contract.UnpackLog(event, "ConfigUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseConfigUpdated is a log parse operation binding the contract event 0xac2ccce3de9c0816ae772598f7f65fe69f9893b637f7c490497378cbb3ea043e. -// -// Solidity: event ConfigUpdated(bytes32 indexed key, uint256 previous, uint256 updated) -func (_NFTConfig *NFTConfigFilterer) ParseConfigUpdated(log types.Log) (*NFTConfigConfigUpdated, error) { - event := new(NFTConfigConfigUpdated) - if err := _NFTConfig.contract.UnpackLog(event, "ConfigUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// NFTConfigOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the NFTConfig contract. -type NFTConfigOwnershipTransferredIterator struct { - Event *NFTConfigOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *NFTConfigOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(NFTConfigOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(NFTConfigOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *NFTConfigOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *NFTConfigOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// NFTConfigOwnershipTransferred represents a OwnershipTransferred event raised by the NFTConfig contract. -type NFTConfigOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_NFTConfig *NFTConfigFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*NFTConfigOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _NFTConfig.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &NFTConfigOwnershipTransferredIterator{contract: _NFTConfig.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_NFTConfig *NFTConfigFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NFTConfigOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _NFTConfig.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(NFTConfigOwnershipTransferred) - if err := _NFTConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_NFTConfig *NFTConfigFilterer) ParseOwnershipTransferred(log types.Log) (*NFTConfigOwnershipTransferred, error) { - event := new(NFTConfigOwnershipTransferred) - if err := _NFTConfig.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/zcnbridge/ethereum/uniswapnetwork/uniswapnetwork.go b/zcnbridge/ethereum/uniswapnetwork/uniswapnetwork.go deleted file mode 100644 index 1045cad8b..000000000 --- a/zcnbridge/ethereum/uniswapnetwork/uniswapnetwork.go +++ /dev/null @@ -1,536 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package uniswapnetwork - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// UniswapMetaData contains all meta data concerning the Uniswap contract. -var UniswapMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"msg\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"v\",\"type\":\"uint256\"}],\"name\":\"DebugMsg\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"zcnAmount\",\"type\":\"uint256\"}],\"name\":\"getEstimatedETHforZCN\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"}],\"name\":\"swapETHForZCNExactAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutDesired\",\"type\":\"uint256\"}],\"name\":\"swapETHForZCNExactAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"}],\"name\":\"swapUSDCForZCNExactAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"}],\"name\":\"swapUSDCForZCNExactAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"}],\"name\":\"swapZCNForUSDCExactAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"}],\"name\":\"swapZCNForUSDCExactAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"}],\"name\":\"swapZCNForWETHExactAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"}],\"name\":\"swapZCNForWETHExactAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", -} - -// UniswapABI is the input ABI used to generate the binding from. -// Deprecated: Use UniswapMetaData.ABI instead. -var UniswapABI = UniswapMetaData.ABI - -// Uniswap is an auto generated Go binding around an Ethereum contract. -type Uniswap struct { - UniswapCaller // Read-only binding to the contract - UniswapTransactor // Write-only binding to the contract - UniswapFilterer // Log filterer for contract events -} - -// UniswapCaller is an auto generated read-only Go binding around an Ethereum contract. -type UniswapCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswapTransactor is an auto generated write-only Go binding around an Ethereum contract. -type UniswapTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type UniswapFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswapSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type UniswapSession struct { - Contract *Uniswap // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniswapCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type UniswapCallerSession struct { - Contract *UniswapCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// UniswapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type UniswapTransactorSession struct { - Contract *UniswapTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniswapRaw is an auto generated low-level Go binding around an Ethereum contract. -type UniswapRaw struct { - Contract *Uniswap // Generic contract binding to access the raw methods on -} - -// UniswapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type UniswapCallerRaw struct { - Contract *UniswapCaller // Generic read-only contract binding to access the raw methods on -} - -// UniswapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type UniswapTransactorRaw struct { - Contract *UniswapTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewUniswap creates a new instance of Uniswap, bound to a specific deployed contract. -func NewUniswap(address common.Address, backend bind.ContractBackend) (*Uniswap, error) { - contract, err := bindUniswap(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Uniswap{UniswapCaller: UniswapCaller{contract: contract}, UniswapTransactor: UniswapTransactor{contract: contract}, UniswapFilterer: UniswapFilterer{contract: contract}}, nil -} - -// NewUniswapCaller creates a new read-only instance of Uniswap, bound to a specific deployed contract. -func NewUniswapCaller(address common.Address, caller bind.ContractCaller) (*UniswapCaller, error) { - contract, err := bindUniswap(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &UniswapCaller{contract: contract}, nil -} - -// NewUniswapTransactor creates a new write-only instance of Uniswap, bound to a specific deployed contract. -func NewUniswapTransactor(address common.Address, transactor bind.ContractTransactor) (*UniswapTransactor, error) { - contract, err := bindUniswap(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &UniswapTransactor{contract: contract}, nil -} - -// NewUniswapFilterer creates a new log filterer instance of Uniswap, bound to a specific deployed contract. -func NewUniswapFilterer(address common.Address, filterer bind.ContractFilterer) (*UniswapFilterer, error) { - contract, err := bindUniswap(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &UniswapFilterer{contract: contract}, nil -} - -// bindUniswap binds a generic wrapper to an already deployed contract. -func bindUniswap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := UniswapMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Uniswap *UniswapRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Uniswap.Contract.UniswapCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Uniswap *UniswapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswap.Contract.UniswapTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Uniswap *UniswapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Uniswap.Contract.UniswapTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Uniswap *UniswapCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Uniswap.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Uniswap *UniswapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswap.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Uniswap *UniswapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Uniswap.Contract.contract.Transact(opts, method, params...) -} - -// GetEstimatedETHforZCN is a free data retrieval call binding the contract method 0x1a34ff1c. -// -// Solidity: function getEstimatedETHforZCN(uint256 zcnAmount) view returns(uint256[]) -func (_Uniswap *UniswapCaller) GetEstimatedETHforZCN(opts *bind.CallOpts, zcnAmount *big.Int) ([]*big.Int, error) { - var out []interface{} - err := _Uniswap.contract.Call(opts, &out, "getEstimatedETHforZCN", zcnAmount) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -// GetEstimatedETHforZCN is a free data retrieval call binding the contract method 0x1a34ff1c. -// -// Solidity: function getEstimatedETHforZCN(uint256 zcnAmount) view returns(uint256[]) -func (_Uniswap *UniswapSession) GetEstimatedETHforZCN(zcnAmount *big.Int) ([]*big.Int, error) { - return _Uniswap.Contract.GetEstimatedETHforZCN(&_Uniswap.CallOpts, zcnAmount) -} - -// GetEstimatedETHforZCN is a free data retrieval call binding the contract method 0x1a34ff1c. -// -// Solidity: function getEstimatedETHforZCN(uint256 zcnAmount) view returns(uint256[]) -func (_Uniswap *UniswapCallerSession) GetEstimatedETHforZCN(zcnAmount *big.Int) ([]*big.Int, error) { - return _Uniswap.Contract.GetEstimatedETHforZCN(&_Uniswap.CallOpts, zcnAmount) -} - -// SwapETHForZCNExactAmountIn is a paid mutator transaction binding the contract method 0xb33d99b1. -// -// Solidity: function swapETHForZCNExactAmountIn(uint256 amountOutMin) payable returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapETHForZCNExactAmountIn(opts *bind.TransactOpts, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapETHForZCNExactAmountIn", amountOutMin) -} - -// SwapETHForZCNExactAmountIn is a paid mutator transaction binding the contract method 0xb33d99b1. -// -// Solidity: function swapETHForZCNExactAmountIn(uint256 amountOutMin) payable returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapETHForZCNExactAmountIn(amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapETHForZCNExactAmountIn(&_Uniswap.TransactOpts, amountOutMin) -} - -// SwapETHForZCNExactAmountIn is a paid mutator transaction binding the contract method 0xb33d99b1. -// -// Solidity: function swapETHForZCNExactAmountIn(uint256 amountOutMin) payable returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapETHForZCNExactAmountIn(amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapETHForZCNExactAmountIn(&_Uniswap.TransactOpts, amountOutMin) -} - -// SwapETHForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x18ae74a4. -// -// Solidity: function swapETHForZCNExactAmountOut(uint256 amountOutDesired) payable returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapETHForZCNExactAmountOut(opts *bind.TransactOpts, amountOutDesired *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapETHForZCNExactAmountOut", amountOutDesired) -} - -// SwapETHForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x18ae74a4. -// -// Solidity: function swapETHForZCNExactAmountOut(uint256 amountOutDesired) payable returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapETHForZCNExactAmountOut(amountOutDesired *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapETHForZCNExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired) -} - -// SwapETHForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x18ae74a4. -// -// Solidity: function swapETHForZCNExactAmountOut(uint256 amountOutDesired) payable returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapETHForZCNExactAmountOut(amountOutDesired *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapETHForZCNExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired) -} - -// SwapUSDCForZCNExactAmountIn is a paid mutator transaction binding the contract method 0x0976c3c2. -// -// Solidity: function swapUSDCForZCNExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapUSDCForZCNExactAmountIn(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapUSDCForZCNExactAmountIn", amountIn, amountOutMin) -} - -// SwapUSDCForZCNExactAmountIn is a paid mutator transaction binding the contract method 0x0976c3c2. -// -// Solidity: function swapUSDCForZCNExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapUSDCForZCNExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapUSDCForZCNExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapUSDCForZCNExactAmountIn is a paid mutator transaction binding the contract method 0x0976c3c2. -// -// Solidity: function swapUSDCForZCNExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapUSDCForZCNExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapUSDCForZCNExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapUSDCForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x97a40b34. -// -// Solidity: function swapUSDCForZCNExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapUSDCForZCNExactAmountOut(opts *bind.TransactOpts, amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapUSDCForZCNExactAmountOut", amountOutDesired, amountInMax) -} - -// SwapUSDCForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x97a40b34. -// -// Solidity: function swapUSDCForZCNExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapUSDCForZCNExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapUSDCForZCNExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// SwapUSDCForZCNExactAmountOut is a paid mutator transaction binding the contract method 0x97a40b34. -// -// Solidity: function swapUSDCForZCNExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapUSDCForZCNExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapUSDCForZCNExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// SwapZCNForUSDCExactAmountIn is a paid mutator transaction binding the contract method 0xe60b51b6. -// -// Solidity: function swapZCNForUSDCExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapZCNForUSDCExactAmountIn(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapZCNForUSDCExactAmountIn", amountIn, amountOutMin) -} - -// SwapZCNForUSDCExactAmountIn is a paid mutator transaction binding the contract method 0xe60b51b6. -// -// Solidity: function swapZCNForUSDCExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapZCNForUSDCExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForUSDCExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapZCNForUSDCExactAmountIn is a paid mutator transaction binding the contract method 0xe60b51b6. -// -// Solidity: function swapZCNForUSDCExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapZCNForUSDCExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForUSDCExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapZCNForUSDCExactAmountOut is a paid mutator transaction binding the contract method 0x4becb631. -// -// Solidity: function swapZCNForUSDCExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapZCNForUSDCExactAmountOut(opts *bind.TransactOpts, amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapZCNForUSDCExactAmountOut", amountOutDesired, amountInMax) -} - -// SwapZCNForUSDCExactAmountOut is a paid mutator transaction binding the contract method 0x4becb631. -// -// Solidity: function swapZCNForUSDCExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapZCNForUSDCExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForUSDCExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// SwapZCNForUSDCExactAmountOut is a paid mutator transaction binding the contract method 0x4becb631. -// -// Solidity: function swapZCNForUSDCExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapZCNForUSDCExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForUSDCExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// SwapZCNForWETHExactAmountIn is a paid mutator transaction binding the contract method 0x50a6cd6f. -// -// Solidity: function swapZCNForWETHExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapZCNForWETHExactAmountIn(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapZCNForWETHExactAmountIn", amountIn, amountOutMin) -} - -// SwapZCNForWETHExactAmountIn is a paid mutator transaction binding the contract method 0x50a6cd6f. -// -// Solidity: function swapZCNForWETHExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapZCNForWETHExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForWETHExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapZCNForWETHExactAmountIn is a paid mutator transaction binding the contract method 0x50a6cd6f. -// -// Solidity: function swapZCNForWETHExactAmountIn(uint256 amountIn, uint256 amountOutMin) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapZCNForWETHExactAmountIn(amountIn *big.Int, amountOutMin *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForWETHExactAmountIn(&_Uniswap.TransactOpts, amountIn, amountOutMin) -} - -// SwapZCNForWETHExactAmountOut is a paid mutator transaction binding the contract method 0xaae07c3e. -// -// Solidity: function swapZCNForWETHExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactor) SwapZCNForWETHExactAmountOut(opts *bind.TransactOpts, amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.contract.Transact(opts, "swapZCNForWETHExactAmountOut", amountOutDesired, amountInMax) -} - -// SwapZCNForWETHExactAmountOut is a paid mutator transaction binding the contract method 0xaae07c3e. -// -// Solidity: function swapZCNForWETHExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapSession) SwapZCNForWETHExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForWETHExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// SwapZCNForWETHExactAmountOut is a paid mutator transaction binding the contract method 0xaae07c3e. -// -// Solidity: function swapZCNForWETHExactAmountOut(uint256 amountOutDesired, uint256 amountInMax) returns(uint256 amountOut) -func (_Uniswap *UniswapTransactorSession) SwapZCNForWETHExactAmountOut(amountOutDesired *big.Int, amountInMax *big.Int) (*types.Transaction, error) { - return _Uniswap.Contract.SwapZCNForWETHExactAmountOut(&_Uniswap.TransactOpts, amountOutDesired, amountInMax) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswap *UniswapTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswap.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswap *UniswapSession) Receive() (*types.Transaction, error) { - return _Uniswap.Contract.Receive(&_Uniswap.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswap *UniswapTransactorSession) Receive() (*types.Transaction, error) { - return _Uniswap.Contract.Receive(&_Uniswap.TransactOpts) -} - -// UniswapDebugMsgIterator is returned from FilterDebugMsg and is used to iterate over the raw logs and unpacked data for DebugMsg events raised by the Uniswap contract. -type UniswapDebugMsgIterator struct { - Event *UniswapDebugMsg // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *UniswapDebugMsgIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(UniswapDebugMsg) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(UniswapDebugMsg) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *UniswapDebugMsgIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *UniswapDebugMsgIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// UniswapDebugMsg represents a DebugMsg event raised by the Uniswap contract. -type UniswapDebugMsg struct { - Msg string - V *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDebugMsg is a free log retrieval operation binding the contract event 0xea30ed2bcbf4b7c5487f2c07ef639257ebf04932960dff4496fb914f769a6439. -// -// Solidity: event DebugMsg(string msg, uint256 v) -func (_Uniswap *UniswapFilterer) FilterDebugMsg(opts *bind.FilterOpts) (*UniswapDebugMsgIterator, error) { - - logs, sub, err := _Uniswap.contract.FilterLogs(opts, "DebugMsg") - if err != nil { - return nil, err - } - return &UniswapDebugMsgIterator{contract: _Uniswap.contract, event: "DebugMsg", logs: logs, sub: sub}, nil -} - -// WatchDebugMsg is a free log subscription operation binding the contract event 0xea30ed2bcbf4b7c5487f2c07ef639257ebf04932960dff4496fb914f769a6439. -// -// Solidity: event DebugMsg(string msg, uint256 v) -func (_Uniswap *UniswapFilterer) WatchDebugMsg(opts *bind.WatchOpts, sink chan<- *UniswapDebugMsg) (event.Subscription, error) { - - logs, sub, err := _Uniswap.contract.WatchLogs(opts, "DebugMsg") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(UniswapDebugMsg) - if err := _Uniswap.contract.UnpackLog(event, "DebugMsg", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseDebugMsg is a log parse operation binding the contract event 0xea30ed2bcbf4b7c5487f2c07ef639257ebf04932960dff4496fb914f769a6439. -// -// Solidity: event DebugMsg(string msg, uint256 v) -func (_Uniswap *UniswapFilterer) ParseDebugMsg(log types.Log) (*UniswapDebugMsg, error) { - event := new(UniswapDebugMsg) - if err := _Uniswap.contract.UnpackLog(event, "DebugMsg", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/zcnbridge/ethereum/uniswaprouter/uniswaprouter.go b/zcnbridge/ethereum/uniswaprouter/uniswaprouter.go deleted file mode 100644 index 834210b2d..000000000 --- a/zcnbridge/ethereum/uniswaprouter/uniswaprouter.go +++ /dev/null @@ -1,777 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package uniswaprouter - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// UniswaprouterMetaData contains all meta data concerning the Uniswaprouter contract. -var UniswaprouterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WETH\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountADesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"addLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenDesired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"addLiquidityETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveOut\",\"type\":\"uint256\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveOut\",\"type\":\"uint256\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"}],\"name\":\"getAmountsIn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"}],\"name\":\"getAmountsOut\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveB\",\"type\":\"uint256\"}],\"name\":\"quote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidityETH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"removeLiquidityETHSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityETHWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountToken\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountTokenMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountETHMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountETH\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountAMin\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountBMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approveMax\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"removeLiquidityWithPermit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountA\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountB\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapETHForExactTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactETHForTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactETHForTokensSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForETH\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForETHSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapExactTokensForTokensSupportingFeeOnTransferTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapTokensForExactETH\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"swapTokensForExactTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", -} - -// UniswaprouterABI is the input ABI used to generate the binding from. -// Deprecated: Use UniswaprouterMetaData.ABI instead. -var UniswaprouterABI = UniswaprouterMetaData.ABI - -// Uniswaprouter is an auto generated Go binding around an Ethereum contract. -type Uniswaprouter struct { - UniswaprouterCaller // Read-only binding to the contract - UniswaprouterTransactor // Write-only binding to the contract - UniswaprouterFilterer // Log filterer for contract events -} - -// UniswaprouterCaller is an auto generated read-only Go binding around an Ethereum contract. -type UniswaprouterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswaprouterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type UniswaprouterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswaprouterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type UniswaprouterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniswaprouterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type UniswaprouterSession struct { - Contract *Uniswaprouter // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniswaprouterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type UniswaprouterCallerSession struct { - Contract *UniswaprouterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// UniswaprouterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type UniswaprouterTransactorSession struct { - Contract *UniswaprouterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniswaprouterRaw is an auto generated low-level Go binding around an Ethereum contract. -type UniswaprouterRaw struct { - Contract *Uniswaprouter // Generic contract binding to access the raw methods on -} - -// UniswaprouterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type UniswaprouterCallerRaw struct { - Contract *UniswaprouterCaller // Generic read-only contract binding to access the raw methods on -} - -// UniswaprouterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type UniswaprouterTransactorRaw struct { - Contract *UniswaprouterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewUniswaprouter creates a new instance of Uniswaprouter, bound to a specific deployed contract. -func NewUniswaprouter(address common.Address, backend bind.ContractBackend) (*Uniswaprouter, error) { - contract, err := bindUniswaprouter(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Uniswaprouter{UniswaprouterCaller: UniswaprouterCaller{contract: contract}, UniswaprouterTransactor: UniswaprouterTransactor{contract: contract}, UniswaprouterFilterer: UniswaprouterFilterer{contract: contract}}, nil -} - -// NewUniswaprouterCaller creates a new read-only instance of Uniswaprouter, bound to a specific deployed contract. -func NewUniswaprouterCaller(address common.Address, caller bind.ContractCaller) (*UniswaprouterCaller, error) { - contract, err := bindUniswaprouter(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &UniswaprouterCaller{contract: contract}, nil -} - -// NewUniswaprouterTransactor creates a new write-only instance of Uniswaprouter, bound to a specific deployed contract. -func NewUniswaprouterTransactor(address common.Address, transactor bind.ContractTransactor) (*UniswaprouterTransactor, error) { - contract, err := bindUniswaprouter(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &UniswaprouterTransactor{contract: contract}, nil -} - -// NewUniswaprouterFilterer creates a new log filterer instance of Uniswaprouter, bound to a specific deployed contract. -func NewUniswaprouterFilterer(address common.Address, filterer bind.ContractFilterer) (*UniswaprouterFilterer, error) { - contract, err := bindUniswaprouter(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &UniswaprouterFilterer{contract: contract}, nil -} - -// bindUniswaprouter binds a generic wrapper to an already deployed contract. -func bindUniswaprouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := UniswaprouterMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Uniswaprouter *UniswaprouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Uniswaprouter.Contract.UniswaprouterCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Uniswaprouter *UniswaprouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswaprouter.Contract.UniswaprouterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Uniswaprouter *UniswaprouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Uniswaprouter.Contract.UniswaprouterTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Uniswaprouter *UniswaprouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Uniswaprouter.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Uniswaprouter *UniswaprouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswaprouter.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Uniswaprouter *UniswaprouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Uniswaprouter.Contract.contract.Transact(opts, method, params...) -} - -// WETH is a free data retrieval call binding the contract method 0xad5c4648. -// -// Solidity: function WETH() view returns(address) -func (_Uniswaprouter *UniswaprouterCaller) WETH(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "WETH") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// WETH is a free data retrieval call binding the contract method 0xad5c4648. -// -// Solidity: function WETH() view returns(address) -func (_Uniswaprouter *UniswaprouterSession) WETH() (common.Address, error) { - return _Uniswaprouter.Contract.WETH(&_Uniswaprouter.CallOpts) -} - -// WETH is a free data retrieval call binding the contract method 0xad5c4648. -// -// Solidity: function WETH() view returns(address) -func (_Uniswaprouter *UniswaprouterCallerSession) WETH() (common.Address, error) { - return _Uniswaprouter.Contract.WETH(&_Uniswaprouter.CallOpts) -} - -// Factory is a free data retrieval call binding the contract method 0xc45a0155. -// -// Solidity: function factory() view returns(address) -func (_Uniswaprouter *UniswaprouterCaller) Factory(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "factory") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Factory is a free data retrieval call binding the contract method 0xc45a0155. -// -// Solidity: function factory() view returns(address) -func (_Uniswaprouter *UniswaprouterSession) Factory() (common.Address, error) { - return _Uniswaprouter.Contract.Factory(&_Uniswaprouter.CallOpts) -} - -// Factory is a free data retrieval call binding the contract method 0xc45a0155. -// -// Solidity: function factory() view returns(address) -func (_Uniswaprouter *UniswaprouterCallerSession) Factory() (common.Address, error) { - return _Uniswaprouter.Contract.Factory(&_Uniswaprouter.CallOpts) -} - -// GetAmountIn is a free data retrieval call binding the contract method 0x85f8c259. -// -// Solidity: function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountIn) -func (_Uniswaprouter *UniswaprouterCaller) GetAmountIn(opts *bind.CallOpts, amountOut *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "getAmountIn", amountOut, reserveIn, reserveOut) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetAmountIn is a free data retrieval call binding the contract method 0x85f8c259. -// -// Solidity: function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountIn) -func (_Uniswaprouter *UniswaprouterSession) GetAmountIn(amountOut *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountIn(&_Uniswaprouter.CallOpts, amountOut, reserveIn, reserveOut) -} - -// GetAmountIn is a free data retrieval call binding the contract method 0x85f8c259. -// -// Solidity: function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountIn) -func (_Uniswaprouter *UniswaprouterCallerSession) GetAmountIn(amountOut *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountIn(&_Uniswaprouter.CallOpts, amountOut, reserveIn, reserveOut) -} - -// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4. -// -// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut) -func (_Uniswaprouter *UniswaprouterCaller) GetAmountOut(opts *bind.CallOpts, amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "getAmountOut", amountIn, reserveIn, reserveOut) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4. -// -// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut) -func (_Uniswaprouter *UniswaprouterSession) GetAmountOut(amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountOut(&_Uniswaprouter.CallOpts, amountIn, reserveIn, reserveOut) -} - -// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4. -// -// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut) -func (_Uniswaprouter *UniswaprouterCallerSession) GetAmountOut(amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountOut(&_Uniswaprouter.CallOpts, amountIn, reserveIn, reserveOut) -} - -// GetAmountsIn is a free data retrieval call binding the contract method 0x1f00ca74. -// -// Solidity: function getAmountsIn(uint256 amountOut, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterCaller) GetAmountsIn(opts *bind.CallOpts, amountOut *big.Int, path []common.Address) ([]*big.Int, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "getAmountsIn", amountOut, path) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -// GetAmountsIn is a free data retrieval call binding the contract method 0x1f00ca74. -// -// Solidity: function getAmountsIn(uint256 amountOut, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) GetAmountsIn(amountOut *big.Int, path []common.Address) ([]*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountsIn(&_Uniswaprouter.CallOpts, amountOut, path) -} - -// GetAmountsIn is a free data retrieval call binding the contract method 0x1f00ca74. -// -// Solidity: function getAmountsIn(uint256 amountOut, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterCallerSession) GetAmountsIn(amountOut *big.Int, path []common.Address) ([]*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountsIn(&_Uniswaprouter.CallOpts, amountOut, path) -} - -// GetAmountsOut is a free data retrieval call binding the contract method 0xd06ca61f. -// -// Solidity: function getAmountsOut(uint256 amountIn, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterCaller) GetAmountsOut(opts *bind.CallOpts, amountIn *big.Int, path []common.Address) ([]*big.Int, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "getAmountsOut", amountIn, path) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -// GetAmountsOut is a free data retrieval call binding the contract method 0xd06ca61f. -// -// Solidity: function getAmountsOut(uint256 amountIn, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) GetAmountsOut(amountIn *big.Int, path []common.Address) ([]*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountsOut(&_Uniswaprouter.CallOpts, amountIn, path) -} - -// GetAmountsOut is a free data retrieval call binding the contract method 0xd06ca61f. -// -// Solidity: function getAmountsOut(uint256 amountIn, address[] path) view returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterCallerSession) GetAmountsOut(amountIn *big.Int, path []common.Address) ([]*big.Int, error) { - return _Uniswaprouter.Contract.GetAmountsOut(&_Uniswaprouter.CallOpts, amountIn, path) -} - -// Quote is a free data retrieval call binding the contract method 0xad615dec. -// -// Solidity: function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) pure returns(uint256 amountB) -func (_Uniswaprouter *UniswaprouterCaller) Quote(opts *bind.CallOpts, amountA *big.Int, reserveA *big.Int, reserveB *big.Int) (*big.Int, error) { - var out []interface{} - err := _Uniswaprouter.contract.Call(opts, &out, "quote", amountA, reserveA, reserveB) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Quote is a free data retrieval call binding the contract method 0xad615dec. -// -// Solidity: function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) pure returns(uint256 amountB) -func (_Uniswaprouter *UniswaprouterSession) Quote(amountA *big.Int, reserveA *big.Int, reserveB *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.Quote(&_Uniswaprouter.CallOpts, amountA, reserveA, reserveB) -} - -// Quote is a free data retrieval call binding the contract method 0xad615dec. -// -// Solidity: function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) pure returns(uint256 amountB) -func (_Uniswaprouter *UniswaprouterCallerSession) Quote(amountA *big.Int, reserveA *big.Int, reserveB *big.Int) (*big.Int, error) { - return _Uniswaprouter.Contract.Quote(&_Uniswaprouter.CallOpts, amountA, reserveA, reserveB) -} - -// AddLiquidity is a paid mutator transaction binding the contract method 0xe8e33700. -// -// Solidity: function addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterTransactor) AddLiquidity(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address, amountADesired *big.Int, amountBDesired *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "addLiquidity", tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, to, deadline) -} - -// AddLiquidity is a paid mutator transaction binding the contract method 0xe8e33700. -// -// Solidity: function addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterSession) AddLiquidity(tokenA common.Address, tokenB common.Address, amountADesired *big.Int, amountBDesired *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.AddLiquidity(&_Uniswaprouter.TransactOpts, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, to, deadline) -} - -// AddLiquidity is a paid mutator transaction binding the contract method 0xe8e33700. -// -// Solidity: function addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterTransactorSession) AddLiquidity(tokenA common.Address, tokenB common.Address, amountADesired *big.Int, amountBDesired *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.AddLiquidity(&_Uniswaprouter.TransactOpts, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, to, deadline) -} - -// AddLiquidityETH is a paid mutator transaction binding the contract method 0xf305d719. -// -// Solidity: function addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) payable returns(uint256 amountToken, uint256 amountETH, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterTransactor) AddLiquidityETH(opts *bind.TransactOpts, token common.Address, amountTokenDesired *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "addLiquidityETH", token, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline) -} - -// AddLiquidityETH is a paid mutator transaction binding the contract method 0xf305d719. -// -// Solidity: function addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) payable returns(uint256 amountToken, uint256 amountETH, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterSession) AddLiquidityETH(token common.Address, amountTokenDesired *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.AddLiquidityETH(&_Uniswaprouter.TransactOpts, token, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline) -} - -// AddLiquidityETH is a paid mutator transaction binding the contract method 0xf305d719. -// -// Solidity: function addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) payable returns(uint256 amountToken, uint256 amountETH, uint256 liquidity) -func (_Uniswaprouter *UniswaprouterTransactorSession) AddLiquidityETH(token common.Address, amountTokenDesired *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.AddLiquidityETH(&_Uniswaprouter.TransactOpts, token, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidity is a paid mutator transaction binding the contract method 0xbaa2abde. -// -// Solidity: function removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidity(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidity", tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline) -} - -// RemoveLiquidity is a paid mutator transaction binding the contract method 0xbaa2abde. -// -// Solidity: function removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidity(tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidity(&_Uniswaprouter.TransactOpts, tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline) -} - -// RemoveLiquidity is a paid mutator transaction binding the contract method 0xbaa2abde. -// -// Solidity: function removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidity(tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidity(&_Uniswaprouter.TransactOpts, tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline) -} - -// RemoveLiquidityETH is a paid mutator transaction binding the contract method 0x02751cec. -// -// Solidity: function removeLiquidityETH(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidityETH(opts *bind.TransactOpts, token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidityETH", token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETH is a paid mutator transaction binding the contract method 0x02751cec. -// -// Solidity: function removeLiquidityETH(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidityETH(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETH(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETH is a paid mutator transaction binding the contract method 0x02751cec. -// -// Solidity: function removeLiquidityETH(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidityETH(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETH(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xaf2979eb. -// -// Solidity: function removeLiquidityETHSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidityETHSupportingFeeOnTransferTokens(opts *bind.TransactOpts, token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidityETHSupportingFeeOnTransferTokens", token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xaf2979eb. -// -// Solidity: function removeLiquidityETHSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidityETHSupportingFeeOnTransferTokens(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xaf2979eb. -// -// Solidity: function removeLiquidityETHSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidityETHSupportingFeeOnTransferTokens(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline) -} - -// RemoveLiquidityETHWithPermit is a paid mutator transaction binding the contract method 0xded9382a. -// -// Solidity: function removeLiquidityETHWithPermit(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidityETHWithPermit(opts *bind.TransactOpts, token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidityETHWithPermit", token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityETHWithPermit is a paid mutator transaction binding the contract method 0xded9382a. -// -// Solidity: function removeLiquidityETHWithPermit(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidityETHWithPermit(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHWithPermit(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityETHWithPermit is a paid mutator transaction binding the contract method 0xded9382a. -// -// Solidity: function removeLiquidityETHWithPermit(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountToken, uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidityETHWithPermit(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHWithPermit(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5b0d5984. -// -// Solidity: function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(opts *bind.TransactOpts, token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5b0d5984. -// -// Solidity: function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5b0d5984. -// -// Solidity: function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountETH) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(token common.Address, liquidity *big.Int, amountTokenMin *big.Int, amountETHMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, token, liquidity, amountTokenMin, amountETHMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityWithPermit is a paid mutator transaction binding the contract method 0x2195995c. -// -// Solidity: function removeLiquidityWithPermit(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterTransactor) RemoveLiquidityWithPermit(opts *bind.TransactOpts, tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "removeLiquidityWithPermit", tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityWithPermit is a paid mutator transaction binding the contract method 0x2195995c. -// -// Solidity: function removeLiquidityWithPermit(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterSession) RemoveLiquidityWithPermit(tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityWithPermit(&_Uniswaprouter.TransactOpts, tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline, approveMax, v, r, s) -} - -// RemoveLiquidityWithPermit is a paid mutator transaction binding the contract method 0x2195995c. -// -// Solidity: function removeLiquidityWithPermit(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s) returns(uint256 amountA, uint256 amountB) -func (_Uniswaprouter *UniswaprouterTransactorSession) RemoveLiquidityWithPermit(tokenA common.Address, tokenB common.Address, liquidity *big.Int, amountAMin *big.Int, amountBMin *big.Int, to common.Address, deadline *big.Int, approveMax bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _Uniswaprouter.Contract.RemoveLiquidityWithPermit(&_Uniswaprouter.TransactOpts, tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline, approveMax, v, r, s) -} - -// SwapETHForExactTokens is a paid mutator transaction binding the contract method 0xfb3bdb41. -// -// Solidity: function swapETHForExactTokens(uint256 amountOut, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapETHForExactTokens(opts *bind.TransactOpts, amountOut *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapETHForExactTokens", amountOut, path, to, deadline) -} - -// SwapETHForExactTokens is a paid mutator transaction binding the contract method 0xfb3bdb41. -// -// Solidity: function swapETHForExactTokens(uint256 amountOut, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapETHForExactTokens(amountOut *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapETHForExactTokens(&_Uniswaprouter.TransactOpts, amountOut, path, to, deadline) -} - -// SwapETHForExactTokens is a paid mutator transaction binding the contract method 0xfb3bdb41. -// -// Solidity: function swapETHForExactTokens(uint256 amountOut, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapETHForExactTokens(amountOut *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapETHForExactTokens(&_Uniswaprouter.TransactOpts, amountOut, path, to, deadline) -} - -// SwapExactETHForTokens is a paid mutator transaction binding the contract method 0x7ff36ab5. -// -// Solidity: function swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactETHForTokens(opts *bind.TransactOpts, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactETHForTokens", amountOutMin, path, to, deadline) -} - -// SwapExactETHForTokens is a paid mutator transaction binding the contract method 0x7ff36ab5. -// -// Solidity: function swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapExactETHForTokens(amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactETHForTokens(&_Uniswaprouter.TransactOpts, amountOutMin, path, to, deadline) -} - -// SwapExactETHForTokens is a paid mutator transaction binding the contract method 0x7ff36ab5. -// -// Solidity: function swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactETHForTokens(amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactETHForTokens(&_Uniswaprouter.TransactOpts, amountOutMin, path, to, deadline) -} - -// SwapExactETHForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xb6f9de95. -// -// Solidity: function swapExactETHForTokensSupportingFeeOnTransferTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns() -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactETHForTokensSupportingFeeOnTransferTokens(opts *bind.TransactOpts, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactETHForTokensSupportingFeeOnTransferTokens", amountOutMin, path, to, deadline) -} - -// SwapExactETHForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xb6f9de95. -// -// Solidity: function swapExactETHForTokensSupportingFeeOnTransferTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns() -func (_Uniswaprouter *UniswaprouterSession) SwapExactETHForTokensSupportingFeeOnTransferTokens(amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactETHForTokensSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountOutMin, path, to, deadline) -} - -// SwapExactETHForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0xb6f9de95. -// -// Solidity: function swapExactETHForTokensSupportingFeeOnTransferTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) payable returns() -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactETHForTokensSupportingFeeOnTransferTokens(amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactETHForTokensSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETH is a paid mutator transaction binding the contract method 0x18cbafe5. -// -// Solidity: function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactTokensForETH(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactTokensForETH", amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETH is a paid mutator transaction binding the contract method 0x18cbafe5. -// -// Solidity: function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapExactTokensForETH(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForETH(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETH is a paid mutator transaction binding the contract method 0x18cbafe5. -// -// Solidity: function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactTokensForETH(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForETH(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x791ac947. -// -// Solidity: function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactTokensForETHSupportingFeeOnTransferTokens(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactTokensForETHSupportingFeeOnTransferTokens", amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x791ac947. -// -// Solidity: function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterSession) SwapExactTokensForETHSupportingFeeOnTransferTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForETHSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForETHSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x791ac947. -// -// Solidity: function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactTokensForETHSupportingFeeOnTransferTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForETHSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x38ed1739. -// -// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactTokensForTokens(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactTokensForTokens", amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x38ed1739. -// -// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokens is a paid mutator transaction binding the contract method 0x38ed1739. -// -// Solidity: function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactTokensForTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5c11d795. -// -// Solidity: function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterTransactor) SwapExactTokensForTokensSupportingFeeOnTransferTokens(opts *bind.TransactOpts, amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapExactTokensForTokensSupportingFeeOnTransferTokens", amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5c11d795. -// -// Solidity: function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterSession) SwapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForTokensSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapExactTokensForTokensSupportingFeeOnTransferTokens is a paid mutator transaction binding the contract method 0x5c11d795. -// -// Solidity: function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns() -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn *big.Int, amountOutMin *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapExactTokensForTokensSupportingFeeOnTransferTokens(&_Uniswaprouter.TransactOpts, amountIn, amountOutMin, path, to, deadline) -} - -// SwapTokensForExactETH is a paid mutator transaction binding the contract method 0x4a25d94a. -// -// Solidity: function swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapTokensForExactETH(opts *bind.TransactOpts, amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapTokensForExactETH", amountOut, amountInMax, path, to, deadline) -} - -// SwapTokensForExactETH is a paid mutator transaction binding the contract method 0x4a25d94a. -// -// Solidity: function swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapTokensForExactETH(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapTokensForExactETH(&_Uniswaprouter.TransactOpts, amountOut, amountInMax, path, to, deadline) -} - -// SwapTokensForExactETH is a paid mutator transaction binding the contract method 0x4a25d94a. -// -// Solidity: function swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapTokensForExactETH(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapTokensForExactETH(&_Uniswaprouter.TransactOpts, amountOut, amountInMax, path, to, deadline) -} - -// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x8803dbee. -// -// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactor) SwapTokensForExactTokens(opts *bind.TransactOpts, amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.contract.Transact(opts, "swapTokensForExactTokens", amountOut, amountInMax, path, to, deadline) -} - -// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x8803dbee. -// -// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterSession) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapTokensForExactTokens(&_Uniswaprouter.TransactOpts, amountOut, amountInMax, path, to, deadline) -} - -// SwapTokensForExactTokens is a paid mutator transaction binding the contract method 0x8803dbee. -// -// Solidity: function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) returns(uint256[] amounts) -func (_Uniswaprouter *UniswaprouterTransactorSession) SwapTokensForExactTokens(amountOut *big.Int, amountInMax *big.Int, path []common.Address, to common.Address, deadline *big.Int) (*types.Transaction, error) { - return _Uniswaprouter.Contract.SwapTokensForExactTokens(&_Uniswaprouter.TransactOpts, amountOut, amountInMax, path, to, deadline) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswaprouter *UniswaprouterTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Uniswaprouter.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswaprouter *UniswaprouterSession) Receive() (*types.Transaction, error) { - return _Uniswaprouter.Contract.Receive(&_Uniswaprouter.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Uniswaprouter *UniswaprouterTransactorSession) Receive() (*types.Transaction, error) { - return _Uniswaprouter.Contract.Receive(&_Uniswaprouter.TransactOpts) -} - diff --git a/zcnbridge/ethereum/zcntoken/zcntoken.go b/zcnbridge/ethereum/zcntoken/zcntoken.go deleted file mode 100644 index 0caf78343..000000000 --- a/zcnbridge/ethereum/zcntoken/zcntoken.go +++ /dev/null @@ -1,1336 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package zcntoken - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// TokenMetaData contains all meta data concerning the Token contract. -var TokenMetaData = &bind.MetaData{ - ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"mintingFinished\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finishMinting\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MintFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"}]", -} - -// TokenABI is the input ABI used to generate the binding from. -// Deprecated: Use TokenMetaData.ABI instead. -var TokenABI = TokenMetaData.ABI - -// Token is an auto generated Go binding around an Ethereum contract. -type Token struct { - TokenCaller // Read-only binding to the contract - TokenTransactor // Write-only binding to the contract - TokenFilterer // Log filterer for contract events -} - -// TokenCaller is an auto generated read-only Go binding around an Ethereum contract. -type TokenCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TokenTransactor is an auto generated write-only Go binding around an Ethereum contract. -type TokenTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type TokenFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TokenSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type TokenSession struct { - Contract *Token // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// TokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type TokenCallerSession struct { - Contract *TokenCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// TokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type TokenTransactorSession struct { - Contract *TokenTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// TokenRaw is an auto generated low-level Go binding around an Ethereum contract. -type TokenRaw struct { - Contract *Token // Generic contract binding to access the raw methods on -} - -// TokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type TokenCallerRaw struct { - Contract *TokenCaller // Generic read-only contract binding to access the raw methods on -} - -// TokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type TokenTransactorRaw struct { - Contract *TokenTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewToken creates a new instance of Token, bound to a specific deployed contract. -func NewToken(address common.Address, backend bind.ContractBackend) (*Token, error) { - contract, err := bindToken(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Token{TokenCaller: TokenCaller{contract: contract}, TokenTransactor: TokenTransactor{contract: contract}, TokenFilterer: TokenFilterer{contract: contract}}, nil -} - -// NewTokenCaller creates a new read-only instance of Token, bound to a specific deployed contract. -func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error) { - contract, err := bindToken(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &TokenCaller{contract: contract}, nil -} - -// NewTokenTransactor creates a new write-only instance of Token, bound to a specific deployed contract. -func NewTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenTransactor, error) { - contract, err := bindToken(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &TokenTransactor{contract: contract}, nil -} - -// NewTokenFilterer creates a new log filterer instance of Token, bound to a specific deployed contract. -func NewTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenFilterer, error) { - contract, err := bindToken(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &TokenFilterer{contract: contract}, nil -} - -// bindToken binds a generic wrapper to an already deployed contract. -func bindToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := TokenMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Token *TokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Token.Contract.TokenCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Token *TokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Token.Contract.TokenTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Token *TokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Token.Contract.TokenTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Token *TokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Token.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Token *TokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Token.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Token *TokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Token.Contract.contract.Transact(opts, method, params...) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address _owner, address _spender) view returns(uint256) -func (_Token *TokenCaller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "allowance", _owner, _spender) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address _owner, address _spender) view returns(uint256) -func (_Token *TokenSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { - return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address _owner, address _spender) view returns(uint256) -func (_Token *TokenCallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { - return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address _owner) view returns(uint256 balance) -func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "balanceOf", _owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address _owner) view returns(uint256 balance) -func (_Token *TokenSession) BalanceOf(_owner common.Address) (*big.Int, error) { - return _Token.Contract.BalanceOf(&_Token.CallOpts, _owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address _owner) view returns(uint256 balance) -func (_Token *TokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { - return _Token.Contract.BalanceOf(&_Token.CallOpts, _owner) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_Token *TokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "decimals") - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_Token *TokenSession) Decimals() (uint8, error) { - return _Token.Contract.Decimals(&_Token.CallOpts) -} - -// Decimals is a free data retrieval call binding the contract method 0x313ce567. -// -// Solidity: function decimals() view returns(uint8) -func (_Token *TokenCallerSession) Decimals() (uint8, error) { - return _Token.Contract.Decimals(&_Token.CallOpts) -} - -// MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. -// -// Solidity: function mintingFinished() view returns(bool) -func (_Token *TokenCaller) MintingFinished(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "mintingFinished") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. -// -// Solidity: function mintingFinished() view returns(bool) -func (_Token *TokenSession) MintingFinished() (bool, error) { - return _Token.Contract.MintingFinished(&_Token.CallOpts) -} - -// MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. -// -// Solidity: function mintingFinished() view returns(bool) -func (_Token *TokenCallerSession) MintingFinished() (bool, error) { - return _Token.Contract.MintingFinished(&_Token.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Token *TokenCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Token *TokenSession) Name() (string, error) { - return _Token.Contract.Name(&_Token.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Token *TokenCallerSession) Name() (string, error) { - return _Token.Contract.Name(&_Token.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Token *TokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Token *TokenSession) Owner() (common.Address, error) { - return _Token.Contract.Owner(&_Token.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Token *TokenCallerSession) Owner() (common.Address, error) { - return _Token.Contract.Owner(&_Token.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Token *TokenCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Token *TokenSession) Symbol() (string, error) { - return _Token.Contract.Symbol(&_Token.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Token *TokenCallerSession) Symbol() (string, error) { - return _Token.Contract.Symbol(&_Token.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_Token *TokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Token.contract.Call(opts, &out, "totalSupply") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_Token *TokenSession) TotalSupply() (*big.Int, error) { - return _Token.Contract.TotalSupply(&_Token.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_Token *TokenCallerSession) TotalSupply() (*big.Int, error) { - return _Token.Contract.TotalSupply(&_Token.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address _spender, uint256 _value) returns(bool) -func (_Token *TokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "approve", _spender, _value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address _spender, uint256 _value) returns(bool) -func (_Token *TokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address _spender, uint256 _value) returns(bool) -func (_Token *TokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value) -} - -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. -// -// Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) -func (_Token *TokenTransactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue) -} - -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. -// -// Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) -func (_Token *TokenSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _Token.Contract.DecreaseApproval(&_Token.TransactOpts, _spender, _subtractedValue) -} - -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. -// -// Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) -func (_Token *TokenTransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _Token.Contract.DecreaseApproval(&_Token.TransactOpts, _spender, _subtractedValue) -} - -// FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. -// -// Solidity: function finishMinting() returns(bool) -func (_Token *TokenTransactor) FinishMinting(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "finishMinting") -} - -// FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. -// -// Solidity: function finishMinting() returns(bool) -func (_Token *TokenSession) FinishMinting() (*types.Transaction, error) { - return _Token.Contract.FinishMinting(&_Token.TransactOpts) -} - -// FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. -// -// Solidity: function finishMinting() returns(bool) -func (_Token *TokenTransactorSession) FinishMinting() (*types.Transaction, error) { - return _Token.Contract.FinishMinting(&_Token.TransactOpts) -} - -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. -// -// Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) -func (_Token *TokenTransactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "increaseApproval", _spender, _addedValue) -} - -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. -// -// Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) -func (_Token *TokenSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _Token.Contract.IncreaseApproval(&_Token.TransactOpts, _spender, _addedValue) -} - -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. -// -// Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) -func (_Token *TokenTransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _Token.Contract.IncreaseApproval(&_Token.TransactOpts, _spender, _addedValue) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address _to, uint256 _amount) returns(bool) -func (_Token *TokenTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "mint", _to, _amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address _to, uint256 _amount) returns(bool) -func (_Token *TokenSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { - return _Token.Contract.Mint(&_Token.TransactOpts, _to, _amount) -} - -// Mint is a paid mutator transaction binding the contract method 0x40c10f19. -// -// Solidity: function mint(address _to, uint256 _amount) returns(bool) -func (_Token *TokenTransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { - return _Token.Contract.Mint(&_Token.TransactOpts, _to, _amount) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address _to, uint256 _value) returns(bool) -func (_Token *TokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "transfer", _to, _value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address _to, uint256 _value) returns(bool) -func (_Token *TokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address _to, uint256 _value) returns(bool) -func (_Token *TokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) -func (_Token *TokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "transferFrom", _from, _to, _value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) -func (_Token *TokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) -func (_Token *TokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Token *TokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Token.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Token *TokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Token *TokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner) -} - -// TokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Token contract. -type TokenApprovalIterator struct { - Event *TokenApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TokenApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TokenApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TokenApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TokenApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TokenApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TokenApproval represents a Approval event raised by the Token contract. -type TokenApproval struct { - Owner common.Address - Spender common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_Token *TokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TokenApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _Token.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return &TokenApprovalIterator{contract: _Token.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_Token *TokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _Token.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TokenApproval) - if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_Token *TokenFilterer) ParseApproval(log types.Log) (*TokenApproval, error) { - event := new(TokenApproval) - if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TokenMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Token contract. -type TokenMintIterator struct { - Event *TokenMint // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TokenMintIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TokenMint) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TokenMint) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TokenMintIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TokenMintIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TokenMint represents a Mint event raised by the Token contract. -type TokenMint struct { - To common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. -// -// Solidity: event Mint(address indexed to, uint256 amount) -func (_Token *TokenFilterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*TokenMintIterator, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _Token.contract.FilterLogs(opts, "Mint", toRule) - if err != nil { - return nil, err - } - return &TokenMintIterator{contract: _Token.contract, event: "Mint", logs: logs, sub: sub}, nil -} - -// WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. -// -// Solidity: event Mint(address indexed to, uint256 amount) -func (_Token *TokenFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *TokenMint, to []common.Address) (event.Subscription, error) { - - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _Token.contract.WatchLogs(opts, "Mint", toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TokenMint) - if err := _Token.contract.UnpackLog(event, "Mint", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMint is a log parse operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. -// -// Solidity: event Mint(address indexed to, uint256 amount) -func (_Token *TokenFilterer) ParseMint(log types.Log) (*TokenMint, error) { - event := new(TokenMint) - if err := _Token.contract.UnpackLog(event, "Mint", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TokenMintFinishedIterator is returned from FilterMintFinished and is used to iterate over the raw logs and unpacked data for MintFinished events raised by the Token contract. -type TokenMintFinishedIterator struct { - Event *TokenMintFinished // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TokenMintFinishedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TokenMintFinished) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TokenMintFinished) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TokenMintFinishedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TokenMintFinishedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TokenMintFinished represents a MintFinished event raised by the Token contract. -type TokenMintFinished struct { - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintFinished is a free log retrieval operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. -// -// Solidity: event MintFinished() -func (_Token *TokenFilterer) FilterMintFinished(opts *bind.FilterOpts) (*TokenMintFinishedIterator, error) { - - logs, sub, err := _Token.contract.FilterLogs(opts, "MintFinished") - if err != nil { - return nil, err - } - return &TokenMintFinishedIterator{contract: _Token.contract, event: "MintFinished", logs: logs, sub: sub}, nil -} - -// WatchMintFinished is a free log subscription operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. -// -// Solidity: event MintFinished() -func (_Token *TokenFilterer) WatchMintFinished(opts *bind.WatchOpts, sink chan<- *TokenMintFinished) (event.Subscription, error) { - - logs, sub, err := _Token.contract.WatchLogs(opts, "MintFinished") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TokenMintFinished) - if err := _Token.contract.UnpackLog(event, "MintFinished", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMintFinished is a log parse operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. -// -// Solidity: event MintFinished() -func (_Token *TokenFilterer) ParseMintFinished(log types.Log) (*TokenMintFinished, error) { - event := new(TokenMintFinished) - if err := _Token.contract.UnpackLog(event, "MintFinished", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Token contract. -type TokenOwnershipTransferredIterator struct { - Event *TokenOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TokenOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TokenOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TokenOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TokenOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TokenOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TokenOwnershipTransferred represents a OwnershipTransferred event raised by the Token contract. -type TokenOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Token *TokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TokenOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Token.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &TokenOwnershipTransferredIterator{contract: _Token.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Token *TokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Token.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TokenOwnershipTransferred) - if err := _Token.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Token *TokenFilterer) ParseOwnershipTransferred(log types.Log) (*TokenOwnershipTransferred, error) { - event := new(TokenOwnershipTransferred) - if err := _Token.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Token contract. -type TokenTransferIterator struct { - Event *TokenTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TokenTransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TokenTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TokenTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TokenTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TokenTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TokenTransfer represents a Transfer event raised by the Token contract. -type TokenTransfer struct { - From common.Address - To common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_Token *TokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _Token.contract.FilterLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return &TokenTransferIterator{contract: _Token.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_Token *TokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _Token.contract.WatchLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TokenTransfer) - if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_Token *TokenFilterer) ParseTransfer(log types.Log) (*TokenTransfer, error) { - event := new(TokenTransfer) - if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/zcnbridge/http/client.go b/zcnbridge/http/client.go deleted file mode 100644 index a8044cab7..000000000 --- a/zcnbridge/http/client.go +++ /dev/null @@ -1,42 +0,0 @@ -package http - -import ( - "net/http" - "time" - - "github.com/hashicorp/go-retryablehttp" -) - -const ( - RetryWaitMax = 120 * time.Second - RetryMax = 60 -) - -// NewClient creates default http.Client with timeouts. -func NewClient() *http.Client { - return &http.Client{ - Transport: http.DefaultTransport, - } -} - -func CleanClient() *http.Client { - client := &http.Client{ - Transport: http.DefaultTransport, - } - client.Timeout = 250 * time.Second - return client -} - -// NewRetryableClient creates default retryablehttp.Client with timeouts and embedded NewClient result. -func NewRetryableClient(verbose bool) *retryablehttp.Client { - client := retryablehttp.NewClient() - client.HTTPClient = &http.Client{ - Transport: http.DefaultTransport, - } - - if !verbose { - client.Logger = nil - } - - return client -} diff --git a/zcnbridge/http/doc.go b/zcnbridge/http/doc.go deleted file mode 100644 index fd578c520..000000000 --- a/zcnbridge/http/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Utility methods and types to work with HTTP requests and responses. -package http \ No newline at end of file diff --git a/zcnbridge/keystore.go b/zcnbridge/keystore.go deleted file mode 100644 index 4794681ce..000000000 --- a/zcnbridge/keystore.go +++ /dev/null @@ -1,202 +0,0 @@ -package zcnbridge - -import ( - "fmt" - "path" - "time" - - hdw "github.com/0chain/gosdk/zcncore/ethhdwallet" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -// DetailedAccount describes detailed account -type DetailedAccount struct { - EthereumAddress, - PublicKey, - PrivateKey accounts.Account -} - -// KeyStore is a wrapper, which exposes Ethereum KeyStore methods used by DEX bridge. -type KeyStore interface { - Find(accounts.Account) (accounts.Account, error) - TimedUnlock(accounts.Account, string, time.Duration) error - SignHash(account accounts.Account, hash []byte) ([]byte, error) - GetEthereumKeyStore() *keystore.KeyStore -} - -type keyStore struct { - ks *keystore.KeyStore -} - -// NewKeyStore creates new KeyStore wrapper instance -func NewKeyStore(path string) KeyStore { - return &keyStore{ - ks: keystore.NewKeyStore(path, keystore.StandardScryptN, keystore.StandardScryptP), - } -} - -// Find forwards request to Ethereum KeyStore Find method -func (k *keyStore) Find(account accounts.Account) (accounts.Account, error) { - return k.ks.Find(account) -} - -// TimedUnlock forwards request to Ethereum KeyStore TimedUnlock method -func (k *keyStore) TimedUnlock(account accounts.Account, passPhrase string, timeout time.Duration) error { - return k.ks.TimedUnlock(account, passPhrase, timeout) -} - -// SignHash forwards request to Ethereum KeyStore SignHash method -func (k *keyStore) SignHash(account accounts.Account, hash []byte) ([]byte, error) { - return k.ks.SignHash(account, hash) -} - -// GetEthereumKeyStore returns Ethereum KeyStore instance -func (k *keyStore) GetEthereumKeyStore() *keystore.KeyStore { - return k.ks -} - -// ListStorageAccounts List available accounts -// - homedir is the home directory -func ListStorageAccounts(homedir string) []common.Address { - keyDir := path.Join(homedir, EthereumWalletStorageDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - config := &accounts.Config{InsecureUnlockAllowed: false} - am := accounts.NewManager(config, ks) - addresses := am.Accounts() - - return addresses -} - -// DeleteAccount deletes account from wallet -// - homedir is the home directory -// - address is the account address -func DeleteAccount(homedir, address string) bool { - keyDir := path.Join(homedir, EthereumWalletStorageDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - config := &accounts.Config{InsecureUnlockAllowed: false} - am := accounts.NewManager(config, ks) - - wallet, err := am.Find(accounts.Account{ - Address: common.HexToAddress(address), - }) - - if err != nil && wallet == nil { - fmt.Printf("failed to find account %s, error: %s", address, err) - return false - } - - return true -} - -// AccountExists checks if account exists -// - homedir is the home directory -// - address is the account address -func AccountExists(homedir, address string) bool { - keyDir := path.Join(homedir, EthereumWalletStorageDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - config := &accounts.Config{InsecureUnlockAllowed: false} - am := accounts.NewManager(config, ks) - - wallet, err := am.Find(accounts.Account{ - Address: common.HexToAddress(address), - }) - - if err != nil && wallet == nil { - fmt.Printf("failed to find account %s, error: %s\n", address, err) - return false - } - - status, _ := wallet.Status() - url := wallet.URL() - - fmt.Printf("Account exists. Status: %s, Path: %s\n", status, url) - - return true -} - -// CreateKeyStorage create, restore or unlock key storage -// - homedir is the home directory -// - password is the password -func CreateKeyStorage(homedir, password string) error { - keyDir := path.Join(homedir, EthereumWalletStorageDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - account, err := ks.NewAccount(password) - if err != nil { - return errors.Wrap(err, "failed to create keystore") - } - fmt.Printf("Created account: %s", account.Address.Hex()) - - return nil -} - -// AccountAddressIndex represents client account and address indexes for multi-key wallet. Used to derive ethereum account. -type AccountAddressIndex struct { - AccountIndex int - AddressIndex int - - // Bip32 flag indicates if the account is derived using BIP32 derivation path. - Bip32 bool -} - -// ImportAccount imports account using mnemonic -// - homedir is the home directory -// - mnemonic is the mnemonic phrase -// - password is the password -// - accountAddrIndex is the account and address indexes used for the derivation of the ethereum account -func ImportAccount(homedir, mnemonic, password string, accountAddrIndex ...AccountAddressIndex) (string, error) { - // 1. Create storage and account if it doesn't exist and add account to it - - keyDir := path.Join(homedir, EthereumWalletStorageDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - - // 2. Init wallet - - wallet, err := hdw.NewFromMnemonic(mnemonic) - if err != nil { - return "", errors.Wrap(err, "failed to import from mnemonic") - } - - var aai AccountAddressIndex - if len(accountAddrIndex) > 0 { - aai = accountAddrIndex[0] - } - - var pathD accounts.DerivationPath - if aai.Bip32 { - pathD = hdw.MustParseDerivationPath(fmt.Sprintf("m/44'/60'/0'/%d", aai.AddressIndex)) - } else { - pathD = hdw.MustParseDerivationPath(fmt.Sprintf("m/44'/60'/%d'/0/%d", aai.AccountIndex, aai.AddressIndex)) - } - - account, err := wallet.Derive(pathD, true) - if err != nil { - return "", errors.Wrap(err, "failed parse derivation path") - } - - key, err := wallet.PrivateKey(account) - if err != nil { - return "", errors.Wrap(err, "failed to get private key") - } - - // 3. Find key - - acc, err := ks.Find(account) - if err == nil { - fmt.Printf("Account already exists: %s\nPath: %s\n\n", acc.Address.Hex(), acc.URL.Path) - return acc.Address.Hex(), nil - } - - // 4. Import the key if it doesn't exist - - acc, err = ks.ImportECDSA(key, password) - if err != nil { - return "", errors.Wrap(err, "failed to get import private key") - } - - fmt.Printf("Imported account %s to path: %s\n", acc.Address.Hex(), acc.URL.Path) - - return acc.Address.Hex(), nil -} diff --git a/zcnbridge/log/doc.go b/zcnbridge/log/doc.go deleted file mode 100644 index dee00abe6..000000000 --- a/zcnbridge/log/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Logging methods and types for the ZCN bridge SDK. -package log \ No newline at end of file diff --git a/zcnbridge/log/handler.go b/zcnbridge/log/handler.go deleted file mode 100644 index f99b41730..000000000 --- a/zcnbridge/log/handler.go +++ /dev/null @@ -1,57 +0,0 @@ -package log - -import ( - "net/http" - "os" - "strings" - - "github.com/0chain/gosdk/core/sys" -) - -// HandleFunc returns handle function that writes logs to http.ResponseWriter with provided buffer size. -// Buffered length represented in kilobytes. -func HandleFunc(buffLen int64) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, _ *http.Request) { - file, err := os.Open(logName) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - defer func() { - _ = file.Close() - }() - - stat, err := sys.Files.Stat(logName) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - var ( - writeLen = buffLen * 1024 - brokenLines = true // flag that describes existence of broken lines - ) - if writeLen > stat.Size() { - writeLen = stat.Size() - brokenLines = false - } - - buf := make([]byte, writeLen) - _, err = file.ReadAt(buf, stat.Size()-writeLen) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - // cut broken lines if it exists - if brokenLines { - lbInd := strings.Index(string(buf), "\n") - buf = buf[lbInd+1:] - } - - if _, err := w.Write(buf); err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - } -} diff --git a/zcnbridge/log/logging.go b/zcnbridge/log/logging.go deleted file mode 100644 index d3faac3df..000000000 --- a/zcnbridge/log/logging.go +++ /dev/null @@ -1,93 +0,0 @@ -package log - -import ( - "os" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "gopkg.in/natefinch/lumberjack.v2" - - "github.com/0chain/gosdk/zcnbridge/errors" -) - -var ( - // Logger represents main logger implementation used in app. - Logger = zap.NewNop() - - // logName - logName string -) - -// InitLogging initializes the main Logger consistent with passed log directory and level. -// -// If an error occurs during execution, the program terminates with code 2 and the error will be written in os.Stderr. -// -// InitLogging should be used only once while application is starting. -func InitLogging(development bool, logDir, level string) { - logName = logDir + "/" + "logs.log" - var ( - logWriter = getWriteSyncer(logName) - logCfg zap.Config - ) - - if development { - logCfg = zap.NewProductionConfig() - logCfg.DisableCaller = true - } else { - logCfg = zap.NewDevelopmentConfig() - logCfg.EncoderConfig.LevelKey = "level" - logCfg.EncoderConfig.NameKey = "name" - logCfg.EncoderConfig.MessageKey = "msg" - logCfg.EncoderConfig.CallerKey = "caller" - logCfg.EncoderConfig.StacktraceKey = "stacktrace" - - logWriter = zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), logWriter) - } - _ = logCfg.Level.UnmarshalText([]byte(level)) - logCfg.Encoding = consoleEncoderType - logCfg.EncoderConfig.TimeKey = "timestamp" - logCfg.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder - - l, err := logCfg.Build(setOutput(logWriter, logCfg)) - if err != nil { - errors.ExitErr("error while build logger config", err, 2) - } - - Logger = l -} - -const ( - jsonEncoderType = "json" - consoleEncoderType = "console" -) - -// setOutput replaces existing Core with new, that writes to passed zapcore.WriteSyncer. -func setOutput(ws zapcore.WriteSyncer, conf zap.Config) zap.Option { - var enc zapcore.Encoder - switch conf.Encoding { - case jsonEncoderType: - enc = zapcore.NewJSONEncoder(conf.EncoderConfig) - case consoleEncoderType: - enc = zapcore.NewConsoleEncoder(conf.EncoderConfig) - default: - errors.ExitMsg("error while build logger config", 2) - } - - return zap.WrapCore(func(core zapcore.Core) zapcore.Core { - return zapcore.NewCore(enc, ws, conf.Level) - }) -} - -// getWriteSyncer creates zapcore.WriteSyncer using provided log file. -func getWriteSyncer(logName string) zapcore.WriteSyncer { - var ioWriter = &lumberjack.Logger{ - Filename: logName, - MaxSize: 10, // MB - MaxBackups: 3, // number of backups - MaxAge: 28, // days - LocalTime: true, - Compress: false, // disabled by default - } - _ = ioWriter.Rotate() - return zapcore.AddSync(ioWriter) -} diff --git a/zcnbridge/mocks/EthereumClient.go b/zcnbridge/mocks/EthereumClient.go deleted file mode 100644 index 309d5ae67..000000000 --- a/zcnbridge/mocks/EthereumClient.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by mockery v2.28.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - big "math/big" - - common "github.com/ethereum/go-ethereum/common" - - ethereum "github.com/ethereum/go-ethereum" - - mock "github.com/stretchr/testify/mock" - - types "github.com/ethereum/go-ethereum/core/types" -) - -// EthereumClient is an autogenerated mock type for the EthereumClient type -type EthereumClient struct { - mock.Mock -} - -// CallContract provides a mock function with given fields: ctx, call, blockNumber -func (_m *EthereumClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { - ret := _m.Called(ctx, call, blockNumber) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error)); ok { - return rf(ctx, call, blockNumber) - } - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg, *big.Int) []byte); ok { - r0 = rf(ctx, call, blockNumber) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg, *big.Int) error); ok { - r1 = rf(ctx, call, blockNumber) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ChainID provides a mock function with given fields: ctx -func (_m *EthereumClient) ChainID(ctx context.Context) (*big.Int, error) { - ret := _m.Called(ctx) - - var r0 *big.Int - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CodeAt provides a mock function with given fields: ctx, contract, blockNumber -func (_m *EthereumClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) { - ret := _m.Called(ctx, contract, blockNumber) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) ([]byte, error)); ok { - return rf(ctx, contract, blockNumber) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int) []byte); ok { - r0 = rf(ctx, contract, blockNumber) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int) error); ok { - r1 = rf(ctx, contract, blockNumber) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// EstimateGas provides a mock function with given fields: ctx, call -func (_m *EthereumClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { - ret := _m.Called(ctx, call) - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) (uint64, error)); ok { - return rf(ctx, call) - } - if rf, ok := ret.Get(0).(func(context.Context, ethereum.CallMsg) uint64); ok { - r0 = rf(ctx, call) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, ethereum.CallMsg) error); ok { - r1 = rf(ctx, call) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// FilterLogs provides a mock function with given fields: ctx, query -func (_m *EthereumClient) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) { - ret := _m.Called(ctx, query) - - var r0 []types.Log - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery) ([]types.Log, error)); ok { - return rf(ctx, query) - } - if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery) []types.Log); ok { - r0 = rf(ctx, query) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]types.Log) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery) error); ok { - r1 = rf(ctx, query) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// HeaderByNumber provides a mock function with given fields: ctx, number -func (_m *EthereumClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { - ret := _m.Called(ctx, number) - - var r0 *types.Header - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok { - return rf(ctx, number) - } - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok { - r0 = rf(ctx, number) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Header) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { - r1 = rf(ctx, number) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PendingCodeAt provides a mock function with given fields: ctx, account -func (_m *EthereumClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { - ret := _m.Called(ctx, account) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address) ([]byte, error)); ok { - return rf(ctx, account) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address) []byte); ok { - r0 = rf(ctx, account) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { - r1 = rf(ctx, account) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PendingNonceAt provides a mock function with given fields: ctx, account -func (_m *EthereumClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { - ret := _m.Called(ctx, account) - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok { - return rf(ctx, account) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok { - r0 = rf(ctx, account) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { - r1 = rf(ctx, account) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SendTransaction provides a mock function with given fields: ctx, tx -func (_m *EthereumClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { - ret := _m.Called(ctx, tx) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) error); ok { - r0 = rf(ctx, tx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SubscribeFilterLogs provides a mock function with given fields: ctx, query, ch -func (_m *EthereumClient) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { - ret := _m.Called(ctx, query, ch) - - var r0 ethereum.Subscription - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) (ethereum.Subscription, error)); ok { - return rf(ctx, query, ch) - } - if rf, ok := ret.Get(0).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) ethereum.Subscription); ok { - r0 = rf(ctx, query, ch) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ethereum.Subscription) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, ethereum.FilterQuery, chan<- types.Log) error); ok { - r1 = rf(ctx, query, ch) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SuggestGasPrice provides a mock function with given fields: ctx -func (_m *EthereumClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { - ret := _m.Called(ctx) - - var r0 *big.Int - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SuggestGasTipCap provides a mock function with given fields: ctx -func (_m *EthereumClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { - ret := _m.Called(ctx) - - var r0 *big.Int - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*big.Int) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -type mockConstructorTestingTNewEthereumClient interface { - mock.TestingT - Cleanup(func()) -} - -// NewEthereumClient creates a new instance of EthereumClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewEthereumClient(t mockConstructorTestingTNewEthereumClient) *EthereumClient { - mock := &EthereumClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/zcnbridge/mocks/JobResult.go b/zcnbridge/mocks/JobResult.go deleted file mode 100644 index ed7bf80fa..000000000 --- a/zcnbridge/mocks/JobResult.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by mockery v2.28.1. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// JobResult is an autogenerated mock type for the JobResult type -type JobResult struct { - mock.Mock -} - -// Data provides a mock function with given fields: -func (_m *JobResult) Data() interface{} { - ret := _m.Called() - - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// Error provides a mock function with given fields: -func (_m *JobResult) Error() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetAuthorizerID provides a mock function with given fields: -func (_m *JobResult) GetAuthorizerID() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// SetAuthorizerID provides a mock function with given fields: ID -func (_m *JobResult) SetAuthorizerID(ID string) { - _m.Called(ID) -} - -type mockConstructorTestingTNewJobResult interface { - mock.TestingT - Cleanup(func()) -} - -// NewJobResult creates a new instance of JobResult. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewJobResult(t mockConstructorTestingTNewJobResult) *JobResult { - mock := &JobResult{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/zcnbridge/mocks/KeyStore.go b/zcnbridge/mocks/KeyStore.go deleted file mode 100644 index be5f0130d..000000000 --- a/zcnbridge/mocks/KeyStore.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by mockery v2.28.1. DO NOT EDIT. - -package mocks - -import ( - accounts "github.com/ethereum/go-ethereum/accounts" - keystore "github.com/ethereum/go-ethereum/accounts/keystore" - - mock "github.com/stretchr/testify/mock" - - time "time" -) - -// KeyStore is an autogenerated mock type for the KeyStore type -type KeyStore struct { - mock.Mock -} - -// Find provides a mock function with given fields: _a0 -func (_m *KeyStore) Find(_a0 accounts.Account) (accounts.Account, error) { - ret := _m.Called(_a0) - - var r0 accounts.Account - var r1 error - if rf, ok := ret.Get(0).(func(accounts.Account) (accounts.Account, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(accounts.Account) accounts.Account); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(accounts.Account) - } - - if rf, ok := ret.Get(1).(func(accounts.Account) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetEthereumKeyStore provides a mock function with given fields: -func (_m *KeyStore) GetEthereumKeyStore() *keystore.KeyStore { - ret := _m.Called() - - var r0 *keystore.KeyStore - if rf, ok := ret.Get(0).(func() *keystore.KeyStore); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*keystore.KeyStore) - } - } - - return r0 -} - -// SignHash provides a mock function with given fields: account, hash -func (_m *KeyStore) SignHash(account accounts.Account, hash []byte) ([]byte, error) { - ret := _m.Called(account, hash) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(accounts.Account, []byte) ([]byte, error)); ok { - return rf(account, hash) - } - if rf, ok := ret.Get(0).(func(accounts.Account, []byte) []byte); ok { - r0 = rf(account, hash) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(accounts.Account, []byte) error); ok { - r1 = rf(account, hash) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TimedUnlock provides a mock function with given fields: _a0, _a1, _a2 -func (_m *KeyStore) TimedUnlock(_a0 accounts.Account, _a1 string, _a2 time.Duration) error { - ret := _m.Called(_a0, _a1, _a2) - - var r0 error - if rf, ok := ret.Get(0).(func(accounts.Account, string, time.Duration) error); ok { - r0 = rf(_a0, _a1, _a2) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -type mockConstructorTestingTNewKeyStore interface { - mock.TestingT - Cleanup(func()) -} - -// NewKeyStore creates a new instance of KeyStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewKeyStore(t mockConstructorTestingTNewKeyStore) *KeyStore { - mock := &KeyStore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/zcnbridge/mocks/doc.go b/zcnbridge/mocks/doc.go deleted file mode 100644 index d5f5048fa..000000000 --- a/zcnbridge/mocks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOGENERATED! Do not use. -package mocks \ No newline at end of file diff --git a/zcnbridge/rest.go b/zcnbridge/rest.go deleted file mode 100644 index f5c12241f..000000000 --- a/zcnbridge/rest.go +++ /dev/null @@ -1,116 +0,0 @@ -package zcnbridge - -import ( - "encoding/json" - "fmt" - - coreHttp "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/common" - - "github.com/0chain/gosdk/zcncore" -) - -const ( - // SCRestAPIPrefix represents base URL path to execute smart contract rest points. - SCRestAPIPrefix = "v1/screst/" - RestPrefix = SCRestAPIPrefix + zcncore.ZCNSCSmartContractAddress - PathGetAuthorizerNodes = "/getAuthorizerNodes?active=%t" - PathGetGlobalConfig = "/getGlobalConfig" - PathGetAuthorizer = "/getAuthorizer" -) - -// AuthorizerResponse represents the response of the request to get authorizer info from the sharders. -type AuthorizerResponse struct { - AuthorizerID string `json:"id"` - URL string `json:"url"` - - // Configuration - Fee common.Balance `json:"fee"` - - // Geolocation - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - - // Stats - LastHealthCheck int64 `json:"last_health_check"` - - // stake_pool_settings - DelegateWallet string `json:"delegate_wallet"` - MinStake common.Balance `json:"min_stake"` - MaxStake common.Balance `json:"max_stake"` - NumDelegates int `json:"num_delegates"` - ServiceCharge float64 `json:"service_charge"` -} - -// AuthorizerNodesResponse represents the response of the request to get authorizers -type AuthorizerNodesResponse struct { - Nodes []*AuthorizerNode `json:"nodes"` -} - -// AuthorizerNode represents an authorizer node -type AuthorizerNode struct { - ID string `json:"id"` - URL string `json:"url"` -} - -// Rest endpoints - -// getAuthorizers returns authorizers from smart contract -func getAuthorizers(active bool) ([]*AuthorizerNode, error) { - var ( - authorizers = new(AuthorizerNodesResponse) - err error - res []byte - ) - - if res, err = GetAuthorizers(active); err != nil { - return nil, err - } - - err = json.Unmarshal(res, authorizers) - if err != nil { - return nil, err - } - - if len(authorizers.Nodes) == 0 { - fmt.Println("no authorizers found") - return nil, err - } - - return authorizers.Nodes, nil -} - -// GetAuthorizer returned authorizer information from Züs Blockchain by the ID -// - id is the authorizer ID -// - cb is the callback function to handle the response asynchronously -func GetAuthorizer(id string) (res []byte, err error) { - err = zcncore.CheckConfig() - if err != nil { - return nil, err - } - - return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, PathGetAuthorizer, zcncore.Params{ - "id": id, - }) -} - -// GetAuthorizers Returns all or only active authorizers -// - active is the flag to get only active authorizers -// - cb is the callback function to handle the response asynchronously -func GetAuthorizers(active bool) (res []byte, err error) { - err = zcncore.CheckConfig() - if err != nil { - return nil, err - } - return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, fmt.Sprintf(PathGetAuthorizerNodes, active), nil) -} - -// GetGlobalConfig Returns global config -// - cb is the callback function to handle the response asynchronously -func GetGlobalConfig() (res []byte, err error) { - err = zcncore.CheckConfig() - if err != nil { - return nil, err - } - return coreHttp.MakeSCRestAPICallToSharder(zcncore.ZCNSCSmartContractAddress, PathGetGlobalConfig, nil) -} diff --git a/zcnbridge/time/doc.go b/zcnbridge/time/doc.go deleted file mode 100644 index 2feb4fd7d..000000000 --- a/zcnbridge/time/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Utility functions to handle the time. -package time diff --git a/zcnbridge/time/time.go b/zcnbridge/time/time.go deleted file mode 100644 index 2095bbe32..000000000 --- a/zcnbridge/time/time.go +++ /dev/null @@ -1,34 +0,0 @@ -package time - -import ( - "time" -) - -const ( - // RFC3339 is useful for formatting time. - RFC3339 = "2006-01-02T15:04:05Z07:00" -) - -type ( - // A Duration represents the elapsed time between two instants - // as an int64 nanosecond count. The representation limits the - // largest representable duration to approximately 290 years. - Duration = time.Duration - - // Time is a copy of time from golang std lib - // to avoid import it from other packages. - Time = time.Time - - // Timestamp represents a wrapper to control the json encoding. - Timestamp int64 -) - -// Now returns current Unix time. -func Now() Timestamp { - return Timestamp(time.Now().Unix()) -} - -// NowTime returns the current local time. -func NowTime() Time { - return time.Now() -} diff --git a/zcnbridge/transaction/const.go b/zcnbridge/transaction/const.go deleted file mode 100644 index 3ad2971c2..000000000 --- a/zcnbridge/transaction/const.go +++ /dev/null @@ -1,62 +0,0 @@ -package transaction - -type ( - // TxnStatus represented zcncore.TransactionCallback operations statuses. - TxnStatus int -) - -const ( - // StatusSuccess represent zcncore.StatusSuccess. - StatusSuccess TxnStatus = iota - // StatusNetworkError represent zcncore.StatusNetworkError. - StatusNetworkError - // StatusError represent zcncore.StatusError. - StatusError - // StatusRejectedByUser represent zcncore.StatusRejectedByUser. - StatusRejectedByUser - // StatusInvalidSignature represent zcncore.StatusInvalidSignature. - StatusInvalidSignature - // StatusAuthError represent zcncore.StatusAuthError. - StatusAuthError - // StatusAuthVerifyFailed represent zcncore.StatusAuthVerifyFailed. - StatusAuthVerifyFailed - // StatusAuthTimeout represent zcncore.StatusAuthTimeout. - StatusAuthTimeout - // StatusUnknown represent zcncore.StatusUnknown. - StatusUnknown = -1 -) - -// String returns represented in string format TxnStatus. -func (ts TxnStatus) String() string { - switch ts { - case StatusSuccess: - return "success" - - case StatusNetworkError: - return "network error" - - case StatusError: - return "error" - - case StatusRejectedByUser: - return "rejected byt user" - - case StatusInvalidSignature: - return "invalid signature" - - case StatusAuthError: - return "auth error" - - case StatusAuthVerifyFailed: - return "auth verify error" - - case StatusAuthTimeout: - return "auth timeout error" - - case StatusUnknown: - return "unknown" - - default: - return "" - } -} diff --git a/zcnbridge/transaction/doc.go b/zcnbridge/transaction/doc.go deleted file mode 100644 index 7c7450aee..000000000 --- a/zcnbridge/transaction/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Methods and types to interact with native Züs transactions. -package transaction \ No newline at end of file diff --git a/zcnbridge/utils/convert.go b/zcnbridge/utils/convert.go deleted file mode 100644 index a3bf4d776..000000000 --- a/zcnbridge/utils/convert.go +++ /dev/null @@ -1,18 +0,0 @@ -// Miscellaneous utility functions. -package utils - -import ( - "crypto/ecdsa" - "crypto/x509" - "encoding/pem" -) - -func Encode(publicKey *ecdsa.PublicKey, privateKey *ecdsa.PrivateKey) (string, string) { - x509Encoded, _ := x509.MarshalECPrivateKey(privateKey) - pemEncoded := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: x509Encoded}) - - x509EncodedPub, _ := x509.MarshalPKIXPublicKey(publicKey) - pemEncodedPub := pem.EncodeToMemory(&pem.Block{Type: "PUBLIC KEY", Bytes: x509EncodedPub}) - - return string(pemEncoded), string(pemEncodedPub) -} diff --git a/zcnbridge/wallet/doc.go b/zcnbridge/wallet/doc.go deleted file mode 100644 index ca7daf1aa..000000000 --- a/zcnbridge/wallet/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Methods and types to represent client's wallet. -package wallet \ No newline at end of file diff --git a/zcnbridge/wallet/status.go b/zcnbridge/wallet/status.go deleted file mode 100644 index 12b1979a2..000000000 --- a/zcnbridge/wallet/status.go +++ /dev/null @@ -1,152 +0,0 @@ -package wallet - -import ( - "encoding/json" - "errors" - "fmt" - "os" - "sync" - - "github.com/0chain/gosdk/zcncore" -) - -// ZCNStatus represents the status of a ZCN operation. -type ZCNStatus struct { - walletString string - balance int64 - value interface{} - Wg *sync.WaitGroup - Success bool - Err error -} - -// NewZCNStatus creates a new ZCNStatus instance. -// - value: value to be stored in the ZCNStatus instance -func NewZCNStatus(value interface{}) (zcns *ZCNStatus) { - return &ZCNStatus{ - Wg: new(sync.WaitGroup), - value: value, - } -} - -// Begin starts the wait group -func (zcn *ZCNStatus) Begin() { - zcn.Wg.Add(1) -} - -// Wait waits for the wait group to finish -func (zcn *ZCNStatus) Wait() error { - zcn.Wg.Wait() - return zcn.Err -} - -// OnBalanceAvailable callback when balance is available -// - status: status of the operation -// - value: balance value -// - third parameter is not used, it is kept for compatibility -func (zcn *ZCNStatus) OnBalanceAvailable(status int, value int64, _ string) { - defer zcn.Wg.Done() - if status == zcncore.StatusSuccess { - zcn.Success = true - } else { - zcn.Success = false - } - zcn.balance = value -} - -// OnWalletCreateComplete callback when a wallet is created -// - status: status of the operation -// - wallet: wallet json string -func (zcn *ZCNStatus) OnWalletCreateComplete(status int, wallet string, err string) { - defer zcn.Wg.Done() - if status != zcncore.StatusSuccess { - zcn.Success = false - zcn.Err = errors.New(err) - zcn.walletString = "" - return - } - zcn.Success = true - zcn.Err = nil - zcn.walletString = wallet -} - -// OnInfoAvailable callback when information is available -// - op`: operation type (check `zcncore.Op* constants) -// - status: status of the operation -// - info: information represneted as a string -// - err: error message -func (zcn *ZCNStatus) OnInfoAvailable(op int, status int, info string, err string) { - defer zcn.Wg.Done() - - if status != zcncore.StatusSuccess { - zcn.Err = errors.New(err) - zcn.Success = false - return - } - - if info == "" || info == "{}" { - zcn.Err = errors.New("empty response") - zcn.Success = false - return - } - - var errm error - if errm = json.Unmarshal([]byte(info), zcn.value); errm != nil { - zcn.Err = fmt.Errorf("decoding response: %v", errm) - zcn.Success = false - return - } - - zcn.Err = nil - zcn.Success = true -} - -// OnSetupComplete callback when setup is completed. -// Paramters are not used in this implementation, -// just kept for compatibility. -func (zcn *ZCNStatus) OnSetupComplete(_ int, _ string) { - defer zcn.Wg.Done() -} - -// OnAuthorizeSendComplete callback when authorization is completed -// - status: status of the operation -// - 2nd parameter is not used, it is kept for compatibility -// - 3rd parameter is not used, it is kept for compatibility -// - 4th parameter is not used, it is kept for compatibility -// - creationDate: timestamp of the creation date -// - signature: signature of the operation -func (zcn *ZCNStatus) OnAuthorizeSendComplete(status int, _ string, _ int64, _ string, creationDate int64, signature string) { - defer zcn.Wg.Done() - - Logger.Info("Status: ", status) - Logger.Info("Timestamp:", creationDate) - Logger.Info("Signature:", signature) -} - -// OnVoteComplete callback when a multisig vote is completed -// - status: status of the operation -// - proposal: proposal json string -// - err: error message -func (zcn *ZCNStatus) OnVoteComplete(status int, proposal string, err string) { - defer zcn.Wg.Done() - if status != zcncore.StatusSuccess { - zcn.Success = false - zcn.Err = errors.New(err) - zcn.walletString = "" - return - } - zcn.Success = true - zcn.Err = nil - zcn.walletString = proposal -} - -//goland:noinspection ALL -func PrintError(v ...interface{}) { - fmt.Fprintln(os.Stderr, v...) -} - -//goland:noinspection ALL -func ExitWithError(v ...interface{}) { - fmt.Fprintln(os.Stderr, v...) - os.Exit(1) -} diff --git a/zcnbridge/wallet/wallet.go b/zcnbridge/wallet/wallet.go deleted file mode 100644 index 74168b313..000000000 --- a/zcnbridge/wallet/wallet.go +++ /dev/null @@ -1,33 +0,0 @@ -package wallet - -import ( - "github.com/0chain/gosdk/core/logger" - "gopkg.in/natefinch/lumberjack.v2" -) - -const ( - ZCNSCSmartContractAddress = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0" - MintFunc = "mint" - BurnFunc = "burn" - BurnWzcnTicketPath = "/v1/ether/burnticket/" - BurnWzcnBurnEventsPath = "/v1/ether/burnevents/" - BurnNativeTicketPath = "/v1/0chain/burnticket/" -) - -var Logger logger.Logger -var defaultLogLevel = logger.DEBUG - -func init() { - Logger.Init(defaultLogLevel, "zcnbridge-wallet-sdk") - - Logger.SetLevel(logger.DEBUG) - ioWriter := &lumberjack.Logger{ - Filename: "bridge.log", - MaxSize: 100, // MB - MaxBackups: 5, // number of backups - MaxAge: 28, //days - LocalTime: false, - Compress: false, // disabled by default - } - Logger.SetLogFile(ioWriter, true) -} diff --git a/zcnbridge/wallets/README.md b/zcnbridge/wallets/README.md deleted file mode 100644 index 9ab8bf214..000000000 --- a/zcnbridge/wallets/README.md +++ /dev/null @@ -1 +0,0 @@ -Contains Ethereum KeyStore wallets used for tests. \ No newline at end of file diff --git a/zcnbridge/wallets/UTC--2023-08-29T19-30-47.946612000Z--d8c9156e782c68ee671c09b6b92de76c97948432 b/zcnbridge/wallets/UTC--2023-08-29T19-30-47.946612000Z--d8c9156e782c68ee671c09b6b92de76c97948432 deleted file mode 100644 index a3590fc0a..000000000 --- a/zcnbridge/wallets/UTC--2023-08-29T19-30-47.946612000Z--d8c9156e782c68ee671c09b6b92de76c97948432 +++ /dev/null @@ -1 +0,0 @@ -{"address":"d8c9156e782c68ee671c09b6b92de76c97948432","crypto":{"cipher":"aes-128-ctr","ciphertext":"7048af9fa09a3a0ca22e7ef8afea41fec8dcce848b48be8fc0d59a1f04e8581f","cipherparams":{"iv":"c97dd7cb9c554965196dd4d5bc218e0e"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"aaccc85e65af50058262ee54a2e8952a91b47d0af266e4a3558425049e77c835"},"mac":"c5ac03cbe13375c6e4c3052ff5f23f92a2c595fca6c90c3ac908b57dccd78b0a"},"id":"16c89ced-50fd-4c78-86e3-40ff440078fb","version":3} \ No newline at end of file diff --git a/zcnbridge/zcnsc/burn_event.go b/zcnbridge/zcnsc/burn_event.go deleted file mode 100644 index 152528ce4..000000000 --- a/zcnbridge/zcnsc/burn_event.go +++ /dev/null @@ -1,6 +0,0 @@ -package zcnsc - -// BurnEvent represents WZCN burn event -type BurnEvent struct { - Burneds []BurnTicket `json:"burneds"` -} diff --git a/zcnbridge/zcnsc/burn_payload.go b/zcnbridge/zcnsc/burn_payload.go deleted file mode 100644 index c5747a78f..000000000 --- a/zcnbridge/zcnsc/burn_payload.go +++ /dev/null @@ -1,18 +0,0 @@ -package zcnsc - -import "encoding/json" - -// BurnPayload Payload to submit to ZCN chain `burn` smart contract -type BurnPayload struct { - EthereumAddress string `json:"ethereum_address"` -} - -func (bp *BurnPayload) Encode() []byte { - buff, _ := json.Marshal(bp) - return buff -} - -func (bp *BurnPayload) Decode(input []byte) error { - err := json.Unmarshal(input, bp) - return err -} diff --git a/zcnbridge/zcnsc/burn_ticket.go b/zcnbridge/zcnsc/burn_ticket.go deleted file mode 100644 index 9f7169524..000000000 --- a/zcnbridge/zcnsc/burn_ticket.go +++ /dev/null @@ -1,7 +0,0 @@ -package zcnsc - -// BurnTicket represents WZCN burn ticket details -type BurnTicket struct { - TransactionHash string `json:"transactionHash"` - Nonce string `json:"nonce"` -} diff --git a/zcnbridge/zcnsc/doc.go b/zcnbridge/zcnsc/doc.go deleted file mode 100644 index 25a1aa998..000000000 --- a/zcnbridge/zcnsc/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Utilities to interact with native ZCN smart contract functions. -package zcnsc \ No newline at end of file diff --git a/zcnbridge/zcnsc/mint_payload.go b/zcnbridge/zcnsc/mint_payload.go deleted file mode 100644 index 921e202b6..000000000 --- a/zcnbridge/zcnsc/mint_payload.go +++ /dev/null @@ -1,26 +0,0 @@ -package zcnsc - -import ( - "encoding/json" - - "github.com/0chain/gosdk/core/common" -) - -// MintPayload Payload to submit to ZCN chain `mint` smart contract -type MintPayload struct { - EthereumTxnID string `json:"ethereum_txn_id"` - Amount common.Balance `json:"amount"` - Nonce int64 `json:"nonce"` - Signatures []*AuthorizerSignature `json:"signatures"` - ReceivingClientID string `json:"receiving_client_id"` -} - -type AuthorizerSignature struct { - ID string `json:"authorizer_id"` - Signature string `json:"signature"` -} - -func (mp *MintPayload) Encode() []byte { - buff, _ := json.Marshal(mp) - return buff -} diff --git a/zcncore/doc.go b/zcncore/doc.go deleted file mode 100644 index 1e9ce0fa8..000000000 --- a/zcncore/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Contains sub-packages and modules for managing users' wallets and issuing transactions. -package zcncore \ No newline at end of file diff --git a/zcncore/ethhdwallet/hdwallet.go b/zcncore/ethhdwallet/hdwallet.go deleted file mode 100644 index ec5afbb51..000000000 --- a/zcncore/ethhdwallet/hdwallet.go +++ /dev/null @@ -1,558 +0,0 @@ -// Utilities to interact with ethereum wallet. -package hdwallet - -import ( - "crypto/ecdsa" - "crypto/rand" - "errors" - "fmt" - "math/big" - "os" - "sync" - - "github.com/btcsuite/btcd/btcutil/hdkeychain" - - "github.com/btcsuite/btcd/chaincfg" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/tyler-smith/go-bip39" -) - -// DefaultRootDerivationPath is the root path to which custom derivation endpoints -// are appended. As such, the first account will be at m/44'/60'/0'/0, the second -// at m/44'/60'/0'/1, etc. -var DefaultRootDerivationPath = accounts.DefaultRootDerivationPath - -// DefaultBaseDerivationPath is the base path from which custom derivation endpoints -// are incremented. As such, the first account will be at m/44'/60'/0'/0, the second -// at m/44'/60'/0'/1, etc -var DefaultBaseDerivationPath = accounts.DefaultBaseDerivationPath - -const issue179FixEnvar = "GO_ETHEREUM_HDWALLET_FIX_ISSUE_179" - -// Wallet is the underlying wallet struct. -type Wallet struct { - mnemonic string - masterKey *hdkeychain.ExtendedKey - seed []byte - url accounts.URL - paths map[common.Address]accounts.DerivationPath - accounts []accounts.Account - stateLock sync.RWMutex - fixIssue172 bool -} - -func newWallet(seed []byte) (*Wallet, error) { - masterKey, err := hdkeychain.NewMaster(seed, &chaincfg.MainNetParams) - if err != nil { - return nil, err - } - - return &Wallet{ - masterKey: masterKey, - seed: seed, - accounts: []accounts.Account{}, - paths: map[common.Address]accounts.DerivationPath{}, - fixIssue172: false || len(os.Getenv(issue179FixEnvar)) > 0, - }, nil -} - -// NewFromMnemonic returns a new wallet from a BIP-39 mnemonic. -func NewFromMnemonic(mnemonic string) (*Wallet, error) { - if mnemonic == "" { - return nil, errors.New("mnemonic is required") - } - - if !bip39.IsMnemonicValid(mnemonic) { - return nil, errors.New("mnemonic is invalid") - } - - seed, err := NewSeedFromMnemonic(mnemonic) - if err != nil { - return nil, err - } - - wallet, err := newWallet(seed) - if err != nil { - return nil, err - } - wallet.mnemonic = mnemonic - - return wallet, nil -} - -// NewFromSeed returns a new wallet from a BIP-39 seed. -func NewFromSeed(seed []byte) (*Wallet, error) { - if len(seed) == 0 { - return nil, errors.New("seed is required") - } - - return newWallet(seed) -} - -// URL implements accounts.Wallet, returning the URL of the device that -// the wallet is on, however this does nothing since this is not a hardware device. -func (w *Wallet) URL() accounts.URL { - return w.url -} - -// Status implements accounts.Wallet, returning a custom status message -// from the underlying vendor-specific hardware wallet implementation, -// however this does nothing since this is not a hardware device. -func (w *Wallet) Status() (string, error) { - return "ok", nil -} - -// Open implements accounts.Wallet, however this does nothing since this -// is not a hardware device. -func (w *Wallet) Open(passphrase string) error { - return nil -} - -// Close implements accounts.Wallet, however this does nothing since this -// is not a hardware device. -func (w *Wallet) Close() error { - return nil -} - -// Accounts implements accounts.Wallet, returning the list of accounts pinned to -// the wallet. If self-derivation was enabled, the account list is -// periodically expanded based on current chain state. -func (w *Wallet) Accounts() []accounts.Account { - // Attempt self-derivation if it's running - // Return whatever account list we ended up with - w.stateLock.RLock() - defer w.stateLock.RUnlock() - - cpy := make([]accounts.Account, len(w.accounts)) - copy(cpy, w.accounts) - return cpy -} - -// Contains implements accounts.Wallet, returning whether a particular account is -// or is not pinned into this wallet instance. -func (w *Wallet) Contains(account accounts.Account) bool { - w.stateLock.RLock() - defer w.stateLock.RUnlock() - - _, exists := w.paths[account.Address] - return exists -} - -// Unpin unpins account from list of pinned accounts. -func (w *Wallet) Unpin(account accounts.Account) error { - w.stateLock.RLock() - defer w.stateLock.RUnlock() - - for i, acct := range w.accounts { - if acct.Address.String() == account.Address.String() { - w.accounts = removeAtIndex(w.accounts, i) - delete(w.paths, account.Address) - return nil - } - } - - return errors.New("account not found") -} - -// SetFixIssue172 determines whether the standard (correct) bip39 -// derivation path was used, or if derivation should be affected by -// Issue172 [0] which was how this library was originally implemented. -// [0] https://github.com/btcsuite/btcutil/pull/182/files -func (w *Wallet) SetFixIssue172(fixIssue172 bool) { - w.fixIssue172 = fixIssue172 -} - -// Derive implements accounts.Wallet, deriving a new account at the specific -// derivation path. If pin is set to true, the account will be added to the list -// of tracked accounts. -func (w *Wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Account, error) { - // Try to derive the actual account and update its URL if successful - w.stateLock.RLock() // Avoid device disappearing during derivation - - address, err := w.deriveAddress(path) - - w.stateLock.RUnlock() - - // If an error occurred or no pinning was requested, return - if err != nil { - return accounts.Account{}, err - } - - account := accounts.Account{ - Address: address, - URL: accounts.URL{ - Scheme: "", - Path: path.String(), - }, - } - - if !pin { - return account, nil - } - - // Pinning needs to modify the state - w.stateLock.Lock() - defer w.stateLock.Unlock() - - if _, ok := w.paths[address]; !ok { - w.accounts = append(w.accounts, account) - w.paths[address] = path - } - - return account, nil -} - -// SelfDerive implements accounts.Wallet, trying to discover accounts that the -// user used previously (based on the chain state), but ones that he/she did not -// explicitly pin to the wallet manually. To avoid chain head monitoring, self -// derivation only runs during account listing (and even then throttled). -func (w *Wallet) SelfDerive(base []accounts.DerivationPath, chain ethereum.ChainStateReader) { - // TODO: self derivation -} - -// SignHash implements accounts.Wallet, which allows signing arbitrary data. -func (w *Wallet) SignHash(account accounts.Account, hash []byte) ([]byte, error) { - // Make sure the requested account is contained within - path, ok := w.paths[account.Address] - if !ok { - return nil, accounts.ErrUnknownAccount - } - - privateKey, err := w.derivePrivateKey(path) - if err != nil { - return nil, err - } - - return crypto.Sign(hash, privateKey) -} - -// SignTxEIP155 implements accounts.Wallet, which allows the account to sign an ERC-20 transaction. -func (w *Wallet) SignTxEIP155(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { - w.stateLock.RLock() // Comms have own mutex, this is for the state fields - defer w.stateLock.RUnlock() - - // Make sure the requested account is contained within - path, ok := w.paths[account.Address] - if !ok { - return nil, accounts.ErrUnknownAccount - } - - privateKey, err := w.derivePrivateKey(path) - if err != nil { - return nil, err - } - - signer := types.NewEIP155Signer(chainID) - // Sign the transaction and verify the sender to avoid hardware fault surprises - signedTx, err := types.SignTx(tx, signer, privateKey) - if err != nil { - return nil, err - } - - sender, err := types.Sender(signer, signedTx) - if err != nil { - return nil, err - } - - if sender != account.Address { - return nil, fmt.Errorf("signer mismatch: expected %s, got %s", account.Address.Hex(), sender.Hex()) - } - - return signedTx, nil -} - -// SignTx implements accounts.Wallet, which allows the account to sign an Ethereum transaction. -func (w *Wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { - w.stateLock.RLock() // Comms have own mutex, this is for the state fields - defer w.stateLock.RUnlock() - - // Make sure the requested account is contained within - path, ok := w.paths[account.Address] - if !ok { - return nil, accounts.ErrUnknownAccount - } - - privateKey, err := w.derivePrivateKey(path) - if err != nil { - return nil, err - } - - signer := types.HomesteadSigner{} - // Sign the transaction and verify the sender to avoid hardware fault surprises - signedTx, err := types.SignTx(tx, signer, privateKey) - if err != nil { - return nil, err - } - - sender, err := types.Sender(signer, signedTx) - if err != nil { - return nil, err - } - - if sender != account.Address { - return nil, fmt.Errorf("signer mismatch: expected %s, got %s", account.Address.Hex(), sender.Hex()) - } - - return signedTx, nil -} - -// SignHashWithPassphrase implements accounts.Wallet, attempting -// to sign the given hash with the given account using the -// passphrase as extra authentication. -func (w *Wallet) SignHashWithPassphrase(account accounts.Account, passphrase string, hash []byte) ([]byte, error) { - return w.SignHash(account, hash) -} - -// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given -// transaction with the given account using passphrase as extra authentication. -func (w *Wallet) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { - return w.SignTx(account, tx, chainID) -} - -// PrivateKey returns the ECDSA private key of the account. -func (w *Wallet) PrivateKey(account accounts.Account) (*ecdsa.PrivateKey, error) { - path, err := ParseDerivationPath(account.URL.Path) - if err != nil { - return nil, err - } - - return w.derivePrivateKey(path) -} - -// PrivateKeyBytes returns the ECDSA private key in bytes format of the account. -func (w *Wallet) PrivateKeyBytes(account accounts.Account) ([]byte, error) { - privateKey, err := w.PrivateKey(account) - if err != nil { - return nil, err - } - - return crypto.FromECDSA(privateKey), nil -} - -// PrivateKeyHex return the ECDSA private key in hex string format of the account. -func (w *Wallet) PrivateKeyHex(account accounts.Account) (string, error) { - privateKeyBytes, err := w.PrivateKeyBytes(account) - if err != nil { - return "", err - } - - return hexutil.Encode(privateKeyBytes)[2:], nil -} - -// PublicKey returns the ECDSA public key of the account. -func (w *Wallet) PublicKey(account accounts.Account) (*ecdsa.PublicKey, error) { - path, err := ParseDerivationPath(account.URL.Path) - if err != nil { - return nil, err - } - - return w.derivePublicKey(path) -} - -// PublicKeyBytes returns the ECDSA public key in bytes format of the account. -func (w *Wallet) PublicKeyBytes(account accounts.Account) ([]byte, error) { - publicKey, err := w.PublicKey(account) - if err != nil { - return nil, err - } - - return crypto.FromECDSAPub(publicKey), nil -} - -// PublicKeyHex return the ECDSA public key in hex string format of the account. -func (w *Wallet) PublicKeyHex(account accounts.Account) (string, error) { - publicKeyBytes, err := w.PublicKeyBytes(account) - if err != nil { - return "", err - } - - return hexutil.Encode(publicKeyBytes)[4:], nil -} - -// Address returns the address of the account. -func (w *Wallet) Address(account accounts.Account) (common.Address, error) { - publicKey, err := w.PublicKey(account) - if err != nil { - return common.Address{}, err - } - - return crypto.PubkeyToAddress(*publicKey), nil -} - -// AddressBytes returns the address in bytes format of the account. -func (w *Wallet) AddressBytes(account accounts.Account) ([]byte, error) { - address, err := w.Address(account) - if err != nil { - return nil, err - } - return address.Bytes(), nil -} - -// AddressHex returns the address in hex string format of the account. -func (w *Wallet) AddressHex(account accounts.Account) (string, error) { - address, err := w.Address(account) - if err != nil { - return "", err - } - return address.Hex(), nil -} - -// Path return the derivation path of the account. -func (w *Wallet) Path(account accounts.Account) (string, error) { - return account.URL.Path, nil -} - -// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed -func (w *Wallet) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error) { - // Make sure the requested account is contained within - if !w.Contains(account) { - return nil, accounts.ErrUnknownAccount - } - - return w.SignHash(account, crypto.Keccak256(data)) -} - -// SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed -func (w *Wallet) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) { - // Make sure the requested account is contained within - if !w.Contains(account) { - return nil, accounts.ErrUnknownAccount - } - - return w.SignHashWithPassphrase(account, passphrase, crypto.Keccak256(data)) -} - -// SignText requests the wallet to sign the hash of a given piece of data, prefixed -// the needed details via SignHashWithPassphrase, or by other means (e.g. unlock -// the account in a keystore). -func (w *Wallet) SignText(account accounts.Account, text []byte) ([]byte, error) { - // Make sure the requested account is contained within - if !w.Contains(account) { - return nil, accounts.ErrUnknownAccount - } - - return w.SignHash(account, accounts.TextHash(text)) -} - -// SignTextWithPassphrase implements accounts.Wallet, attempting to sign the -// given text (which is hashed) with the given account using passphrase as extra authentication. -func (w *Wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) { - // Make sure the requested account is contained within - if !w.Contains(account) { - return nil, accounts.ErrUnknownAccount - } - - return w.SignHashWithPassphrase(account, passphrase, accounts.TextHash(text)) -} - -// ParseDerivationPath parses the derivation path in string format into []uint32 -func ParseDerivationPath(path string) (accounts.DerivationPath, error) { - return accounts.ParseDerivationPath(path) -} - -// MustParseDerivationPath parses the derivation path in string format into -// []uint32 but will panic if it can't parse it. -func MustParseDerivationPath(path string) accounts.DerivationPath { - parsed, err := accounts.ParseDerivationPath(path) - if err != nil { - panic(err) - } - - return parsed -} - -// NewMnemonic returns a randomly generated BIP-39 mnemonic using 128-256 bits of entropy. -func NewMnemonic(bits int) (string, error) { - entropy, err := bip39.NewEntropy(bits) - if err != nil { - return "", err - } - return bip39.NewMnemonic(entropy) -} - -// NewMnemonicFromEntropy returns a BIP-39 mnemonic from entropy. -func NewMnemonicFromEntropy(entropy []byte) (string, error) { - return bip39.NewMnemonic(entropy) -} - -// NewEntropy returns a randomly generated entropy. -func NewEntropy(bits int) ([]byte, error) { - return bip39.NewEntropy(bits) -} - -// NewSeed returns a randomly generated BIP-39 seed. -func NewSeed() ([]byte, error) { - b := make([]byte, 64) - _, err := rand.Read(b) - return b, err -} - -// NewSeedFromMnemonic returns a BIP-39 seed based on a BIP-39 mnemonic. -func NewSeedFromMnemonic(mnemonic string) ([]byte, error) { - if mnemonic == "" { - return nil, errors.New("mnemonic is required") - } - - return bip39.NewSeedWithErrorChecking(mnemonic, "") -} - -// DerivePrivateKey derives the private key of the derivation path. -func (w *Wallet) derivePrivateKey(path accounts.DerivationPath) (*ecdsa.PrivateKey, error) { - var err error - key := w.masterKey - for _, n := range path { - if w.fixIssue172 && key.IsAffectedByIssue172() { - key, err = key.Derive(n) - } else { - key, err = key.DeriveNonStandard(n) //nolint - } - if err != nil { - return nil, err - } - } - - privateKey, err := key.ECPrivKey() - privateKeyECDSA := privateKey.ToECDSA() - if err != nil { - return nil, err - } - - return privateKeyECDSA, nil -} - -// DerivePublicKey derives the public key of the derivation path. -func (w *Wallet) derivePublicKey(path accounts.DerivationPath) (*ecdsa.PublicKey, error) { - privateKeyECDSA, err := w.derivePrivateKey(path) - if err != nil { - return nil, err - } - - publicKey := privateKeyECDSA.Public() - publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) - if !ok { - return nil, errors.New("failed to get public key") - } - - return publicKeyECDSA, nil -} - -// DeriveAddress derives the account address of the derivation path. -func (w *Wallet) deriveAddress(path accounts.DerivationPath) (common.Address, error) { - publicKeyECDSA, err := w.derivePublicKey(path) - if err != nil { - return common.Address{}, err - } - - address := crypto.PubkeyToAddress(*publicKeyECDSA) - return address, nil -} - -// removeAtIndex removes an account at index. -func removeAtIndex(accts []accounts.Account, index int) []accounts.Account { - return append(accts[:index], accts[index+1:]...) -} diff --git a/zcncore/ethhdwallet/hdwallet_test.go b/zcncore/ethhdwallet/hdwallet_test.go deleted file mode 100644 index b95f26aae..000000000 --- a/zcncore/ethhdwallet/hdwallet_test.go +++ /dev/null @@ -1,344 +0,0 @@ -package hdwallet - -import ( - "math/big" - "os" - "strings" - "testing" - - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" -) - -// TODO: table test - -func TestIssue172(t *testing.T) { - mnemonic := "sound practice disease erupt basket pumpkin truck file gorilla behave find exchange napkin boy congress address city net prosper crop chair marine chase seven" - - getWallet := func() *Wallet { - wallet, err := NewFromMnemonic(mnemonic) - if err != nil { - t.Error(err) - } - return wallet - } - - path, err := ParseDerivationPath("m/44'/60'/0'/0/0") - if err != nil { - t.Error(err) - } - - // Reset Envars - os.Setenv(issue179FixEnvar, "") - - // Derive the old (wrong way) - account, err := getWallet().Derive(path, false) - if err != nil { - t.Error(err) - } - - if account.Address.Hex() != "0x3943412CBEEEd4b68d73382b136F36b0CB82F481" { - t.Error("wrong address") - } - - // Set envar to non-zero length to derive correctly - os.Setenv(issue179FixEnvar, "1") - account, err = getWallet().Derive(path, false) - if err != nil { - t.Error(err) - } - if account.Address.Hex() != "0x98e440675eFF3041D20bECb7fE7e81746A431b6d" { - t.Error("wrong address") - } - - // Reset Envars - os.Setenv(issue179FixEnvar, "") - wallet := getWallet() - wallet.SetFixIssue172(true) - account, err = wallet.Derive(path, false) - if err != nil { - t.Error(err) - } - if account.Address.Hex() != "0x98e440675eFF3041D20bECb7fE7e81746A431b6d" { - t.Error("wrong address") - } -} - -func TestWallet(t *testing.T) { - mnemonic := "tag volcano eight thank tide danger coast health above argue embrace heavy" - wallet, err := NewFromMnemonic(mnemonic) - if err != nil { - t.Error(err) - } - // Check that Wallet implements the accounts.Wallet interface. - var _ accounts.Wallet = wallet - - path, err := ParseDerivationPath("m/44'/60'/0'/0/0") - if err != nil { - t.Error(err) - } - - account, err := wallet.Derive(path, false) - if err != nil { - t.Error(err) - } - - if account.Address.Hex() != "0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947" { - t.Error("wrong address") - } - - if len(wallet.Accounts()) != 0 { - t.Error("expected 0") - } - - account, err = wallet.Derive(path, true) - if err != nil { - t.Error(err) - } - - if len(wallet.Accounts()) != 1 { - t.Error("expected 1") - } - - if !wallet.Contains(account) { - t.Error("expected to contain account") - } - - url := wallet.URL() - if url.String() != "" { - t.Error("expected empty url") - } - - if err := wallet.Open(""); err != nil { - t.Error(err) - } - - if err := wallet.Close(); err != nil { - t.Error(err) - } - - status, err := wallet.Status() - if err != nil { - t.Error(err) - } - - if status != "ok" { - t.Error("expected status ok") - } - - accountPath, err := wallet.Path(account) - if err != nil { - t.Error(err) - } - - if accountPath != `m/44'/60'/0'/0/0` { - t.Error("wrong hdpath") - } - - privateKeyHex, err := wallet.PrivateKeyHex(account) - if err != nil { - t.Error(err) - } - - if privateKeyHex != "63e21d10fd50155dbba0e7d3f7431a400b84b4c2ac1ee38872f82448fe3ecfb9" { - t.Error("wrong private key") - } - - publicKeyHex, err := wallet.PublicKeyHex(account) - if err != nil { - t.Error(err) - } - - if publicKeyHex != "6005c86a6718f66221713a77073c41291cc3abbfcd03aa4955e9b2b50dbf7f9b6672dad0d46ade61e382f79888a73ea7899d9419becf1d6c9ec2087c1188fa18" { - t.Error("wrong public key") - } - - addressHex, err := wallet.AddressHex(account) - if err != nil { - t.Error(err) - } - - if addressHex != "0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947" { - t.Error("wrong address") - } - - nonce := uint64(0) - value := big.NewInt(1000000000000000000) - toAddress := common.HexToAddress("0x0") - gasLimit := uint64(21000) - gasPrice := big.NewInt(21000000000) - data := []byte{} - - tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, data) - - signedTx, err := wallet.SignTx(account, tx, nil) - if err != nil { - t.Error(err) - } - - v, r, s := signedTx.RawSignatureValues() - if v.Cmp(big.NewInt(0)) != 1 { - t.Error("expected v value") - } - if r.Cmp(big.NewInt(0)) != 1 { - t.Error("expected r value") - } - if s.Cmp(big.NewInt(0)) != 1 { - t.Error("expected s value") - } - - signedTx2, err := wallet.SignTxWithPassphrase(account, "", tx, nil) - if err != nil { - t.Error(err) - } - if signedTx.Hash() != signedTx2.Hash() { - t.Error("expected match") - } - - signedTx3, err := wallet.SignTxEIP155(account, tx, big.NewInt(42)) - if err != nil { - t.Error(err) - } - - v, r, s = signedTx3.RawSignatureValues() - if v.Cmp(big.NewInt(0)) != 1 { - t.Error("expected v value") - } - if r.Cmp(big.NewInt(0)) != 1 { - t.Error("expected r value") - } - if s.Cmp(big.NewInt(0)) != 1 { - t.Error("expected s value") - } - - data = []byte("hello") - hash := crypto.Keccak256Hash(data) - sig, err := wallet.SignHash(account, hash.Bytes()) - if err != nil { - t.Error(err) - } - if len(sig) == 0 { - t.Error("expected signature") - } - - sig2, err := wallet.SignHashWithPassphrase(account, "", hash.Bytes()) - if err != nil { - t.Error(err) - } - if len(sig2) == 0 { - t.Error("expected signature") - } - if hexutil.Encode(sig) != hexutil.Encode(sig2) { - t.Error("expected match") - } - - mimeType := "text/plain" - signedData, err := wallet.SignData(account, mimeType, []byte("hello world")) - if err != nil { - t.Error(err) - } - if len(signedData) == 0 { - t.Error("Expected signature") - } - - signedTextData, err := wallet.SignText(account, []byte("hello world")) - if err != nil { - t.Error(err) - } - if len(signedTextData) == 0 { - t.Error("Expected signature") - } - - signedData2, err := wallet.SignDataWithPassphrase(account, "", mimeType, []byte("hello world")) - if err != nil { - t.Error(err) - } - if len(signedData2) == 0 { - t.Error("Expected signature") - } - - signedData3, err := wallet.SignTextWithPassphrase(account, "", []byte("hello world")) - if err != nil { - t.Error(err) - } - if len(signedData3) == 0 { - t.Error("Expected signature") - } - - err = wallet.Unpin(account) - if err != nil { - t.Error(err) - } - - if wallet.Contains(account) { - t.Error("expected to not contain account") - } - - // seed test - - seed, err := NewSeedFromMnemonic(mnemonic) - if err != nil { - t.Error(err) - } - - wallet, err = NewFromSeed(seed) - if err != nil { - t.Error(err) - } - - path = MustParseDerivationPath("m/44'/60'/0'/0/0") - account, err = wallet.Derive(path, false) - if err != nil { - t.Error(err) - } - - if account.Address.Hex() != "0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947" { - t.Error("wrong address") - } - - seed, err = NewSeed() - if err != nil { - t.Error(err) - } - - if len(seed) != 64 { - t.Error("expected size of 64") - } - - seed, err = NewSeedFromMnemonic(mnemonic) - if err != nil { - t.Error(err) - } - - if len(seed) != 64 { - t.Error("expected size of 64") - } - - mnemonic, err = NewMnemonic(128) - if err != nil { - t.Error(err) - } - - words := strings.Split(mnemonic, " ") - if len(words) != 12 { - t.Error("expected 12 words") - } - - entropy, err := NewEntropy(128) - if err != nil { - t.Error(err) - } - - mnemonic, err = NewMnemonicFromEntropy(entropy) - if err != nil { - t.Error(err) - } - - words = strings.Split(mnemonic, " ") - if len(words) != 12 { - t.Error("expected 12 words") - } -} diff --git a/zcncore/ethwallet.go b/zcncore/ethwallet.go deleted file mode 100644 index 2eea48f48..000000000 --- a/zcncore/ethwallet.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build !mobile -// +build !mobile - -package zcncore - -import "github.com/ethereum/go-ethereum/ethclient" - -func GetEthClient() (*ethclient.Client, error) { - return getEthClient() -} diff --git a/zcncore/ethwallet_base.go b/zcncore/ethwallet_base.go deleted file mode 100644 index 401005e76..000000000 --- a/zcncore/ethwallet_base.go +++ /dev/null @@ -1,321 +0,0 @@ -package zcncore - -import ( - "context" - "crypto/ecdsa" - "encoding/json" - "fmt" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "golang.org/x/crypto/sha3" - "log" - "math" - "math/big" - "regexp" - "sync" - - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/tokenrate" - "github.com/0chain/gosdk/core/zcncrypto" - hdwallet "github.com/0chain/gosdk/zcncore/ethhdwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/params" -) - -// TODO change to real wallets -const walletAddr = "0xb9EF770B6A5e12E45983C5D80545258aA38F3B78" -const tokenAddress = "0x28b149020d2152179873ec60bed6bf7cd705775d" - -var once sync.Once - -var ethClient *ethclient.Client - -var getEthClient = func() (*ethclient.Client, error) { - var err error - - cfg, err := conf.GetClientConfig() - if err != nil { - return nil, err - } - once.Do(func() { - if len(cfg.EthereumNode) == 0 { - err = fmt.Errorf("eth node SDK not initialized") - return - } - - logging.Info("requesting from ", cfg.EthereumNode) - ethClient, err = ethclient.Dial(cfg.EthereumNode) - }) - - return ethClient, err -} - -// TokensToEth - converting wei to eth tokens -func TokensToEth(tokens int64) float64 { - fbalance := new(big.Float) - fbalance.SetString(fmt.Sprint(tokens)) - ethValue, _ := new(big.Float).Quo(fbalance, big.NewFloat(math.Pow10(18))).Float64() - return ethValue -} - -// TokensToEth - converting eth tokens to wei -func EthToTokens(tokens float64) int64 { - return int64(tokens * float64(params.Ether)) -} - -func GTokensToEth(tokens int64) float64 { - return float64(tokens) / float64(params.GWei) -} - -func GEthToTokens(gwei float64) int64 { - return int64(gwei * float64(params.GWei)) -} - -// GetWalletAddrFromEthMnemonic - wallet ETH address from mnemoninnc -func GetWalletAddrFromEthMnemonic(mnemonic string) (string, error) { - wallet, err := hdwallet.NewFromMnemonic(mnemonic) - if err != nil { - return "", err - } - - path := hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/0") - account, err := wallet.Derive(path, false) - if err != nil { - return "", err - } - - privKey, err := wallet.PrivateKeyHex(account) - if err != nil { - return "", err - } - - type ethWalletinfo struct { - ID string `json:"ID"` - PrivateKey string `json:"PrivateKey"` - } - - res, err := json.Marshal(ethWalletinfo{ID: account.Address.Hex(), PrivateKey: privKey}) - return string(res), err -} - -// GetEthBalance - getting back balance for ETH wallet -func GetEthBalance(ethAddr string, cb GetBalanceCallback) error { - go func() { - value, err := getBalanceFromEthNode(ethAddr) - if err != nil { - logging.Error(err) - cb.OnBalanceAvailable(StatusError, 0, err.Error()) - return - } - cb.OnBalanceAvailable(StatusSuccess, value, "") - }() - return nil -} - -// IsValidEthAddress - multiple checks for valid ETH address -func IsValidEthAddress(ethAddr string) (bool, error) { - client, err := getEthClient() - if err != nil { - return false, err - } - - return isValidEthAddress(ethAddr, client) -} - -// IsEthTransactionVerified checks if the transaction - given its hash - is verified on the ethereum network -// - txHash: transaction hash -func IsEthTransactionVerified(txHash string) (bool, error) { - client, err := getEthClient() - if err != nil { - return false, err - } - - var ( - tx *types.Transaction - pending bool - ) - - tx, pending, err = client.TransactionByHash(context.Background(), common.HexToHash(txHash)) - if err != nil { - return false, err - } - return tx != nil && !pending, nil -} - -func isValidEthAddress(ethAddr string, client *ethclient.Client) (bool, error) { - re := regexp.MustCompile("^0x[0-9a-fA-F]{40}$") - if !re.MatchString(ethAddr) { - return false, fmt.Errorf("regex error") - } - - address := common.HexToAddress(ethAddr) - balance, err := client.BalanceAt(context.Background(), address, nil) - if err != nil { - return false, fmt.Errorf(err.Error()) - } - - isContract := balance.Int64() > 0 - return isContract, nil -} - -// CreateWalletFromEthMnemonic - creating new wallet from Eth mnemonics -func CreateWalletFromEthMnemonic(mnemonic, password string, statusCb WalletCallback) error { - cfg, err := conf.GetClientConfig() - if err != nil { - return fmt.Errorf("SDK not initialized") - } - go func() { - sigScheme := zcncrypto.NewSignatureScheme(cfg.SignatureScheme) - _, err := sigScheme.GenerateKeysWithEth(mnemonic, password) - if err != nil { - statusCb.OnWalletCreateComplete(StatusError, "", err.Error()) - return - } - }() - return nil -} - -// CheckEthHashStatus - checking the status of ETH transaction -// possible values 0 or 1 -func CheckEthHashStatus(hash string) int { - txHash := common.HexToHash(hash) - - var client *ethclient.Client - var err error - if client, err = getEthClient(); err != nil { - return -1 - } - - tx, err := client.TransactionReceipt(context.Background(), txHash) - if err != nil { - return -1 - } - return int(tx.Status) -} - -// ConvertZcnTokenToETH - converting Zcn tokens to Eth -// - f: ZCN tokens amount -func ConvertZcnTokenToETH(f float64) (float64, error) { - ethRate, err := tokenrate.GetUSD(context.TODO(), "eth") - if err != nil { - return 0, err - } - return f * ethRate, nil -} - -// SuggestEthGasPrice - return back suggested price for gas -func SuggestEthGasPrice() (int64, error) { - var client *ethclient.Client - var err error - if client, err = getEthClient(); err != nil { - return 0, err - } - - gasPrice, err := client.SuggestGasPrice(context.Background()) - if err != nil { - return 0, err - } - - return gasPrice.Int64(), nil -} - -// TransferEthTokens - transfer ETH tokens to multisign wallet -func TransferEthTokens(fromPrivKey string, amountTokens, gasPrice int64) (string, error) { - var client *ethclient.Client - var err error - if client, err = getEthClient(); err != nil { - return "", err - } - - privateKey, err := crypto.HexToECDSA(fromPrivKey) - if err != nil { - return "", err - } - - publicKey := privateKey.Public() - publicKeyECDSA, _ := publicKey.(*ecdsa.PublicKey) - - fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA) - nonce, err := client.PendingNonceAt(context.Background(), fromAddress) - if err != nil { - return "", err - } - - toAddress := common.HexToAddress(walletAddr) - tokenAddress := common.HexToAddress(tokenAddress) - - transferFnSignature := []byte("transfer(address,uint256)") - hash := sha3.NewLegacyKeccak256() - hash.Write(transferFnSignature) - methodID := hash.Sum(nil)[:4] - fmt.Println(hexutil.Encode(methodID)) // 0xa9059cbb - - paddedAddress := common.LeftPadBytes(toAddress.Bytes(), 32) - fmt.Println(hexutil.Encode(paddedAddress)) // 0x0000000000000000000000004592d8f8d7b001e72cb26a73e4fa1806a51ac79d - - amount := new(big.Int) - amount.SetInt64(amountTokens) - - paddedAmount := common.LeftPadBytes(amount.Bytes(), 32) - fmt.Println(hexutil.Encode(paddedAmount)) // 0x00000000000000000000000000000000000000000000003635c9adc5dea00000 - - var data []byte - data = append(data, methodID...) - data = append(data, paddedAddress...) - data = append(data, paddedAmount...) - - gasLimit, err := client.EstimateGas(context.Background(), ethereum.CallMsg{ - To: &tokenAddress, - Data: data, - }) - if err != nil { - log.Fatal(err) - } - - txData := &types.LegacyTx{ - Nonce: nonce, - GasPrice: big.NewInt(gasPrice), - Gas: gasLimit, - To: &tokenAddress, - Value: amount, - Data: data, - } - tx := types.NewTx(txData) - - chainID, err := client.ChainID(context.Background()) - if err != nil { - return "", err - } - - signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), privateKey) - if err != nil { - return "", err - } - - err = client.SendTransaction(context.Background(), signedTx) - if err != nil { - return "", err - } - - return signedTx.Hash().Hex(), nil -} - -func getBalanceFromEthNode(ethAddr string) (int64, error) { - if client, err := getEthClient(); err == nil { - account := common.HexToAddress(ethAddr) - logging.Info("for eth address", account) - balance, err := client.BalanceAt(context.Background(), account, nil) - if err != nil { - return 0, err - } - - logging.Info("balance", balance.String()) - - return balance.Int64(), nil - } else { - return 0, err - } -} diff --git a/zcncore/ethwallet_base_test.go b/zcncore/ethwallet_base_test.go deleted file mode 100644 index b60588832..000000000 --- a/zcncore/ethwallet_base_test.go +++ /dev/null @@ -1,286 +0,0 @@ -package zcncore - -import ( - "context" - "math/big" - "sync" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/stretchr/testify/require" -) - -var ( - testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") - testAddr = crypto.PubkeyToAddress(testKey.PublicKey) - testBalance = big.NewInt(2e15) -) - -func TestTokensConversion(t *testing.T) { - t.Run("Tokens to Eth", func(t *testing.T) { - ethTokens := TokensToEth(4337488392000000000) - require.Equal(t, 4.337488392, ethTokens) - }) - - t.Run("Eth to tokens", func(t *testing.T) { - ethTokens := EthToTokens(4.337488392) - require.Equal(t, int64(4337488392000000000), ethTokens) - }) - - t.Run("GTokens to Eth", func(t *testing.T) { - ethTokens := GTokensToEth(10000000) - require.Equal(t, 0.01, ethTokens) - }) - - t.Run("Eth to GTokens", func(t *testing.T) { - ethTokens := GEthToTokens(4.337488392) - require.Equal(t, int64(4337488392), ethTokens) - }) -} - -func TestValidEthAddress(t *testing.T) { - t.Run("Valid Eth wallet, but no balance", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - - res, err := IsValidEthAddress("0x531f9349ed2Fe5c526B47fa7841D35c90482e6cF") - require.Nil(t, err, "") - require.False(t, res, "") - }) - - t.Run("Valid Eth wallet", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - err := sendTransaction(realClient) - require.Nil(t, err) - - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - - res, err := IsValidEthAddress(testAddr.String()) - require.Nil(t, err, "") - require.True(t, res, "") - }) - - t.Run("Invalid Eth wallet", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - - res, err := IsValidEthAddress("testAddr.String()") - require.NotNil(t, err, "") - require.False(t, res, "") - }) -} - -func TestGetWalletAddrFromEthMnemonic(t *testing.T) { - t.Run("Success", func(t *testing.T) { - mnemonic := "expect domain water near beauty bag pond clap chronic chronic length leisure" - res, err := GetWalletAddrFromEthMnemonic(mnemonic) - require.Nil(t, err, "") - require.Equal(t, res, "{\"ID\":\"0x531f9349ed2Fe5c526B47fa7841D35c90482e6cF\",\"PrivateKey\":\"b68bbd97a2b46b3fb2e38db771ec38935231f0b95733a4021d61601c658bc541\"}") - }) - - t.Run("Wrong", func(t *testing.T) { - mnemonic := "this is wrong mnemonic" - _, err := GetWalletAddrFromEthMnemonic(mnemonic) - require.NotNil(t, err, "") - }) -} - -func TestGetEthBalance(t *testing.T) { - t.Run("Success", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - err := sendTransaction(realClient) - require.Nil(t, err) - - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - - tcb := &MockBalanceCallback{} - tcb.wg = &sync.WaitGroup{} - tcb.wg.Add(1) - err = GetEthBalance(testAddr.String(), tcb) - if err != nil { - tcb.wg.Done() - } - tcb.wg.Wait() - - require.Nil(t, err, "") - require.True(t, tcb.value > 0, "") - require.True(t, tcb.status == StatusSuccess, "") - require.True(t, tcb.info == "") - }) -} - -func TestCheckEthHashStatus(t *testing.T) { - t.Run("Pending transaction", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - err := sendTransaction(realClient) - require.Nil(t, err) - - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - result := CheckEthHashStatus("0x05aa8890d4778e292f837dd36b59a50931c175f4648c3d8157525f5454475cf7") - require.True(t, result < 0, "") - }) -} - -func TestSuggestEthGasPrice(t *testing.T) { - t.Run("suggest gas price success", func(t *testing.T) { - backend, _ := newTestBackend(t) - client, _ := backend.Attach() - defer backend.Close() - defer client.Close() - - realClient := ethclient.NewClient(client) - getEthClient = func() (*ethclient.Client, error) { - return realClient, nil - } - gas, err := SuggestEthGasPrice() - require.Nil(t, err) - require.True(t, gas > 0) - }) -} - -//TODO:JAYASHTODO -//func TestTransferEthTokens(t *testing.T) { -// t.Run("success transfer", func(t *testing.T) { -// backend, _ := newTestBackend(t) -// client, _ := backend.Attach() -// defer backend.Close() -// defer client.Close() -// -// realClient := ethclient.NewClient(client) -// getEthClient = func() (*ethclient.Client, error) { -// return realClient, nil -// } -// -// hash, err := TransferEthTokens("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291", 1000000000000, 10000) -// require.Nil(t, err) -// require.EqualValues(t, hash, "0x43eba8525933e34908e766de93176d810e8582e886052708d44d9db157803aec") -// }) -//} - -type MockBalanceCallback struct { - wg *sync.WaitGroup - status int - value int64 - info string -} - -func (balCall *MockBalanceCallback) OnBalanceAvailable(status int, value int64, info string) { - defer balCall.wg.Done() - - balCall.status = status - balCall.value = value - balCall.info = info -} - -func newTestBackend(t *testing.T) (*node.Node, []*types.Block) { - // Generate test chain. - genesis, blocks := generateTestChain() - // Create node - n, err := node.New(&node.Config{}) - if err != nil { - t.Fatalf("can't create new node: %v", err) - } - // Create Ethereum Service - config := ðconfig.Config{Genesis: genesis} - config.Ethash.PowMode = ethash.ModeFake - ethservice, err := eth.New(n, config) - if err != nil { - t.Fatalf("can't create new ethereum service: %v", err) - } - // Import the test chain. - if err := n.Start(); err != nil { - t.Fatalf("can't start test node: %v", err) - } - if _, err := ethservice.BlockChain().InsertChain(blocks[1:]); err != nil { - t.Fatalf("can't import test blocks: %v", err) - } - return n, blocks -} - -func generateTestChain() (*core.Genesis, []*types.Block) { - db := rawdb.NewMemoryDatabase() - config := params.AllEthashProtocolChanges - genesis := &core.Genesis{ - Config: config, - Alloc: core.GenesisAlloc{testAddr: {Balance: testBalance}}, - ExtraData: []byte("test genesis"), - Timestamp: 9000, - } - // BaseFee: big.NewInt(params.InitialBaseFee), - generate := func(i int, g *core.BlockGen) { - g.OffsetTime(5) - g.SetExtra([]byte("test")) - } - gblock := genesis.ToBlock() - genesis.Commit(db) //nolint: errcheck - engine := ethash.NewFaker() - blocks, _ := core.GenerateChain(config, gblock, engine, db, 1, generate) - blocks = append([]*types.Block{gblock}, blocks...) - return genesis, blocks -} - -func sendTransaction(ec *ethclient.Client) error { - // Retrieve chainID - chainID, err := ec.ChainID(context.Background()) - if err != nil { - return err - } - // Create transaction - tx := types.NewTransaction(0, common.Address{1}, big.NewInt(1), 22000, big.NewInt(1), nil) - signer := types.LatestSignerForChainID(chainID) - signature, err := crypto.Sign(signer.Hash(tx).Bytes(), testKey) - if err != nil { - return err - } - signedTx, err := tx.WithSignature(signer, signature) - if err != nil { - return err - } - // Send transaction - return ec.SendTransaction(context.Background(), signedTx) -} diff --git a/zcncore/execute_transactions.go b/zcncore/execute_transactions.go deleted file mode 100644 index 45c49a5ad..000000000 --- a/zcncore/execute_transactions.go +++ /dev/null @@ -1,222 +0,0 @@ -package zcncore - -import ( - "fmt" - "github.com/0chain/gosdk/core/transaction" -) - -// AuthorizerNode represents an authorizer node in the network -type AuthorizerNode struct { - ID string `json:"id"` - URL string `json:"url"` - Config *AuthorizerConfig `json:"config"` -} - -type scCollectReward struct { - ProviderId string `json:"provider_id"` - ProviderType int `json:"provider_type"` -} - -type MinerSCDelegatePool struct { - Settings StakePoolSettings `json:"settings"` -} - -// SimpleMiner represents a node in the network, miner or sharder. -type SimpleMiner struct { - ID string `json:"id"` -} - -// MinerSCMinerInfo interface for miner/sharder info functions on miner smart contract. -type MinerSCMinerInfo struct { - SimpleMiner `json:"simple_miner"` - MinerSCDelegatePool `json:"stake_pool"` -} - -func MinerSCLock(providerId string, providerType Provider, lock uint64, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxnValue(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_LOCK, - InputArgs: &stakePoolRequest{ - ProviderID: providerId, - ProviderType: providerType, - }, - }, lock, true, client...) - -} - -func MinerSCUnlock(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_UNLOCK, - InputArgs: &stakePoolRequest{ - ProviderID: providerId, - ProviderType: providerType, - }, - }, true, client...) -} - -func MinerSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_COLLECT_REWARD, - InputArgs: &scCollectReward{ - ProviderId: providerId, - ProviderType: int(providerType), - }, - }, true, client...) - -} - -func MinerSCKill(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - pr := &scCollectReward{ - ProviderId: providerId, - ProviderType: int(providerType), - } - var name string - switch providerType { - case ProviderMiner: - name = transaction.MINERSC_KILL_MINER - case ProviderSharder: - name = transaction.MINERSC_KILL_SHARDER - default: - return "", "", -1, &transaction.Transaction{}, fmt.Errorf("kill provider type %v not implimented", providerType) - } - - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: name, - InputArgs: pr, - }, true, client...) - -} - -func StorageSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(StorageSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.STORAGESC_COLLECT_REWARD, - InputArgs: &scCollectReward{ - ProviderId: providerId, - ProviderType: int(providerType), - }, - }, true, client...) - -} - -func MinerScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_UPDATE_SETTINGS, - InputArgs: input, - }, true, client...) - -} - -func MinerScUpdateGlobals(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_UPDATE_GLOBALS, - InputArgs: input, - }, true, client...) - -} - -func StorageScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(StorageSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.STORAGESC_UPDATE_SETTINGS, - InputArgs: input, - }, true, client...) - -} - -func AddHardfork(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ADD_HARDFORK, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCUpdateGlobalConfig(input *InputMap, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_UPDATE_GLOBAL_CONFIG, - InputArgs: input, - }, true, client...) - -} - -func MinerSCMinerSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_MINER_SETTINGS, - InputArgs: input, - }, true, client...) - -} - -func MinerSCSharderSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.MINERSC_SHARDER_SETTINGS, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCUpdateAuthorizerConfig(input *AuthorizerNode, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_UPDATE_AUTHORIZER_CONFIG, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCAddAuthorizer(input *AddAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_ADD_AUTHORIZER, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCAuthorizerHealthCheck(input *AuthorizerHealthCheckPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_AUTHORIZER_HEALTH_CHECK, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCDeleteAuthorizer(input *DeleteAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_DELETE_AUTHORIZER, - InputArgs: input, - }, true, client...) - -} - -func ZCNSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - pr := &scCollectReward{ - ProviderId: providerId, - ProviderType: int(providerType), - } - - return transaction.SmartContractTxn(ZCNSCSmartContractAddress, transaction.SmartContractTxnData{ - Name: transaction.ZCNSC_COLLECT_REWARD, - InputArgs: pr, - }, true, client...) -} - -type SendTxnData struct { - Note string `json:"note"` -} - -func Send(toClientID string, tokens uint64, desc string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - if len(client) == 0 { - client = append(client, "") - client = append(client, toClientID) - } else { - client = append(client, toClientID) - } - return transaction.SmartContractTxnValue(MinerSmartContractAddress, transaction.SmartContractTxnData{ - Name: "transfer", - InputArgs: SendTxnData{Note: desc}, - }, tokens, true, client...) -} - -func Faucet(tokens uint64, input string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error) { - return transaction.SmartContractTxnValue(FaucetSmartContractAddress, transaction.SmartContractTxnData{ - Name: "pour", - InputArgs: input, - }, tokens, true, client...) -} diff --git a/zcncore/get_data.go b/zcncore/get_data.go deleted file mode 100644 index f6f752e76..000000000 --- a/zcncore/get_data.go +++ /dev/null @@ -1,424 +0,0 @@ -package zcncore - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/url" - "strconv" - - "github.com/0chain/gosdk/core/block" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/screstapi" - "github.com/0chain/gosdk/core/sys" - "github.com/0chain/gosdk/core/tokenrate" - "github.com/0chain/gosdk/core/util" - "github.com/0chain/gosdk/core/zcncrypto" -) - -type GetClientResponse struct { - ID string `json:"id"` - Version string `json:"version"` - CreationDate int `json:"creation_date"` - PublicKey string `json:"public_key"` -} - -func GetClientDetails(clientID string) (*GetClientResponse, error) { - clientNode, err := client.GetNode() - if err != nil { - panic(err) - } - minerurl := util.GetRandom(clientNode.Network().Miners, 1)[0] - url := minerurl + GET_CLIENT - url = fmt.Sprintf("%v?id=%v", url, clientID) - req, err := util.NewHTTPGetRequest(url) - if err != nil { - logging.Error(minerurl, "new get request failed. ", err.Error()) - return nil, err - } - res, err := req.Get() - if err != nil { - logging.Error(minerurl, "send error. ", err.Error()) - return nil, err - } - - var clientDetails GetClientResponse - err = json.Unmarshal([]byte(res.Body), &clientDetails) - if err != nil { - return nil, err - } - - return &clientDetails, nil -} - -// Deprecated: Use zcncrypto.IsMnemonicValid() -// IsMnemonicValid is an utility function to check the mnemonic valid -// -// # Inputs -// - mnemonic: mnemonics -func IsMnemonicValid(mnemonic string) bool { - return zcncrypto.IsMnemonicValid(mnemonic) -} - -// SetWalletInfo should be set before any transaction or client specific APIs -// splitKeyWallet parameter is valid only if SignatureScheme is "BLS0Chain" -// -// # Inputs -// - jsonWallet: json format of wallet -// { -// "client_id":"30764bcba73216b67c36b05a17b4dd076bfdc5bb0ed84856f27622188c377269", -// "client_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c", -// "keys":[ -// {"public_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c","private_key":"41729ed8d82f782646d2d30b9719acfd236842b9b6e47fee12b7bdbd05b35122"} -// ], -// "mnemonics":"glare mistake gun joke bid spare across diagram wrap cube swear cactus cave repeat you brave few best wild lion pitch pole original wasp", -// "version":"1.0", -// "date_created":"1662534022", -// "nonce":0 -// } -// -// - splitKeyWallet: if wallet keys is split -func SetWalletInfo(jsonWallet, sigScheme string, splitKeyWallet bool) error { - wallet := zcncrypto.Wallet{} - err := json.Unmarshal([]byte(jsonWallet), &wallet) - if err != nil { - return errors.New("invalid jsonWallet: " + err.Error()) - } - - client.SetWallet(wallet) - client.SetSignatureScheme(sigScheme) - - return client.SetSplitKeyWallet(splitKeyWallet) -} - -// SetGeneralWalletInfo should be set before any transaction or client specific APIs. Automatically sets KMS mode if specified by wallet structure. -// -// # Inputs(non-KMS) -// - jsonWallet: json format of wallet -// { -// "client_id":"30764bcba73216b67c36b05a17b4dd076bfdc5bb0ed84856f27622188c377269", -// "client_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c", -// "keys":[ -// {"public_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c","private_key":"41729ed8d82f782646d2d30b9719acfd236842b9b6e47fee12b7bdbd05b35122"} -// ], -// "mnemonics":"glare mistake gun joke bid spare across diagram wrap cube swear cactus cave repeat you brave few best wild lion pitch pole original wasp", -// "version":"1.0", -// "date_created":"1662534022", -// "nonce":0 -// } -// -// # Inputs(KMS) -// - jsonWallet: json format of wallet -// { -// "client_id":"30764bcba73216b67c36b05a17b4dd076bfdc5bb0ed84856f27622188c377269", -// "client_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c", -// "keys":[ -// {"public_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c","private_key":"41729ed8d82f782646d2d30b9719acfd236842b9b6e47fee12b7bdbd05b35122"} -// ], -// "mnemonics":"glare mistake gun joke bid spare across diagram wrap cube swear cactus cave repeat you brave few best wild lion pitch pole original wasp", -// "is_split": true, -// "version":"1.0", -// "date_created":"1662534022", -// "nonce":0, -// } -func SetGeneralWalletInfo(jsonWallet, sigScheme string) error { - wallet := zcncrypto.Wallet{} - err := json.Unmarshal([]byte(jsonWallet), &wallet) - if err != nil { - return errors.New("invalid jsonWallet: " + err.Error()) - } - - client.SetWallet(wallet) - client.SetSignatureScheme(sigScheme) - - return client.SetSplitKeyWallet(wallet.IsSplit) -} - -// RegisterZauthServer registers zauth server callbacks for signing operations. Should be used for split key mode. -func RegisterZauthServer(serverAddr string) { - sys.SetAuthorize(ZauthSignTxn(serverAddr)) - sys.SetAuthCommon(ZauthAuthCommon(serverAddr)) -} - -// SetAuthUrl will be called by app to set zauth URL to SDK. -// # Inputs -// - url: the url of zAuth server -func SetAuthUrl(url string) error { - return client.SetAuthUrl(url) -} - -// ConvertTokenToUSD converts the ZCN tokens to USD amount -// - token: ZCN tokens amount -func ConvertTokenToUSD(token float64) (float64, error) { - zcnRate, err := getTokenUSDRate() - if err != nil { - return 0, err - } - return token * zcnRate, nil -} - -// ConvertUSDToToken converts the USD amount to ZCN tokens -// - usd: USD amount -func ConvertUSDToToken(usd float64) (float64, error) { - zcnRate, err := getTokenUSDRate() - if err != nil { - return 0, err - } - return usd * (1 / zcnRate), nil -} - -func getTokenUSDRate() (float64, error) { - return tokenrate.GetUSD(context.TODO(), "zcn") -} - -// getWallet get a wallet object from a wallet string -func getWallet(walletStr string) (*zcncrypto.Wallet, error) { - var w zcncrypto.Wallet - err := json.Unmarshal([]byte(walletStr), &w) - if err != nil { - fmt.Printf("error while parsing wallet string.\n%v\n", err) - return nil, err - } - - return &w, nil -} - -type Params map[string]string - -func (p Params) Query() string { - if len(p) == 0 { - return "" - } - var params = make(url.Values) - for k, v := range p { - params[k] = []string{v} - } - return "?" + params.Encode() -} - -func withParams(uri string, params Params) string { //nolint:unused - return uri + params.Query() -} - -// GetBlobberSnapshots obtains list of allocations of a blobber. -// Blobber snapshots are historical records of the blobber instance to track its change over time and serve graph requests, -// which are requests that need multiple data points, distributed over an interval of time, usually to plot them on a -// graph. -// - round: round number -// - limit: how many blobber snapshots should be fetched -// - offset: how many blobber snapshots should be skipped -// - cb: info callback instance, carries the response of the GET request to the sharders -//func GetBlobberSnapshots(round int64, limit int64, offset int64) (res []byte, err error) { -// if err = CheckConfig(); err != nil { -// return -// } -// -// return coreHttp.MakeSCRestAPICallToSharder(StorageSmartContractAddress, STORAGE_GET_BLOBBER_SNAPSHOT, Params{ -// "round": strconv.FormatInt(round, 10), -// "limit": strconv.FormatInt(limit, 10), -// "offset": strconv.FormatInt(offset, 10), -// }, nil) -//} - -// GetMinerSCNodeInfo get miner information from sharders -// - id: the id of miner -// - cb: info callback instance, carries the response of the GET request to the sharders -func GetMinerSCNodeInfo(id string) ([]byte, error) { - if err := CheckConfig(); err != nil { - return nil, err - } - - return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_NODE, Params{ - "id": id, - }) -} - -// GetMintNonce retrieve the client's latest mint nonce from sharders -// - cb: info callback instance, carries the response of the GET request to the sharders -func GetMintNonce() ([]byte, error) { - err := CheckConfig() - if err != nil { - return nil, err - } - - return screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_MINT_NONCE, Params{ - "client_id": client.Id(), - }) -} - -func GetMiners(active, stakable bool, limit, offset int) ([]byte, error) { - if err := CheckConfig(); err != nil { - return nil, err - } - - return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_MINERS, Params{ - "active": strconv.FormatBool(active), - "stakable": strconv.FormatBool(stakable), - "offset": strconv.FormatInt(int64(offset), 10), - "limit": strconv.FormatInt(int64(limit), 10), - }) -} - -func GetSharders(active, stakable bool, limit, offset int) ([]byte, error) { - if err := CheckConfig(); err != nil { - return nil, err - } - - return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_SHARDERS, Params{ - "active": strconv.FormatBool(active), - "stakable": strconv.FormatBool(stakable), - "offset": strconv.FormatInt(int64(offset), 10), - "limit": strconv.FormatInt(int64(limit), 10), - }) -} - -// GetLatestFinalizedMagicBlock gets latest finalized magic block -// - numSharders: number of sharders -// - timeout: request timeout -func GetLatestFinalizedMagicBlock() (m *block.MagicBlock, err error) { - res, err := screstapi.MakeSCRestAPICall("", GET_LATEST_FINALIZED_MAGIC_BLOCK, nil, "") - if err != nil { - return nil, err - } - - type respObj struct { - MagicBlock *block.MagicBlock `json:"magic_block"` - } - - var resp respObj - - err = json.Unmarshal(res, &resp) - if err != nil { - return nil, err - } - - return resp.MagicBlock, nil -} - -// GetMinerSCUserInfo retrieve user stake pools for the providers related to the Miner SC (miners/sharders). -// - clientID: user's wallet id -func GetMinerSCUserInfo(clientID string) ([]byte, error) { - if err := CheckConfig(); err != nil { - return nil, err - } - if clientID == "" { - clientID = client.Id() - } - - return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_USER, Params{ - "client_id": clientID, - }) -} - -// GetMinerSCNodePool get miner smart contract node pool -// - id: the id of miner -func GetMinerSCNodePool(id string) ([]byte, error) { - if err := CheckConfig(); err != nil { - return nil, err - } - - return screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_MINERSC_POOL, Params{ - "id": id, - "pool_id": client.Id(), - }) -} - -// GetNotProcessedZCNBurnTickets retrieve burn tickets that are not compensated by minting -// - ethereumAddress: ethereum address for the issuer of the burn tickets -// - startNonce: start nonce for the burn tickets -// - cb: info callback instance, carries the response of the GET request to the sharders -func GetNotProcessedZCNBurnTickets(ethereumAddress, startNonce string) ([]byte, error) { - err := CheckConfig() - if err != nil { - return nil, err - } - - const GET_NOT_PROCESSED_BURN_TICKETS = `/v1/not_processed_burn_tickets` - - return screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_NOT_PROCESSED_BURN_TICKETS, Params{ - "ethereum_address": ethereumAddress, - "nonce": startNonce, - }) -} - -// GetUserLockedTotal get total token user locked -// # Inputs -// - clientID wallet id -func GetUserLockedTotal(clientID string) (int64, error) { - var result map[string]int64 - - err := CheckConfig() - if err != nil { - return 0, err - } - - const GET_USER_LOCKED_TOTAL = `/v1/getUserLockedTotal` - - info, err := screstapi.MakeSCRestAPICall(ZCNSCSmartContractAddress, GET_USER_LOCKED_TOTAL, Params{ - "client_id": clientID, - }) - - if err != nil { - return 0, errors.New("error while making rest api call: " + err.Error()) - } - - err = json.Unmarshal([]byte(info), &result) - if err != nil { - return 0, errors.New("invalid json format: " + err.Error()) - } - - total, ok := result["total"] - if ok { - return total, nil - } else { - return 0, err - } -} - -func IsHardforkActivated(name string) (bool, error) { - res, err := screstapi.MakeSCRestAPICall(MinerSmartContractAddress, GET_HARDFORK, Params{ - "name": name, - }) - if err != nil { - return false, fmt.Errorf("error getting hardfork status: %v", err) - } - - var result map[string]string - err = json.Unmarshal(res, &result) - if err != nil { - return false, fmt.Errorf("error unmarshalling hardfork status: %v", err) - } - - roundString, ok := result["round"] - if !ok { - return false, errors.New("hardfork not found") - } - - round, err := strconv.ParseInt(roundString, 10, 64) - if err != nil { - return false, fmt.Errorf("error parsing round: %v", err) - } - - currentRound, err := GetCurrentRound() - if err != nil { - return false, fmt.Errorf("error getting current round: %v", err) - } - - return currentRound >= round, nil -} - -func GetCurrentRound() (int64, error) { - res, err := screstapi.MakeSCRestAPICall("", GET_CURRENT_ROUND, nil, "") - if err != nil { - return 0, err - } - - var round int64 - err = json.Unmarshal(res, &round) - if err != nil { - return 0, fmt.Errorf("error getting current round : %v", err) - } - - return round, nil -} diff --git a/zcncore/transaction.go b/zcncore/transaction.go deleted file mode 100644 index 4294ff1a7..000000000 --- a/zcncore/transaction.go +++ /dev/null @@ -1,171 +0,0 @@ -package zcncore - -import ( - "time" - - "github.com/0chain/gosdk/core/common" -) - -// Provider represents the type of provider. -type Provider int - -const ( - ProviderMiner Provider = iota + 1 - ProviderSharder - ProviderBlobber - ProviderValidator - ProviderAuthorizer -) - -type ConfirmationStatus int - -type Miner struct { - ID string `json:"id"` - N2NHost string `json:"n2n_host"` - Host string `json:"host"` - Port int `json:"port"` - PublicKey string `json:"public_key"` - ShortName string `json:"short_name"` - BuildTag string `json:"build_tag"` - TotalStake int64 `json:"total_stake"` - Stat interface{} `json:"stat"` -} - -// Node represents a node (miner or sharder) in the network. -type Node struct { - Miner Miner `json:"simple_miner"` - StakePool `json:"stake_pool"` -} - -// MinerSCNodes list of nodes registered to the miner smart contract -type MinerSCNodes struct { - Nodes []Node `json:"Nodes"` -} - -type DelegatePool struct { - Balance int64 `json:"balance"` - Reward int64 `json:"reward"` - Status int `json:"status"` - RoundCreated int64 `json:"round_created"` // used for cool down - DelegateID string `json:"delegate_id"` -} - -type StakePool struct { - Pools map[string]*DelegatePool `json:"pools"` - Reward int64 `json:"rewards"` - Settings StakePoolSettings `json:"settings"` - Minter int `json:"minter"` -} - -type stakePoolRequest struct { - ProviderType Provider `json:"provider_type,omitempty"` - ProviderID string `json:"provider_id,omitempty"` - ClientID string `json:"client_id,omitempty"` -} - -type MinerSCDelegatePoolInfo struct { - ID common.Key `json:"id"` - Balance common.Balance `json:"balance"` - Reward common.Balance `json:"reward"` // uncollected reread - RewardPaid common.Balance `json:"reward_paid"` // total reward all time - Status string `json:"status"` -} - -// MinerSCUserPoolsInfo represents the user stake pools information -type MinerSCUserPoolsInfo struct { - Pools map[string][]*MinerSCDelegatePoolInfo `json:"pools"` -} - -// PriceRange represents a price range allowed by user to filter blobbers. -type PriceRange struct { - Min common.Balance `json:"min"` - Max common.Balance `json:"max"` -} - -// CreateAllocationRequest is information to create allocation. -type CreateAllocationRequest struct { - DataShards int `json:"data_shards"` - ParityShards int `json:"parity_shards"` - Size common.Size `json:"size"` - Expiration common.Timestamp `json:"expiration_date"` - Owner string `json:"owner_id"` - OwnerPublicKey string `json:"owner_public_key"` - Blobbers []string `json:"blobbers"` - ReadPriceRange PriceRange `json:"read_price_range"` - WritePriceRange PriceRange `json:"write_price_range"` -} - -type StakePoolSettings struct { - DelegateWallet *string `json:"delegate_wallet,omitempty"` - NumDelegates *int `json:"num_delegates,omitempty"` - ServiceCharge *float64 `json:"service_charge,omitempty"` -} - -type Terms struct { - ReadPrice common.Balance `json:"read_price"` // tokens / GB - WritePrice common.Balance `json:"write_price"` // tokens / GB ` - MaxOfferDuration time.Duration `json:"max_offer_duration"` -} - -// Blobber represents a blobber node. -type Blobber struct { - // ID is the blobber ID. - ID common.Key `json:"id"` - // BaseURL is the blobber's base URL used to access the blobber - BaseURL string `json:"url"` - // Terms of storage service of the blobber (read/write price, max offer duration) - Terms Terms `json:"terms"` - // Capacity is the total capacity of the blobber - Capacity common.Size `json:"capacity"` - // Used is the capacity of the blobber used to create allocations - Allocated common.Size `json:"allocated"` - // LastHealthCheck is the last time the blobber was checked for health - LastHealthCheck common.Timestamp `json:"last_health_check"` - // StakePoolSettings is the settings of the blobber's stake pool - StakePoolSettings StakePoolSettings `json:"stake_pool_settings"` - // NotAvailable is true if the blobber is not available - NotAvailable bool `json:"not_available"` - // IsRestricted is true if the blobber is restricted. - // Restricted blobbers needs to be authenticated using AuthTickets in order to be used for allocation creation. - // Check Restricted Blobbers documentation for more details. - IsRestricted bool `json:"is_restricted"` -} - -type Validator struct { - ID common.Key `json:"id"` - BaseURL string `json:"url"` - StakePoolSettings StakePoolSettings `json:"stake_pool_settings"` -} - -// AddAuthorizerPayload represents the payload for adding an authorizer. -type AddAuthorizerPayload struct { - PublicKey string `json:"public_key"` - URL string `json:"url"` - StakePoolSettings AuthorizerStakePoolSettings `json:"stake_pool_settings"` // Used to initially create stake pool -} - -// DeleteAuthorizerPayload represents the payload for deleting an authorizer. -type DeleteAuthorizerPayload struct { - ID string `json:"id"` // authorizer ID -} - -// AuthorizerHealthCheckPayload represents the payload for authorizer health check. -type AuthorizerHealthCheckPayload struct { - ID string `json:"id"` // authorizer ID -} - -// AuthorizerStakePoolSettings represents the settings for an authorizer's stake pool. -type AuthorizerStakePoolSettings struct { - DelegateWallet string `json:"delegate_wallet"` - NumDelegates int `json:"num_delegates"` - ServiceCharge float64 `json:"service_charge"` -} - -type AuthorizerConfig struct { - Fee common.Balance `json:"fee"` -} - -// InputMap represents a map of input fields. -type InputMap struct { - Fields map[string]string `json:"Fields"` -} diff --git a/zcncore/wallet.go b/zcncore/wallet.go deleted file mode 100644 index f564819e1..000000000 --- a/zcncore/wallet.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build !mobile -// +build !mobile - -package zcncore - -import ( - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/core/zcncrypto" -) - -// GetWallet get a wallet object from a wallet string -func GetWallet(walletStr string) (*zcncrypto.Wallet, error) { - return getWallet(walletStr) -} - -// Deprecated: use Sign() method in zcncrypto.Wallet -func SignWith0Wallet(hash string, w *zcncrypto.Wallet) (string, error) { - cfg, err := conf.GetClientConfig() - if err != nil { - return "", err - } - sigScheme := zcncrypto.NewSignatureScheme(cfg.SignatureScheme) - err = sigScheme.SetPrivateKey(w.Keys[0].PrivateKey) - if err != nil { - return "", err - } - return sigScheme.Sign(hash) -} diff --git a/zcncore/wallet_base.go b/zcncore/wallet_base.go deleted file mode 100644 index d8b689ac8..000000000 --- a/zcncore/wallet_base.go +++ /dev/null @@ -1,428 +0,0 @@ -package zcncore - -import ( - "crypto/ed25519" - "encoding/hex" - "fmt" - "net/http" - "strings" - "time" - - "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/core/util" - - "errors" - - "github.com/0chain/gosdk/core/client" - rawencryption "github.com/0chain/gosdk/core/encryption" - "github.com/0chain/gosdk/core/logger" - "github.com/0chain/gosdk/core/version" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/encryption" - "github.com/0chain/gosdk/zboxcore/zboxutil" - openssl "github.com/Luzifer/go-openssl/v3" - "gopkg.in/natefinch/lumberjack.v2" -) - -const ( - GET_CLIENT = `/v1/client/get` - PUT_TRANSACTION = `/v1/transaction/put` - TXN_VERIFY_URL = `/v1/transaction/get/confirmation?hash=` - GET_BLOCK_INFO = `/v1/block/get?` - GET_MAGIC_BLOCK_INFO = `/v1/block/magic/get?` - GET_LATEST_FINALIZED = `/v1/block/get/latest_finalized` - GET_LATEST_FINALIZED_MAGIC_BLOCK = `/v1/block/get/latest_finalized_magic_block` - GET_FEE_STATS = `/v1/block/get/fee_stats` - GET_CHAIN_STATS = `/v1/chain/get/stats` - - GET_MINT_NONCE = `/v1/mint_nonce` - - // miner SC - - GET_MINERSC_NODE = "/nodeStat" - GET_MINERSC_POOL = "/nodePoolStat" - GET_MINERSC_USER = "/getUserPools" - GET_MINERSC_MINERS = "/getMinerList" - GET_MINERSC_SHARDERS = "/getSharderList" - - GET_HARDFORK = "/hardfork" - GET_CURRENT_ROUND = "/v1/current-round" -) - -const ( - StorageSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7` - FaucetSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d3` - MinerSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d9` - ZCNSCSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0` -) - -// In percentage -const consensusThresh = 25 //nolint:unused - -const ( - defaultMinSubmit = int(10) //nolint:unused - defaultMinConfirmation = int(10) //nolint:unused - defaultConfirmationChainLength = int(3) //nolint:unused - defaultTxnExpirationSeconds = 60 //nolint:unused - defaultWaitSeconds = 3 * time.Second //nolint:unused -) - -const ( - StatusSuccess int = 0 - StatusNetworkError int = 1 - // TODO: Change to specific error - StatusError int = 2 - StatusRejectedByUser int = 3 - StatusInvalidSignature int = 4 - StatusAuthError int = 5 - StatusAuthVerifyFailed int = 6 - StatusAuthTimeout int = 7 - StatusUnknown int = -1 -) - -var defaultLogLevel = logger.DEBUG -var logging = logger.GetLogger() - -// GetLogger returns the logger instance -func GetLogger() *logger.Logger { - return logging -} - -// CloseLog closes log file -func CloseLog() { - logging.Close() -} - -const TOKEN_UNIT int64 = 1e10 - -// WalletCallback needs to be implemented for wallet creation. -type WalletCallback interface { - OnWalletCreateComplete(status int, wallet string, err string) -} - -// GetBalanceCallback needs to be implemented by the caller of GetBalance() to get the status -type GetBalanceCallback interface { - OnBalanceAvailable(status int, value int64, info string) -} - -// BurnTicket represents the burn ticket of native ZCN tokens used by the bridge protocol to mint ERC20 tokens -type BurnTicket struct { - Hash string `json:"hash"` - Amount int64 `json:"amount"` - Nonce int64 `json:"nonce"` -} - -// GetNonceCallback needs to be implemented by the caller of GetNonce() to get the status -type GetNonceCallback interface { - OnNonceAvailable(status int, nonce int64, info string) -} - -type GetNonceCallbackStub struct { - status int - nonce int64 - info string -} - -func (g *GetNonceCallbackStub) OnNonceAvailable(status int, nonce int64, info string) { - g.status = status - g.nonce = nonce - g.info = info -} - -// GetInfoCallback represents the functions that will be called when the response of a GET request to the sharders is available -type GetInfoCallback interface { - // OnInfoAvailable will be called when GetLockTokenConfig is complete - // if status == StatusSuccess then info is valid - // is status != StatusSuccess then err will give the reason - OnInfoAvailable(op int, status int, info string, err string) -} - -// AuthCallback needs to be implemented by the caller SetupAuth() -type AuthCallback interface { - // OnSetupComplete This call back gives the status of the Two factor authenticator(zauth) setup. - OnSetupComplete(status int, err string) -} - -func checkSdkInit() error { - _, err := client.GetNode() - if err != nil { - return err - } - return nil -} - -func checkWalletConfig() error { - if !client.IsWalletSet() { - return errors.New("wallet info not found. set wallet info") - } - return nil -} - -func CheckConfig() error { - err := checkSdkInit() - if err != nil { - return err - } - err = checkWalletConfig() - if err != nil { - return err - } - return nil -} - -// SetLogLevel set the log level. -// lvl - 0 disabled; higher number (upto 4) more verbosity -func SetLogLevel(lvl int) { - logging.SetLevel(lvl) -} - -// SetLogFile - sets file path to write log -// verbose - true - console output; false - no console output -func SetLogFile(logFile string, verbose bool) { - ioWriter := &lumberjack.Logger{ - Filename: logFile, - MaxSize: 100, // MB - MaxBackups: 5, // number of backups - MaxAge: 28, //days - LocalTime: false, - Compress: false, // disabled by default - } - logging.SetLogFile(ioWriter, verbose) - logging.Info("******* Wallet SDK Version:", version.VERSIONSTR, " ******* (SetLogFile)") -} - -// CreateWalletOffline creates the wallet for the config signature scheme. -func CreateWalletOffline() (string, error) { - sigScheme := zcncrypto.NewSignatureScheme("bls0chain") - wallet, err := sigScheme.GenerateKeys() - if err != nil { - return "", errors.New("failed to generate keys: " + err.Error()) - } - w, err := wallet.Marshal() - if err != nil { - return "", errors.New("wallet encoding failed: " + err.Error()) - } - return w, nil -} - -// RecoverOfflineWallet recovers the previously generated wallet using the mnemonic. -func RecoverOfflineWallet(mnemonic string) (string, error) { - if !zcncrypto.IsMnemonicValid(mnemonic) { - return "", errors.New("Invalid mnemonic") - } - sigScheme := zcncrypto.NewSignatureScheme("bls0chain") - wallet, err := sigScheme.RecoverKeys(mnemonic) - if err != nil { - return "", err - } - - walletString, err := wallet.Marshal() - if err != nil { - return "", err - } - - return walletString, nil -} - -// RecoverWallet recovers the previously generated wallet using the mnemonic. -// It also registers the wallet again to block chain. -func RecoverWallet(mnemonic string, statusCb WalletCallback) error { - if !zcncrypto.IsMnemonicValid(mnemonic) { - return errors.New("Invalid mnemonic") - } - go func() { - sigScheme := zcncrypto.NewSignatureScheme(client.SignatureScheme()) - _, err := sigScheme.RecoverKeys(mnemonic) - if err != nil { - statusCb.OnWalletCreateComplete(StatusError, "", err.Error()) - return - } - }() - return nil -} - -// SplitKeys Split keys from the primary master key -func SplitKeys(privateKey string, numSplits int) (string, error) { - if client.SignatureScheme() != constants.BLS0CHAIN.String() { - return "", errors.New("signature key doesn't support split key") - } - sigScheme := zcncrypto.NewSignatureScheme(client.SignatureScheme()) - err := sigScheme.SetPrivateKey(privateKey) - if err != nil { - return "", errors.New("set private key failed." + err.Error()) - } - w, err := sigScheme.SplitKeys(numSplits) - if err != nil { - return "", errors.New("split key failed." + err.Error()) - } - w.IsSplit = true - wStr, err := w.Marshal() - if err != nil { - return "", errors.New("wallet encoding failed." + err.Error()) - } - return wStr, nil -} - -func Encrypt(key, text string) (string, error) { - keyBytes := []byte(key) - textBytes := []byte(text) - response, err := zboxutil.Encrypt(keyBytes, textBytes) - if err != nil { - return "", err - } - return hex.EncodeToString(response), nil -} - -// Decrypt decrypts encrypted text using the key. -// - key: key to use for decryption -// - text: text to decrypt -func Decrypt(key, text string) (string, error) { - keyBytes := []byte(key) - textBytes, _ := hex.DecodeString(text) - response, err := zboxutil.Decrypt(keyBytes, textBytes) - if err != nil { - return "", err - } - return string(response), nil -} - -func CryptoJsEncrypt(passphrase, message string) (string, error) { - o := openssl.New() - - enc, err := o.EncryptBytes(passphrase, []byte(message), openssl.DigestMD5Sum) - if err != nil { - return "", err - } - - return string(enc), nil -} - -func CryptoJsDecrypt(passphrase, encryptedMessage string) (string, error) { - o := openssl.New() - dec, err := o.DecryptBytes(passphrase, []byte(encryptedMessage), openssl.DigestMD5Sum) - if err != nil { - return "", err - } - - return string(dec), nil -} - -// GetPublicEncryptionKey returns the public encryption key for the given mnemonic -func GetPublicEncryptionKey(mnemonic string) (string, error) { - encScheme := encryption.NewEncryptionScheme() - _, err := encScheme.Initialize(mnemonic) - if err != nil { - return "", err - } - return encScheme.GetPublicKey() -} - -func GetPublicEncryptionKeyV2(publicKey string) (string, error) { - if client.GetWallet() == nil { - return "", errors.New("wallet not found") - } - if client.PublicKey() != publicKey { - fmt.Println("public key mismatch", client.PublicKey(), publicKey) - return "", errors.New("public_key_mismatch") - } - hashData := fmt.Sprintf("%s:%s", publicKey, "owner_signing_public_key") - sig, err := client.Sign(rawencryption.Hash(hashData)) - if err != nil { - return "", err - } - decodedSig, err := hex.DecodeString(sig) - if err != nil { - return "", err - } - privateSigningKey := ed25519.NewKeyFromSeed(decodedSig[:32]) - encScheme := encryption.NewEncryptionScheme() - _, err = encScheme.Initialize(hex.EncodeToString(privateSigningKey)) - if err != nil { - return "", err - } - return encScheme.GetPublicKey() -} - -// ConvertToValue converts ZCN tokens to SAS tokens -// # Inputs -// - token: ZCN tokens -func ConvertToValue(token float64) uint64 { - return uint64(token * common.TokenUnit) -} - -func SignWithKey(privateKey, hash string) (string, error) { - sigScheme := zcncrypto.NewSignatureScheme("bls0chain") - err := sigScheme.SetPrivateKey(privateKey) - if err != nil { - return "", err - } - return sigScheme.Sign(hash) -} - -var AddSignature = func(privateKey, signature string, hash string) (string, error) { - var ( - ss = zcncrypto.NewSignatureScheme(client.SignatureScheme()) - err error - ) - - err = ss.SetPrivateKey(privateKey) - if err != nil { - return "", err - } - - return ss.Add(signature, hash) -} - -// ConvertToToken converts the SAS tokens to ZCN tokens -// - token: SAS tokens amount -func ConvertToToken(token int64) float64 { - return float64(token) / float64(common.TokenUnit) -} - -// GetIdForUrl retrieve the ID of the network node (miner/sharder) given its url. -// - url: url of the node. -func GetIdForUrl(url string) string { - url = strings.TrimRight(url, "/") - url = fmt.Sprintf("%v/_nh/whoami", url) - req, err := util.NewHTTPGetRequest(url) - if err != nil { - logging.Error(url, "new get request failed. ", err.Error()) - return "" - } - res, err := req.Get() - if err != nil { - logging.Error(url, "get error. ", err.Error()) - return "" - } - - s := strings.Split(res.Body, ",") - if len(s) >= 3 { - return s[3] - } - return "" -} - -// SetupAuth prepare auth app with clientid, key and a set of public, private key and local publickey -// which is running on PC/Mac. -func SetupAuth(authHost, clientID, clientKey, publicKey, privateKey, localPublicKey string, cb AuthCallback) error { - go func() { - authHost = strings.TrimRight(authHost, "/") - data := map[string]string{"client_id": clientID, "client_key": clientKey, "public_key": publicKey, "private_key": privateKey, "peer_public_key": localPublicKey} - req, err := util.NewHTTPPostRequest(authHost+"/setup", data) - if err != nil { - logging.Error("new post request failed. ", err.Error()) - return - } - res, err := req.Post() - if err != nil { - logging.Error(authHost+"send error. ", err.Error()) - } - if res.StatusCode != http.StatusOK { - cb.OnSetupComplete(StatusError, res.Body) - return - } - cb.OnSetupComplete(StatusSuccess, "") - }() - return nil -} diff --git a/zcncore/wallet_base_test.go b/zcncore/wallet_base_test.go deleted file mode 100644 index e90c01945..000000000 --- a/zcncore/wallet_base_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package zcncore - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestCFBEncryption(t *testing.T) { - key := "passphrase1111111111111111111111" - mnemonics := "glare mistake gun joke bid spare across diagram wrap cube swear cactus cave repeat you brave few best wild lion pitch pole original wasp" - - encryptedMnemonics, err := Encrypt(key, mnemonics) - - require.Nil(t, err) - require.NotEmpty(t, encryptedMnemonics) - - decryptedMnemonics, err := Decrypt(key, encryptedMnemonics) - require.Nil(t, err) - require.Equal(t, mnemonics, decryptedMnemonics) -} - -func TestCBCEncryption(t *testing.T) { - passphrase := "12345611111111111111111111111111" - mnemonics := "cube reward february gym summer peanut marble slow puppy picnic cart waste aspect either anchor vacant horse north border wonder stamp mansion steak magic" - - enc, err := CryptoJsEncrypt(passphrase, mnemonics) - require.Nil(t, err) - - dec, err := CryptoJsDecrypt(passphrase, string(enc)) - require.Nil(t, err) - require.Equal(t, mnemonics, string(dec)) - encryptedMnemonics := "U2FsdGVkX1/Dz58HfdXjHGJioPZ8bnEWIfa0dZcz0JuizI/Tu1+1ncVv60f4w53VimvKG0dC5zhVFQC8dt7K7Lydutu/pquTCDfKt3AUK2iJ5mjN1n4rCvp5IMG+5fKuVyY0z+PbH5MgyJdAF1Fbsi3X+ccfd/ZB9jg6deHpneHDMxhRzuGKcKUuWA6+D/peQTGCmHCLbAPYswFUeF0Elcmgi1mx69UYeM1qgfumuFs=" - dec, err = CryptoJsDecrypt(passphrase, encryptedMnemonics) - require.Nil(t, err) - require.Equal(t, mnemonics, string(dec)) -} diff --git a/zcncore/wallet_callback.go b/zcncore/wallet_callback.go deleted file mode 100644 index 054068fba..000000000 --- a/zcncore/wallet_callback.go +++ /dev/null @@ -1,28 +0,0 @@ -package zcncore - -import ( - "sync" - - "github.com/0chain/gosdk/core/common" -) - -type walletCallback struct { //nolint:unused - sync.WaitGroup - success bool - - balance common.Balance - info string - err error -} - -func (cb *walletCallback) OnBalanceAvailable(status int, value int64, info string) { //nolint:unused - defer cb.Done() - - if status == StatusSuccess { - cb.success = true - } else { - cb.success = false - } - cb.info = info - cb.balance = common.Balance(value) -} diff --git a/zcncore/wallet_mobile.go b/zcncore/wallet_mobile.go deleted file mode 100644 index b84955efd..000000000 --- a/zcncore/wallet_mobile.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build mobile -// +build mobile - -package zcncore - -import ( - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/screstapi" - "github.com/0chain/gosdk/core/zcncrypto" -) - -// Wallet interface to gather all wallet related functions -type Wallet interface { - // Sign sign the hash - Sign(hash string) (string, error) -} - -type wallet struct { - zcncrypto.Wallet -} - -// Sign sign the given string using the wallet's private key -func (w *wallet) Sign(hash string) (string, error) { - sigScheme := zcncrypto.NewSignatureScheme(client.SignatureScheme()) - err := sigScheme.SetPrivateKey(w.Keys[0].PrivateKey) - if err != nil { - return "", err - } - return sigScheme.Sign(hash) -} - -// GetWalletBalance retrieve wallet balance from sharders -// - id: client id -func GetWalletBalance(id string) (int64, error) { - response, err := screstapi.GetBalance(id) - if err != nil { - return 0, err - } - return int64(response.Balance), nil -} diff --git a/zcncore/zauth.go b/zcncore/zauth.go deleted file mode 100644 index e3723388f..000000000 --- a/zcncore/zauth.go +++ /dev/null @@ -1,601 +0,0 @@ -package zcncore - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/sys" - "github.com/pkg/errors" -) - -// AvailableRestrictions represents supported restrictions mapping. -var AvailableRestrictions = map[string][]string{ - "token_transfers": {"transfer"}, - "allocation_file_operations": { - "read_redeem", - "commit_connection", - }, - "allocation_storage_operations": { - "new_allocation_request", - "update_allocation_request", - "finalize_allocation", - "cancel_allocation", - "add_free_storage_assigner", - "free_allocation_request", - }, - "allocation_token_operations": { - "read_pool_lock", - "read_pool_unlock", - "write_pool_lock", - }, - "storage_rewards": { - "collect_reward", - "stake_pool_lock", - "stake_pool_unlock", - }, - "storage_operations": { - "challenge_response", - "add_validator", - "add_blobber", - "blobber_health_check", - "validator_health_check", - }, - "storage_management": { - "kill_blobber", - "kill_validator", - "shutdown_blobber", - "shutdown_validator", - "update_blobber_settings", - "update_validator_settings", - }, - "miner_operations": { - "add_miner", - "add_sharder", - "miner_health_check", - "sharder_health_check", - "contributeMpk", - "shareSignsOrShares", - "wait", - "sharder_keep", - }, - "miner_management_operations": { - "delete_miner", - "delete_sharder", - "update_miner_settings", - "kill_miner", - "kill_sharder", - }, - "miner_financial_operations": { - "addToDelegatePool", - "deleteFromDelegatePool", - "collect_reward", - }, - "token_bridging": { - "mint", - "burn", - }, - "authorizer_management_operations": { - "delete-authorizer", - }, - "authorizer_operations": { - "add-authorizer", - "authorizer-health-check", - "add-to-delegate-pool", - "delete-from-delegate-pool", - }, -} - -type updateRestrictionsRequest struct { - Restrictions []string `json:"restrictions"` -} - -type AuthMessage struct { - Hash string `json:"hash"` - Signature string `json:"signature"` - ClientID string `json:"client_id"` -} - -type AuthResponse struct { - Sig string `json:"sig"` -} - -func CallZauthRetreiveKey(serverAddr, token, clientID, peerPublicKey string) (string, error) { - endpoint := fmt.Sprintf("%s/key/%s", serverAddr, clientID) - - req, err := http.NewRequest("GET", endpoint, nil) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Peer-Public-Key", peerPublicKey) - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return "", fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil -} - -func CallZauthRevoke(serverAddr, token, clientID, peerPublicKey string) error { - endpoint := serverAddr + "/revoke/" + clientID + "?peer_public_key=" + peerPublicKey - - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - - return nil -} - -func CallZauthDelete(serverAddr, token, clientID string) error { - endpoint := serverAddr + "/delete/" + clientID - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - return nil -} - -func CallZvaultNewWallet(serverAddr, token string) error { - endpoint := serverAddr + "/wallet" - - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - - return nil -} - -func CallZvaultNewSplit(serverAddr, token, clientID string) error { - endpoint := serverAddr + "/key/" + clientID - - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - - return nil -} - -func CallZvaultRetrieveRestrictions(serverAddr, token, peerPublicKey string) (string, error) { - endpoint := serverAddr + "/restrictions" - - req, err := http.NewRequest("GET", endpoint, nil) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Peer-Public-Key", peerPublicKey) - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return "", errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return "", errors.Errorf("code: %d", resp.StatusCode) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil -} - -func CallZvaultUpdateRestrictions(serverAddr, token, clientID, peerPublicKey string, restrictions []string) error { - endpoint := serverAddr + "/restrictions/" + clientID - - data, err := json.Marshal(updateRestrictionsRequest{ - Restrictions: restrictions, - }) - if err != nil { - return errors.Wrap(err, "failed to serialize request") - } - - req, err := http.NewRequest("PUT", endpoint, bytes.NewReader(data)) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Peer-Public-Key", peerPublicKey) - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - - return nil -} - -func CallZvaultStoreKeyString(serverAddr, token, privateKey string) error { - endpoint := serverAddr + "/store" - - reqData := struct { - PrivateKey string `json:"private_key"` - }{ - PrivateKey: privateKey, - } - - var buff bytes.Buffer - - encoder := json.NewEncoder(&buff) - - err := encoder.Encode(reqData) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - var req *http.Request - - req, err = http.NewRequest("POST", endpoint, &buff) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - if len(errMsg) > 0 { - return errors.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - return errors.Errorf("code: %d", resp.StatusCode) - } - - return nil -} - -func CallZvaultRetrieveKeys(serverAddr, token, clientID string) (string, error) { - endpoint := fmt.Sprintf("%s/keys/%s", serverAddr, clientID) - req, err := http.NewRequest("GET", endpoint, nil) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return "", fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil -} - -func CallZvaultDeletePrimaryKey(serverAddr, token, clientID string) error { - endpoint := serverAddr + "/delete/" + clientID - - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - _, err = io.ReadAll(resp.Body) - if err != nil { - return errors.Wrap(err, "failed to read response body") - } - - return nil -} - -func CallZvaultRevokeKey(serverAddr, token, clientID, publicKey string) error { - // Add your code here - endpoint := fmt.Sprintf("%s/revoke/%s?public_key=%s", serverAddr, clientID, publicKey) - req, err := http.NewRequest("POST", endpoint, nil) - if err != nil { - return errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - _, err = io.ReadAll(resp.Body) - if err != nil { - return errors.Wrap(err, "failed to read response body") - } - - return nil -} - -func CallZvaultRetrieveWallets(serverAddr, token string) (string, error) { - // Add your code here - endpoint := fmt.Sprintf("%s/wallets", serverAddr) - req, err := http.NewRequest("GET", endpoint, nil) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return "", fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil -} - -func CallZvaultRetrieveSharedWallets(serverAddr, token string) (string, error) { - // Add your code here - endpoint := fmt.Sprintf("%s/wallets/shared", serverAddr) - req, err := http.NewRequest("GET", endpoint, nil) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Jwt-Token", token) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - errMsg, _ := io.ReadAll(resp.Body) - return "", fmt.Errorf("code: %d, err: %s", resp.StatusCode, string(errMsg)) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil -} - -// ZauthSignTxn returns a function that sends a txn signing request to the zauth server -func ZauthSignTxn(serverAddr string) sys.AuthorizeFunc { - return func(msg string) (string, error) { - req, err := http.NewRequest("POST", serverAddr+"/sign/txn", bytes.NewBuffer([]byte(msg))) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - req.Header.Set("Content-Type", "application/json") - c := client.GetClient() - pubkey := c.Keys[0].PublicKey - req.Header.Set("X-Peer-Public-Key", pubkey) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - rsp, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return "", errors.Errorf("unexpected status code: %d, res: %s", resp.StatusCode, string(rsp)) - } - - var d string - - err = json.NewDecoder(resp.Body).Decode(&d) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return d, nil - } -} - -func ZauthAuthCommon(serverAddr string) sys.AuthorizeFunc { - return func(msg string) (string, error) { - req, err := http.NewRequest("POST", serverAddr+"/sign/msg", bytes.NewBuffer([]byte(msg))) - if err != nil { - return "", errors.Wrap(err, "failed to create HTTP request") - } - - c := client.GetClient() - pubkey := c.Keys[0].PublicKey - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Peer-Public-Key", pubkey) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return "", errors.Wrap(err, "failed to send HTTP request") - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - rsp, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return "", errors.Errorf("unexpected status code: %d, res: %s", resp.StatusCode, string(rsp)) - } - - d, err := io.ReadAll(resp.Body) - if err != nil { - return "", errors.Wrap(err, "failed to read response body") - } - - return string(d), nil - } -} diff --git a/znft/README.MD b/znft/README.MD deleted file mode 100644 index 78750d679..000000000 --- a/znft/README.MD +++ /dev/null @@ -1,1308 +0,0 @@ - - -# znft - -```go -import "github.com/0chain/gosdk/znft" -``` - -## Index - -- [Constants](<#constants>) -- [Variables](<#variables>) -- [func AccountExists\(homedir, address string\) bool](<#AccountExists>) -- [func CreateEthClient\(ethereumNodeURL string\) \(\*ethclient.Client, error\)](<#CreateEthClient>) -- [func CreateKeyStorage\(homedir, password string\) error](<#CreateKeyStorage>) -- [func DeleteAccount\(homedir, address string\) bool](<#DeleteAccount>) -- [func GetConfigDir\(\) string](<#GetConfigDir>) -- [func ImportAccount\(homedir, mnemonic, password string\) \(string, error\)](<#ImportAccount>) -- [func ListStorageAccounts\(homedir string\) \[\]common.Address](<#ListStorageAccounts>) -- [func UpdateClientEthereumAddress\(homedir, address string\) \(err error\)](<#UpdateClientEthereumAddress>) -- [type Configuration](<#Configuration>) -- [type FactoryERC721](<#FactoryERC721>) - - [func \(s \*FactoryERC721\) CreateToken\(owner, name, symbol, uri string, max \*big.Int, data \[\]byte\) error](<#FactoryERC721.CreateToken>) -- [type FactoryFixed](<#FactoryFixed>) - - [func \(s \*FactoryFixed\) CreateToken\(owner, name, symbol, uri string, max, price, batch \*big.Int, calldata \[\]byte\) error](<#FactoryFixed.CreateToken>) -- [type FactoryPack](<#FactoryPack>) - - [func \(s \*FactoryPack\) CreateToken\(owner, name, symbol, uri string, max, price, batch \*big.Int, calldata \[\]byte\) error](<#FactoryPack.CreateToken>) -- [type FactoryRandom](<#FactoryRandom>) - - [func \(s \*FactoryRandom\) CreateToken\(owner, name, symbol, uri string, max, price, batch \*big.Int, calldata \[\]byte\) error](<#FactoryRandom.CreateToken>) -- [type IFactoryERC721](<#IFactoryERC721>) -- [type IFactoryFixed](<#IFactoryFixed>) -- [type IFactoryPack](<#IFactoryPack>) -- [type IFactoryRandom](<#IFactoryRandom>) -- [type IStorageECR721](<#IStorageECR721>) -- [type IStorageECR721Fixed](<#IStorageECR721Fixed>) -- [type IStorageECR721Pack](<#IStorageECR721Pack>) -- [type IStorageECR721Random](<#IStorageECR721Random>) -- [type StorageECR721](<#StorageECR721>) - - [func \(s \*StorageECR721\) Allocation\(\) \(string, error\)](<#StorageECR721.Allocation>) - - [func \(s \*StorageECR721\) Batch\(\) \(\*big.Int, error\)](<#StorageECR721.Batch>) - - [func \(s \*StorageECR721\) Max\(\) \(\*big.Int, error\)](<#StorageECR721.Max>) - - [func \(s \*StorageECR721\) Mint\(amount \*big.Int\) error](<#StorageECR721.Mint>) - - [func \(s \*StorageECR721\) MintOwner\(amount \*big.Int\) error](<#StorageECR721.MintOwner>) - - [func \(s \*StorageECR721\) Mintable\(\) \(bool, error\)](<#StorageECR721.Mintable>) - - [func \(s \*StorageECR721\) Price\(\) \(\*big.Int, error\)](<#StorageECR721.Price>) - - [func \(s \*StorageECR721\) Receiver\(\) \(string, error\)](<#StorageECR721.Receiver>) - - [func \(s \*StorageECR721\) Royalty\(\) \(\*big.Int, error\)](<#StorageECR721.Royalty>) - - [func \(s \*StorageECR721\) RoyaltyInfo\(tokenId, salePrice \*big.Int\) \(string, \*big.Int, error\)](<#StorageECR721.RoyaltyInfo>) - - [func \(s \*StorageECR721\) SetAllocation\(allocation string\) error](<#StorageECR721.SetAllocation>) - - [func \(s \*StorageECR721\) SetMintable\(status bool\) error](<#StorageECR721.SetMintable>) - - [func \(s \*StorageECR721\) SetReceiver\(receiver string\) error](<#StorageECR721.SetReceiver>) - - [func \(s \*StorageECR721\) SetRoyalty\(sum \*big.Int\) error](<#StorageECR721.SetRoyalty>) - - [func \(s \*StorageECR721\) SetURI\(uri string\) error](<#StorageECR721.SetURI>) - - [func \(s \*StorageECR721\) SetURIFallback\(uri string\) error](<#StorageECR721.SetURIFallback>) - - [func \(s \*StorageECR721\) TokenURIFallback\(token \*big.Int\) \(string, error\)](<#StorageECR721.TokenURIFallback>) - - [func \(s \*StorageECR721\) Total\(\) \(\*big.Int, error\)](<#StorageECR721.Total>) - - [func \(s \*StorageECR721\) Uri\(\) \(string, error\)](<#StorageECR721.Uri>) - - [func \(s \*StorageECR721\) UriFallback\(\) \(string, error\)](<#StorageECR721.UriFallback>) - - [func \(s \*StorageECR721\) Withdraw\(\) error](<#StorageECR721.Withdraw>) -- [type StorageECR721Fixed](<#StorageECR721Fixed>) - - [func \(s \*StorageECR721Fixed\) Allocation\(\) \(string, error\)](<#StorageECR721Fixed.Allocation>) - - [func \(s \*StorageECR721Fixed\) Batch\(\) \(\*big.Int, error\)](<#StorageECR721Fixed.Batch>) - - [func \(s \*StorageECR721Fixed\) Max\(\) \(\*big.Int, error\)](<#StorageECR721Fixed.Max>) - - [func \(s \*StorageECR721Fixed\) Mint\(amount \*big.Int\) error](<#StorageECR721Fixed.Mint>) - - [func \(s \*StorageECR721Fixed\) MintOwner\(amount \*big.Int\) error](<#StorageECR721Fixed.MintOwner>) - - [func \(s \*StorageECR721Fixed\) Mintable\(\) \(bool, error\)](<#StorageECR721Fixed.Mintable>) - - [func \(s \*StorageECR721Fixed\) Price\(\) \(\*big.Int, error\)](<#StorageECR721Fixed.Price>) - - [func \(s \*StorageECR721Fixed\) Receiver\(\) \(string, error\)](<#StorageECR721Fixed.Receiver>) - - [func \(s \*StorageECR721Fixed\) Royalty\(\) \(\*big.Int, error\)](<#StorageECR721Fixed.Royalty>) - - [func \(s \*StorageECR721Fixed\) RoyaltyInfo\(tokenId, salePrice \*big.Int\) \(string, \*big.Int, error\)](<#StorageECR721Fixed.RoyaltyInfo>) - - [func \(s \*StorageECR721Fixed\) SetAllocation\(allocation string\) error](<#StorageECR721Fixed.SetAllocation>) - - [func \(s \*StorageECR721Fixed\) SetMintable\(status bool\) error](<#StorageECR721Fixed.SetMintable>) - - [func \(s \*StorageECR721Fixed\) SetReceiver\(receiver string\) error](<#StorageECR721Fixed.SetReceiver>) - - [func \(s \*StorageECR721Fixed\) SetRoyalty\(sum \*big.Int\) error](<#StorageECR721Fixed.SetRoyalty>) - - [func \(s \*StorageECR721Fixed\) SetURI\(uri string\) error](<#StorageECR721Fixed.SetURI>) - - [func \(s \*StorageECR721Fixed\) SetURIFallback\(uri string\) error](<#StorageECR721Fixed.SetURIFallback>) - - [func \(s \*StorageECR721Fixed\) TokenURI\(token \*big.Int\) \(string, error\)](<#StorageECR721Fixed.TokenURI>) - - [func \(s \*StorageECR721Fixed\) TokenURIFallback\(token \*big.Int\) \(string, error\)](<#StorageECR721Fixed.TokenURIFallback>) - - [func \(s \*StorageECR721Fixed\) Total\(\) \(\*big.Int, error\)](<#StorageECR721Fixed.Total>) - - [func \(s \*StorageECR721Fixed\) Uri\(\) \(string, error\)](<#StorageECR721Fixed.Uri>) - - [func \(s \*StorageECR721Fixed\) UriFallback\(\) \(string, error\)](<#StorageECR721Fixed.UriFallback>) - - [func \(s \*StorageECR721Fixed\) Withdraw\(\) error](<#StorageECR721Fixed.Withdraw>) -- [type StorageECR721Pack](<#StorageECR721Pack>) - - [func \(s \*StorageECR721Pack\) Allocation\(\) \(string, error\)](<#StorageECR721Pack.Allocation>) - - [func \(s \*StorageECR721Pack\) Batch\(\) \(\*big.Int, error\)](<#StorageECR721Pack.Batch>) - - [func \(s \*StorageECR721Pack\) Max\(\) \(\*big.Int, error\)](<#StorageECR721Pack.Max>) - - [func \(s \*StorageECR721Pack\) Mint\(amount \*big.Int\) error](<#StorageECR721Pack.Mint>) - - [func \(s \*StorageECR721Pack\) MintOwner\(amount \*big.Int\) error](<#StorageECR721Pack.MintOwner>) - - [func \(s \*StorageECR721Pack\) Mintable\(\) \(bool, error\)](<#StorageECR721Pack.Mintable>) - - [func \(s \*StorageECR721Pack\) Price\(\) \(\*big.Int, error\)](<#StorageECR721Pack.Price>) - - [func \(s \*StorageECR721Pack\) Receiver\(\) \(string, error\)](<#StorageECR721Pack.Receiver>) - - [func \(s \*StorageECR721Pack\) Redeem\(tokenId \*big.Int\) error](<#StorageECR721Pack.Redeem>) - - [func \(s \*StorageECR721Pack\) Reveal\(tokenId \*big.Int\) error](<#StorageECR721Pack.Reveal>) - - [func \(s \*StorageECR721Pack\) Royalty\(\) \(\*big.Int, error\)](<#StorageECR721Pack.Royalty>) - - [func \(s \*StorageECR721Pack\) RoyaltyInfo\(tokenId, salePrice \*big.Int\) \(string, \*big.Int, error\)](<#StorageECR721Pack.RoyaltyInfo>) - - [func \(s \*StorageECR721Pack\) SetAllocation\(allocation string\) error](<#StorageECR721Pack.SetAllocation>) - - [func \(s \*StorageECR721Pack\) SetClosed\(closed string\) error](<#StorageECR721Pack.SetClosed>) - - [func \(s \*StorageECR721Pack\) SetMintable\(status bool\) error](<#StorageECR721Pack.SetMintable>) - - [func \(s \*StorageECR721Pack\) SetOpened\(opened string\) error](<#StorageECR721Pack.SetOpened>) - - [func \(s \*StorageECR721Pack\) SetReceiver\(receiver string\) error](<#StorageECR721Pack.SetReceiver>) - - [func \(s \*StorageECR721Pack\) SetRoyalty\(sum \*big.Int\) error](<#StorageECR721Pack.SetRoyalty>) - - [func \(s \*StorageECR721Pack\) SetURI\(uri string\) error](<#StorageECR721Pack.SetURI>) - - [func \(s \*StorageECR721Pack\) SetURIFallback\(uri string\) error](<#StorageECR721Pack.SetURIFallback>) - - [func \(s \*StorageECR721Pack\) TokenURI\(tokenId \*big.Int\) \(string, error\)](<#StorageECR721Pack.TokenURI>) - - [func \(s \*StorageECR721Pack\) TokenURIFallback\(tokenId \*big.Int\) \(string, error\)](<#StorageECR721Pack.TokenURIFallback>) - - [func \(s \*StorageECR721Pack\) Total\(\) \(\*big.Int, error\)](<#StorageECR721Pack.Total>) - - [func \(s \*StorageECR721Pack\) Uri\(\) \(string, error\)](<#StorageECR721Pack.Uri>) - - [func \(s \*StorageECR721Pack\) UriFallback\(\) \(string, error\)](<#StorageECR721Pack.UriFallback>) - - [func \(s \*StorageECR721Pack\) Withdraw\(\) error](<#StorageECR721Pack.Withdraw>) -- [type StorageECR721Random](<#StorageECR721Random>) - - [func \(s \*StorageECR721Random\) Mint\(amount \*big.Int\) error](<#StorageECR721Random.Mint>) - - [func \(s \*StorageECR721Random\) MintOwner\(amount \*big.Int\) error](<#StorageECR721Random.MintOwner>) - - [func \(s \*StorageECR721Random\) Price\(\) \(\*big.Int, error\)](<#StorageECR721Random.Price>) - - [func \(s \*StorageECR721Random\) Reveal\(tokens \[\]\*big.Int\) error](<#StorageECR721Random.Reveal>) - - [func \(s \*StorageECR721Random\) SetHidden\(hidden string\) error](<#StorageECR721Random.SetHidden>) - - [func \(s \*StorageECR721Random\) SetPack\(address common.Address\) error](<#StorageECR721Random.SetPack>) - - [func \(s \*StorageECR721Random\) SetRevealable\(status bool\) error](<#StorageECR721Random.SetRevealable>) - - [func \(s \*StorageECR721Random\) TokenURI\(token \*big.Int\) \(string, error\)](<#StorageECR721Random.TokenURI>) - - [func \(s \*StorageECR721Random\) TokenURIFallback\(token \*big.Int\) \(string, error\)](<#StorageECR721Random.TokenURIFallback>) -- [type Znft](<#Znft>) - - [func NewNFTApplication\(c \*Configuration\) \*Znft](<#NewNFTApplication>) - - [func \(app \*Znft\) CreateFactoryERC721FixedSession\(ctx context.Context, addr string\) \(IFactoryFixed, error\)](<#Znft.CreateFactoryERC721FixedSession>) - - [func \(app \*Znft\) CreateFactoryERC721PackSession\(ctx context.Context, addr string\) \(IFactoryPack, error\)](<#Znft.CreateFactoryERC721PackSession>) - - [func \(app \*Znft\) CreateFactoryERC721RandomSession\(ctx context.Context, addr string\) \(IFactoryRandom, error\)](<#Znft.CreateFactoryERC721RandomSession>) - - [func \(app \*Znft\) CreateFactoryERC721Session\(ctx context.Context, addr string\) \(IFactoryERC721, error\)](<#Znft.CreateFactoryERC721Session>) - - [func \(app \*Znft\) CreateStorageERC721FixedSession\(ctx context.Context, addr string\) \(IStorageECR721Fixed, error\)](<#Znft.CreateStorageERC721FixedSession>) - - [func \(app \*Znft\) CreateStorageERC721PackSession\(ctx context.Context, addr string\) \(IStorageECR721Pack, error\)](<#Znft.CreateStorageERC721PackSession>) - - [func \(app \*Znft\) CreateStorageERC721RandomSession\(ctx context.Context, addr string\) \(IStorageECR721Random, error\)](<#Znft.CreateStorageERC721RandomSession>) - - [func \(app \*Znft\) CreateStorageERC721Session\(ctx context.Context, addr string\) \(IStorageECR721, error\)](<#Znft.CreateStorageERC721Session>) - - -## Constants - - - -```go -const ( - ContractStorageERC721Name = "StorageERC721" - ContractStorageERC721FixedName = "StorageERC721Fixed" - ContractStorageERC721PackName = "StorageERC721Pack" - ContractStorageERC721RandomName = "StorageERC721Random" - Withdraw = "withdraw" - SetReceiver = "setReceiver" - SetRoyalty = "setRoyalty" - SetMintable = "setMintable" - SetAllocation = "setAllocation" - SetURI = "setURI" - TokenURIFallback = "tokenURIFallback" - TokenURI = "tokenURI" - Price = "price" - Mint = "mint" - MintOwner = "mintOwner" - RoyaltyInfo = "royaltyInfo" -) -``` - - - -```go -const ( - ConfigFile = "config.yaml" - WalletDir = "wallets" -) -``` - -## Variables - - - -```go -var Logger logger.Logger -``` - - -## func [AccountExists]() - -```go -func AccountExists(homedir, address string) bool -``` - -AccountExists checks if account exists - - -## func [CreateEthClient]() - -```go -func CreateEthClient(ethereumNodeURL string) (*ethclient.Client, error) -``` - - - - -## func [CreateKeyStorage]() - -```go -func CreateKeyStorage(homedir, password string) error -``` - -CreateKeyStorage create, restore or unlock key storage - - -## func [DeleteAccount]() - -```go -func DeleteAccount(homedir, address string) bool -``` - -DeleteAccount deletes account from wallet - - -## func [GetConfigDir]() - -```go -func GetConfigDir() string -``` - - - - -## func [ImportAccount]() - -```go -func ImportAccount(homedir, mnemonic, password string) (string, error) -``` - -ImportAccount imports account using mnemonic password is used to lock and unlock keystorage before signing transaction - - -## func [ListStorageAccounts]() - -```go -func ListStorageAccounts(homedir string) []common.Address -``` - -ListStorageAccounts List available accounts - - -## func [UpdateClientEthereumAddress]() - -```go -func UpdateClientEthereumAddress(homedir, address string) (err error) -``` - -UpdateClientEthereumAddress updates Ethereum address - - -## type [Configuration]() - - - -```go -type Configuration struct { - FactoryAddress string // FactoryAddress address - FactoryModuleERC721Address string // FactoryModuleERC721Address address - FactoryModuleERC721PackedAddress string // FactoryModuleERC721PackedAddress address - FactoryModuleERC721FixedAddress string // FactoryModuleERC721FixedAddress address - FactoryModuleERC721RandomAddress string // FactoryModuleERC721RandomAddress address - EthereumNodeURL string // EthereumNodeURL URL of ethereum RPC node (infura or alchemy) - WalletAddress string // WalletAddress client address - VaultPassword string // VaultPassword used to sign transactions on behalf of the client - Homedir string // Homedir is a client config folder - Value int64 // Value to execute Ethereum smart contracts (default = 0) -} -``` - - -## type [FactoryERC721]() - - - -```go -type FactoryERC721 struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*FactoryERC721\) [CreateToken]() - -```go -func (s *FactoryERC721) CreateToken(owner, name, symbol, uri string, max *big.Int, data []byte) error -``` - - - - -## type [FactoryFixed]() - - - -```go -type FactoryFixed struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*FactoryFixed\) [CreateToken]() - -```go -func (s *FactoryFixed) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -``` - - - - -## type [FactoryPack]() - - - -```go -type FactoryPack struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*FactoryPack\) [CreateToken]() - -```go -func (s *FactoryPack) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -``` - - - - -## type [FactoryRandom]() - - - -```go -type FactoryRandom struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*FactoryRandom\) [CreateToken]() - -```go -func (s *FactoryRandom) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -``` - - - - -## type [IFactoryERC721]() - - - -```go -type IFactoryERC721 interface { - CreateToken(owner, name, symbol, uri string, max *big.Int, data []byte) error -} -``` - - -## type [IFactoryFixed]() - - - -```go -type IFactoryFixed interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} -``` - - -## type [IFactoryPack]() - - - -```go -type IFactoryPack interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} -``` - - -## type [IFactoryRandom]() - - - -```go -type IFactoryRandom interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} -``` - - -## type [IStorageECR721]() - - - -```go -type IStorageECR721 interface { - Withdraw() error - SetReceiver(receiver string) error - SetRoyalty(sum *big.Int) error - SetMintable(status bool) error - SetAllocation(allocation string) error - SetURI(uri string) error - SetURIFallback(uri string) error - TokenURIFallback(token *big.Int) (string, error) - Price() (*big.Int, error) - Mint(amount *big.Int) error - MintOwner(amount *big.Int) error - RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) - Max() (*big.Int, error) // Fields - Total() (*big.Int, error) - Batch() (*big.Int, error) - Mintable() (bool, error) - Allocation() (string, error) - Uri() (string, error) - UriFallback() (string, error) - Royalty() (*big.Int, error) - Receiver() (string, error) -} -``` - - -## type [IStorageECR721Fixed]() - - - -```go -type IStorageECR721Fixed interface { - IStorageECR721 -} -``` - - -## type [IStorageECR721Pack]() - - - -```go -type IStorageECR721Pack interface { - IStorageECR721Fixed - MintOwner(amount *big.Int) error - Mint(amount *big.Int) error - Reveal(tokenId *big.Int) error - Redeem(tokenId *big.Int) error - TokenURI(tokenId *big.Int) (string, error) - TokenURIFallback(tokenId *big.Int) (string, error) - SetClosed(closed string) error - SetOpened(opened string) error -} -``` - - -## type [IStorageECR721Random]() - - - -```go -type IStorageECR721Random interface { - MintOwner(amount *big.Int) error - Mint(amount *big.Int) error - Reveal(tokens []*big.Int) error - TokenURI(token *big.Int) (string, error) - TokenURIFallback(token *big.Int) (string, error) - SetHidden(hidden string) error - SetPack(address common.Address) error - SetRevealable(status bool) error - Price() (*big.Int, error) -} -``` - - -## type [StorageECR721]() - - - -```go -type StorageECR721 struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*StorageECR721\) [Allocation]() - -```go -func (s *StorageECR721) Allocation() (string, error) -``` - - - - -### func \(\*StorageECR721\) [Batch]() - -```go -func (s *StorageECR721) Batch() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721\) [Max]() - -```go -func (s *StorageECR721) Max() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721\) [Mint]() - -```go -func (s *StorageECR721) Mint(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721\) [MintOwner]() - -```go -func (s *StorageECR721) MintOwner(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721\) [Mintable]() - -```go -func (s *StorageECR721) Mintable() (bool, error) -``` - - - - -### func \(\*StorageECR721\) [Price]() - -```go -func (s *StorageECR721) Price() (*big.Int, error) -``` - -Price returns price - - -### func \(\*StorageECR721\) [Receiver]() - -```go -func (s *StorageECR721) Receiver() (string, error) -``` - - - - -### func \(\*StorageECR721\) [Royalty]() - -```go -func (s *StorageECR721) Royalty() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721\) [RoyaltyInfo]() - -```go -func (s *StorageECR721) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) -``` - - - - -### func \(\*StorageECR721\) [SetAllocation]() - -```go -func (s *StorageECR721) SetAllocation(allocation string) error -``` - -SetAllocation updates allocation - - -### func \(\*StorageECR721\) [SetMintable]() - -```go -func (s *StorageECR721) SetMintable(status bool) error -``` - -SetMintable updates mintable state - - -### func \(\*StorageECR721\) [SetReceiver]() - -```go -func (s *StorageECR721) SetReceiver(receiver string) error -``` - -SetReceiver eth balance from token contract \- setReceiver\(address receiver_\) - - -### func \(\*StorageECR721\) [SetRoyalty]() - -```go -func (s *StorageECR721) SetRoyalty(sum *big.Int) error -``` - -SetRoyalty eth balance from token contract \- setReceiver\(address receiver_\) - - -### func \(\*StorageECR721\) [SetURI]() - -```go -func (s *StorageECR721) SetURI(uri string) error -``` - -SetURI updates uri - - -### func \(\*StorageECR721\) [SetURIFallback]() - -```go -func (s *StorageECR721) SetURIFallback(uri string) error -``` - - - - -### func \(\*StorageECR721\) [TokenURIFallback]() - -```go -func (s *StorageECR721) TokenURIFallback(token *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721\) [Total]() - -```go -func (s *StorageECR721) Total() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721\) [Uri]() - -```go -func (s *StorageECR721) Uri() (string, error) -``` - - - - -### func \(\*StorageECR721\) [UriFallback]() - -```go -func (s *StorageECR721) UriFallback() (string, error) -``` - - - - -### func \(\*StorageECR721\) [Withdraw]() - -```go -func (s *StorageECR721) Withdraw() error -``` - -Withdraw eth balance from token contract \- withdraw\(\) - - -## type [StorageECR721Fixed]() - - - -```go -type StorageECR721Fixed struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*StorageECR721Fixed\) [Allocation]() - -```go -func (s *StorageECR721Fixed) Allocation() (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Batch]() - -```go -func (s *StorageECR721Fixed) Batch() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Max]() - -```go -func (s *StorageECR721Fixed) Max() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Mint]() - -```go -func (s *StorageECR721Fixed) Mint(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Fixed\) [MintOwner]() - -```go -func (s *StorageECR721Fixed) MintOwner(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Fixed\) [Mintable]() - -```go -func (s *StorageECR721Fixed) Mintable() (bool, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Price]() - -```go -func (s *StorageECR721Fixed) Price() (*big.Int, error) -``` - -Price returns price - - -### func \(\*StorageECR721Fixed\) [Receiver]() - -```go -func (s *StorageECR721Fixed) Receiver() (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Royalty]() - -```go -func (s *StorageECR721Fixed) Royalty() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [RoyaltyInfo]() - -```go -func (s *StorageECR721Fixed) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [SetAllocation]() - -```go -func (s *StorageECR721Fixed) SetAllocation(allocation string) error -``` - -SetAllocation updates allocation - - -### func \(\*StorageECR721Fixed\) [SetMintable]() - -```go -func (s *StorageECR721Fixed) SetMintable(status bool) error -``` - -SetMintable updates mintable state - - -### func \(\*StorageECR721Fixed\) [SetReceiver]() - -```go -func (s *StorageECR721Fixed) SetReceiver(receiver string) error -``` - -SetReceiver eth balance from token contract \- setReceiver\(address receiver_\) - - -### func \(\*StorageECR721Fixed\) [SetRoyalty]() - -```go -func (s *StorageECR721Fixed) SetRoyalty(sum *big.Int) error -``` - -SetRoyalty eth balance from token contract \- setReceiver\(address receiver_\) - - -### func \(\*StorageECR721Fixed\) [SetURI]() - -```go -func (s *StorageECR721Fixed) SetURI(uri string) error -``` - -SetURI updates uri - - -### func \(\*StorageECR721Fixed\) [SetURIFallback]() - -```go -func (s *StorageECR721Fixed) SetURIFallback(uri string) error -``` - - - - -### func \(\*StorageECR721Fixed\) [TokenURI]() - -```go -func (s *StorageECR721Fixed) TokenURI(token *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [TokenURIFallback]() - -```go -func (s *StorageECR721Fixed) TokenURIFallback(token *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Total]() - -```go -func (s *StorageECR721Fixed) Total() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Uri]() - -```go -func (s *StorageECR721Fixed) Uri() (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [UriFallback]() - -```go -func (s *StorageECR721Fixed) UriFallback() (string, error) -``` - - - - -### func \(\*StorageECR721Fixed\) [Withdraw]() - -```go -func (s *StorageECR721Fixed) Withdraw() error -``` - -Withdraw eth balance from token contract \- withdraw\(\) - - -## type [StorageECR721Pack]() - - - -```go -type StorageECR721Pack struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*StorageECR721Pack\) [Allocation]() - -```go -func (s *StorageECR721Pack) Allocation() (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Batch]() - -```go -func (s *StorageECR721Pack) Batch() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Max]() - -```go -func (s *StorageECR721Pack) Max() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Mint]() - -```go -func (s *StorageECR721Pack) Mint(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Pack\) [MintOwner]() - -```go -func (s *StorageECR721Pack) MintOwner(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Pack\) [Mintable]() - -```go -func (s *StorageECR721Pack) Mintable() (bool, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Price]() - -```go -func (s *StorageECR721Pack) Price() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Receiver]() - -```go -func (s *StorageECR721Pack) Receiver() (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Redeem]() - -```go -func (s *StorageECR721Pack) Redeem(tokenId *big.Int) error -``` - - - - -### func \(\*StorageECR721Pack\) [Reveal]() - -```go -func (s *StorageECR721Pack) Reveal(tokenId *big.Int) error -``` - - - - -### func \(\*StorageECR721Pack\) [Royalty]() - -```go -func (s *StorageECR721Pack) Royalty() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [RoyaltyInfo]() - -```go -func (s *StorageECR721Pack) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [SetAllocation]() - -```go -func (s *StorageECR721Pack) SetAllocation(allocation string) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetClosed]() - -```go -func (s *StorageECR721Pack) SetClosed(closed string) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetMintable]() - -```go -func (s *StorageECR721Pack) SetMintable(status bool) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetOpened]() - -```go -func (s *StorageECR721Pack) SetOpened(opened string) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetReceiver]() - -```go -func (s *StorageECR721Pack) SetReceiver(receiver string) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetRoyalty]() - -```go -func (s *StorageECR721Pack) SetRoyalty(sum *big.Int) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetURI]() - -```go -func (s *StorageECR721Pack) SetURI(uri string) error -``` - - - - -### func \(\*StorageECR721Pack\) [SetURIFallback]() - -```go -func (s *StorageECR721Pack) SetURIFallback(uri string) error -``` - - - - -### func \(\*StorageECR721Pack\) [TokenURI]() - -```go -func (s *StorageECR721Pack) TokenURI(tokenId *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [TokenURIFallback]() - -```go -func (s *StorageECR721Pack) TokenURIFallback(tokenId *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Total]() - -```go -func (s *StorageECR721Pack) Total() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Uri]() - -```go -func (s *StorageECR721Pack) Uri() (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [UriFallback]() - -```go -func (s *StorageECR721Pack) UriFallback() (string, error) -``` - - - - -### func \(\*StorageECR721Pack\) [Withdraw]() - -```go -func (s *StorageECR721Pack) Withdraw() error -``` - - - - -## type [StorageECR721Random]() - - - -```go -type StorageECR721Random struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*StorageECR721Random\) [Mint]() - -```go -func (s *StorageECR721Random) Mint(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Random\) [MintOwner]() - -```go -func (s *StorageECR721Random) MintOwner(amount *big.Int) error -``` - - - - -### func \(\*StorageECR721Random\) [Price]() - -```go -func (s *StorageECR721Random) Price() (*big.Int, error) -``` - - - - -### func \(\*StorageECR721Random\) [Reveal]() - -```go -func (s *StorageECR721Random) Reveal(tokens []*big.Int) error -``` - - - - -### func \(\*StorageECR721Random\) [SetHidden]() - -```go -func (s *StorageECR721Random) SetHidden(hidden string) error -``` - - - - -### func \(\*StorageECR721Random\) [SetPack]() - -```go -func (s *StorageECR721Random) SetPack(address common.Address) error -``` - - - - -### func \(\*StorageECR721Random\) [SetRevealable]() - -```go -func (s *StorageECR721Random) SetRevealable(status bool) error -``` - - - - -### func \(\*StorageECR721Random\) [TokenURI]() - -```go -func (s *StorageECR721Random) TokenURI(token *big.Int) (string, error) -``` - - - - -### func \(\*StorageECR721Random\) [TokenURIFallback]() - -```go -func (s *StorageECR721Random) TokenURIFallback(token *big.Int) (string, error) -``` - - - - -## type [Znft]() - - - -```go -type Znft struct { - // contains filtered or unexported fields -} -``` - - -### func [NewNFTApplication]() - -```go -func NewNFTApplication(c *Configuration) *Znft -``` - - - - -### func \(\*Znft\) [CreateFactoryERC721FixedSession]() - -```go -func (app *Znft) CreateFactoryERC721FixedSession(ctx context.Context, addr string) (IFactoryFixed, error) -``` - - - - -### func \(\*Znft\) [CreateFactoryERC721PackSession]() - -```go -func (app *Znft) CreateFactoryERC721PackSession(ctx context.Context, addr string) (IFactoryPack, error) -``` - - - - -### func \(\*Znft\) [CreateFactoryERC721RandomSession]() - -```go -func (app *Znft) CreateFactoryERC721RandomSession(ctx context.Context, addr string) (IFactoryRandom, error) -``` - - - - -### func \(\*Znft\) [CreateFactoryERC721Session]() - -```go -func (app *Znft) CreateFactoryERC721Session(ctx context.Context, addr string) (IFactoryERC721, error) -``` - - - - -### func \(\*Znft\) [CreateStorageERC721FixedSession]() - -```go -func (app *Znft) CreateStorageERC721FixedSession(ctx context.Context, addr string) (IStorageECR721Fixed, error) -``` - - - - -### func \(\*Znft\) [CreateStorageERC721PackSession]() - -```go -func (app *Znft) CreateStorageERC721PackSession(ctx context.Context, addr string) (IStorageECR721Pack, error) -``` - - - - -### func \(\*Znft\) [CreateStorageERC721RandomSession]() - -```go -func (app *Znft) CreateStorageERC721RandomSession(ctx context.Context, addr string) (IStorageECR721Random, error) -``` - - - - -### func \(\*Znft\) [CreateStorageERC721Session]() - -```go -func (app *Znft) CreateStorageERC721Session(ctx context.Context, addr string) (IStorageECR721, error) -``` - - - -Generated by [gomarkdoc]() diff --git a/znft/assets/1652602057996-nft_dstorage_activity_diagram.png b/znft/assets/1652602057996-nft_dstorage_activity_diagram.png deleted file mode 100644 index ab3afb29d2336862386d7ed234b2d23ccf9a704d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 430030 zcmeFZby$>LyEd*!cXtdWASf`@&|T6cAw6^mh_rMK4T5y&P!bXX3JB66DIp~d(%sGP zp6Aj1?stFBcK`PA{reprD#~!Lb+2{hd0pofp{^>AgGq^b=gu7*MFknnJ9khmfG^$9 zQGx&A#@t;8{<`a`DKB-WY=9d02k4HXjHI@w@m3bv1e0t{6P89D*=y5IWLWBJqjJGJ zC2+W*WaE7%4lCji6j@0NeS#{al{+6oO5nOd~h2(LekNf_QClRX0yWsxe1rZ+%OvYgCuEw5NVg4WX9~ABS=To?gQLQW?Szy`B&-p*> zpV%Vv-tR+KPHOg-<+GZ z;RrYs>{B>e9`+01=^DA|Ko(()tzRy8eta!4Z1i@UaH#4xpL^7>*IHpS1dlj5tluod z!t-5|Zj19f%B|>q^f`n`6=DXz-e3Oxo-g78f|O4?+i4a5K1EVu;0jUrrtfjOPi0+W zg71ab@}RMHzp!HM98MT-x;ZvGKlr)uGw@O& z0u2i|3pM4w+f1LA>VDt&8ac3)SRB|)!rzjk{OXRd@Z9C>Y1oLGxTv8^2g!m*)1^`E zwxbi3N9KpBRR45$_ZPD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g>;qlZ!d8RtblSnXZi(b3`f z)m{;G=*^UPkZAUTMA;f9x1A-n23YY8n1e)%Up{^uq@Cz5Z5vWoydsuI3Vtlz5CdWh zLJWH~|Bd*3%6;JB&Sg;55An0cn>KG}9mi=!Z^1*Lj23M3)}R48m{9*7MoJ<}VXhj` zzTI$Vf#DFt&?Z6DIcZ6L diff --git a/znft/contracts/doc.go b/znft/contracts/doc.go deleted file mode 100644 index 1c2861cff..000000000 --- a/znft/contracts/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOGENERATED! All sub-packages and modules are auto-generated and should not be modified. -package contracts \ No newline at end of file diff --git a/znft/contracts/dstorageerc721/binding/dstorageerc721.go b/znft/contracts/dstorageerc721/binding/dstorageerc721.go deleted file mode 100644 index bd45f94a0..000000000 --- a/znft/contracts/dstorageerc721/binding/dstorageerc721.go +++ /dev/null @@ -1,2660 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"MetadataFrozen\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"previous\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"updated\",\"type\":\"bool\"}],\"name\":\"MintableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"updated\",\"type\":\"address\"}],\"name\":\"ReceiverUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"RoyaltyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriFallbackUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allocation\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"freeze\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"frozen\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"max\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royalty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"allocation_\",\"type\":\"string\"}],\"name\":\"setAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status_\",\"type\":\"bool\"}],\"name\":\"setMintable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver_\",\"type\":\"address\"}],\"name\":\"setReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"royalty_\",\"type\":\"uint256\"}],\"name\":\"setRoyalty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURIFallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURIFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"total\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uriFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCaller) Allocation(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "allocation") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCallerSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "balanceOf", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCaller) Batch(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "batch") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCallerSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCaller) Frozen(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "frozen") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCallerSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "getApproved", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "isApprovedForAll", owner, operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCaller) Max(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "max") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCallerSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCaller) Mintable(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "mintable") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCallerSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCallerSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCallerSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "ownerOf", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCaller) Price(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "price") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCallerSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCaller) Receiver(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "receiver") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCallerSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCaller) Royalty(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royalty") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCallerSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCaller) RoyaltyInfo(opts *bind.CallOpts, tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royaltyInfo", tokenId, salePrice) - - if err != nil { - return *new(common.Address), *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return out0, out1, err - -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCallerSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCallerSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURI", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURIFallback(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURIFallback", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCaller) Total(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "total") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCallerSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCaller) Uri(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uri") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCallerSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCaller) UriFallback(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uriFallback") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCallerSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "approve", to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactor) Freeze(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "freeze") -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactorSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactor) Mint(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mint", amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactorSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactor) MintOwner(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mintOwner", amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactorSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactor) SetAllocation(opts *bind.TransactOpts, allocation_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setAllocation", allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactorSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setApprovalForAll", operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactor) SetMintable(opts *bind.TransactOpts, status_ bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setMintable", status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactorSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactor) SetReceiver(opts *bind.TransactOpts, receiver_ common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setReceiver", receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactorSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactor) SetRoyalty(opts *bind.TransactOpts, royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setRoyalty", royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactorSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactor) SetURI(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURI", uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactor) SetURIFallback(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURIFallback", uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferFrom", from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactorSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// BindingApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Binding contract. -type BindingApprovalIterator struct { - Event *BindingApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApproval represents a Approval event raised by the Binding contract. -type BindingApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*BindingApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingApprovalIterator{contract: _Binding.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *BindingApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseApproval(log types.Log) (*BindingApproval, error) { - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Binding contract. -type BindingApprovalForAllIterator struct { - Event *BindingApprovalForAll // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalForAllIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalForAllIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApprovalForAll represents a ApprovalForAll event raised by the Binding contract. -type BindingApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*BindingApprovalForAllIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &BindingApprovalForAllIterator{contract: _Binding.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil -} - -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *BindingApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) ParseApprovalForAll(log types.Log) (*BindingApprovalForAll, error) { - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMetadataFrozenIterator is returned from FilterMetadataFrozen and is used to iterate over the raw logs and unpacked data for MetadataFrozen events raised by the Binding contract. -type BindingMetadataFrozenIterator struct { - Event *BindingMetadataFrozen // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMetadataFrozenIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMetadataFrozenIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMetadataFrozenIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMetadataFrozen represents a MetadataFrozen event raised by the Binding contract. -type BindingMetadataFrozen struct { - Uri string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMetadataFrozen is a free log retrieval operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) FilterMetadataFrozen(opts *bind.FilterOpts) (*BindingMetadataFrozenIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return &BindingMetadataFrozenIterator{contract: _Binding.contract, event: "MetadataFrozen", logs: logs, sub: sub}, nil -} - -// WatchMetadataFrozen is a free log subscription operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) WatchMetadataFrozen(opts *bind.WatchOpts, sink chan<- *BindingMetadataFrozen) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMetadataFrozen is a log parse operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) ParseMetadataFrozen(log types.Log) (*BindingMetadataFrozen, error) { - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMintableUpdatedIterator is returned from FilterMintableUpdated and is used to iterate over the raw logs and unpacked data for MintableUpdated events raised by the Binding contract. -type BindingMintableUpdatedIterator struct { - Event *BindingMintableUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMintableUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMintableUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMintableUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMintableUpdated represents a MintableUpdated event raised by the Binding contract. -type BindingMintableUpdated struct { - Previous bool - Updated bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintableUpdated is a free log retrieval operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) FilterMintableUpdated(opts *bind.FilterOpts) (*BindingMintableUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return &BindingMintableUpdatedIterator{contract: _Binding.contract, event: "MintableUpdated", logs: logs, sub: sub}, nil -} - -// WatchMintableUpdated is a free log subscription operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) WatchMintableUpdated(opts *bind.WatchOpts, sink chan<- *BindingMintableUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMintableUpdated is a log parse operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) ParseMintableUpdated(log types.Log) (*BindingMintableUpdated, error) { - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Binding contract. -type BindingOwnershipTransferredIterator struct { - Event *BindingOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOwnershipTransferred represents a OwnershipTransferred event raised by the Binding contract. -type BindingOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BindingOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BindingOwnershipTransferredIterator{contract: _Binding.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BindingOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) ParseOwnershipTransferred(log types.Log) (*BindingOwnershipTransferred, error) { - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingReceiverUpdatedIterator is returned from FilterReceiverUpdated and is used to iterate over the raw logs and unpacked data for ReceiverUpdated events raised by the Binding contract. -type BindingReceiverUpdatedIterator struct { - Event *BindingReceiverUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingReceiverUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingReceiverUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingReceiverUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingReceiverUpdated represents a ReceiverUpdated event raised by the Binding contract. -type BindingReceiverUpdated struct { - Previous common.Address - Updated common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterReceiverUpdated is a free log retrieval operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) FilterReceiverUpdated(opts *bind.FilterOpts) (*BindingReceiverUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return &BindingReceiverUpdatedIterator{contract: _Binding.contract, event: "ReceiverUpdated", logs: logs, sub: sub}, nil -} - -// WatchReceiverUpdated is a free log subscription operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) WatchReceiverUpdated(opts *bind.WatchOpts, sink chan<- *BindingReceiverUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseReceiverUpdated is a log parse operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) ParseReceiverUpdated(log types.Log) (*BindingReceiverUpdated, error) { - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingRoyaltyUpdatedIterator is returned from FilterRoyaltyUpdated and is used to iterate over the raw logs and unpacked data for RoyaltyUpdated events raised by the Binding contract. -type BindingRoyaltyUpdatedIterator struct { - Event *BindingRoyaltyUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingRoyaltyUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingRoyaltyUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingRoyaltyUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingRoyaltyUpdated represents a RoyaltyUpdated event raised by the Binding contract. -type BindingRoyaltyUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoyaltyUpdated is a free log retrieval operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterRoyaltyUpdated(opts *bind.FilterOpts) (*BindingRoyaltyUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return &BindingRoyaltyUpdatedIterator{contract: _Binding.contract, event: "RoyaltyUpdated", logs: logs, sub: sub}, nil -} - -// WatchRoyaltyUpdated is a free log subscription operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchRoyaltyUpdated(opts *bind.WatchOpts, sink chan<- *BindingRoyaltyUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoyaltyUpdated is a log parse operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseRoyaltyUpdated(log types.Log) (*BindingRoyaltyUpdated, error) { - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Binding contract. -type BindingTransferIterator struct { - Event *BindingTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTransfer represents a Transfer event raised by the Binding contract. -type BindingTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*BindingTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingTransferIterator{contract: _Binding.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *BindingTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseTransfer(log types.Log) (*BindingTransfer, error) { - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriFallbackUpdatedIterator is returned from FilterUriFallbackUpdated and is used to iterate over the raw logs and unpacked data for UriFallbackUpdated events raised by the Binding contract. -type BindingUriFallbackUpdatedIterator struct { - Event *BindingUriFallbackUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriFallbackUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriFallbackUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriFallbackUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriFallbackUpdated represents a UriFallbackUpdated event raised by the Binding contract. -type BindingUriFallbackUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriFallbackUpdated is a free log retrieval operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriFallbackUpdated(opts *bind.FilterOpts) (*BindingUriFallbackUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return &BindingUriFallbackUpdatedIterator{contract: _Binding.contract, event: "UriFallbackUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriFallbackUpdated is a free log subscription operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriFallbackUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriFallbackUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriFallbackUpdated is a log parse operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriFallbackUpdated(log types.Log) (*BindingUriFallbackUpdated, error) { - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriUpdatedIterator is returned from FilterUriUpdated and is used to iterate over the raw logs and unpacked data for UriUpdated events raised by the Binding contract. -type BindingUriUpdatedIterator struct { - Event *BindingUriUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriUpdated represents a UriUpdated event raised by the Binding contract. -type BindingUriUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriUpdated is a free log retrieval operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriUpdated(opts *bind.FilterOpts) (*BindingUriUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return &BindingUriUpdatedIterator{contract: _Binding.contract, event: "UriUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriUpdated is a free log subscription operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriUpdated is a log parse operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriUpdated(log types.Log) (*BindingUriUpdated, error) { - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/znft/contracts/dstorageerc721fixed/binding/dstorageerc721fixed.go b/znft/contracts/dstorageerc721fixed/binding/dstorageerc721fixed.go deleted file mode 100644 index cc665c565..000000000 --- a/znft/contracts/dstorageerc721fixed/binding/dstorageerc721fixed.go +++ /dev/null @@ -1,2930 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"BatchUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"MetadataFrozen\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"previous\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"updated\",\"type\":\"bool\"}],\"name\":\"MintableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"PriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"updated\",\"type\":\"address\"}],\"name\":\"ReceiverUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"RoyaltyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriFallbackUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allocation\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"freeze\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"frozen\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"max\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royalty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"allocation_\",\"type\":\"string\"}],\"name\":\"setAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status_\",\"type\":\"bool\"}],\"name\":\"setMintable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver_\",\"type\":\"address\"}],\"name\":\"setReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"royalty_\",\"type\":\"uint256\"}],\"name\":\"setRoyalty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURIFallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURIFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"total\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uriFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCaller) Allocation(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "allocation") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCallerSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "balanceOf", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCaller) Batch(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "batch") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCallerSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCaller) Frozen(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "frozen") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCallerSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "getApproved", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "isApprovedForAll", owner, operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCaller) Max(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "max") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCallerSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCaller) Mintable(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "mintable") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCallerSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCallerSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCallerSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "ownerOf", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCaller) Price(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "price") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCallerSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCaller) Receiver(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "receiver") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCallerSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCaller) Royalty(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royalty") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCallerSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCaller) RoyaltyInfo(opts *bind.CallOpts, tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royaltyInfo", tokenId, salePrice) - - if err != nil { - return *new(common.Address), *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return out0, out1, err - -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCallerSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCallerSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURI", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURIFallback(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURIFallback", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCaller) Total(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "total") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCallerSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCaller) Uri(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uri") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCallerSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCaller) UriFallback(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uriFallback") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCallerSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "approve", to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactor) Freeze(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "freeze") -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactorSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactor) Mint(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mint", amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactorSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactor) MintOwner(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mintOwner", amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactorSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactor) SetAllocation(opts *bind.TransactOpts, allocation_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setAllocation", allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactorSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setApprovalForAll", operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactor) SetMintable(opts *bind.TransactOpts, status_ bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setMintable", status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactorSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactor) SetReceiver(opts *bind.TransactOpts, receiver_ common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setReceiver", receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactorSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactor) SetRoyalty(opts *bind.TransactOpts, royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setRoyalty", royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactorSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactor) SetURI(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURI", uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactor) SetURIFallback(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURIFallback", uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferFrom", from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactorSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// BindingApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Binding contract. -type BindingApprovalIterator struct { - Event *BindingApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApproval represents a Approval event raised by the Binding contract. -type BindingApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*BindingApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingApprovalIterator{contract: _Binding.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *BindingApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseApproval(log types.Log) (*BindingApproval, error) { - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Binding contract. -type BindingApprovalForAllIterator struct { - Event *BindingApprovalForAll // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalForAllIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalForAllIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApprovalForAll represents a ApprovalForAll event raised by the Binding contract. -type BindingApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*BindingApprovalForAllIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &BindingApprovalForAllIterator{contract: _Binding.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil -} - -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *BindingApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) ParseApprovalForAll(log types.Log) (*BindingApprovalForAll, error) { - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingBatchUpdatedIterator is returned from FilterBatchUpdated and is used to iterate over the raw logs and unpacked data for BatchUpdated events raised by the Binding contract. -type BindingBatchUpdatedIterator struct { - Event *BindingBatchUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingBatchUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingBatchUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingBatchUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingBatchUpdated represents a BatchUpdated event raised by the Binding contract. -type BindingBatchUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBatchUpdated is a free log retrieval operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterBatchUpdated(opts *bind.FilterOpts) (*BindingBatchUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return &BindingBatchUpdatedIterator{contract: _Binding.contract, event: "BatchUpdated", logs: logs, sub: sub}, nil -} - -// WatchBatchUpdated is a free log subscription operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchBatchUpdated(opts *bind.WatchOpts, sink chan<- *BindingBatchUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBatchUpdated is a log parse operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseBatchUpdated(log types.Log) (*BindingBatchUpdated, error) { - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMetadataFrozenIterator is returned from FilterMetadataFrozen and is used to iterate over the raw logs and unpacked data for MetadataFrozen events raised by the Binding contract. -type BindingMetadataFrozenIterator struct { - Event *BindingMetadataFrozen // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMetadataFrozenIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMetadataFrozenIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMetadataFrozenIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMetadataFrozen represents a MetadataFrozen event raised by the Binding contract. -type BindingMetadataFrozen struct { - Uri string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMetadataFrozen is a free log retrieval operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) FilterMetadataFrozen(opts *bind.FilterOpts) (*BindingMetadataFrozenIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return &BindingMetadataFrozenIterator{contract: _Binding.contract, event: "MetadataFrozen", logs: logs, sub: sub}, nil -} - -// WatchMetadataFrozen is a free log subscription operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) WatchMetadataFrozen(opts *bind.WatchOpts, sink chan<- *BindingMetadataFrozen) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMetadataFrozen is a log parse operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) ParseMetadataFrozen(log types.Log) (*BindingMetadataFrozen, error) { - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMintableUpdatedIterator is returned from FilterMintableUpdated and is used to iterate over the raw logs and unpacked data for MintableUpdated events raised by the Binding contract. -type BindingMintableUpdatedIterator struct { - Event *BindingMintableUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMintableUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMintableUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMintableUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMintableUpdated represents a MintableUpdated event raised by the Binding contract. -type BindingMintableUpdated struct { - Previous bool - Updated bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintableUpdated is a free log retrieval operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) FilterMintableUpdated(opts *bind.FilterOpts) (*BindingMintableUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return &BindingMintableUpdatedIterator{contract: _Binding.contract, event: "MintableUpdated", logs: logs, sub: sub}, nil -} - -// WatchMintableUpdated is a free log subscription operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) WatchMintableUpdated(opts *bind.WatchOpts, sink chan<- *BindingMintableUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMintableUpdated is a log parse operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) ParseMintableUpdated(log types.Log) (*BindingMintableUpdated, error) { - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Binding contract. -type BindingOwnershipTransferredIterator struct { - Event *BindingOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOwnershipTransferred represents a OwnershipTransferred event raised by the Binding contract. -type BindingOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BindingOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BindingOwnershipTransferredIterator{contract: _Binding.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BindingOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) ParseOwnershipTransferred(log types.Log) (*BindingOwnershipTransferred, error) { - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPriceUpdatedIterator is returned from FilterPriceUpdated and is used to iterate over the raw logs and unpacked data for PriceUpdated events raised by the Binding contract. -type BindingPriceUpdatedIterator struct { - Event *BindingPriceUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPriceUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPriceUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPriceUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPriceUpdated represents a PriceUpdated event raised by the Binding contract. -type BindingPriceUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPriceUpdated is a free log retrieval operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterPriceUpdated(opts *bind.FilterOpts) (*BindingPriceUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return &BindingPriceUpdatedIterator{contract: _Binding.contract, event: "PriceUpdated", logs: logs, sub: sub}, nil -} - -// WatchPriceUpdated is a free log subscription operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchPriceUpdated(opts *bind.WatchOpts, sink chan<- *BindingPriceUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePriceUpdated is a log parse operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParsePriceUpdated(log types.Log) (*BindingPriceUpdated, error) { - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingReceiverUpdatedIterator is returned from FilterReceiverUpdated and is used to iterate over the raw logs and unpacked data for ReceiverUpdated events raised by the Binding contract. -type BindingReceiverUpdatedIterator struct { - Event *BindingReceiverUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingReceiverUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingReceiverUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingReceiverUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingReceiverUpdated represents a ReceiverUpdated event raised by the Binding contract. -type BindingReceiverUpdated struct { - Previous common.Address - Updated common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterReceiverUpdated is a free log retrieval operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) FilterReceiverUpdated(opts *bind.FilterOpts) (*BindingReceiverUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return &BindingReceiverUpdatedIterator{contract: _Binding.contract, event: "ReceiverUpdated", logs: logs, sub: sub}, nil -} - -// WatchReceiverUpdated is a free log subscription operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) WatchReceiverUpdated(opts *bind.WatchOpts, sink chan<- *BindingReceiverUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseReceiverUpdated is a log parse operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) ParseReceiverUpdated(log types.Log) (*BindingReceiverUpdated, error) { - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingRoyaltyUpdatedIterator is returned from FilterRoyaltyUpdated and is used to iterate over the raw logs and unpacked data for RoyaltyUpdated events raised by the Binding contract. -type BindingRoyaltyUpdatedIterator struct { - Event *BindingRoyaltyUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingRoyaltyUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingRoyaltyUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingRoyaltyUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingRoyaltyUpdated represents a RoyaltyUpdated event raised by the Binding contract. -type BindingRoyaltyUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoyaltyUpdated is a free log retrieval operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterRoyaltyUpdated(opts *bind.FilterOpts) (*BindingRoyaltyUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return &BindingRoyaltyUpdatedIterator{contract: _Binding.contract, event: "RoyaltyUpdated", logs: logs, sub: sub}, nil -} - -// WatchRoyaltyUpdated is a free log subscription operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchRoyaltyUpdated(opts *bind.WatchOpts, sink chan<- *BindingRoyaltyUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoyaltyUpdated is a log parse operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseRoyaltyUpdated(log types.Log) (*BindingRoyaltyUpdated, error) { - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Binding contract. -type BindingTransferIterator struct { - Event *BindingTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTransfer represents a Transfer event raised by the Binding contract. -type BindingTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*BindingTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingTransferIterator{contract: _Binding.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *BindingTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseTransfer(log types.Log) (*BindingTransfer, error) { - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriFallbackUpdatedIterator is returned from FilterUriFallbackUpdated and is used to iterate over the raw logs and unpacked data for UriFallbackUpdated events raised by the Binding contract. -type BindingUriFallbackUpdatedIterator struct { - Event *BindingUriFallbackUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriFallbackUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriFallbackUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriFallbackUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriFallbackUpdated represents a UriFallbackUpdated event raised by the Binding contract. -type BindingUriFallbackUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriFallbackUpdated is a free log retrieval operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriFallbackUpdated(opts *bind.FilterOpts) (*BindingUriFallbackUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return &BindingUriFallbackUpdatedIterator{contract: _Binding.contract, event: "UriFallbackUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriFallbackUpdated is a free log subscription operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriFallbackUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriFallbackUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriFallbackUpdated is a log parse operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriFallbackUpdated(log types.Log) (*BindingUriFallbackUpdated, error) { - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriUpdatedIterator is returned from FilterUriUpdated and is used to iterate over the raw logs and unpacked data for UriUpdated events raised by the Binding contract. -type BindingUriUpdatedIterator struct { - Event *BindingUriUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriUpdated represents a UriUpdated event raised by the Binding contract. -type BindingUriUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriUpdated is a free log retrieval operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriUpdated(opts *bind.FilterOpts) (*BindingUriUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return &BindingUriUpdatedIterator{contract: _Binding.contract, event: "UriUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriUpdated is a free log subscription operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriUpdated is a log parse operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriUpdated(log types.Log) (*BindingUriUpdated, error) { - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/znft/contracts/dstorageerc721pack/binding/dstorageerc721pack.go b/znft/contracts/dstorageerc721pack/binding/dstorageerc721pack.go deleted file mode 100644 index 6fd81685c..000000000 --- a/znft/contracts/dstorageerc721pack/binding/dstorageerc721pack.go +++ /dev/null @@ -1,3731 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"price_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"size_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"BatchUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"ClosedUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"MetadataFrozen\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"previous\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"updated\",\"type\":\"bool\"}],\"name\":\"MintableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"OpenedUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"PackOpened\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"content\",\"type\":\"uint256\"}],\"name\":\"PackRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"PriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"updated\",\"type\":\"address\"}],\"name\":\"ReceiverUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"RoyaltyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriFallbackUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allocation\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"closed\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"contents\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"freeze\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"frozen\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"max\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"opened\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"redeem\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"reveal\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royalty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"allocation_\",\"type\":\"string\"}],\"name\":\"setAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"closed_\",\"type\":\"string\"}],\"name\":\"setClosed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status_\",\"type\":\"bool\"}],\"name\":\"setMintable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"opened_\",\"type\":\"string\"}],\"name\":\"setOpened\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver_\",\"type\":\"address\"}],\"name\":\"setReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"royalty_\",\"type\":\"uint256\"}],\"name\":\"setRoyalty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURIFallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"size\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURIFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"total\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uriFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCaller) Allocation(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "allocation") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCallerSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "balanceOf", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCaller) Batch(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "batch") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCallerSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Closed is a free data retrieval call binding the contract method 0x597e1fb5. -// -// Solidity: function closed() view returns(string) -func (_Binding *BindingCaller) Closed(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "closed") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Closed is a free data retrieval call binding the contract method 0x597e1fb5. -// -// Solidity: function closed() view returns(string) -func (_Binding *BindingSession) Closed() (string, error) { - return _Binding.Contract.Closed(&_Binding.CallOpts) -} - -// Closed is a free data retrieval call binding the contract method 0x597e1fb5. -// -// Solidity: function closed() view returns(string) -func (_Binding *BindingCallerSession) Closed() (string, error) { - return _Binding.Contract.Closed(&_Binding.CallOpts) -} - -// Contents is a free data retrieval call binding the contract method 0xb5ecf912. -// -// Solidity: function contents(uint256 ) view returns(uint256) -func (_Binding *BindingCaller) Contents(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "contents", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Contents is a free data retrieval call binding the contract method 0xb5ecf912. -// -// Solidity: function contents(uint256 ) view returns(uint256) -func (_Binding *BindingSession) Contents(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Contents(&_Binding.CallOpts, arg0) -} - -// Contents is a free data retrieval call binding the contract method 0xb5ecf912. -// -// Solidity: function contents(uint256 ) view returns(uint256) -func (_Binding *BindingCallerSession) Contents(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Contents(&_Binding.CallOpts, arg0) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCaller) Frozen(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "frozen") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCallerSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "getApproved", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "isApprovedForAll", owner, operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCaller) Max(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "max") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCallerSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCaller) Mintable(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "mintable") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCallerSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCallerSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Opened is a free data retrieval call binding the contract method 0x5f88eade. -// -// Solidity: function opened() view returns(string) -func (_Binding *BindingCaller) Opened(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "opened") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Opened is a free data retrieval call binding the contract method 0x5f88eade. -// -// Solidity: function opened() view returns(string) -func (_Binding *BindingSession) Opened() (string, error) { - return _Binding.Contract.Opened(&_Binding.CallOpts) -} - -// Opened is a free data retrieval call binding the contract method 0x5f88eade. -// -// Solidity: function opened() view returns(string) -func (_Binding *BindingCallerSession) Opened() (string, error) { - return _Binding.Contract.Opened(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCallerSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "ownerOf", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCaller) Price(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "price") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCallerSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCaller) Receiver(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "receiver") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCallerSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCaller) Royalty(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royalty") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCallerSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCaller) RoyaltyInfo(opts *bind.CallOpts, tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royaltyInfo", tokenId, salePrice) - - if err != nil { - return *new(common.Address), *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return out0, out1, err - -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCallerSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// Size is a free data retrieval call binding the contract method 0x949d225d. -// -// Solidity: function size() view returns(uint256) -func (_Binding *BindingCaller) Size(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "size") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Size is a free data retrieval call binding the contract method 0x949d225d. -// -// Solidity: function size() view returns(uint256) -func (_Binding *BindingSession) Size() (*big.Int, error) { - return _Binding.Contract.Size(&_Binding.CallOpts) -} - -// Size is a free data retrieval call binding the contract method 0x949d225d. -// -// Solidity: function size() view returns(uint256) -func (_Binding *BindingCallerSession) Size() (*big.Int, error) { - return _Binding.Contract.Size(&_Binding.CallOpts) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCallerSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// Token is a free data retrieval call binding the contract method 0xfc0c546a. -// -// Solidity: function token() view returns(address) -func (_Binding *BindingCaller) Token(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "token") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Token is a free data retrieval call binding the contract method 0xfc0c546a. -// -// Solidity: function token() view returns(address) -func (_Binding *BindingSession) Token() (common.Address, error) { - return _Binding.Contract.Token(&_Binding.CallOpts) -} - -// Token is a free data retrieval call binding the contract method 0xfc0c546a. -// -// Solidity: function token() view returns(address) -func (_Binding *BindingCallerSession) Token() (common.Address, error) { - return _Binding.Contract.Token(&_Binding.CallOpts) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURI", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURIFallback(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURIFallback", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCaller) Total(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "total") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCallerSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCaller) Uri(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uri") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCallerSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCaller) UriFallback(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uriFallback") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCallerSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "approve", to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactor) Freeze(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "freeze") -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactorSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactor) Mint(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mint", amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactorSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactor) MintOwner(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mintOwner", amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactorSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. -// -// Solidity: function redeem(uint256 tokenId) returns() -func (_Binding *BindingTransactor) Redeem(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "redeem", tokenId) -} - -// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. -// -// Solidity: function redeem(uint256 tokenId) returns() -func (_Binding *BindingSession) Redeem(tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Redeem(&_Binding.TransactOpts, tokenId) -} - -// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. -// -// Solidity: function redeem(uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) Redeem(tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Redeem(&_Binding.TransactOpts, tokenId) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// Reveal is a paid mutator transaction binding the contract method 0xc2ca0ac5. -// -// Solidity: function reveal(uint256 tokenId) returns(bytes32) -func (_Binding *BindingTransactor) Reveal(opts *bind.TransactOpts, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "reveal", tokenId) -} - -// Reveal is a paid mutator transaction binding the contract method 0xc2ca0ac5. -// -// Solidity: function reveal(uint256 tokenId) returns(bytes32) -func (_Binding *BindingSession) Reveal(tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Reveal(&_Binding.TransactOpts, tokenId) -} - -// Reveal is a paid mutator transaction binding the contract method 0xc2ca0ac5. -// -// Solidity: function reveal(uint256 tokenId) returns(bytes32) -func (_Binding *BindingTransactorSession) Reveal(tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Reveal(&_Binding.TransactOpts, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactor) SetAllocation(opts *bind.TransactOpts, allocation_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setAllocation", allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactorSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setApprovalForAll", operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetClosed is a paid mutator transaction binding the contract method 0x2b079e9c. -// -// Solidity: function setClosed(string closed_) returns() -func (_Binding *BindingTransactor) SetClosed(opts *bind.TransactOpts, closed_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setClosed", closed_) -} - -// SetClosed is a paid mutator transaction binding the contract method 0x2b079e9c. -// -// Solidity: function setClosed(string closed_) returns() -func (_Binding *BindingSession) SetClosed(closed_ string) (*types.Transaction, error) { - return _Binding.Contract.SetClosed(&_Binding.TransactOpts, closed_) -} - -// SetClosed is a paid mutator transaction binding the contract method 0x2b079e9c. -// -// Solidity: function setClosed(string closed_) returns() -func (_Binding *BindingTransactorSession) SetClosed(closed_ string) (*types.Transaction, error) { - return _Binding.Contract.SetClosed(&_Binding.TransactOpts, closed_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactor) SetMintable(opts *bind.TransactOpts, status_ bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setMintable", status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactorSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetOpened is a paid mutator transaction binding the contract method 0x8967032b. -// -// Solidity: function setOpened(string opened_) returns() -func (_Binding *BindingTransactor) SetOpened(opts *bind.TransactOpts, opened_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setOpened", opened_) -} - -// SetOpened is a paid mutator transaction binding the contract method 0x8967032b. -// -// Solidity: function setOpened(string opened_) returns() -func (_Binding *BindingSession) SetOpened(opened_ string) (*types.Transaction, error) { - return _Binding.Contract.SetOpened(&_Binding.TransactOpts, opened_) -} - -// SetOpened is a paid mutator transaction binding the contract method 0x8967032b. -// -// Solidity: function setOpened(string opened_) returns() -func (_Binding *BindingTransactorSession) SetOpened(opened_ string) (*types.Transaction, error) { - return _Binding.Contract.SetOpened(&_Binding.TransactOpts, opened_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactor) SetReceiver(opts *bind.TransactOpts, receiver_ common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setReceiver", receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactorSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactor) SetRoyalty(opts *bind.TransactOpts, royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setRoyalty", royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactorSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactor) SetURI(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURI", uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactor) SetURIFallback(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURIFallback", uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferFrom", from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactorSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// BindingApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Binding contract. -type BindingApprovalIterator struct { - Event *BindingApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApproval represents a Approval event raised by the Binding contract. -type BindingApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*BindingApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingApprovalIterator{contract: _Binding.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *BindingApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseApproval(log types.Log) (*BindingApproval, error) { - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Binding contract. -type BindingApprovalForAllIterator struct { - Event *BindingApprovalForAll // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalForAllIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalForAllIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApprovalForAll represents a ApprovalForAll event raised by the Binding contract. -type BindingApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*BindingApprovalForAllIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &BindingApprovalForAllIterator{contract: _Binding.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil -} - -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *BindingApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) ParseApprovalForAll(log types.Log) (*BindingApprovalForAll, error) { - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingBatchUpdatedIterator is returned from FilterBatchUpdated and is used to iterate over the raw logs and unpacked data for BatchUpdated events raised by the Binding contract. -type BindingBatchUpdatedIterator struct { - Event *BindingBatchUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingBatchUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingBatchUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingBatchUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingBatchUpdated represents a BatchUpdated event raised by the Binding contract. -type BindingBatchUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBatchUpdated is a free log retrieval operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterBatchUpdated(opts *bind.FilterOpts) (*BindingBatchUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return &BindingBatchUpdatedIterator{contract: _Binding.contract, event: "BatchUpdated", logs: logs, sub: sub}, nil -} - -// WatchBatchUpdated is a free log subscription operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchBatchUpdated(opts *bind.WatchOpts, sink chan<- *BindingBatchUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBatchUpdated is a log parse operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseBatchUpdated(log types.Log) (*BindingBatchUpdated, error) { - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingClosedUpdatedIterator is returned from FilterClosedUpdated and is used to iterate over the raw logs and unpacked data for ClosedUpdated events raised by the Binding contract. -type BindingClosedUpdatedIterator struct { - Event *BindingClosedUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingClosedUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingClosedUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingClosedUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingClosedUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingClosedUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingClosedUpdated represents a ClosedUpdated event raised by the Binding contract. -type BindingClosedUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterClosedUpdated is a free log retrieval operation binding the contract event 0xe522ca01e98dcc00c0c8fbb3f248b612670c83507d33b0e30f7cb683ee21a3eb. -// -// Solidity: event ClosedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterClosedUpdated(opts *bind.FilterOpts) (*BindingClosedUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ClosedUpdated") - if err != nil { - return nil, err - } - return &BindingClosedUpdatedIterator{contract: _Binding.contract, event: "ClosedUpdated", logs: logs, sub: sub}, nil -} - -// WatchClosedUpdated is a free log subscription operation binding the contract event 0xe522ca01e98dcc00c0c8fbb3f248b612670c83507d33b0e30f7cb683ee21a3eb. -// -// Solidity: event ClosedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchClosedUpdated(opts *bind.WatchOpts, sink chan<- *BindingClosedUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ClosedUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingClosedUpdated) - if err := _Binding.contract.UnpackLog(event, "ClosedUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseClosedUpdated is a log parse operation binding the contract event 0xe522ca01e98dcc00c0c8fbb3f248b612670c83507d33b0e30f7cb683ee21a3eb. -// -// Solidity: event ClosedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseClosedUpdated(log types.Log) (*BindingClosedUpdated, error) { - event := new(BindingClosedUpdated) - if err := _Binding.contract.UnpackLog(event, "ClosedUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMetadataFrozenIterator is returned from FilterMetadataFrozen and is used to iterate over the raw logs and unpacked data for MetadataFrozen events raised by the Binding contract. -type BindingMetadataFrozenIterator struct { - Event *BindingMetadataFrozen // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMetadataFrozenIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMetadataFrozenIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMetadataFrozenIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMetadataFrozen represents a MetadataFrozen event raised by the Binding contract. -type BindingMetadataFrozen struct { - Uri string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMetadataFrozen is a free log retrieval operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) FilterMetadataFrozen(opts *bind.FilterOpts) (*BindingMetadataFrozenIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return &BindingMetadataFrozenIterator{contract: _Binding.contract, event: "MetadataFrozen", logs: logs, sub: sub}, nil -} - -// WatchMetadataFrozen is a free log subscription operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) WatchMetadataFrozen(opts *bind.WatchOpts, sink chan<- *BindingMetadataFrozen) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMetadataFrozen is a log parse operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) ParseMetadataFrozen(log types.Log) (*BindingMetadataFrozen, error) { - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMintableUpdatedIterator is returned from FilterMintableUpdated and is used to iterate over the raw logs and unpacked data for MintableUpdated events raised by the Binding contract. -type BindingMintableUpdatedIterator struct { - Event *BindingMintableUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMintableUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMintableUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMintableUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMintableUpdated represents a MintableUpdated event raised by the Binding contract. -type BindingMintableUpdated struct { - Previous bool - Updated bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintableUpdated is a free log retrieval operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) FilterMintableUpdated(opts *bind.FilterOpts) (*BindingMintableUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return &BindingMintableUpdatedIterator{contract: _Binding.contract, event: "MintableUpdated", logs: logs, sub: sub}, nil -} - -// WatchMintableUpdated is a free log subscription operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) WatchMintableUpdated(opts *bind.WatchOpts, sink chan<- *BindingMintableUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMintableUpdated is a log parse operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) ParseMintableUpdated(log types.Log) (*BindingMintableUpdated, error) { - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOpenedUpdatedIterator is returned from FilterOpenedUpdated and is used to iterate over the raw logs and unpacked data for OpenedUpdated events raised by the Binding contract. -type BindingOpenedUpdatedIterator struct { - Event *BindingOpenedUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOpenedUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOpenedUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOpenedUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOpenedUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOpenedUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOpenedUpdated represents a OpenedUpdated event raised by the Binding contract. -type BindingOpenedUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOpenedUpdated is a free log retrieval operation binding the contract event 0x26d3ff72bc1fe742dadc405289d851bbaf16c9efcaabfd1e911dd66022097308. -// -// Solidity: event OpenedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterOpenedUpdated(opts *bind.FilterOpts) (*BindingOpenedUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OpenedUpdated") - if err != nil { - return nil, err - } - return &BindingOpenedUpdatedIterator{contract: _Binding.contract, event: "OpenedUpdated", logs: logs, sub: sub}, nil -} - -// WatchOpenedUpdated is a free log subscription operation binding the contract event 0x26d3ff72bc1fe742dadc405289d851bbaf16c9efcaabfd1e911dd66022097308. -// -// Solidity: event OpenedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchOpenedUpdated(opts *bind.WatchOpts, sink chan<- *BindingOpenedUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OpenedUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOpenedUpdated) - if err := _Binding.contract.UnpackLog(event, "OpenedUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOpenedUpdated is a log parse operation binding the contract event 0x26d3ff72bc1fe742dadc405289d851bbaf16c9efcaabfd1e911dd66022097308. -// -// Solidity: event OpenedUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseOpenedUpdated(log types.Log) (*BindingOpenedUpdated, error) { - event := new(BindingOpenedUpdated) - if err := _Binding.contract.UnpackLog(event, "OpenedUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Binding contract. -type BindingOwnershipTransferredIterator struct { - Event *BindingOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOwnershipTransferred represents a OwnershipTransferred event raised by the Binding contract. -type BindingOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BindingOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BindingOwnershipTransferredIterator{contract: _Binding.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BindingOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) ParseOwnershipTransferred(log types.Log) (*BindingOwnershipTransferred, error) { - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPackOpenedIterator is returned from FilterPackOpened and is used to iterate over the raw logs and unpacked data for PackOpened events raised by the Binding contract. -type BindingPackOpenedIterator struct { - Event *BindingPackOpened // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPackOpenedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPackOpened) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPackOpened) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPackOpenedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPackOpenedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPackOpened represents a PackOpened event raised by the Binding contract. -type BindingPackOpened struct { - User common.Address - RequestId [32]byte - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPackOpened is a free log retrieval operation binding the contract event 0x5b8ff795b38bcf217c82aab5e970dbee75f066d71d5279afe50e56e0352be74f. -// -// Solidity: event PackOpened(address indexed user, bytes32 requestId, uint256 tokenId) -func (_Binding *BindingFilterer) FilterPackOpened(opts *bind.FilterOpts, user []common.Address) (*BindingPackOpenedIterator, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PackOpened", userRule) - if err != nil { - return nil, err - } - return &BindingPackOpenedIterator{contract: _Binding.contract, event: "PackOpened", logs: logs, sub: sub}, nil -} - -// WatchPackOpened is a free log subscription operation binding the contract event 0x5b8ff795b38bcf217c82aab5e970dbee75f066d71d5279afe50e56e0352be74f. -// -// Solidity: event PackOpened(address indexed user, bytes32 requestId, uint256 tokenId) -func (_Binding *BindingFilterer) WatchPackOpened(opts *bind.WatchOpts, sink chan<- *BindingPackOpened, user []common.Address) (event.Subscription, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PackOpened", userRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPackOpened) - if err := _Binding.contract.UnpackLog(event, "PackOpened", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePackOpened is a log parse operation binding the contract event 0x5b8ff795b38bcf217c82aab5e970dbee75f066d71d5279afe50e56e0352be74f. -// -// Solidity: event PackOpened(address indexed user, bytes32 requestId, uint256 tokenId) -func (_Binding *BindingFilterer) ParsePackOpened(log types.Log) (*BindingPackOpened, error) { - event := new(BindingPackOpened) - if err := _Binding.contract.UnpackLog(event, "PackOpened", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPackRedeemedIterator is returned from FilterPackRedeemed and is used to iterate over the raw logs and unpacked data for PackRedeemed events raised by the Binding contract. -type BindingPackRedeemedIterator struct { - Event *BindingPackRedeemed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPackRedeemedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPackRedeemed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPackRedeemed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPackRedeemedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPackRedeemedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPackRedeemed represents a PackRedeemed event raised by the Binding contract. -type BindingPackRedeemed struct { - User common.Address - TokenId *big.Int - Content *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPackRedeemed is a free log retrieval operation binding the contract event 0x3bfe8a64824b40e960c91dcea2b5ec9b8eca227bf9406456b954ef3aeb3506c1. -// -// Solidity: event PackRedeemed(address indexed user, uint256 tokenId, uint256 content) -func (_Binding *BindingFilterer) FilterPackRedeemed(opts *bind.FilterOpts, user []common.Address) (*BindingPackRedeemedIterator, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PackRedeemed", userRule) - if err != nil { - return nil, err - } - return &BindingPackRedeemedIterator{contract: _Binding.contract, event: "PackRedeemed", logs: logs, sub: sub}, nil -} - -// WatchPackRedeemed is a free log subscription operation binding the contract event 0x3bfe8a64824b40e960c91dcea2b5ec9b8eca227bf9406456b954ef3aeb3506c1. -// -// Solidity: event PackRedeemed(address indexed user, uint256 tokenId, uint256 content) -func (_Binding *BindingFilterer) WatchPackRedeemed(opts *bind.WatchOpts, sink chan<- *BindingPackRedeemed, user []common.Address) (event.Subscription, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PackRedeemed", userRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPackRedeemed) - if err := _Binding.contract.UnpackLog(event, "PackRedeemed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePackRedeemed is a log parse operation binding the contract event 0x3bfe8a64824b40e960c91dcea2b5ec9b8eca227bf9406456b954ef3aeb3506c1. -// -// Solidity: event PackRedeemed(address indexed user, uint256 tokenId, uint256 content) -func (_Binding *BindingFilterer) ParsePackRedeemed(log types.Log) (*BindingPackRedeemed, error) { - event := new(BindingPackRedeemed) - if err := _Binding.contract.UnpackLog(event, "PackRedeemed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPriceUpdatedIterator is returned from FilterPriceUpdated and is used to iterate over the raw logs and unpacked data for PriceUpdated events raised by the Binding contract. -type BindingPriceUpdatedIterator struct { - Event *BindingPriceUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPriceUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPriceUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPriceUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPriceUpdated represents a PriceUpdated event raised by the Binding contract. -type BindingPriceUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPriceUpdated is a free log retrieval operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterPriceUpdated(opts *bind.FilterOpts) (*BindingPriceUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return &BindingPriceUpdatedIterator{contract: _Binding.contract, event: "PriceUpdated", logs: logs, sub: sub}, nil -} - -// WatchPriceUpdated is a free log subscription operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchPriceUpdated(opts *bind.WatchOpts, sink chan<- *BindingPriceUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePriceUpdated is a log parse operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParsePriceUpdated(log types.Log) (*BindingPriceUpdated, error) { - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingReceiverUpdatedIterator is returned from FilterReceiverUpdated and is used to iterate over the raw logs and unpacked data for ReceiverUpdated events raised by the Binding contract. -type BindingReceiverUpdatedIterator struct { - Event *BindingReceiverUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingReceiverUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingReceiverUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingReceiverUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingReceiverUpdated represents a ReceiverUpdated event raised by the Binding contract. -type BindingReceiverUpdated struct { - Previous common.Address - Updated common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterReceiverUpdated is a free log retrieval operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) FilterReceiverUpdated(opts *bind.FilterOpts) (*BindingReceiverUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return &BindingReceiverUpdatedIterator{contract: _Binding.contract, event: "ReceiverUpdated", logs: logs, sub: sub}, nil -} - -// WatchReceiverUpdated is a free log subscription operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) WatchReceiverUpdated(opts *bind.WatchOpts, sink chan<- *BindingReceiverUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseReceiverUpdated is a log parse operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) ParseReceiverUpdated(log types.Log) (*BindingReceiverUpdated, error) { - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingRoyaltyUpdatedIterator is returned from FilterRoyaltyUpdated and is used to iterate over the raw logs and unpacked data for RoyaltyUpdated events raised by the Binding contract. -type BindingRoyaltyUpdatedIterator struct { - Event *BindingRoyaltyUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingRoyaltyUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingRoyaltyUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingRoyaltyUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingRoyaltyUpdated represents a RoyaltyUpdated event raised by the Binding contract. -type BindingRoyaltyUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoyaltyUpdated is a free log retrieval operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterRoyaltyUpdated(opts *bind.FilterOpts) (*BindingRoyaltyUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return &BindingRoyaltyUpdatedIterator{contract: _Binding.contract, event: "RoyaltyUpdated", logs: logs, sub: sub}, nil -} - -// WatchRoyaltyUpdated is a free log subscription operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchRoyaltyUpdated(opts *bind.WatchOpts, sink chan<- *BindingRoyaltyUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoyaltyUpdated is a log parse operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseRoyaltyUpdated(log types.Log) (*BindingRoyaltyUpdated, error) { - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Binding contract. -type BindingTransferIterator struct { - Event *BindingTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTransfer represents a Transfer event raised by the Binding contract. -type BindingTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*BindingTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingTransferIterator{contract: _Binding.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *BindingTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseTransfer(log types.Log) (*BindingTransfer, error) { - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriFallbackUpdatedIterator is returned from FilterUriFallbackUpdated and is used to iterate over the raw logs and unpacked data for UriFallbackUpdated events raised by the Binding contract. -type BindingUriFallbackUpdatedIterator struct { - Event *BindingUriFallbackUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriFallbackUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriFallbackUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriFallbackUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriFallbackUpdated represents a UriFallbackUpdated event raised by the Binding contract. -type BindingUriFallbackUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriFallbackUpdated is a free log retrieval operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriFallbackUpdated(opts *bind.FilterOpts) (*BindingUriFallbackUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return &BindingUriFallbackUpdatedIterator{contract: _Binding.contract, event: "UriFallbackUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriFallbackUpdated is a free log subscription operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriFallbackUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriFallbackUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriFallbackUpdated is a log parse operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriFallbackUpdated(log types.Log) (*BindingUriFallbackUpdated, error) { - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriUpdatedIterator is returned from FilterUriUpdated and is used to iterate over the raw logs and unpacked data for UriUpdated events raised by the Binding contract. -type BindingUriUpdatedIterator struct { - Event *BindingUriUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriUpdated represents a UriUpdated event raised by the Binding contract. -type BindingUriUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriUpdated is a free log retrieval operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriUpdated(opts *bind.FilterOpts) (*BindingUriUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return &BindingUriUpdatedIterator{contract: _Binding.contract, event: "UriUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriUpdated is a free log subscription operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriUpdated is a log parse operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriUpdated(log types.Log) (*BindingUriUpdated, error) { - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/znft/contracts/dstorageerc721random/binding/dstorageerc721random.go b/znft/contracts/dstorageerc721random/binding/dstorageerc721random.go deleted file mode 100644 index 00e3a63ff..000000000 --- a/znft/contracts/dstorageerc721random/binding/dstorageerc721random.go +++ /dev/null @@ -1,3925 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// DStorageERC721RandomVRFConfig is an auto generated low-level Go binding around an user-defined struct. -type DStorageERC721RandomVRFConfig struct { - Coordinator common.Address - Link common.Address - Keyhash [32]byte - Fee *big.Int -} - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch_\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"keyhash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"internalType\":\"structDStorageERC721Random.VRFConfig\",\"name\":\"vrf_\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"BatchUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"HiddenUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"MetadataFrozen\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"previous\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"updated\",\"type\":\"bool\"}],\"name\":\"MintableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"updated\",\"type\":\"address\"}],\"name\":\"PackUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"PriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"updated\",\"type\":\"address\"}],\"name\":\"ReceiverUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"previous\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"updated\",\"type\":\"bool\"}],\"name\":\"RevealableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previous\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updated\",\"type\":\"uint256\"}],\"name\":\"RoyaltyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"tokens\",\"type\":\"uint256[]\"}],\"name\":\"TokenReveal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriFallbackUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"previous\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"updated\",\"type\":\"string\"}],\"name\":\"UriUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"allocation\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"freeze\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"frozen\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hidden\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"max\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"order\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pack\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pending\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"randomness\",\"type\":\"uint256\"}],\"name\":\"rawFulfillRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"receiver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"tokens\",\"type\":\"uint256[]\"}],\"name\":\"reveal\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revealable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revealed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"royalty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"salePrice\",\"type\":\"uint256\"}],\"name\":\"royaltyInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"allocation_\",\"type\":\"string\"}],\"name\":\"setAllocation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"hidden_\",\"type\":\"string\"}],\"name\":\"setHidden\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status_\",\"type\":\"bool\"}],\"name\":\"setMintable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pack_\",\"type\":\"address\"}],\"name\":\"setPack\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver_\",\"type\":\"address\"}],\"name\":\"setReceiver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status_\",\"type\":\"bool\"}],\"name\":\"setRevealable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"royalty_\",\"type\":\"uint256\"}],\"name\":\"setRoyalty\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri_\",\"type\":\"string\"}],\"name\":\"setURIFallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"shuffle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURIFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"total\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"update\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uriFallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vrfFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vrfKeyHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCaller) Allocation(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "allocation") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// Allocation is a free data retrieval call binding the contract method 0x88a17bde. -// -// Solidity: function allocation() view returns(string) -func (_Binding *BindingCallerSession) Allocation() (string, error) { - return _Binding.Contract.Allocation(&_Binding.CallOpts) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "balanceOf", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Binding *BindingCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCaller) Batch(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "batch") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Batch is a free data retrieval call binding the contract method 0xaf713566. -// -// Solidity: function batch() view returns(uint256) -func (_Binding *BindingCallerSession) Batch() (*big.Int, error) { - return _Binding.Contract.Batch(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCaller) Frozen(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "frozen") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// Frozen is a free data retrieval call binding the contract method 0x054f7d9c. -// -// Solidity: function frozen() view returns(bool) -func (_Binding *BindingCallerSession) Frozen() (bool, error) { - return _Binding.Contract.Frozen(&_Binding.CallOpts) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "getApproved", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.GetApproved(&_Binding.CallOpts, tokenId) -} - -// Hidden is a free data retrieval call binding the contract method 0xaef6d4b1. -// -// Solidity: function hidden() view returns(string) -func (_Binding *BindingCaller) Hidden(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "hidden") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Hidden is a free data retrieval call binding the contract method 0xaef6d4b1. -// -// Solidity: function hidden() view returns(string) -func (_Binding *BindingSession) Hidden() (string, error) { - return _Binding.Contract.Hidden(&_Binding.CallOpts) -} - -// Hidden is a free data retrieval call binding the contract method 0xaef6d4b1. -// -// Solidity: function hidden() view returns(string) -func (_Binding *BindingCallerSession) Hidden() (string, error) { - return _Binding.Contract.Hidden(&_Binding.CallOpts) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "isApprovedForAll", owner, operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Binding *BindingCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Binding.Contract.IsApprovedForAll(&_Binding.CallOpts, owner, operator) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCaller) Max(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "max") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Max is a free data retrieval call binding the contract method 0x6ac5db19. -// -// Solidity: function max() view returns(uint256) -func (_Binding *BindingCallerSession) Max() (*big.Int, error) { - return _Binding.Contract.Max(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCaller) Mintable(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "mintable") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Mintable is a free data retrieval call binding the contract method 0x4bf365df. -// -// Solidity: function mintable() view returns(bool) -func (_Binding *BindingCallerSession) Mintable() (bool, error) { - return _Binding.Contract.Mintable(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Binding *BindingCallerSession) Name() (string, error) { - return _Binding.Contract.Name(&_Binding.CallOpts) -} - -// Order is a free data retrieval call binding the contract method 0x21603f43. -// -// Solidity: function order(uint256 ) view returns(uint256) -func (_Binding *BindingCaller) Order(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "order", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Order is a free data retrieval call binding the contract method 0x21603f43. -// -// Solidity: function order(uint256 ) view returns(uint256) -func (_Binding *BindingSession) Order(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Order(&_Binding.CallOpts, arg0) -} - -// Order is a free data retrieval call binding the contract method 0x21603f43. -// -// Solidity: function order(uint256 ) view returns(uint256) -func (_Binding *BindingCallerSession) Order(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Order(&_Binding.CallOpts, arg0) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCallerSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "ownerOf", tokenId) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Binding *BindingCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Binding.Contract.OwnerOf(&_Binding.CallOpts, tokenId) -} - -// Pack is a free data retrieval call binding the contract method 0xef082838. -// -// Solidity: function pack() view returns(address) -func (_Binding *BindingCaller) Pack(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "pack") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Pack is a free data retrieval call binding the contract method 0xef082838. -// -// Solidity: function pack() view returns(address) -func (_Binding *BindingSession) Pack() (common.Address, error) { - return _Binding.Contract.Pack(&_Binding.CallOpts) -} - -// Pack is a free data retrieval call binding the contract method 0xef082838. -// -// Solidity: function pack() view returns(address) -func (_Binding *BindingCallerSession) Pack() (common.Address, error) { - return _Binding.Contract.Pack(&_Binding.CallOpts) -} - -// Pending is a free data retrieval call binding the contract method 0xe20ccec3. -// -// Solidity: function pending() view returns(uint256) -func (_Binding *BindingCaller) Pending(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "pending") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Pending is a free data retrieval call binding the contract method 0xe20ccec3. -// -// Solidity: function pending() view returns(uint256) -func (_Binding *BindingSession) Pending() (*big.Int, error) { - return _Binding.Contract.Pending(&_Binding.CallOpts) -} - -// Pending is a free data retrieval call binding the contract method 0xe20ccec3. -// -// Solidity: function pending() view returns(uint256) -func (_Binding *BindingCallerSession) Pending() (*big.Int, error) { - return _Binding.Contract.Pending(&_Binding.CallOpts) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCaller) Price(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "price") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Price is a free data retrieval call binding the contract method 0xa035b1fe. -// -// Solidity: function price() view returns(uint256) -func (_Binding *BindingCallerSession) Price() (*big.Int, error) { - return _Binding.Contract.Price(&_Binding.CallOpts) -} - -// Randomness is a free data retrieval call binding the contract method 0x36013189. -// -// Solidity: function randomness() view returns(uint256) -func (_Binding *BindingCaller) Randomness(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "randomness") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Randomness is a free data retrieval call binding the contract method 0x36013189. -// -// Solidity: function randomness() view returns(uint256) -func (_Binding *BindingSession) Randomness() (*big.Int, error) { - return _Binding.Contract.Randomness(&_Binding.CallOpts) -} - -// Randomness is a free data retrieval call binding the contract method 0x36013189. -// -// Solidity: function randomness() view returns(uint256) -func (_Binding *BindingCallerSession) Randomness() (*big.Int, error) { - return _Binding.Contract.Randomness(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCaller) Receiver(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "receiver") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Receiver is a free data retrieval call binding the contract method 0xf7260d3e. -// -// Solidity: function receiver() view returns(address) -func (_Binding *BindingCallerSession) Receiver() (common.Address, error) { - return _Binding.Contract.Receiver(&_Binding.CallOpts) -} - -// Revealable is a free data retrieval call binding the contract method 0x03d16985. -// -// Solidity: function revealable() view returns(bool) -func (_Binding *BindingCaller) Revealable(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "revealable") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Revealable is a free data retrieval call binding the contract method 0x03d16985. -// -// Solidity: function revealable() view returns(bool) -func (_Binding *BindingSession) Revealable() (bool, error) { - return _Binding.Contract.Revealable(&_Binding.CallOpts) -} - -// Revealable is a free data retrieval call binding the contract method 0x03d16985. -// -// Solidity: function revealable() view returns(bool) -func (_Binding *BindingCallerSession) Revealable() (bool, error) { - return _Binding.Contract.Revealable(&_Binding.CallOpts) -} - -// Revealed is a free data retrieval call binding the contract method 0x51830227. -// -// Solidity: function revealed() view returns(uint256) -func (_Binding *BindingCaller) Revealed(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "revealed") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Revealed is a free data retrieval call binding the contract method 0x51830227. -// -// Solidity: function revealed() view returns(uint256) -func (_Binding *BindingSession) Revealed() (*big.Int, error) { - return _Binding.Contract.Revealed(&_Binding.CallOpts) -} - -// Revealed is a free data retrieval call binding the contract method 0x51830227. -// -// Solidity: function revealed() view returns(uint256) -func (_Binding *BindingCallerSession) Revealed() (*big.Int, error) { - return _Binding.Contract.Revealed(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCaller) Royalty(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royalty") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// Royalty is a free data retrieval call binding the contract method 0x29ee566c. -// -// Solidity: function royalty() view returns(uint256) -func (_Binding *BindingCallerSession) Royalty() (*big.Int, error) { - return _Binding.Contract.Royalty(&_Binding.CallOpts) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCaller) RoyaltyInfo(opts *bind.CallOpts, tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "royaltyInfo", tokenId, salePrice) - - if err != nil { - return *new(common.Address), *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return out0, out1, err - -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// RoyaltyInfo is a free data retrieval call binding the contract method 0x2a55205a. -// -// Solidity: function royaltyInfo(uint256 tokenId, uint256 salePrice) view returns(address, uint256) -func (_Binding *BindingCallerSession) RoyaltyInfo(tokenId *big.Int, salePrice *big.Int) (common.Address, *big.Int, error) { - return _Binding.Contract.RoyaltyInfo(&_Binding.CallOpts, tokenId, salePrice) -} - -// Shuffle is a free data retrieval call binding the contract method 0xef6537b5. -// -// Solidity: function shuffle(uint256 ) view returns(uint256) -func (_Binding *BindingCaller) Shuffle(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "shuffle", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Shuffle is a free data retrieval call binding the contract method 0xef6537b5. -// -// Solidity: function shuffle(uint256 ) view returns(uint256) -func (_Binding *BindingSession) Shuffle(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Shuffle(&_Binding.CallOpts, arg0) -} - -// Shuffle is a free data retrieval call binding the contract method 0xef6537b5. -// -// Solidity: function shuffle(uint256 ) view returns(uint256) -func (_Binding *BindingCallerSession) Shuffle(arg0 *big.Int) (*big.Int, error) { - return _Binding.Contract.Shuffle(&_Binding.CallOpts, arg0) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Binding *BindingCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Binding.Contract.SupportsInterface(&_Binding.CallOpts, interfaceId) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Binding *BindingCallerSession) Symbol() (string, error) { - return _Binding.Contract.Symbol(&_Binding.CallOpts) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURI", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURI(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURI(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCaller) TokenURIFallback(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenURIFallback", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// TokenURIFallback is a free data retrieval call binding the contract method 0xc7c8f564. -// -// Solidity: function tokenURIFallback(uint256 tokenId) view returns(string) -func (_Binding *BindingCallerSession) TokenURIFallback(tokenId *big.Int) (string, error) { - return _Binding.Contract.TokenURIFallback(&_Binding.CallOpts, tokenId) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCaller) Total(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "total") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Total is a free data retrieval call binding the contract method 0x2ddbd13a. -// -// Solidity: function total() view returns(uint256) -func (_Binding *BindingCallerSession) Total() (*big.Int, error) { - return _Binding.Contract.Total(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCaller) Uri(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uri") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// Uri is a free data retrieval call binding the contract method 0xeac989f8. -// -// Solidity: function uri() view returns(string) -func (_Binding *BindingCallerSession) Uri() (string, error) { - return _Binding.Contract.Uri(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCaller) UriFallback(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "uriFallback") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// UriFallback is a free data retrieval call binding the contract method 0x6dd8e21a. -// -// Solidity: function uriFallback() view returns(string) -func (_Binding *BindingCallerSession) UriFallback() (string, error) { - return _Binding.Contract.UriFallback(&_Binding.CallOpts) -} - -// VrfFee is a free data retrieval call binding the contract method 0x1017507d. -// -// Solidity: function vrfFee() view returns(uint256) -func (_Binding *BindingCaller) VrfFee(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "vrfFee") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// VrfFee is a free data retrieval call binding the contract method 0x1017507d. -// -// Solidity: function vrfFee() view returns(uint256) -func (_Binding *BindingSession) VrfFee() (*big.Int, error) { - return _Binding.Contract.VrfFee(&_Binding.CallOpts) -} - -// VrfFee is a free data retrieval call binding the contract method 0x1017507d. -// -// Solidity: function vrfFee() view returns(uint256) -func (_Binding *BindingCallerSession) VrfFee() (*big.Int, error) { - return _Binding.Contract.VrfFee(&_Binding.CallOpts) -} - -// VrfKeyHash is a free data retrieval call binding the contract method 0x041d443e. -// -// Solidity: function vrfKeyHash() view returns(bytes32) -func (_Binding *BindingCaller) VrfKeyHash(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "vrfKeyHash") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// VrfKeyHash is a free data retrieval call binding the contract method 0x041d443e. -// -// Solidity: function vrfKeyHash() view returns(bytes32) -func (_Binding *BindingSession) VrfKeyHash() ([32]byte, error) { - return _Binding.Contract.VrfKeyHash(&_Binding.CallOpts) -} - -// VrfKeyHash is a free data retrieval call binding the contract method 0x041d443e. -// -// Solidity: function vrfKeyHash() view returns(bytes32) -func (_Binding *BindingCallerSession) VrfKeyHash() ([32]byte, error) { - return _Binding.Contract.VrfKeyHash(&_Binding.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "approve", to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Approve(&_Binding.TransactOpts, to, tokenId) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactor) Freeze(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "freeze") -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Freeze is a paid mutator transaction binding the contract method 0x62a5af3b. -// -// Solidity: function freeze() returns() -func (_Binding *BindingTransactorSession) Freeze() (*types.Transaction, error) { - return _Binding.Contract.Freeze(&_Binding.TransactOpts) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactor) Mint(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mint", amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// Mint is a paid mutator transaction binding the contract method 0xa0712d68. -// -// Solidity: function mint(uint256 amount) payable returns() -func (_Binding *BindingTransactorSession) Mint(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.Mint(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactor) MintOwner(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "mintOwner", amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// MintOwner is a paid mutator transaction binding the contract method 0x33f88d22. -// -// Solidity: function mintOwner(uint256 amount) returns() -func (_Binding *BindingTransactorSession) MintOwner(amount *big.Int) (*types.Transaction, error) { - return _Binding.Contract.MintOwner(&_Binding.TransactOpts, amount) -} - -// RawFulfillRandomness is a paid mutator transaction binding the contract method 0x94985ddd. -// -// Solidity: function rawFulfillRandomness(bytes32 requestId, uint256 randomness) returns() -func (_Binding *BindingTransactor) RawFulfillRandomness(opts *bind.TransactOpts, requestId [32]byte, randomness *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "rawFulfillRandomness", requestId, randomness) -} - -// RawFulfillRandomness is a paid mutator transaction binding the contract method 0x94985ddd. -// -// Solidity: function rawFulfillRandomness(bytes32 requestId, uint256 randomness) returns() -func (_Binding *BindingSession) RawFulfillRandomness(requestId [32]byte, randomness *big.Int) (*types.Transaction, error) { - return _Binding.Contract.RawFulfillRandomness(&_Binding.TransactOpts, requestId, randomness) -} - -// RawFulfillRandomness is a paid mutator transaction binding the contract method 0x94985ddd. -// -// Solidity: function rawFulfillRandomness(bytes32 requestId, uint256 randomness) returns() -func (_Binding *BindingTransactorSession) RawFulfillRandomness(requestId [32]byte, randomness *big.Int) (*types.Transaction, error) { - return _Binding.Contract.RawFulfillRandomness(&_Binding.TransactOpts, requestId, randomness) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// Reveal is a paid mutator transaction binding the contract method 0xb93f208a. -// -// Solidity: function reveal(uint256[] tokens) returns(bytes32) -func (_Binding *BindingTransactor) Reveal(opts *bind.TransactOpts, tokens []*big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "reveal", tokens) -} - -// Reveal is a paid mutator transaction binding the contract method 0xb93f208a. -// -// Solidity: function reveal(uint256[] tokens) returns(bytes32) -func (_Binding *BindingSession) Reveal(tokens []*big.Int) (*types.Transaction, error) { - return _Binding.Contract.Reveal(&_Binding.TransactOpts, tokens) -} - -// Reveal is a paid mutator transaction binding the contract method 0xb93f208a. -// -// Solidity: function reveal(uint256[] tokens) returns(bytes32) -func (_Binding *BindingTransactorSession) Reveal(tokens []*big.Int) (*types.Transaction, error) { - return _Binding.Contract.Reveal(&_Binding.TransactOpts, tokens) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) returns() -func (_Binding *BindingTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, _data []byte) (*types.Transaction, error) { - return _Binding.Contract.SafeTransferFrom0(&_Binding.TransactOpts, from, to, tokenId, _data) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactor) SetAllocation(opts *bind.TransactOpts, allocation_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setAllocation", allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetAllocation is a paid mutator transaction binding the contract method 0x970a1fa8. -// -// Solidity: function setAllocation(string allocation_) returns() -func (_Binding *BindingTransactorSession) SetAllocation(allocation_ string) (*types.Transaction, error) { - return _Binding.Contract.SetAllocation(&_Binding.TransactOpts, allocation_) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setApprovalForAll", operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Binding *BindingTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Binding.Contract.SetApprovalForAll(&_Binding.TransactOpts, operator, approved) -} - -// SetHidden is a paid mutator transaction binding the contract method 0xd309aa2c. -// -// Solidity: function setHidden(string hidden_) returns() -func (_Binding *BindingTransactor) SetHidden(opts *bind.TransactOpts, hidden_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setHidden", hidden_) -} - -// SetHidden is a paid mutator transaction binding the contract method 0xd309aa2c. -// -// Solidity: function setHidden(string hidden_) returns() -func (_Binding *BindingSession) SetHidden(hidden_ string) (*types.Transaction, error) { - return _Binding.Contract.SetHidden(&_Binding.TransactOpts, hidden_) -} - -// SetHidden is a paid mutator transaction binding the contract method 0xd309aa2c. -// -// Solidity: function setHidden(string hidden_) returns() -func (_Binding *BindingTransactorSession) SetHidden(hidden_ string) (*types.Transaction, error) { - return _Binding.Contract.SetHidden(&_Binding.TransactOpts, hidden_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactor) SetMintable(opts *bind.TransactOpts, status_ bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setMintable", status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetMintable is a paid mutator transaction binding the contract method 0x285d70d4. -// -// Solidity: function setMintable(bool status_) returns() -func (_Binding *BindingTransactorSession) SetMintable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetMintable(&_Binding.TransactOpts, status_) -} - -// SetPack is a paid mutator transaction binding the contract method 0x353c65c5. -// -// Solidity: function setPack(address pack_) returns() -func (_Binding *BindingTransactor) SetPack(opts *bind.TransactOpts, pack_ common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setPack", pack_) -} - -// SetPack is a paid mutator transaction binding the contract method 0x353c65c5. -// -// Solidity: function setPack(address pack_) returns() -func (_Binding *BindingSession) SetPack(pack_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetPack(&_Binding.TransactOpts, pack_) -} - -// SetPack is a paid mutator transaction binding the contract method 0x353c65c5. -// -// Solidity: function setPack(address pack_) returns() -func (_Binding *BindingTransactorSession) SetPack(pack_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetPack(&_Binding.TransactOpts, pack_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactor) SetReceiver(opts *bind.TransactOpts, receiver_ common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setReceiver", receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetReceiver is a paid mutator transaction binding the contract method 0x718da7ee. -// -// Solidity: function setReceiver(address receiver_) returns() -func (_Binding *BindingTransactorSession) SetReceiver(receiver_ common.Address) (*types.Transaction, error) { - return _Binding.Contract.SetReceiver(&_Binding.TransactOpts, receiver_) -} - -// SetRevealable is a paid mutator transaction binding the contract method 0xb06194d3. -// -// Solidity: function setRevealable(bool status_) returns() -func (_Binding *BindingTransactor) SetRevealable(opts *bind.TransactOpts, status_ bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setRevealable", status_) -} - -// SetRevealable is a paid mutator transaction binding the contract method 0xb06194d3. -// -// Solidity: function setRevealable(bool status_) returns() -func (_Binding *BindingSession) SetRevealable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetRevealable(&_Binding.TransactOpts, status_) -} - -// SetRevealable is a paid mutator transaction binding the contract method 0xb06194d3. -// -// Solidity: function setRevealable(bool status_) returns() -func (_Binding *BindingTransactorSession) SetRevealable(status_ bool) (*types.Transaction, error) { - return _Binding.Contract.SetRevealable(&_Binding.TransactOpts, status_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactor) SetRoyalty(opts *bind.TransactOpts, royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setRoyalty", royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetRoyalty is a paid mutator transaction binding the contract method 0x4209a2e1. -// -// Solidity: function setRoyalty(uint256 royalty_) returns() -func (_Binding *BindingTransactorSession) SetRoyalty(royalty_ *big.Int) (*types.Transaction, error) { - return _Binding.Contract.SetRoyalty(&_Binding.TransactOpts, royalty_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactor) SetURI(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURI", uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURI is a paid mutator transaction binding the contract method 0x02fe5305. -// -// Solidity: function setURI(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURI(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURI(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactor) SetURIFallback(opts *bind.TransactOpts, uri_ string) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "setURIFallback", uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// SetURIFallback is a paid mutator transaction binding the contract method 0x0c8ab6e1. -// -// Solidity: function setURIFallback(string uri_) returns() -func (_Binding *BindingTransactorSession) SetURIFallback(uri_ string) (*types.Transaction, error) { - return _Binding.Contract.SetURIFallback(&_Binding.TransactOpts, uri_) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferFrom", from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Binding *BindingTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Binding.Contract.TransferFrom(&_Binding.TransactOpts, from, to, tokenId) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// Update is a paid mutator transaction binding the contract method 0xa2e62045. -// -// Solidity: function update() returns() -func (_Binding *BindingTransactor) Update(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "update") -} - -// Update is a paid mutator transaction binding the contract method 0xa2e62045. -// -// Solidity: function update() returns() -func (_Binding *BindingSession) Update() (*types.Transaction, error) { - return _Binding.Contract.Update(&_Binding.TransactOpts) -} - -// Update is a paid mutator transaction binding the contract method 0xa2e62045. -// -// Solidity: function update() returns() -func (_Binding *BindingTransactorSession) Update() (*types.Transaction, error) { - return _Binding.Contract.Update(&_Binding.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_Binding *BindingTransactorSession) Withdraw() (*types.Transaction, error) { - return _Binding.Contract.Withdraw(&_Binding.TransactOpts) -} - -// BindingApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Binding contract. -type BindingApprovalIterator struct { - Event *BindingApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApproval represents a Approval event raised by the Binding contract. -type BindingApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*BindingApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingApprovalIterator{contract: _Binding.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *BindingApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseApproval(log types.Log) (*BindingApproval, error) { - event := new(BindingApproval) - if err := _Binding.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Binding contract. -type BindingApprovalForAllIterator struct { - Event *BindingApprovalForAll // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingApprovalForAllIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingApprovalForAll) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingApprovalForAllIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingApprovalForAll represents a ApprovalForAll event raised by the Binding contract. -type BindingApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*BindingApprovalForAllIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &BindingApprovalForAllIterator{contract: _Binding.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil -} - -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *BindingApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. -// -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Binding *BindingFilterer) ParseApprovalForAll(log types.Log) (*BindingApprovalForAll, error) { - event := new(BindingApprovalForAll) - if err := _Binding.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingBatchUpdatedIterator is returned from FilterBatchUpdated and is used to iterate over the raw logs and unpacked data for BatchUpdated events raised by the Binding contract. -type BindingBatchUpdatedIterator struct { - Event *BindingBatchUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingBatchUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingBatchUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingBatchUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingBatchUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingBatchUpdated represents a BatchUpdated event raised by the Binding contract. -type BindingBatchUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBatchUpdated is a free log retrieval operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterBatchUpdated(opts *bind.FilterOpts) (*BindingBatchUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return &BindingBatchUpdatedIterator{contract: _Binding.contract, event: "BatchUpdated", logs: logs, sub: sub}, nil -} - -// WatchBatchUpdated is a free log subscription operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchBatchUpdated(opts *bind.WatchOpts, sink chan<- *BindingBatchUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "BatchUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBatchUpdated is a log parse operation binding the contract event 0x656359bd8624a98c9559c454e7835a5e93f0867eacab61bfda9d2d0fce4e3097. -// -// Solidity: event BatchUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseBatchUpdated(log types.Log) (*BindingBatchUpdated, error) { - event := new(BindingBatchUpdated) - if err := _Binding.contract.UnpackLog(event, "BatchUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingHiddenUpdatedIterator is returned from FilterHiddenUpdated and is used to iterate over the raw logs and unpacked data for HiddenUpdated events raised by the Binding contract. -type BindingHiddenUpdatedIterator struct { - Event *BindingHiddenUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingHiddenUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingHiddenUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingHiddenUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingHiddenUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingHiddenUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingHiddenUpdated represents a HiddenUpdated event raised by the Binding contract. -type BindingHiddenUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHiddenUpdated is a free log retrieval operation binding the contract event 0x57189fe32dda35d8b092ccd5a7d65eeecb46be25ce11a28ad02b5b0d3f662505. -// -// Solidity: event HiddenUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterHiddenUpdated(opts *bind.FilterOpts) (*BindingHiddenUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "HiddenUpdated") - if err != nil { - return nil, err - } - return &BindingHiddenUpdatedIterator{contract: _Binding.contract, event: "HiddenUpdated", logs: logs, sub: sub}, nil -} - -// WatchHiddenUpdated is a free log subscription operation binding the contract event 0x57189fe32dda35d8b092ccd5a7d65eeecb46be25ce11a28ad02b5b0d3f662505. -// -// Solidity: event HiddenUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchHiddenUpdated(opts *bind.WatchOpts, sink chan<- *BindingHiddenUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "HiddenUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingHiddenUpdated) - if err := _Binding.contract.UnpackLog(event, "HiddenUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHiddenUpdated is a log parse operation binding the contract event 0x57189fe32dda35d8b092ccd5a7d65eeecb46be25ce11a28ad02b5b0d3f662505. -// -// Solidity: event HiddenUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseHiddenUpdated(log types.Log) (*BindingHiddenUpdated, error) { - event := new(BindingHiddenUpdated) - if err := _Binding.contract.UnpackLog(event, "HiddenUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMetadataFrozenIterator is returned from FilterMetadataFrozen and is used to iterate over the raw logs and unpacked data for MetadataFrozen events raised by the Binding contract. -type BindingMetadataFrozenIterator struct { - Event *BindingMetadataFrozen // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMetadataFrozenIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMetadataFrozen) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMetadataFrozenIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMetadataFrozenIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMetadataFrozen represents a MetadataFrozen event raised by the Binding contract. -type BindingMetadataFrozen struct { - Uri string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMetadataFrozen is a free log retrieval operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) FilterMetadataFrozen(opts *bind.FilterOpts) (*BindingMetadataFrozenIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return &BindingMetadataFrozenIterator{contract: _Binding.contract, event: "MetadataFrozen", logs: logs, sub: sub}, nil -} - -// WatchMetadataFrozen is a free log subscription operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) WatchMetadataFrozen(opts *bind.WatchOpts, sink chan<- *BindingMetadataFrozen) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MetadataFrozen") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMetadataFrozen is a log parse operation binding the contract event 0xac32328134cd103aa01cccc8f61d479f9613e7f9c1de6bfc70c78412b15c18e3. -// -// Solidity: event MetadataFrozen(string uri) -func (_Binding *BindingFilterer) ParseMetadataFrozen(log types.Log) (*BindingMetadataFrozen, error) { - event := new(BindingMetadataFrozen) - if err := _Binding.contract.UnpackLog(event, "MetadataFrozen", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingMintableUpdatedIterator is returned from FilterMintableUpdated and is used to iterate over the raw logs and unpacked data for MintableUpdated events raised by the Binding contract. -type BindingMintableUpdatedIterator struct { - Event *BindingMintableUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingMintableUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingMintableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingMintableUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingMintableUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingMintableUpdated represents a MintableUpdated event raised by the Binding contract. -type BindingMintableUpdated struct { - Previous bool - Updated bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMintableUpdated is a free log retrieval operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) FilterMintableUpdated(opts *bind.FilterOpts) (*BindingMintableUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return &BindingMintableUpdatedIterator{contract: _Binding.contract, event: "MintableUpdated", logs: logs, sub: sub}, nil -} - -// WatchMintableUpdated is a free log subscription operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) WatchMintableUpdated(opts *bind.WatchOpts, sink chan<- *BindingMintableUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "MintableUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseMintableUpdated is a log parse operation binding the contract event 0x8d9383d773c0600295154578f39da3106938ba8d1fe1767bcfabe8bf05f555f4. -// -// Solidity: event MintableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) ParseMintableUpdated(log types.Log) (*BindingMintableUpdated, error) { - event := new(BindingMintableUpdated) - if err := _Binding.contract.UnpackLog(event, "MintableUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Binding contract. -type BindingOwnershipTransferredIterator struct { - Event *BindingOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOwnershipTransferred represents a OwnershipTransferred event raised by the Binding contract. -type BindingOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BindingOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BindingOwnershipTransferredIterator{contract: _Binding.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BindingOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) ParseOwnershipTransferred(log types.Log) (*BindingOwnershipTransferred, error) { - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPackUpdatedIterator is returned from FilterPackUpdated and is used to iterate over the raw logs and unpacked data for PackUpdated events raised by the Binding contract. -type BindingPackUpdatedIterator struct { - Event *BindingPackUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPackUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPackUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPackUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPackUpdated represents a PackUpdated event raised by the Binding contract. -type BindingPackUpdated struct { - Previous common.Address - Updated common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPackUpdated is a free log retrieval operation binding the contract event 0x69c956910dd41d384c8eaa85a91003a538ae5d5ceb57ae4e530072e3908b10f4. -// -// Solidity: event PackUpdated(address previous, address updated) -func (_Binding *BindingFilterer) FilterPackUpdated(opts *bind.FilterOpts) (*BindingPackUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PackUpdated") - if err != nil { - return nil, err - } - return &BindingPackUpdatedIterator{contract: _Binding.contract, event: "PackUpdated", logs: logs, sub: sub}, nil -} - -// WatchPackUpdated is a free log subscription operation binding the contract event 0x69c956910dd41d384c8eaa85a91003a538ae5d5ceb57ae4e530072e3908b10f4. -// -// Solidity: event PackUpdated(address previous, address updated) -func (_Binding *BindingFilterer) WatchPackUpdated(opts *bind.WatchOpts, sink chan<- *BindingPackUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PackUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPackUpdated) - if err := _Binding.contract.UnpackLog(event, "PackUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePackUpdated is a log parse operation binding the contract event 0x69c956910dd41d384c8eaa85a91003a538ae5d5ceb57ae4e530072e3908b10f4. -// -// Solidity: event PackUpdated(address previous, address updated) -func (_Binding *BindingFilterer) ParsePackUpdated(log types.Log) (*BindingPackUpdated, error) { - event := new(BindingPackUpdated) - if err := _Binding.contract.UnpackLog(event, "PackUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingPriceUpdatedIterator is returned from FilterPriceUpdated and is used to iterate over the raw logs and unpacked data for PriceUpdated events raised by the Binding contract. -type BindingPriceUpdatedIterator struct { - Event *BindingPriceUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingPriceUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingPriceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingPriceUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingPriceUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingPriceUpdated represents a PriceUpdated event raised by the Binding contract. -type BindingPriceUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPriceUpdated is a free log retrieval operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterPriceUpdated(opts *bind.FilterOpts) (*BindingPriceUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return &BindingPriceUpdatedIterator{contract: _Binding.contract, event: "PriceUpdated", logs: logs, sub: sub}, nil -} - -// WatchPriceUpdated is a free log subscription operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchPriceUpdated(opts *bind.WatchOpts, sink chan<- *BindingPriceUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "PriceUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePriceUpdated is a log parse operation binding the contract event 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838. -// -// Solidity: event PriceUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParsePriceUpdated(log types.Log) (*BindingPriceUpdated, error) { - event := new(BindingPriceUpdated) - if err := _Binding.contract.UnpackLog(event, "PriceUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingReceiverUpdatedIterator is returned from FilterReceiverUpdated and is used to iterate over the raw logs and unpacked data for ReceiverUpdated events raised by the Binding contract. -type BindingReceiverUpdatedIterator struct { - Event *BindingReceiverUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingReceiverUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingReceiverUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingReceiverUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingReceiverUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingReceiverUpdated represents a ReceiverUpdated event raised by the Binding contract. -type BindingReceiverUpdated struct { - Previous common.Address - Updated common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterReceiverUpdated is a free log retrieval operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) FilterReceiverUpdated(opts *bind.FilterOpts) (*BindingReceiverUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return &BindingReceiverUpdatedIterator{contract: _Binding.contract, event: "ReceiverUpdated", logs: logs, sub: sub}, nil -} - -// WatchReceiverUpdated is a free log subscription operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) WatchReceiverUpdated(opts *bind.WatchOpts, sink chan<- *BindingReceiverUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ReceiverUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseReceiverUpdated is a log parse operation binding the contract event 0xbda2bcccbfa5ae883ab7d9f03480ab68fe68e9200c9b52c0c47abc21d2c90ec9. -// -// Solidity: event ReceiverUpdated(address previous, address updated) -func (_Binding *BindingFilterer) ParseReceiverUpdated(log types.Log) (*BindingReceiverUpdated, error) { - event := new(BindingReceiverUpdated) - if err := _Binding.contract.UnpackLog(event, "ReceiverUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingRevealableUpdatedIterator is returned from FilterRevealableUpdated and is used to iterate over the raw logs and unpacked data for RevealableUpdated events raised by the Binding contract. -type BindingRevealableUpdatedIterator struct { - Event *BindingRevealableUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingRevealableUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingRevealableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingRevealableUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingRevealableUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingRevealableUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingRevealableUpdated represents a RevealableUpdated event raised by the Binding contract. -type BindingRevealableUpdated struct { - Previous bool - Updated bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRevealableUpdated is a free log retrieval operation binding the contract event 0x84cc45418127802859711bdf440a92a3a6d3819145166e3f884db8d202aa5ebf. -// -// Solidity: event RevealableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) FilterRevealableUpdated(opts *bind.FilterOpts) (*BindingRevealableUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "RevealableUpdated") - if err != nil { - return nil, err - } - return &BindingRevealableUpdatedIterator{contract: _Binding.contract, event: "RevealableUpdated", logs: logs, sub: sub}, nil -} - -// WatchRevealableUpdated is a free log subscription operation binding the contract event 0x84cc45418127802859711bdf440a92a3a6d3819145166e3f884db8d202aa5ebf. -// -// Solidity: event RevealableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) WatchRevealableUpdated(opts *bind.WatchOpts, sink chan<- *BindingRevealableUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "RevealableUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingRevealableUpdated) - if err := _Binding.contract.UnpackLog(event, "RevealableUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRevealableUpdated is a log parse operation binding the contract event 0x84cc45418127802859711bdf440a92a3a6d3819145166e3f884db8d202aa5ebf. -// -// Solidity: event RevealableUpdated(bool previous, bool updated) -func (_Binding *BindingFilterer) ParseRevealableUpdated(log types.Log) (*BindingRevealableUpdated, error) { - event := new(BindingRevealableUpdated) - if err := _Binding.contract.UnpackLog(event, "RevealableUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingRoyaltyUpdatedIterator is returned from FilterRoyaltyUpdated and is used to iterate over the raw logs and unpacked data for RoyaltyUpdated events raised by the Binding contract. -type BindingRoyaltyUpdatedIterator struct { - Event *BindingRoyaltyUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingRoyaltyUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingRoyaltyUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingRoyaltyUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingRoyaltyUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingRoyaltyUpdated represents a RoyaltyUpdated event raised by the Binding contract. -type BindingRoyaltyUpdated struct { - Previous *big.Int - Updated *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoyaltyUpdated is a free log retrieval operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) FilterRoyaltyUpdated(opts *bind.FilterOpts) (*BindingRoyaltyUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return &BindingRoyaltyUpdatedIterator{contract: _Binding.contract, event: "RoyaltyUpdated", logs: logs, sub: sub}, nil -} - -// WatchRoyaltyUpdated is a free log subscription operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) WatchRoyaltyUpdated(opts *bind.WatchOpts, sink chan<- *BindingRoyaltyUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "RoyaltyUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoyaltyUpdated is a log parse operation binding the contract event 0x54e506cda8889617ec187c699f1c3b373053eb5796248194796f7e1501dfab24. -// -// Solidity: event RoyaltyUpdated(uint256 previous, uint256 updated) -func (_Binding *BindingFilterer) ParseRoyaltyUpdated(log types.Log) (*BindingRoyaltyUpdated, error) { - event := new(BindingRoyaltyUpdated) - if err := _Binding.contract.UnpackLog(event, "RoyaltyUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTokenRevealIterator is returned from FilterTokenReveal and is used to iterate over the raw logs and unpacked data for TokenReveal events raised by the Binding contract. -type BindingTokenRevealIterator struct { - Event *BindingTokenReveal // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTokenRevealIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTokenReveal) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTokenReveal) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTokenRevealIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTokenRevealIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTokenReveal represents a TokenReveal event raised by the Binding contract. -type BindingTokenReveal struct { - User common.Address - RequestId [32]byte - Tokens []*big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTokenReveal is a free log retrieval operation binding the contract event 0xf78fdbb14693a4df69f9724dd4d02cb841094dbff2f6dac48ad20cda511f2d12. -// -// Solidity: event TokenReveal(address indexed user, bytes32 requestId, uint256[] tokens) -func (_Binding *BindingFilterer) FilterTokenReveal(opts *bind.FilterOpts, user []common.Address) (*BindingTokenRevealIterator, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "TokenReveal", userRule) - if err != nil { - return nil, err - } - return &BindingTokenRevealIterator{contract: _Binding.contract, event: "TokenReveal", logs: logs, sub: sub}, nil -} - -// WatchTokenReveal is a free log subscription operation binding the contract event 0xf78fdbb14693a4df69f9724dd4d02cb841094dbff2f6dac48ad20cda511f2d12. -// -// Solidity: event TokenReveal(address indexed user, bytes32 requestId, uint256[] tokens) -func (_Binding *BindingFilterer) WatchTokenReveal(opts *bind.WatchOpts, sink chan<- *BindingTokenReveal, user []common.Address) (event.Subscription, error) { - - var userRule []interface{} - for _, userItem := range user { - userRule = append(userRule, userItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "TokenReveal", userRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTokenReveal) - if err := _Binding.contract.UnpackLog(event, "TokenReveal", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTokenReveal is a log parse operation binding the contract event 0xf78fdbb14693a4df69f9724dd4d02cb841094dbff2f6dac48ad20cda511f2d12. -// -// Solidity: event TokenReveal(address indexed user, bytes32 requestId, uint256[] tokens) -func (_Binding *BindingFilterer) ParseTokenReveal(log types.Log) (*BindingTokenReveal, error) { - event := new(BindingTokenReveal) - if err := _Binding.contract.UnpackLog(event, "TokenReveal", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Binding contract. -type BindingTransferIterator struct { - Event *BindingTransfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTransfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTransfer represents a Transfer event raised by the Binding contract. -type BindingTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*BindingTransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return &BindingTransferIterator{contract: _Binding.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *BindingTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Binding *BindingFilterer) ParseTransfer(log types.Log) (*BindingTransfer, error) { - event := new(BindingTransfer) - if err := _Binding.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriFallbackUpdatedIterator is returned from FilterUriFallbackUpdated and is used to iterate over the raw logs and unpacked data for UriFallbackUpdated events raised by the Binding contract. -type BindingUriFallbackUpdatedIterator struct { - Event *BindingUriFallbackUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriFallbackUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriFallbackUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriFallbackUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriFallbackUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriFallbackUpdated represents a UriFallbackUpdated event raised by the Binding contract. -type BindingUriFallbackUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriFallbackUpdated is a free log retrieval operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriFallbackUpdated(opts *bind.FilterOpts) (*BindingUriFallbackUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return &BindingUriFallbackUpdatedIterator{contract: _Binding.contract, event: "UriFallbackUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriFallbackUpdated is a free log subscription operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriFallbackUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriFallbackUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriFallbackUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriFallbackUpdated is a log parse operation binding the contract event 0xe1b7ff5efe58018e39b7877b5cfa772bb90f32504be7b2330b078d2a9b114bbe. -// -// Solidity: event UriFallbackUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriFallbackUpdated(log types.Log) (*BindingUriFallbackUpdated, error) { - event := new(BindingUriFallbackUpdated) - if err := _Binding.contract.UnpackLog(event, "UriFallbackUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingUriUpdatedIterator is returned from FilterUriUpdated and is used to iterate over the raw logs and unpacked data for UriUpdated events raised by the Binding contract. -type BindingUriUpdatedIterator struct { - Event *BindingUriUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingUriUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingUriUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingUriUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingUriUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingUriUpdated represents a UriUpdated event raised by the Binding contract. -type BindingUriUpdated struct { - Previous string - Updated string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUriUpdated is a free log retrieval operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) FilterUriUpdated(opts *bind.FilterOpts) (*BindingUriUpdatedIterator, error) { - - logs, sub, err := _Binding.contract.FilterLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return &BindingUriUpdatedIterator{contract: _Binding.contract, event: "UriUpdated", logs: logs, sub: sub}, nil -} - -// WatchUriUpdated is a free log subscription operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) WatchUriUpdated(opts *bind.WatchOpts, sink chan<- *BindingUriUpdated) (event.Subscription, error) { - - logs, sub, err := _Binding.contract.WatchLogs(opts, "UriUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUriUpdated is a log parse operation binding the contract event 0x7d8ebb5abe647a67ba3a2649e11557ae5aa256cf3449245e0c840c98132e5a37. -// -// Solidity: event UriUpdated(string previous, string updated) -func (_Binding *BindingFilterer) ParseUriUpdated(log types.Log) (*BindingUriUpdated, error) { - event := new(BindingUriUpdated) - if err := _Binding.contract.UnpackLog(event, "UriUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/znft/contracts/factory/binding/factory.go b/znft/contracts/factory/binding/factory.go deleted file mode 100644 index d91d1cfb3..000000000 --- a/znft/contracts/factory/binding/factory.go +++ /dev/null @@ -1,862 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"ModuleRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"moduleRegistry\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokenList\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMapping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Binding *BindingCaller) Count(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "count") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Binding *BindingSession) Count() (*big.Int, error) { - return _Binding.Contract.Count(&_Binding.CallOpts) -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Binding *BindingCallerSession) Count() (*big.Int, error) { - return _Binding.Contract.Count(&_Binding.CallOpts) -} - -// ModuleRegistry is a free data retrieval call binding the contract method 0x082a1051. -// -// Solidity: function moduleRegistry(address ) view returns(bool) -func (_Binding *BindingCaller) ModuleRegistry(opts *bind.CallOpts, arg0 common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "moduleRegistry", arg0) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// ModuleRegistry is a free data retrieval call binding the contract method 0x082a1051. -// -// Solidity: function moduleRegistry(address ) view returns(bool) -func (_Binding *BindingSession) ModuleRegistry(arg0 common.Address) (bool, error) { - return _Binding.Contract.ModuleRegistry(&_Binding.CallOpts, arg0) -} - -// ModuleRegistry is a free data retrieval call binding the contract method 0x082a1051. -// -// Solidity: function moduleRegistry(address ) view returns(bool) -func (_Binding *BindingCallerSession) ModuleRegistry(arg0 common.Address) (bool, error) { - return _Binding.Contract.ModuleRegistry(&_Binding.CallOpts, arg0) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Binding *BindingCallerSession) Owner() (common.Address, error) { - return _Binding.Contract.Owner(&_Binding.CallOpts) -} - -// TokenList is a free data retrieval call binding the contract method 0x9ead7222. -// -// Solidity: function tokenList(uint256 ) view returns(address) -func (_Binding *BindingCaller) TokenList(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenList", arg0) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// TokenList is a free data retrieval call binding the contract method 0x9ead7222. -// -// Solidity: function tokenList(uint256 ) view returns(address) -func (_Binding *BindingSession) TokenList(arg0 *big.Int) (common.Address, error) { - return _Binding.Contract.TokenList(&_Binding.CallOpts, arg0) -} - -// TokenList is a free data retrieval call binding the contract method 0x9ead7222. -// -// Solidity: function tokenList(uint256 ) view returns(address) -func (_Binding *BindingCallerSession) TokenList(arg0 *big.Int) (common.Address, error) { - return _Binding.Contract.TokenList(&_Binding.CallOpts, arg0) -} - -// TokenMapping is a free data retrieval call binding the contract method 0xba27f50b. -// -// Solidity: function tokenMapping(address ) view returns(bool) -func (_Binding *BindingCaller) TokenMapping(opts *bind.CallOpts, arg0 common.Address) (bool, error) { - var out []interface{} - err := _Binding.contract.Call(opts, &out, "tokenMapping", arg0) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// TokenMapping is a free data retrieval call binding the contract method 0xba27f50b. -// -// Solidity: function tokenMapping(address ) view returns(bool) -func (_Binding *BindingSession) TokenMapping(arg0 common.Address) (bool, error) { - return _Binding.Contract.TokenMapping(&_Binding.CallOpts, arg0) -} - -// TokenMapping is a free data retrieval call binding the contract method 0xba27f50b. -// -// Solidity: function tokenMapping(address ) view returns(bool) -func (_Binding *BindingCallerSession) TokenMapping(arg0 common.Address) (bool, error) { - return _Binding.Contract.TokenMapping(&_Binding.CallOpts, arg0) -} - -// Create is a paid mutator transaction binding the contract method 0x9eeeaa75. -// -// Solidity: function create(address module, string name, string symbol, string uri, bytes data) returns(address) -func (_Binding *BindingTransactor) Create(opts *bind.TransactOpts, module common.Address, name string, symbol string, uri string, data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "create", module, name, symbol, uri, data) -} - -// Create is a paid mutator transaction binding the contract method 0x9eeeaa75. -// -// Solidity: function create(address module, string name, string symbol, string uri, bytes data) returns(address) -func (_Binding *BindingSession) Create(module common.Address, name string, symbol string, uri string, data []byte) (*types.Transaction, error) { - return _Binding.Contract.Create(&_Binding.TransactOpts, module, name, symbol, uri, data) -} - -// Create is a paid mutator transaction binding the contract method 0x9eeeaa75. -// -// Solidity: function create(address module, string name, string symbol, string uri, bytes data) returns(address) -func (_Binding *BindingTransactorSession) Create(module common.Address, name string, symbol string, uri string, data []byte) (*types.Transaction, error) { - return _Binding.Contract.Create(&_Binding.TransactOpts, module, name, symbol, uri, data) -} - -// Register is a paid mutator transaction binding the contract method 0xab01b469. -// -// Solidity: function register(address module, bool status) returns() -func (_Binding *BindingTransactor) Register(opts *bind.TransactOpts, module common.Address, status bool) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "register", module, status) -} - -// Register is a paid mutator transaction binding the contract method 0xab01b469. -// -// Solidity: function register(address module, bool status) returns() -func (_Binding *BindingSession) Register(module common.Address, status bool) (*types.Transaction, error) { - return _Binding.Contract.Register(&_Binding.TransactOpts, module, status) -} - -// Register is a paid mutator transaction binding the contract method 0xab01b469. -// -// Solidity: function register(address module, bool status) returns() -func (_Binding *BindingTransactorSession) Register(module common.Address, status bool) (*types.Transaction, error) { - return _Binding.Contract.Register(&_Binding.TransactOpts, module, status) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Binding *BindingTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Binding.Contract.RenounceOwnership(&_Binding.TransactOpts) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Binding *BindingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Binding.Contract.TransferOwnership(&_Binding.TransactOpts, newOwner) -} - -// BindingModuleRegisteredIterator is returned from FilterModuleRegistered and is used to iterate over the raw logs and unpacked data for ModuleRegistered events raised by the Binding contract. -type BindingModuleRegisteredIterator struct { - Event *BindingModuleRegistered // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingModuleRegisteredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingModuleRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingModuleRegistered) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingModuleRegisteredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingModuleRegisteredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingModuleRegistered represents a ModuleRegistered event raised by the Binding contract. -type BindingModuleRegistered struct { - Module common.Address - Status bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterModuleRegistered is a free log retrieval operation binding the contract event 0x30091f391c7fccd6f943ec02ae164c4197ea3e43a67edc2edf908f3efc371876. -// -// Solidity: event ModuleRegistered(address indexed module, bool status) -func (_Binding *BindingFilterer) FilterModuleRegistered(opts *bind.FilterOpts, module []common.Address) (*BindingModuleRegisteredIterator, error) { - - var moduleRule []interface{} - for _, moduleItem := range module { - moduleRule = append(moduleRule, moduleItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "ModuleRegistered", moduleRule) - if err != nil { - return nil, err - } - return &BindingModuleRegisteredIterator{contract: _Binding.contract, event: "ModuleRegistered", logs: logs, sub: sub}, nil -} - -// WatchModuleRegistered is a free log subscription operation binding the contract event 0x30091f391c7fccd6f943ec02ae164c4197ea3e43a67edc2edf908f3efc371876. -// -// Solidity: event ModuleRegistered(address indexed module, bool status) -func (_Binding *BindingFilterer) WatchModuleRegistered(opts *bind.WatchOpts, sink chan<- *BindingModuleRegistered, module []common.Address) (event.Subscription, error) { - - var moduleRule []interface{} - for _, moduleItem := range module { - moduleRule = append(moduleRule, moduleItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "ModuleRegistered", moduleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingModuleRegistered) - if err := _Binding.contract.UnpackLog(event, "ModuleRegistered", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseModuleRegistered is a log parse operation binding the contract event 0x30091f391c7fccd6f943ec02ae164c4197ea3e43a67edc2edf908f3efc371876. -// -// Solidity: event ModuleRegistered(address indexed module, bool status) -func (_Binding *BindingFilterer) ParseModuleRegistered(log types.Log) (*BindingModuleRegistered, error) { - event := new(BindingModuleRegistered) - if err := _Binding.contract.UnpackLog(event, "ModuleRegistered", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Binding contract. -type BindingOwnershipTransferredIterator struct { - Event *BindingOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingOwnershipTransferred represents a OwnershipTransferred event raised by the Binding contract. -type BindingOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BindingOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BindingOwnershipTransferredIterator{contract: _Binding.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BindingOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Binding *BindingFilterer) ParseOwnershipTransferred(log types.Log) (*BindingOwnershipTransferred, error) { - event := new(BindingOwnershipTransferred) - if err := _Binding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// BindingTokenCreatedIterator is returned from FilterTokenCreated and is used to iterate over the raw logs and unpacked data for TokenCreated events raised by the Binding contract. -type BindingTokenCreatedIterator struct { - Event *BindingTokenCreated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BindingTokenCreatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BindingTokenCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BindingTokenCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BindingTokenCreatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BindingTokenCreatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BindingTokenCreated represents a TokenCreated event raised by the Binding contract. -type BindingTokenCreated struct { - Owner common.Address - Token common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTokenCreated is a free log retrieval operation binding the contract event 0xd5f9bdf12adf29dab0248c349842c3822d53ae2bb4f36352f301630d018c8139. -// -// Solidity: event TokenCreated(address indexed owner, address token) -func (_Binding *BindingFilterer) FilterTokenCreated(opts *bind.FilterOpts, owner []common.Address) (*BindingTokenCreatedIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - - logs, sub, err := _Binding.contract.FilterLogs(opts, "TokenCreated", ownerRule) - if err != nil { - return nil, err - } - return &BindingTokenCreatedIterator{contract: _Binding.contract, event: "TokenCreated", logs: logs, sub: sub}, nil -} - -// WatchTokenCreated is a free log subscription operation binding the contract event 0xd5f9bdf12adf29dab0248c349842c3822d53ae2bb4f36352f301630d018c8139. -// -// Solidity: event TokenCreated(address indexed owner, address token) -func (_Binding *BindingFilterer) WatchTokenCreated(opts *bind.WatchOpts, sink chan<- *BindingTokenCreated, owner []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - - logs, sub, err := _Binding.contract.WatchLogs(opts, "TokenCreated", ownerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BindingTokenCreated) - if err := _Binding.contract.UnpackLog(event, "TokenCreated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTokenCreated is a log parse operation binding the contract event 0xd5f9bdf12adf29dab0248c349842c3822d53ae2bb4f36352f301630d018c8139. -// -// Solidity: event TokenCreated(address indexed owner, address token) -func (_Binding *BindingFilterer) ParseTokenCreated(log types.Log) (*BindingTokenCreated, error) { - event := new(BindingTokenCreated) - if err := _Binding.contract.UnpackLog(event, "TokenCreated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/znft/contracts/factorymoduleerc721/binding/factorymoduleerc721.go b/znft/contracts/factorymoduleerc721/binding/factorymoduleerc721.go deleted file mode 100644 index becdae417..000000000 --- a/znft/contracts/factorymoduleerc721/binding/factorymoduleerc721.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 , uint256 , bytes ) returns(address) -func (_Binding *BindingTransactor) CreateToken(opts *bind.TransactOpts, owner common.Address, name string, symbol string, uri string, max *big.Int, arg5 *big.Int, arg6 *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "createToken", owner, name, symbol, uri, max, arg5, arg6, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 , uint256 , bytes ) returns(address) -func (_Binding *BindingSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, arg5 *big.Int, arg6 *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, arg5, arg6, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 , uint256 , bytes ) returns(address) -func (_Binding *BindingTransactorSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, arg5 *big.Int, arg6 *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, arg5, arg6, arg7) -} diff --git a/znft/contracts/factorymoduleerc721fixed/binding/factorymoduleerc721fixed.go b/znft/contracts/factorymoduleerc721fixed/binding/factorymoduleerc721fixed.go deleted file mode 100644 index eb6bfaff7..000000000 --- a/znft/contracts/factorymoduleerc721fixed/binding/factorymoduleerc721fixed.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingTransactor) CreateToken(opts *bind.TransactOpts, owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "createToken", owner, name, symbol, uri, max, price, batch, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingTransactorSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, arg7) -} diff --git a/znft/contracts/factorymoduleerc721pack/binding/factorymoduleerc721pack.go b/znft/contracts/factorymoduleerc721pack/binding/factorymoduleerc721pack.go deleted file mode 100644 index d27aae231..000000000 --- a/znft/contracts/factorymoduleerc721pack/binding/factorymoduleerc721pack.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"factory_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"random_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes data) returns(address) -func (_Binding *BindingTransactor) CreateToken(opts *bind.TransactOpts, owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, data []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "createToken", owner, name, symbol, uri, max, price, batch, data) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes data) returns(address) -func (_Binding *BindingSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, data []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, data) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes data) returns(address) -func (_Binding *BindingTransactorSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, data []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, data) -} diff --git a/znft/contracts/factorymoduleerc721random/binding/factorymoduleerc721random.go b/znft/contracts/factorymoduleerc721random/binding/factorymoduleerc721random.go deleted file mode 100644 index 37cfefa52..000000000 --- a/znft/contracts/factorymoduleerc721random/binding/factorymoduleerc721random.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package binding - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// BindingMetaData contains all meta data concerning the Binding contract. -var BindingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vrfCoordinator_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vrfLink_\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"vrfKeyHash_\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"vrfFee_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batch\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"createToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// BindingABI is the input ABI used to generate the binding from. -// Deprecated: Use BindingMetaData.ABI instead. -var BindingABI = BindingMetaData.ABI - -// Binding is an auto generated Go binding around an Ethereum contract. -type Binding struct { - BindingCaller // Read-only binding to the contract - BindingTransactor // Write-only binding to the contract - BindingFilterer // Log filterer for contract events -} - -// BindingCaller is an auto generated read-only Go binding around an Ethereum contract. -type BindingCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BindingTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BindingFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// BindingSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type BindingSession struct { - Contract *Binding // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type BindingCallerSession struct { - Contract *BindingCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// BindingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type BindingTransactorSession struct { - Contract *BindingTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// BindingRaw is an auto generated low-level Go binding around an Ethereum contract. -type BindingRaw struct { - Contract *Binding // Generic contract binding to access the raw methods on -} - -// BindingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BindingCallerRaw struct { - Contract *BindingCaller // Generic read-only contract binding to access the raw methods on -} - -// BindingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BindingTransactorRaw struct { - Contract *BindingTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewBinding creates a new instance of Binding, bound to a specific deployed contract. -func NewBinding(address common.Address, backend bind.ContractBackend) (*Binding, error) { - contract, err := bindBinding(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Binding{BindingCaller: BindingCaller{contract: contract}, BindingTransactor: BindingTransactor{contract: contract}, BindingFilterer: BindingFilterer{contract: contract}}, nil -} - -// NewBindingCaller creates a new read-only instance of Binding, bound to a specific deployed contract. -func NewBindingCaller(address common.Address, caller bind.ContractCaller) (*BindingCaller, error) { - contract, err := bindBinding(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &BindingCaller{contract: contract}, nil -} - -// NewBindingTransactor creates a new write-only instance of Binding, bound to a specific deployed contract. -func NewBindingTransactor(address common.Address, transactor bind.ContractTransactor) (*BindingTransactor, error) { - contract, err := bindBinding(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &BindingTransactor{contract: contract}, nil -} - -// NewBindingFilterer creates a new log filterer instance of Binding, bound to a specific deployed contract. -func NewBindingFilterer(address common.Address, filterer bind.ContractFilterer) (*BindingFilterer, error) { - contract, err := bindBinding(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &BindingFilterer{contract: contract}, nil -} - -// bindBinding binds a generic wrapper to an already deployed contract. -func bindBinding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BindingABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.BindingCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.BindingTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Binding *BindingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Binding.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Binding *BindingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Binding.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Binding *BindingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Binding.Contract.contract.Transact(opts, method, params...) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingTransactor) CreateToken(opts *bind.TransactOpts, owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.contract.Transact(opts, "createToken", owner, name, symbol, uri, max, price, batch, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, arg7) -} - -// CreateToken is a paid mutator transaction binding the contract method 0x3d774115. -// -// Solidity: function createToken(address owner, string name, string symbol, string uri, uint256 max, uint256 price, uint256 batch, bytes ) returns(address) -func (_Binding *BindingTransactorSession) CreateToken(owner common.Address, name string, symbol string, uri string, max *big.Int, price *big.Int, batch *big.Int, arg7 []byte) (*types.Transaction, error) { - return _Binding.Contract.CreateToken(&_Binding.TransactOpts, owner, name, symbol, uri, max, price, batch, arg7) -} diff --git a/znft/doc.go b/znft/doc.go deleted file mode 100644 index fd18d5ce3..000000000 --- a/znft/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Provides methods and types to interact with the ERC-721 NFT smart contract on the Ethereum blockchain. -// Makes it possible for our clients to create and manage their NFTs using the Chalk apps. -// It defines the functionality to Mint/Burn ERC-721 NFTs. -package znft diff --git a/znft/ethereum_wallet.go b/znft/ethereum_wallet.go deleted file mode 100644 index d1a26a411..000000000 --- a/znft/ethereum_wallet.go +++ /dev/null @@ -1,110 +0,0 @@ -package znft - -import ( - "context" - "math/big" - "path" - "time" - - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/params" - "github.com/pkg/errors" -) - -func CreateEthClient(ethereumNodeURL string) (*ethclient.Client, error) { - client, err := ethclient.Dial(ethereumNodeURL) - if err != nil { - Logger.Error(err) - return nil, err - } - return client, err -} - -func (app *Znft) createSignedTransactionFromKeyStore(ctx context.Context) (*bind.TransactOpts, error) { - var ( - signerAddress = common.HexToAddress(app.cfg.WalletAddress) - password = app.cfg.VaultPassword - value = app.cfg.Value - ) - - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - err := errors.Wrap(err, "failed to create ethereum client") - Logger.Fatal(err) - return nil, err - } - - keyDir := path.Join(app.cfg.Homedir, WalletDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - signer := accounts.Account{ - Address: signerAddress, - } - signerAcc, err := ks.Find(signer) - if err != nil { - err := errors.Wrapf(err, "signer: %s", signerAddress.Hex()) - Logger.Fatal(err) - return nil, err - } - - chainID, err := client.ChainID(ctx) - if err != nil { - err := errors.Wrap(err, "failed to get chain ID") - Logger.Fatal(err) - return nil, err - } - - err = ks.TimedUnlock(signer, password, time.Second*2) - if err != nil { - Logger.Fatal(err) - return nil, err - } - - opts, err := bind.NewKeyStoreTransactorWithChainID(ks, signerAcc, chainID) - if err != nil { - Logger.Fatal(err) - return nil, err - } - - valueWei := new(big.Int).Mul(big.NewInt(value), big.NewInt(params.Wei)) - - opts.Value = valueWei // in wei (= no funds) - - return opts, nil -} - -func (app *Znft) createSignedTransactionFromKeyStoreWithGasPrice(ctx context.Context, gasLimitUnits uint64) (*bind.TransactOpts, error) { //nolint - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - err := errors.Wrap(err, "failed to create ethereum client") - Logger.Fatal(err) - return nil, err - } - - nonce, err := client.PendingNonceAt(ctx, common.HexToAddress(app.cfg.WalletAddress)) - if err != nil { - Logger.Fatal(err) - return nil, err - } - - gasPriceWei, err := client.SuggestGasPrice(ctx) - if err != nil { - Logger.Fatal(err) - return nil, err - } - - opts, err := app.createSignedTransactionFromKeyStore(ctx) - if err != nil { - Logger.Fatal(err) - return nil, err - } - - opts.Nonce = big.NewInt(int64(nonce)) // (nil = use pending state), look at bind.CallOpts{Pending: true} - opts.GasLimit = gasLimitUnits // in units (0 = estimate) - opts.GasPrice = gasPriceWei // wei (nil = gas price oracle) - - return opts, nil -} diff --git a/znft/example/go.mod b/znft/example/go.mod deleted file mode 100644 index 8eebd1585..000000000 --- a/znft/example/go.mod +++ /dev/null @@ -1,32 +0,0 @@ -module example - -go 1.23.2 - -require github.com/0chain/gosdk v1.8.9 - -require ( - github.com/btcsuite/btcd v0.23.4 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/btcsuite/btcd/btcutil v1.1.3 // indirect - github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect - github.com/deckarep/golang-set v1.8.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect - github.com/ethereum/go-ethereum v1.10.26 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-stack/stack v1.8.1 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/rjeczalik/notify v0.9.2 // indirect - github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect - github.com/tyler-smith/go-bip39 v1.1.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.27.0 // indirect - golang.org/x/sys v0.25.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) - -replace github.com/0chain/gosdk => ../../ diff --git a/znft/example/go.sum b/znft/example/go.sum deleted file mode 100644 index bb384aa82..000000000 --- a/znft/example/go.sum +++ /dev/null @@ -1,188 +0,0 @@ -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= -github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd v0.23.2 h1:/YOgUp25sdCnP5ho6Hl3s0E438zlX+Kak7E6TgBgoT0= -github.com/btcsuite/btcd v0.23.2/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= -github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E= -github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= -github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -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/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= -github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s= -github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -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/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= -github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= -github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= -github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A= -github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo= -github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/znft/example/main.go b/znft/example/main.go deleted file mode 100644 index 1b0f1d890..000000000 --- a/znft/example/main.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build ignore -// +build ignore - -// Example usage of the znft package - do not use. -package main - -import ( - "context" - "fmt" - "log" - "math/big" - "os" - - "github.com/0chain/gosdk/znft" -) - -var mnemonic string - -func main() { - mnemonic = "use your mnemonic to import account to a local storage" - - // Create this configuration from console app - cfg := &znft.Configuration{ - FactoryAddress: "0xD98602749e7f46036d496e8D3deb6eb9F90996a6", - FactoryModuleERC721Address: "", - FactoryModuleERC721FixedAddress: "", - FactoryModuleERC721RandomAddress: "", - FactoryModuleERC721PackedAddress: "", - EthereumNodeURL: "https://rinkeby.infura.io/v3/22cb2849f5f74b8599f3dc2a23085bd4", - WalletAddress: "0x860FA46F170a87dF44D7bB867AA4a5D2813127c1", - VaultPassword: "pass", - Homedir: "", // optional, default = "~/.zcn" - Value: 0, // mandatory, default > 0 - } - - if cfg.Homedir == "" { - cfg.Homedir = znft.GetConfigDir() - } - - if !znft.AccountExists(cfg.Homedir, cfg.WalletAddress) { - _, err := znft.ImportAccount(cfg.Homedir, mnemonic, cfg.VaultPassword) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - } - - // Creating NFTs with factories: - // -------------------------------- - // CreateFactoryERC721Session - // CreateFactoryERC721PackSession - // CreateFactoryERC721FixedSession - // CreateFactoryERC721RandomSession - - app := znft.NewNFTApplication(cfg) - - factorySession, err := app.CreateFactoryERC721Session(context.Background(), cfg.FactoryAddress) - if err != nil { - panic(err) - } - - data := []byte("") - max := new(big.Int).SetInt64(10000) - err = factorySession.CreateToken( - cfg.WalletAddress, - "TestFixedPriceToken", - "dNFT", - "https://api.0chain.net/v1/file/abcdefgh/", - max, - data, - ) - if err != nil { - panic(err) - } - - // When addresses are received after deployment with factories... - // Reading and writing to NFT smart contracts using DStorageSessions - // -------------------------------- - // CreateStorageERC721Session - // CreateStorageERC721PackSession - // CreateStorageERC721RandomSession - // CreateStorageERC721FixedSession - - // Create session of NFT token - sessionRandom, err := app.CreateStorageERC721RandomSession(context.Background(), "received from deployment") - if err != nil { - panic(err) - } - - // Start using session - price, err := sessionRandom.Price() - if err != nil { - panic(err) - } - log.Print(price) - - // ERC721Fixed - - // Create session of NFT token - sessionFixed, err := app.CreateStorageERC721FixedSession(context.Background(), "received from deployment") - if err != nil { - panic(err) - } - - // Start using session - price, err = sessionFixed.Price() - if err != nil { - panic(err) - } - log.Print(price) - - // ERC721Pack - - // Create session of NFT token - sessionPack, err := app.CreateStorageERC721PackSession(context.Background(), "received from deployment") - if err != nil { - panic(err) - } - - // Start using session - price, err = sessionPack.Price() - if err != nil { - panic(err) - } - log.Print(price) - - // ERC721 - - // Create session of NFT token - session, err := app.CreateStorageERC721Session(context.Background(), "received from deployment") - if err != nil { - panic(err) - } - - // Start using session - price, err = session.Price() - if err != nil { - panic(err) - } - log.Print(price) -} diff --git a/znft/factoryerc721.go b/znft/factoryerc721.go deleted file mode 100644 index 5fe26fd02..000000000 --- a/znft/factoryerc721.go +++ /dev/null @@ -1,48 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - "github.com/pkg/errors" - - "github.com/ethereum/go-ethereum/common" - - factory "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721/binding" -) - -// Solidity functions - -// function createToken( -// address owner, -// string calldata name, -// string calldata symbol, -// string calldata uri, -// uint256 max, -// uint256, -// uint256, -// bytes calldata -//) external returns (address) { - -type IFactoryERC721 interface { - CreateToken(owner, name, symbol, uri string, max *big.Int, data []byte) error -} - -type FactoryERC721 struct { - session *factory.BindingSession - ctx context.Context -} - -func (s *FactoryERC721) CreateToken(owner, name, symbol, uri string, max *big.Int, data []byte) error { - ownerAddress := common.HexToAddress(owner) - evmTr, err := s.session.CreateToken(ownerAddress, name, symbol, uri, max, nil, nil, data) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "CreateToken") - Logger.Error(err) - return err - } - - Logger.Info("Executed CreateToken, hash: ", evmTr.Hash().Hex()) - - return nil -} diff --git a/znft/factoryerc721fixed.go b/znft/factoryerc721fixed.go deleted file mode 100644 index 9ba0bac09..000000000 --- a/znft/factoryerc721fixed.go +++ /dev/null @@ -1,47 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - factory "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721fixed/binding" -) - -// Solidity functions - -// function createToken( -// address owner, -// string calldata name, -// string calldata symbol, -// string calldata uri, -// uint256 max, -// uint256 price, -// uint256 batch, -// bytes calldata -//) external returns (address) { - -type IFactoryFixed interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} - -type FactoryFixed struct { - session *factory.BindingSession - ctx context.Context -} - -func (s *FactoryFixed) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error { - ownerAddress := common.HexToAddress(owner) - evmTr, err := s.session.CreateToken(ownerAddress, name, symbol, uri, max, price, batch, calldata) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "CreateToken") - Logger.Error(err) - return err - } - - Logger.Info("Executed CreateToken, hash: ", evmTr.Hash().Hex()) - - return nil -} diff --git a/znft/factoryerc721pack.go b/znft/factoryerc721pack.go deleted file mode 100644 index 6965c0e67..000000000 --- a/znft/factoryerc721pack.go +++ /dev/null @@ -1,47 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - factory "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721pack/binding" -) - -// Solidity functions - -// function createToken( -// address owner, -// string calldata name, -// string calldata symbol, -// string calldata uri, -// uint256 max, -// uint256 price, -// uint256 batch, -// bytes calldata -//) external returns (address) { - -type IFactoryPack interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} - -type FactoryPack struct { - session *factory.BindingSession - ctx context.Context -} - -func (s *FactoryPack) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error { - ownerAddress := common.HexToAddress(owner) - evmTr, err := s.session.CreateToken(ownerAddress, name, symbol, uri, max, price, batch, calldata) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "CreateToken") - Logger.Error(err) - return err - } - - Logger.Info("Executed CreateToken, hash: ", evmTr.Hash().Hex()) - - return nil -} diff --git a/znft/factoryerc721random.go b/znft/factoryerc721random.go deleted file mode 100644 index 7d1412290..000000000 --- a/znft/factoryerc721random.go +++ /dev/null @@ -1,47 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - factory "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721random/binding" -) - -// Solidity functions - -// function createToken( -// address owner, -// string calldata name, -// string calldata symbol, -// string calldata uri, -// uint256 max, -// uint256 price, -// uint256 batch, -// bytes calldata -//) external returns (address) { - -type IFactoryRandom interface { - CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error -} - -type FactoryRandom struct { - session *factory.BindingSession - ctx context.Context -} - -func (s *FactoryRandom) CreateToken(owner, name, symbol, uri string, max, price, batch *big.Int, calldata []byte) error { - ownerAddress := common.HexToAddress(owner) - evmTr, err := s.session.CreateToken(ownerAddress, name, symbol, uri, max, price, batch, calldata) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "CreateToken") - Logger.Error(err) - return err - } - - Logger.Info("Executed CreateToken, hash: ", evmTr.Hash().Hex()) - - return nil -} diff --git a/znft/keystore.go b/znft/keystore.go deleted file mode 100644 index 621adcac6..000000000 --- a/znft/keystore.go +++ /dev/null @@ -1,156 +0,0 @@ -package znft - -import ( - "fmt" - "os" - "path" - - hdw "github.com/0chain/gosdk/zcncore/ethhdwallet" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - "gopkg.in/yaml.v2" -) - -// ListStorageAccounts List available accounts -func ListStorageAccounts(homedir string) []common.Address { - am := getAccountManager(homedir) - addresses := am.Accounts() - - return addresses -} - -// DeleteAccount deletes account from wallet -func DeleteAccount(homedir, address string) bool { - am := getAccountManager(homedir) - - wallet, err := am.Find(accounts.Account{ - Address: common.HexToAddress(address), - }) - - if err != nil && wallet == nil { - fmt.Printf("failed to find account %s, error: %s", address, err) - return false - } - - return true -} - -func getAccountManager(homedir string) *accounts.Manager { - keyDir := path.Join(homedir, WalletDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - config := &accounts.Config{InsecureUnlockAllowed: false} - am := accounts.NewManager(config, ks) - return am -} - -// AccountExists checks if account exists -func AccountExists(homedir, address string) bool { - am := getAccountManager(homedir) - - wallet, err := am.Find(accounts.Account{ - Address: common.HexToAddress(address), - }) - - if err != nil && wallet == nil { - fmt.Printf("failed to find account %s, error: %s\n", address, err) - return false - } - - status, _ := wallet.Status() - url := wallet.URL() - - fmt.Printf("Account exists. Status: %s, Path: %s\n", status, url) - - return true -} - -// CreateKeyStorage create, restore or unlock key storage -func CreateKeyStorage(homedir, password string) error { - keyDir := path.Join(homedir, WalletDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - account, err := ks.NewAccount(password) - if err != nil { - return errors.Wrap(err, "failed to create keystore") - } - fmt.Printf("Created account: %s", account.Address.Hex()) - - return nil -} - -// UpdateClientEthereumAddress updates Ethereum address -func UpdateClientEthereumAddress(homedir, address string) (err error) { - configFile := path.Join(homedir, ConfigFile) - buf, err := os.ReadFile(configFile) - if err != nil { - return err - } - cfg := &Configuration{} - err = yaml.Unmarshal(buf, cfg) - if err != nil { - return err - } - - cfg.WalletAddress = address - - text, err := yaml.Marshal(cfg) - if err != nil { - return err - } - - err = os.WriteFile(configFile, text, 0644) - - return err -} - -// ImportAccount imports account using mnemonic -// password is used to lock and unlock keystorage before signing transaction -func ImportAccount(homedir, mnemonic, password string) (string, error) { - // 1. Create storage and account if it doesn't exist and add account to it - keyDir := path.Join(homedir, WalletDir) - ks := keystore.NewKeyStore(keyDir, keystore.StandardScryptN, keystore.StandardScryptP) - - // 2. Init wallet - wallet, err := hdw.NewFromMnemonic(mnemonic) - if err != nil { - return "", errors.Wrap(err, "failed to import from mnemonic") - } - - // DefaultBaseDerivationPath is the base path from which custom derivation endpoints - // are incremented. As such, the first account will be at m/44'/60'/0'/0, the second - // at m/44'/60'/0'/1, etc - // from basic library: - // var DefaultBaseDerivationPath = accounts.DefaultBaseDerivationPath - // from the BIP44 specification, the HD derivation path is defined as - // m / purpose' / coin_type' / account' / change / address_index - // https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki - - pathD := hdw.MustParseDerivationPath("m/44'/60'/0'/0/0") - account, err := wallet.Derive(pathD, true) - if err != nil { - return "", errors.Wrap(err, "failed parse derivation path") - } - - key, err := wallet.PrivateKey(account) - if err != nil { - return "", errors.Wrap(err, "failed to get private key") - } - - // 3. Find key - acc, err := ks.Find(account) - if err == nil { - fmt.Printf("Account already exists: %s\nPath: %s\n\n", acc.Address.Hex(), acc.URL.Path) - return acc.Address.Hex(), nil - } - - // 4. Import the key if it doesn't exist - acc, err = ks.ImportECDSA(key, password) - if err != nil { - return "", errors.Wrap(err, "failed to get import private key") - } - - fmt.Printf("Imported account %s to path: %s\n", acc.Address.Hex(), acc.URL.Path) - - return acc.Address.Hex(), nil -} diff --git a/znft/storageerc721.go b/znft/storageerc721.go deleted file mode 100644 index e43bccfc6..000000000 --- a/znft/storageerc721.go +++ /dev/null @@ -1,347 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - storageerc721 "github.com/0chain/gosdk/znft/contracts/dstorageerc721/binding" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -const ( - ContractStorageERC721Name = "StorageERC721" - ContractStorageERC721FixedName = "StorageERC721Fixed" - ContractStorageERC721PackName = "StorageERC721Pack" - ContractStorageERC721RandomName = "StorageERC721Random" - Withdraw = "withdraw" - SetReceiver = "setReceiver" - SetRoyalty = "setRoyalty" - SetMintable = "setMintable" - SetAllocation = "setAllocation" - SetURI = "setURI" - TokenURIFallback = "tokenURIFallback" - TokenURI = "tokenURI" - Price = "price" - Mint = "mint" - MintOwner = "mintOwner" - RoyaltyInfo = "royaltyInfo" -) - -// Solidity Functions -// - withdraw() -// - setReceiver(address receiver_) -// - setRoyalty(uint256 royalty_) -// - setMintable(bool status_) -// - setMax(uint256 max_) -// - setAllocation(string calldata allocation_) -// - setURI(string calldata uri_) -// - setURIFallback(string calldata uri_) -// - tokenURIFallback(uint256 tokenId) returns (string memory) -// - price() returns (uint256) -// - mint(uint256 amount) -// - mintOwner(uint256 amount) -// - royaltyInfo(uint256 tokenId, uint256 salePrice) returns (address, uint256) -// - freeze() -// Fields: -// uint256 public total; -// uint256 public max; -// uint256 public batch; -// bool public mintable; -// string public allocation; -// string public uri; -// string public uriFallback; -// uint256 public royalty; -// address public receiver; - -type IStorageECR721 interface { - Withdraw() error - SetReceiver(receiver string) error - SetRoyalty(sum *big.Int) error - SetMintable(status bool) error - SetAllocation(allocation string) error - SetURI(uri string) error - SetURIFallback(uri string) error - TokenURIFallback(token *big.Int) (string, error) - Price() (*big.Int, error) - Mint(amount *big.Int) error - MintOwner(amount *big.Int) error - RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) - Max() (*big.Int, error) // Fields - Total() (*big.Int, error) - Batch() (*big.Int, error) - Mintable() (bool, error) - Allocation() (string, error) - Uri() (string, error) - UriFallback() (string, error) - Royalty() (*big.Int, error) - Receiver() (string, error) -} - -var ( - _ IStorageECR721 = (*StorageECR721)(nil) -) - -type StorageECR721 struct { - session *storageerc721.BindingSession - ctx context.Context -} - -func (s *StorageECR721) SetURIFallback(uri string) error { - evmTr, err := s.session.SetURIFallback(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetURIFallback") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetURIFallback, hash: ", evmTr.Hash().Hex()) - - return nil -} - -func (s *StorageECR721) Total() (*big.Int, error) { - total, err := s.session.Total() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Total") - Logger.Error(err) - return nil, err - } - - return total, nil -} - -func (s *StorageECR721) Batch() (*big.Int, error) { - batch, err := s.session.Batch() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Batch") - Logger.Error(err) - return nil, err - } - - return batch, nil -} - -func (s *StorageECR721) Mintable() (bool, error) { - mintable, err := s.session.Mintable() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Mintable") - Logger.Error(err) - return false, err - } - - return mintable, nil -} - -func (s *StorageECR721) Allocation() (string, error) { - allocation, err := s.session.Allocation() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Allocation") - Logger.Error(err) - return "", err - } - - return allocation, nil -} - -func (s *StorageECR721) Uri() (string, error) { - uri, err := s.session.Uri() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URI") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721) UriFallback() (string, error) { - uri, err := s.session.UriFallback() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URIFallback") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721) Royalty() (*big.Int, error) { - value, err := s.session.Royalty() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Royalty") - Logger.Error(err) - return nil, err - } - - return value, nil -} - -func (s *StorageECR721) Receiver() (string, error) { - value, err := s.session.Receiver() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Receiver") - Logger.Error(err) - return "", err - } - - return value.String(), nil -} - -func (s *StorageECR721) Max() (*big.Int, error) { - max, err := s.session.Max() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Max") - Logger.Error(err) - return nil, err - } - - return max, nil -} - -func (s *StorageECR721) Mint(amount *big.Int) error { - evmTr, err := s.session.Mint(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Mint) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Mint, "hash: ", evmTr.Hash().Hex()) - - return nil -} - -func (s *StorageECR721) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) { - address, sum, err := s.session.RoyaltyInfo(tokenId, salePrice) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", RoyaltyInfo) - Logger.Error(err) - return "", nil, err - } - - return address.Hex(), sum, nil -} - -func (s *StorageECR721) MintOwner(amount *big.Int) error { - evmTr, err := s.session.MintOwner(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", MintOwner) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", MintOwner, "hash: ", evmTr.Hash().Hex()) - - return nil -} - -func (s *StorageECR721) TokenURIFallback(token *big.Int) (string, error) { - tokenURI, err := s.session.TokenURIFallback(token) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", TokenURIFallback) - Logger.Error(err) - return "", err - } - - return tokenURI, nil -} - -// Price returns price -func (s *StorageECR721) Price() (*big.Int, error) { - price, err := s.session.Price() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", Price) - Logger.Error(err) - return nil, err - } - - return price, nil -} - -// SetURI updates uri -func (s *StorageECR721) SetURI(uri string) error { - evmTr, err := s.session.SetURI(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetURI) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetURI, "hash: ", evmTr.Hash().String()) - - return nil -} - -// SetAllocation updates allocation -func (s *StorageECR721) SetAllocation(allocation string) error { - evmTr, err := s.session.SetAllocation(allocation) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetAllocation) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetAllocation, " hash: ", evmTr.Hash()) - - return nil -} - -// SetMintable updates mintable state -func (s *StorageECR721) SetMintable(status bool) error { - evmTr, err := s.session.SetMintable(status) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetMintable) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetMintable, " hash: ", evmTr.Hash()) - - return nil -} - -// SetRoyalty eth balance from token contract - setReceiver(address receiver_) -func (s *StorageECR721) SetRoyalty(sum *big.Int) error { - evmTr, err := s.session.SetRoyalty(sum) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetRoyalty) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetRoyalty, "hash: ", evmTr.Hash()) - - return nil -} - -// SetReceiver eth balance from token contract - setReceiver(address receiver_) -func (s *StorageECR721) SetReceiver(receiver string) error { - address := common.HexToAddress(receiver) - - evmTr, err := s.session.SetReceiver(address) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetReceiver) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetReceiver, "hash: ", evmTr.Hash()) - - return nil -} - -// Withdraw eth balance from token contract - withdraw() -func (s *StorageECR721) Withdraw() error { - evmTr, err := s.session.Withdraw() - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Withdraw) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Withdraw, " hash: ", evmTr.Hash()) - - return nil -} diff --git a/znft/storageerc721fixed.go b/znft/storageerc721fixed.go deleted file mode 100644 index faae1fe58..000000000 --- a/znft/storageerc721fixed.go +++ /dev/null @@ -1,297 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - storageerc721fixed "github.com/0chain/gosdk/znft/contracts/dstorageerc721fixed/binding" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -// Solidity Functions -// function mint(uint256 amount) -// function price() public view override returns (uint256) - -type IStorageECR721Fixed interface { - IStorageECR721 -} - -var ( - _ IStorageECR721Fixed = (*StorageECR721Fixed)(nil) -) - -type StorageECR721Fixed struct { - session *storageerc721fixed.BindingSession - ctx context.Context -} - -func (s *StorageECR721Fixed) SetURIFallback(uri string) error { - evmTr, err := s.session.SetURIFallback(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetURIFallback") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetURIFallback, hash: ", evmTr.Hash().Hex()) - - return nil -} - -func (s *StorageECR721Fixed) Total() (*big.Int, error) { - total, err := s.session.Total() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Total") - Logger.Error(err) - return nil, err - } - - return total, nil -} - -func (s *StorageECR721Fixed) Batch() (*big.Int, error) { - batch, err := s.session.Batch() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Batch") - Logger.Error(err) - return nil, err - } - - return batch, nil -} - -func (s *StorageECR721Fixed) Mintable() (bool, error) { - mintable, err := s.session.Mintable() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Mintable") - Logger.Error(err) - return false, err - } - - return mintable, nil -} - -func (s *StorageECR721Fixed) Allocation() (string, error) { - allocation, err := s.session.Allocation() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Allocation") - Logger.Error(err) - return "", err - } - - return allocation, nil -} - -func (s *StorageECR721Fixed) Uri() (string, error) { - uri, err := s.session.Uri() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URI") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721Fixed) UriFallback() (string, error) { - uri, err := s.session.UriFallback() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URIFallback") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721Fixed) Royalty() (*big.Int, error) { - value, err := s.session.Royalty() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Royalty") - Logger.Error(err) - return nil, err - } - - return value, nil -} - -func (s *StorageECR721Fixed) Receiver() (string, error) { - value, err := s.session.Receiver() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Receiver") - Logger.Error(err) - return "", err - } - - return value.String(), nil -} - -func (s *StorageECR721Fixed) Max() (*big.Int, error) { - max, err := s.session.Max() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Max") - Logger.Error(err) - return nil, err - } - - return max, nil -} - -func (s *StorageECR721Fixed) Mint(amount *big.Int) error { - evmTr, err := s.session.Mint(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Mint) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Mint, "hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Fixed) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) { - address, sum, err := s.session.RoyaltyInfo(tokenId, salePrice) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", RoyaltyInfo) - Logger.Error(err) - return "", nil, err - } - - return address.Hex(), sum, nil -} - -func (s *StorageECR721Fixed) MintOwner(amount *big.Int) error { - evmTr, err := s.session.MintOwner(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", MintOwner) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", MintOwner, "hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Fixed) TokenURI(token *big.Int) (string, error) { - tokenURI, err := s.session.TokenURI(token) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", TokenURI) - Logger.Error(err) - return "", err - } - - return tokenURI, nil -} - -func (s *StorageECR721Fixed) TokenURIFallback(token *big.Int) (string, error) { - tokenURI, err := s.session.TokenURIFallback(token) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", TokenURIFallback) - Logger.Error(err) - return "", err - } - - return tokenURI, nil -} - -// Price returns price -func (s *StorageECR721Fixed) Price() (*big.Int, error) { - price, err := s.session.Price() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", Price) - Logger.Error(err) - return nil, err - } - - return price, nil -} - -// SetURI updates uri -func (s *StorageECR721Fixed) SetURI(uri string) error { - evmTr, err := s.session.SetURI(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetURI) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetURI, " hash: ", evmTr.Hash()) - - return nil -} - -// SetAllocation updates allocation -func (s *StorageECR721Fixed) SetAllocation(allocation string) error { - evmTr, err := s.session.SetAllocation(allocation) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetAllocation) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetAllocation, "hash: ", evmTr.Hash()) - - return nil -} - -// SetMintable updates mintable state -func (s *StorageECR721Fixed) SetMintable(status bool) error { - evmTr, err := s.session.SetMintable(status) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetMintable) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetMintable, "hash: ", evmTr.Hash()) - - return nil -} - -// SetRoyalty eth balance from token contract - setReceiver(address receiver_) -func (s *StorageECR721Fixed) SetRoyalty(sum *big.Int) error { - evmTr, err := s.session.SetRoyalty(sum) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetRoyalty) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetRoyalty, " hash: ", evmTr.Hash()) - - return nil -} - -// SetReceiver eth balance from token contract - setReceiver(address receiver_) -func (s *StorageECR721Fixed) SetReceiver(receiver string) error { - address := common.HexToAddress(receiver) - - evmTr, err := s.session.SetReceiver(address) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetReceiver) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetReceiver, " hash: ", evmTr.Hash()) - - return nil -} - -// Withdraw eth balance from token contract - withdraw() -func (s *StorageECR721Fixed) Withdraw() error { - evmTr, err := s.session.Withdraw() - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Withdraw) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Withdraw, " hash: ", evmTr.Hash()) - - return nil -} diff --git a/znft/storageerc721pack.go b/znft/storageerc721pack.go deleted file mode 100644 index d1837258e..000000000 --- a/znft/storageerc721pack.go +++ /dev/null @@ -1,344 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - storageerc721pack "github.com/0chain/gosdk/znft/contracts/dstorageerc721pack/binding" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -// Solidity Functions -// function mintOwner(uint256 amount) -// function mint(uint256 amount) -// function reveal(uint256 tokenId) external returns (bytes32) -// function withdraw(uint256 tokenId) -// function tokenURI(uint256 tokenId) returns (string memory) -// function tokenURIFallback(uint256 tokenId) returns (string memory) -// function setClosed(string calldata closed_) -// function setOpened(string calldata opened_) - -type IStorageECR721Pack interface { - IStorageECR721Fixed - MintOwner(amount *big.Int) error - Mint(amount *big.Int) error - Reveal(tokenId *big.Int) error - Redeem(tokenId *big.Int) error - TokenURI(tokenId *big.Int) (string, error) - TokenURIFallback(tokenId *big.Int) (string, error) - SetClosed(closed string) error - SetOpened(opened string) error -} - -var ( - _ IStorageECR721Pack = (*StorageECR721Pack)(nil) -) - -type StorageECR721Pack struct { - session *storageerc721pack.BindingSession - ctx context.Context -} - -func (s *StorageECR721Pack) SetURIFallback(uri string) error { - evmTr, err := s.session.SetURIFallback(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetURIFallback") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetURIFallback, hash: ", evmTr.Hash().Hex()) - - return nil -} - -func (s *StorageECR721Pack) Withdraw() error { - evmTr, err := s.session.Withdraw() - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Withdraw) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Withdraw, " hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetReceiver(receiver string) error { - address := common.HexToAddress(receiver) - - evmTr, err := s.session.SetReceiver(address) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetReceiver) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetReceiver, " hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetRoyalty(sum *big.Int) error { - evmTr, err := s.session.SetRoyalty(sum) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetRoyalty) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetRoyalty, " hash: ", SetRoyalty, evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetMintable(status bool) error { - evmTr, err := s.session.SetMintable(status) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetMintable) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetMintable, " hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetAllocation(allocation string) error { - evmTr, err := s.session.SetAllocation(allocation) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetAllocation) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetAllocation, " hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetURI(uri string) error { - evmTr, err := s.session.SetURI(uri) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", SetURI) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", SetURI, "hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) Price() (*big.Int, error) { - price, err := s.session.Price() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", Price) - Logger.Error(err) - return nil, err - } - - return price, nil -} - -func (s *StorageECR721Pack) RoyaltyInfo(tokenId, salePrice *big.Int) (string, *big.Int, error) { - address, sum, err := s.session.RoyaltyInfo(tokenId, salePrice) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", RoyaltyInfo) - Logger.Error(err) - return "", nil, err - } - - return address.Hex(), sum, nil -} - -func (s *StorageECR721Pack) Max() (*big.Int, error) { - max, err := s.session.Max() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Max") - Logger.Error(err) - return nil, err - } - - return max, nil -} - -func (s *StorageECR721Pack) Total() (*big.Int, error) { - total, err := s.session.Total() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Total") - Logger.Error(err) - return nil, err - } - - return total, nil -} - -func (s *StorageECR721Pack) Batch() (*big.Int, error) { - batch, err := s.session.Batch() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Batch") - Logger.Error(err) - return nil, err - } - - return batch, nil -} - -func (s *StorageECR721Pack) Mintable() (bool, error) { - mintable, err := s.session.Mintable() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Mintable") - Logger.Error(err) - return false, err - } - - return mintable, nil -} - -func (s *StorageECR721Pack) Allocation() (string, error) { - allocation, err := s.session.Allocation() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Allocation") - Logger.Error(err) - return "", err - } - - return allocation, nil -} - -func (s *StorageECR721Pack) Uri() (string, error) { - uri, err := s.session.Uri() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URI") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721Pack) UriFallback() (string, error) { - uri, err := s.session.UriFallback() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "URIFallback") - Logger.Error(err) - return "", err - } - - return uri, nil -} - -func (s *StorageECR721Pack) Royalty() (*big.Int, error) { - value, err := s.session.Royalty() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Royalty") - Logger.Error(err) - return nil, err - } - - return value, nil -} - -func (s *StorageECR721Pack) Receiver() (string, error) { - value, err := s.session.Receiver() - if err != nil { - err = errors.Wrapf(err, "failed to read %s", "Receiver") - Logger.Error(err) - return "", err - } - - return value.String(), nil -} - -func (s *StorageECR721Pack) MintOwner(amount *big.Int) error { - evmTr, err := s.session.MintOwner(amount) - if err != nil { - return err - } - - Logger.Info("Executed MintOwner, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) Mint(amount *big.Int) error { - evmTr, err := s.session.Mint(amount) - if err != nil { - return err - } - - Logger.Info("Executed Mint, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) Redeem(tokenId *big.Int) error { - evmTr, err := s.session.Redeem(tokenId) - if err != nil { - return err - } - - Logger.Info("Executed Reveal, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) Reveal(tokenId *big.Int) error { - evmTr, err := s.session.Reveal(tokenId) - if err != nil { - return err - } - - Logger.Info("Executed Reveal, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) TokenURI(tokenId *big.Int) (string, error) { - token, err := s.session.TokenURI(tokenId) - if err != nil { - return "", err - } - - Logger.Info("Executed TokenURI, hash: ", token) - - return token, nil -} - -func (s *StorageECR721Pack) TokenURIFallback(tokenId *big.Int) (string, error) { - token, err := s.session.TokenURIFallback(tokenId) - if err != nil { - return "", err - } - - Logger.Info("Executed TokenURIFallback, hash: ", token) - - return token, nil -} - -func (s *StorageECR721Pack) SetClosed(closed string) error { - evmTr, err := s.session.SetClosed(closed) - if err != nil { - return err - } - - Logger.Info("Executed SetClosed, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Pack) SetOpened(opened string) error { - evmTr, err := s.session.SetOpened(opened) - if err != nil { - return err - } - - Logger.Info("Executed SetOpened, hash: ", evmTr.Hash()) - - return nil -} diff --git a/znft/storageerc721random.go b/znft/storageerc721random.go deleted file mode 100644 index e64b6457c..000000000 --- a/znft/storageerc721random.go +++ /dev/null @@ -1,154 +0,0 @@ -package znft - -import ( - "context" - "math/big" - - "github.com/ethereum/go-ethereum/common" - - "github.com/pkg/errors" - - storageerc721random "github.com/0chain/gosdk/znft/contracts/dstorageerc721random/binding" -) - -// Solidity Functions -// function mintOwner(uint256 amount) -// function mint(uint256 amount) -// function reveal(uint256[] calldata tokens) external returns (bytes32) -// function tokenURI(uint256 tokenId) returns (string memory) -// function tokenURIFallback(uint256 tokenId) returns (string memory) -// function setHidden(string calldata hidden_) -// function setPack(address pack_) -// function setRevealable(bool status_) - -type IStorageECR721Random interface { - MintOwner(amount *big.Int) error - Mint(amount *big.Int) error - Reveal(tokens []*big.Int) error - TokenURI(token *big.Int) (string, error) - TokenURIFallback(token *big.Int) (string, error) - SetHidden(hidden string) error - SetPack(address common.Address) error - SetRevealable(status bool) error - Price() (*big.Int, error) -} - -var ( - _ IStorageECR721Random = (*StorageECR721Random)(nil) -) - -type StorageECR721Random struct { - session *storageerc721random.BindingSession - ctx context.Context -} - -func (s *StorageECR721Random) MintOwner(amount *big.Int) error { - evmTr, err := s.session.MintOwner(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", MintOwner) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", MintOwner, " hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) Mint(amount *big.Int) error { - evmTr, err := s.session.Mint(amount) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", Mint) - Logger.Error(err) - return err - } - - Logger.Info("Executed ", Mint, "hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) Reveal(tokens []*big.Int) error { - evmTr, err := s.session.Reveal(tokens) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "Reveal") - Logger.Error(err) - return err - } - - Logger.Info("Executed Reveal, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) TokenURI(token *big.Int) (string, error) { - tokenURI, err := s.session.TokenURI(token) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", TokenURI) - Logger.Error(err) - return "", err - } - - return tokenURI, nil -} - -func (s *StorageECR721Random) TokenURIFallback(token *big.Int) (string, error) { - tokenURI, err := s.session.TokenURIFallback(token) - if err != nil { - err = errors.Wrapf(err, "failed to read %s", TokenURIFallback) - Logger.Error(err) - return "", err - } - - return tokenURI, nil -} - -func (s *StorageECR721Random) SetHidden(hidden string) error { - evmTr, err := s.session.SetHidden(hidden) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetHidden") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetHidden, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) SetPack(address common.Address) error { - evmTr, err := s.session.SetPack(address) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetPack") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetPack, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) SetRevealable(status bool) error { - evmTr, err := s.session.SetRevealable(status) - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetRevealable") - Logger.Error(err) - return err - } - - Logger.Info("Executed SetRevealable, hash: ", evmTr.Hash()) - - return nil -} - -func (s *StorageECR721Random) Price() (*big.Int, error) { - price, err := s.session.Price() - if err != nil { - err = errors.Wrapf(err, "failed to execute %s", "SetMax") - Logger.Error(err) - return price, err - } - - return price, nil -} diff --git a/znft/transaction.go b/znft/transaction.go deleted file mode 100644 index 6263f6c31..000000000 --- a/znft/transaction.go +++ /dev/null @@ -1,52 +0,0 @@ -package znft - -import ( - "context" - - eth "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -func (app *Znft) createTransactionWithGasPrice(ctx context.Context, address string, pack []byte) (*bind.TransactOpts, error) { //nolint - gasLimitUnits, err := app.estimateGas(ctx, address, pack) - if err != nil { - return nil, err - } - - transactOpts, err := app.createSignedTransactionFromKeyStoreWithGasPrice(ctx, gasLimitUnits) - - return transactOpts, err -} - -func (app *Znft) createTransaction(ctx context.Context) (*bind.TransactOpts, error) { - transactOpts, err := app.createSignedTransactionFromKeyStore(ctx) - - return transactOpts, err -} - -func (app *Znft) estimateGas(ctx context.Context, address string, pack []byte) (uint64, error) { //nolint - etherClient, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return 0, errors.Wrap(err, "failed to create etherClient") - } - - // To (contract) - contractAddress := common.HexToAddress(address) - - // Gas limits in units - fromAddress := common.HexToAddress(app.cfg.WalletAddress) - - // Estimate gas - gasLimitUnits, err := etherClient.EstimateGas(ctx, eth.CallMsg{ - To: &contractAddress, - From: fromAddress, - Data: pack, - }) - if err != nil { - return 0, errors.Wrap(err, "failed to estimate gas") - } - - return gasLimitUnits, nil -} diff --git a/znft/znft.go b/znft/znft.go deleted file mode 100644 index f580ce7c6..000000000 --- a/znft/znft.go +++ /dev/null @@ -1,505 +0,0 @@ -package znft - -import ( - "context" - "fmt" - "os" - - "github.com/0chain/gosdk/core/logger" - - storageerc721 "github.com/0chain/gosdk/znft/contracts/dstorageerc721/binding" - storageerc721fixed "github.com/0chain/gosdk/znft/contracts/dstorageerc721fixed/binding" - storageerc721pack "github.com/0chain/gosdk/znft/contracts/dstorageerc721pack/binding" - storageerc721random "github.com/0chain/gosdk/znft/contracts/dstorageerc721random/binding" - - factoryerc721 "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721/binding" - factoryerc721fixed "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721fixed/binding" - factoryerc721pack "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721pack/binding" - factoryerc721random "github.com/0chain/gosdk/znft/contracts/factorymoduleerc721random/binding" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" -) - -var defaultLogLevel = logger.DEBUG -var Logger logger.Logger - -const ( - ConfigFile = "config.yaml" - WalletDir = "wallets" -) - -type Configuration struct { - FactoryAddress string // FactoryAddress address - FactoryModuleERC721Address string // FactoryModuleERC721Address address - FactoryModuleERC721PackedAddress string // FactoryModuleERC721PackedAddress address - FactoryModuleERC721FixedAddress string // FactoryModuleERC721FixedAddress address - FactoryModuleERC721RandomAddress string // FactoryModuleERC721RandomAddress address - EthereumNodeURL string // EthereumNodeURL URL of ethereum RPC node (infura or alchemy) - WalletAddress string // WalletAddress client address - VaultPassword string // VaultPassword used to sign transactions on behalf of the client - Homedir string // Homedir is a client config folder - Value int64 // Value to execute Ethereum smart contracts (default = 0) -} - -type Znft struct { - cfg *Configuration -} - -func init() { - Logger.Init(defaultLogLevel, "0chain-znft-sdk") -} - -func NewNFTApplication(c *Configuration) *Znft { - return &Znft{c} -} - -func GetConfigDir() string { - var configDir string - home, err := os.UserHomeDir() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - configDir = home + "/.zcn" - return configDir -} - -// Functions used by session factories to create session - -func (app *Znft) constructFactoryERC721(ctx context.Context, address string) (*factoryerc721.Binding, *bind.TransactOpts, error) { - storage, err := app.createFactoryERC721(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", "FactoryERC721") - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructFactoryERC721Fixed(ctx context.Context, address string) (*factoryerc721fixed.Binding, *bind.TransactOpts, error) { - storage, err := app.createFactoryERC721Fixed(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", "FactoryERC721Fixed") - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructFactoryERC721Pack(ctx context.Context, address string) (*factoryerc721pack.Binding, *bind.TransactOpts, error) { - storage, err := app.createFactoryERC721Pack(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", "FactoryERC721Pack") - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructFactoryERC721Random(ctx context.Context, address string) (*factoryerc721random.Binding, *bind.TransactOpts, error) { - storage, err := app.createFactoryERC721Random(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", "FactoryERC721Random") - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructStorageERC721Random(ctx context.Context, address string) (*storageerc721random.Binding, *bind.TransactOpts, error) { - storage, err := app.createStorageERC721Random(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", ContractStorageERC721RandomName) - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructStorageERC721Pack(ctx context.Context, address string) (*storageerc721pack.Binding, *bind.TransactOpts, error) { - storage, err := app.createStorageERC721Pack(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", ContractStorageERC721PackName) - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructStorageERC721Fixed(ctx context.Context, address string) (*storageerc721fixed.Binding, *bind.TransactOpts, error) { - storage, err := app.createStorageERC721Fixed(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", ContractStorageERC721FixedName) - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -func (app *Znft) constructStorageERC721(ctx context.Context, address string) (*storageerc721.Binding, *bind.TransactOpts, error) { - storage, err := app.createStorageERC721(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to construct %s", ContractStorageERC721Name) - } - - transaction, err := app.createTransactOpts(ctx) - - return storage, transaction, err -} - -// Used to create StorageERC721 with preliminary gas estimation -func (app *Znft) constructWithEstimation( //nolint - ctx context.Context, - address string, - method string, - params ...interface{}, -) (*storageerc721.Binding, *bind.TransactOpts, error) { - erc721, err := app.createStorageERC721(address) - if err != nil { - return nil, nil, errors.Wrapf(err, "failed to create %s in method: %s", ContractStorageERC721Name, method) - } - - transaction, err := app.createTransactOptsWithEstimation(ctx, address, method, params) - - return erc721, transaction, err -} - -// Create transaction opts with sender signature -func (app *Znft) createTransactOpts(ctx context.Context) (*bind.TransactOpts, error) { - transaction, err := app.createTransaction(ctx) - if err != nil { - return nil, errors.Wrapf(err, "failed to create createTransactOpts in %s", ContractStorageERC721Name) - } - - return transaction, nil -} - -func (app *Znft) createTransactOptsWithEstimation( //nolint - ctx context.Context, - address, method string, - params ...interface{}, -) (*bind.TransactOpts, error) { - // Get ABI of the contract - abi, err := storageerc721.BindingMetaData.GetAbi() - if err != nil { - return nil, errors.Wrapf(err, "failed to get ABI in %s, method: %s", ContractStorageERC721Name, method) - } - - // Pack the method arguments - pack, err := abi.Pack(method, params...) - if err != nil { - return nil, errors.Wrapf(err, "failed to pack arguments in %s, method: %s", ContractStorageERC721Name, method) - } - - transaction, err := app.createTransactionWithGasPrice(ctx, address, pack) - if err != nil { - return nil, errors.Wrapf(err, "failed to create createTransaction in %s, method: %s", ContractStorageERC721Name, method) - } - - return transaction, nil -} - -// Session factories - -// Factory Sessions - -func (app *Znft) CreateFactoryERC721Session(ctx context.Context, addr string) (IFactoryERC721, error) { - contract, transact, err := app.constructFactoryERC721(ctx, addr) - if err != nil { - return nil, err - } - - session := &factoryerc721.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &FactoryERC721{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateFactoryERC721PackSession(ctx context.Context, addr string) (IFactoryPack, error) { - contract, transact, err := app.constructFactoryERC721Pack(ctx, addr) - if err != nil { - return nil, err - } - - session := &factoryerc721pack.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &FactoryPack{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateFactoryERC721FixedSession(ctx context.Context, addr string) (IFactoryFixed, error) { - contract, transact, err := app.constructFactoryERC721Fixed(ctx, addr) - if err != nil { - return nil, err - } - - session := &factoryerc721fixed.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &FactoryFixed{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateFactoryERC721RandomSession(ctx context.Context, addr string) (IFactoryRandom, error) { - contract, transact, err := app.constructFactoryERC721Random(ctx, addr) - if err != nil { - return nil, err - } - - session := &factoryerc721random.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &FactoryRandom{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -// Storage Sessions - -func (app *Znft) CreateStorageERC721PackSession(ctx context.Context, addr string) (IStorageECR721Pack, error) { - contract, transact, err := app.constructStorageERC721Pack(ctx, addr) - if err != nil { - return nil, err - } - - session := &storageerc721pack.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &StorageECR721Pack{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateStorageERC721RandomSession(ctx context.Context, addr string) (IStorageECR721Random, error) { - contract, transact, err := app.constructStorageERC721Random(ctx, addr) - if err != nil { - return nil, err - } - - session := &storageerc721random.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &StorageECR721Random{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateStorageERC721FixedSession(ctx context.Context, addr string) (IStorageECR721Fixed, error) { - contract, transact, err := app.constructStorageERC721Fixed(ctx, addr) - if err != nil { - return nil, err - } - - session := &storageerc721fixed.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &StorageECR721Fixed{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -func (app *Znft) CreateStorageERC721Session(ctx context.Context, addr string) (IStorageECR721, error) { - contract, transact, err := app.constructStorageERC721(ctx, addr) - if err != nil { - return nil, err - } - - session := &storageerc721.BindingSession{ - Contract: contract, - CallOpts: bind.CallOpts{ - Pending: true, - From: transact.From, - Context: ctx, - }, - TransactOpts: *transact, - } - - storage := &StorageECR721{ - session: session, - ctx: ctx, - } - - return storage, nil -} - -// Binding factories - -func (app *Znft) createStorageERC721(address string) (*storageerc721.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := storageerc721.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createStorageERC721Fixed(address string) (*storageerc721fixed.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := storageerc721fixed.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createStorageERC721Random(address string) (*storageerc721random.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := storageerc721random.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createStorageERC721Pack(address string) (*storageerc721pack.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := storageerc721pack.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createFactoryERC721(address string) (*factoryerc721.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := factoryerc721.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createFactoryERC721Pack(address string) (*factoryerc721pack.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := factoryerc721pack.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createFactoryERC721Random(address string) (*factoryerc721random.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := factoryerc721random.NewBinding(addr, client) - - return instance, err -} - -func (app *Znft) createFactoryERC721Fixed(address string) (*factoryerc721fixed.Binding, error) { - client, err := CreateEthClient(app.cfg.EthereumNodeURL) - if err != nil { - return nil, err - } - - addr := common.HexToAddress(address) - instance, err := factoryerc721fixed.NewBinding(addr, client) - - return instance, err -} From 0d4f227da193445abed9583555e1882599276a7c Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Thu, 23 Jan 2025 01:27:15 +0530 Subject: [PATCH 21/23] refactor 2 --- go.mod | 59 +++++++++----------------------------- go.sum | 33 ++------------------- mobilesdk/sdk/sdk.go | 6 ++-- mobilesdk/zcn/writepool.go | 2 +- wasmsdk/allocation.go | 2 +- wasmsdk/blobber.go | 2 +- wasmsdk/common.go | 2 +- wasmsdk/player_file.go | 2 +- wasmsdk/proxy.go | 2 +- wasmsdk/sdk.go | 2 +- 10 files changed, 27 insertions(+), 85 deletions(-) diff --git a/go.mod b/go.mod index 2c24d6ca9..22506e231 100644 --- a/go.mod +++ b/go.mod @@ -5,118 +5,89 @@ go 1.22.0 require ( github.com/0chain/common v1.18.3 github.com/0chain/errors v1.0.3 - github.com/Luzifer/go-openssl/v3 v3.1.0 - github.com/btcsuite/btcd v0.23.4 + github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect + github.com/btcsuite/btcd v0.23.4 // indirect github.com/ethereum/go-ethereum v1.10.26 github.com/google/uuid v1.3.0 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.0 // indirect github.com/h2non/filetype v1.1.4-0.20231228185113-6469358c2bcb - github.com/hashicorp/go-retryablehttp v0.7.2 + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.1 - github.com/herumi/bls-go-binary v1.31.0 + github.com/herumi/bls-go-binary v1.31.0 // indirect github.com/hitenjain14/fasthttp v0.0.0-20240916135632-f9303a91736c github.com/influxdata/influxdb v1.8.3 github.com/klauspost/reedsolomon v1.11.8 github.com/lithammer/shortuuid/v3 v3.0.7 - github.com/machinebox/graphql v0.2.2 + github.com/machinebox/graphql v0.2.2 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/pkg/errors v0.9.1 - github.com/shopspring/decimal v1.3.1 - github.com/spf13/viper v1.15.0 + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/viper v1.15.0 // indirect github.com/stretchr/testify v1.9.0 - github.com/tyler-smith/go-bip39 v1.1.0 + github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/uptrace/bunrouter v1.0.20 go.dedis.ch/kyber/v3 v3.1.0 go.uber.org/zap v1.24.0 golang.org/x/crypto v0.21.0 - golang.org/x/image v0.14.0 + golang.org/x/image v0.14.0 // indirect golang.org/x/sync v0.7.0 gopkg.in/cheggaaa/pb.v1 v1.0.28 gopkg.in/natefinch/lumberjack.v2 v2.2.1 - gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( + github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00 github.com/hack-pad/go-webworkers v0.1.0 - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/minio/sha256-simd v1.0.1 github.com/valyala/bytebufferpool v1.0.0 - github.com/ybbus/jsonrpc/v3 v3.1.5 ) require ( - github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e // indirect - github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/andybalholm/brotli v1.0.5 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect - github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect - github.com/go-kit/kit v0.9.0 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/golang-jwt/jwt/v4 v4.3.0 // indirect - github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect - github.com/huin/goupnp v1.0.3 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/matryer/is v1.4.1 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/mitchellh/pointerstructure v1.2.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/philhofer/fwd v1.1.2-0.20210722190033-5c56ac6d0bb9 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/tsdb v0.7.1 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/rjeczalik/notify v0.9.1 // indirect - github.com/rs/cors v1.7.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/status-im/keycard-go v0.2.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tinylib/msgp v1.1.6 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect - github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect github.com/valyala/fasthttp v1.51.0 // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/ybbus/jsonrpc/v3 v3.1.5 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect ) require ( - github.com/btcsuite/btcd/btcutil v1.1.3 + github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/hack-pad/safejs v0.1.1 github.com/klauspost/compress v1.17.0 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect @@ -124,8 +95,6 @@ require ( github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/time v0.3.0 // indirect ) //replace github.com/ethereum/go-ethereum => github.com/certifaction/go-ethereum v1.10.3-wasm diff --git a/go.sum b/go.sum index b74883881..d067259d1 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,8 @@ github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e h1:TskvG+KrEWp4obrELJk1QRX3tjnsr1mlBapeb1fV2cU= github.com/0chain/gosdk_common v0.0.0-20250121151838-b0477651681e/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM= +github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00 h1:wXxNBOnZxE1nG+6oKjdK5S58yckasW0W8UW2h70ZZTc= +github.com/0chain/gosdk_common v0.0.0-20250122192236-7180658d2e00/go.mod h1:5MtnciUdibSOd2nDEWw346eWXmvpZZAywwrgFm/qmKM= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -60,8 +62,6 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -104,8 +104,8 @@ github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOC github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -144,7 +144,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2U github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= @@ -179,12 +178,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -228,7 +223,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -306,7 +300,6 @@ github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -349,7 +342,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -369,11 +361,9 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -385,7 +375,6 @@ github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dz github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= @@ -394,20 +383,16 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -437,7 +422,6 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= @@ -661,8 +645,6 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -682,13 +664,11 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -729,11 +709,9 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= @@ -810,8 +788,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -926,15 +902,12 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/mobilesdk/sdk/sdk.go b/mobilesdk/sdk/sdk.go index f246b431c..539c26189 100644 --- a/mobilesdk/sdk/sdk.go +++ b/mobilesdk/sdk/sdk.go @@ -16,15 +16,15 @@ import ( "github.com/0chain/gosdk_common/core/sys" "github.com/pkg/errors" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/core/client" "github.com/0chain/gosdk_common/core/conf" "github.com/0chain/gosdk_common/core/util" "github.com/0chain/gosdk_common/core/version" - "github.com/0chain/gosdk_common/sdk" l "github.com/0chain/gosdk_common/zboxcore/logger" - "github.com/0chain/gosdk_common/mobilesdk/zbox" - "github.com/0chain/gosdk_common/mobilesdk/zboxapi" + "github.com/0chain/gosdk/mobilesdk/zbox" + "github.com/0chain/gosdk/mobilesdk/zboxapi" "github.com/0chain/gosdk_common/zcncore" ) diff --git a/mobilesdk/zcn/writepool.go b/mobilesdk/zcn/writepool.go index c1b1254a8..93de28bfb 100644 --- a/mobilesdk/zcn/writepool.go +++ b/mobilesdk/zcn/writepool.go @@ -6,7 +6,7 @@ package zcn import ( "strconv" - "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk/zboxcore/sdk" ) // WritePoolLock locks given number of tokes for given duration in read pool. diff --git a/wasmsdk/allocation.go b/wasmsdk/allocation.go index d42011e36..9787d8a32 100644 --- a/wasmsdk/allocation.go +++ b/wasmsdk/allocation.go @@ -13,8 +13,8 @@ import ( "sync" "syscall/js" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/core/transaction" - "github.com/0chain/gosdk_common/sdk" "github.com/0chain/gosdk_common/wasmsdk/jsbridge" ) diff --git a/wasmsdk/blobber.go b/wasmsdk/blobber.go index bbe1229ac..82c185627 100644 --- a/wasmsdk/blobber.go +++ b/wasmsdk/blobber.go @@ -23,9 +23,9 @@ import ( "github.com/0chain/gosdk_common/core/sys" "github.com/hack-pad/safejs" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk/zboxcore/zboxutil" "github.com/0chain/gosdk_common/core/transaction" - "github.com/0chain/gosdk_common/sdk" "github.com/0chain/gosdk_common/wasmsdk/jsbridge" "github.com/0chain/gosdk_common/zboxcore/fileref" diff --git a/wasmsdk/common.go b/wasmsdk/common.go index 98079e9d4..64008c620 100644 --- a/wasmsdk/common.go +++ b/wasmsdk/common.go @@ -7,7 +7,7 @@ import ( "errors" "syscall/js" - "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/wasmsdk/jsbridge" ) diff --git a/wasmsdk/player_file.go b/wasmsdk/player_file.go index 866e99001..7d847adb5 100644 --- a/wasmsdk/player_file.go +++ b/wasmsdk/player_file.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - "github.com/0chain/gosdk_common/sdk" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/zboxcore/marker" ) diff --git a/wasmsdk/proxy.go b/wasmsdk/proxy.go index fec80855b..231d80954 100644 --- a/wasmsdk/proxy.go +++ b/wasmsdk/proxy.go @@ -13,11 +13,11 @@ import ( "sync" "time" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/core/client" "github.com/0chain/gosdk_common/core/sys" "github.com/0chain/gosdk_common/core/version" "github.com/0chain/gosdk_common/core/zcncrypto" - "github.com/0chain/gosdk_common/sdk" "github.com/0chain/gosdk_common/wasmsdk/jsbridge" "github.com/0chain/gosdk_common/zcncore" diff --git a/wasmsdk/sdk.go b/wasmsdk/sdk.go index beddff136..94a760179 100644 --- a/wasmsdk/sdk.go +++ b/wasmsdk/sdk.go @@ -8,12 +8,12 @@ import ( "encoding/json" "fmt" + "github.com/0chain/gosdk/zboxcore/sdk" "github.com/0chain/gosdk_common/core/client" "github.com/0chain/gosdk_common/core/encryption" "github.com/0chain/gosdk_common/core/imageutil" "github.com/0chain/gosdk_common/core/logger" "github.com/0chain/gosdk_common/core/screstapi" - "github.com/0chain/gosdk_common/sdk" "github.com/0chain/gosdk_common/zcncore" "io" From fe429976262ab120d0e882c713ae91c459c226bb Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Thu, 23 Jan 2025 16:47:41 +0530 Subject: [PATCH 22/23] added verison --- core/version/version.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 core/version/version.go diff --git a/core/version/version.go b/core/version/version.go new file mode 100644 index 000000000..e69de29bb From 4008c7ae22d594c91e32844c7e13a39aea77d9d0 Mon Sep 17 00:00:00 2001 From: smaulik13 Date: Thu, 23 Jan 2025 17:08:44 +0530 Subject: [PATCH 23/23] added version --- core/version/version.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/version/version.go b/core/version/version.go index e69de29bb..fa0af25cc 100644 --- a/core/version/version.go +++ b/core/version/version.go @@ -0,0 +1,5 @@ +//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ======== + +package version + +const VERSIONSTR = "v1.17.11-269-g7fd90660"