From 96cb3fe98854c28e59e661cd34e160b5a4db5c76 Mon Sep 17 00:00:00 2001 From: Emanuel Pargov Date: Tue, 10 Oct 2023 14:53:04 +0300 Subject: [PATCH] Fix: Examples (#815) Signed-off-by: Emanuel Pargov --- client.go | 7 + examples/account_allowance/main.go | 144 +-- .../account_create_token_transfer/main.go | 51 +- examples/account_create_with_hts/main.go | 75 +- examples/alias_id_example/main.go | 30 +- examples/consensus_pub_sub/main.go | 29 +- examples/consensus_pub_sub_chunked/main.go | 39 +- .../consensus_pub_sub_with_submit_key/main.go | 31 +- examples/construct_client/main.go | 31 +- examples/contract_helper/contract_helper.go | 21 +- examples/create_account/main.go | 18 +- examples/create_account_with_alias/main.go | 33 +- .../main.go | 39 +- .../main.go | 33 +- examples/create_file/main.go | 15 +- examples/create_simple_contract/main.go | 45 +- examples/create_stateful_contract/main.go | 51 +- examples/custom_fees/main.go | 134 +- examples/delete_account/main.go | 27 +- examples/delete_file/main.go | 39 +- examples/exempt_custom_fees/main.go | 45 +- examples/file_append_chunked/main.go | 25 +- examples/generate_key/main.go | 3 +- examples/generate_key_with_mnemonic/main.go | 18 +- examples/get_account_balance/main.go | 12 +- examples/get_address_book/main.go | 34 +- examples/get_file_contents/main.go | 15 +- examples/logging/main.go | 18 +- examples/multi_app_transfer/main.go | 31 +- examples/precompile_example/ExpiryHelper.sol | 13 +- examples/precompile_example/FeeHelper.sol | 123 +- .../HederaResponseCodes.sol | 122 +- .../precompile_example/HederaTokenService.sol | 239 ++-- .../IHederaTokenService.sol | 143 ++- .../IPrngSystemContract.sol | 2 +- examples/precompile_example/KeyHelper.sol | 170 ++- .../precompile_example/PrecompileExample.json | 1110 ++++++----------- .../precompile_example/PrecompileExample.sol | 89 +- .../precompile_example/PrngSystemContract.sol | 2 +- .../ZeroTokenOperations.json | 586 +++------ .../ZeroTokenOperations.sol | 65 +- examples/precompile_example/main.go | 106 +- examples/rng_transaction/main.go | 26 +- .../schedule_identical_transaction/main.go | 57 +- .../schedule_multisig_transaction/main.go | 49 +- examples/schedule_transfer_example/main.go | 58 +- examples/schedule_with_expiration/main.go | 52 +- examples/staking/main.go | 21 +- examples/staking_with_update/main.go | 37 +- examples/topic_with_admin_key/main.go | 37 +- examples/transfer_crypto/main.go | 19 +- examples/transfer_tokens/main.go | 122 +- examples/update_account_public_key/main.go | 31 +- examples/validate_checksum/main.go | 121 -- examples/zero_token_operations/main.go | 60 +- 55 files changed, 1955 insertions(+), 2598 deletions(-) delete mode 100644 examples/validate_checksum/main.go diff --git a/client.go b/client.go index 51aed4a15..08f2e5a22 100644 --- a/client.go +++ b/client.go @@ -199,6 +199,13 @@ func ClientForName(name string) (*Client, error) { return ClientForPreviewnet(), nil case string(NetworkNameMainnet): return ClientForMainnet(), nil + case "local", "localhost": + network := make(map[string]AccountID) + network["127.0.0.1:50213"] = AccountID{Account: 3} + mirror := []string{"127.0.0.1:5600"} + client := ClientForNetwork(network) + client.SetMirrorNetwork(mirror) + return client, nil default: return &Client{}, fmt.Errorf("%q is not recognized as a valid Hedera _Network", name) } diff --git a/examples/account_allowance/main.go b/examples/account_allowance/main.go index 789072d87..3be2c314b 100644 --- a/examples/account_allowance/main.go +++ b/examples/account_allowance/main.go @@ -1,8 +1,10 @@ package main import ( - "github.com/hashgraph/hedera-sdk-go/v2" + "fmt" "os" + + "github.com/hashgraph/hedera-sdk-go/v2" ) func main() { @@ -12,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } - // Retrieving operator ID from environment variable OPERATOR_ID + // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -35,19 +34,16 @@ func main() { aliceKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } bobKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } charlieKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } transactionResponse, err := hedera.NewAccountCreateTransaction(). @@ -55,14 +51,12 @@ func main() { SetInitialBalance(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving account creation receipt", err)) } aliceID := *transactionReceipt.AccountID @@ -73,14 +67,12 @@ func main() { SetInitialBalance(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error creating second account") - return + panic(fmt.Sprintf("%v : error creating second account", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving second account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving second account creation receipt", err)) } bobID := *transactionReceipt.AccountID @@ -91,14 +83,12 @@ func main() { SetInitialBalance(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error creating second account") - return + panic(fmt.Sprintf("%v : error creating second account", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving second account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving second account creation receipt", err)) } charlieID := *transactionReceipt.AccountID @@ -109,8 +99,7 @@ func main() { println("Initial Balance:") err = printBalance(client, aliceID, bobID, charlieID, []hedera.AccountID{transactionResponse.NodeID}) if err != nil { - println(err.Error(), ": error retrieving balances") - return + panic(fmt.Sprintf("%v : error retrieving balances", err)) } println("Approve an allowance of 2 Hbar with owner Alice and spender Bob") @@ -120,28 +109,24 @@ func main() { ApproveHbarAllowance(aliceID, bobID, hedera.NewHbar(2)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account allowance approve transaction") - return + panic(fmt.Sprintf("%v : error freezing account allowance approve transaction", err)) } approvalFreeze.Sign(aliceKey) transactionResponse, err = approvalFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing account allowance approve transaction") - return + panic(fmt.Sprintf("%v : error executing account allowance approve transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting account allowance receipt") - return + panic(fmt.Sprintf("%v : error getting account allowance receipt", err)) } err = printBalance(client, aliceID, bobID, charlieID, []hedera.AccountID{transactionResponse.NodeID}) if err != nil { - println(err.Error(), ": error retrieving balances") - return + panic(fmt.Sprintf("%v : error retrieving balances", err)) } println("Transferring 1 Hbar from Alice to Charlie, but the transaction is signed _only_ by Bob (Bob is dipping into his allowance from Alice)") @@ -153,29 +138,25 @@ func main() { SetTransactionID(hedera.TransactionIDGenerate(bobID)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer transaction") - return + panic(fmt.Sprintf("%v : error freezing transfer transaction", err)) } transferFreeze.Sign(bobKey) transactionResponse, err = transferFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing transfer transaction") - return + panic(fmt.Sprintf("%v : error executing transfer transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer transaction receipt", err)) } println("Transfer succeeded. Bob should now have 1 Hbar left in his allowance.") err = printBalance(client, aliceID, bobID, charlieID, []hedera.AccountID{transactionResponse.NodeID}) if err != nil { - println(err.Error(), ": error retrieving balances") - return + panic(fmt.Sprintf("%v : error retrieving balances", err)) } println("Attempting to transfer 2 Hbar from Alice to Charlie using Bob's allowance.") @@ -188,16 +169,14 @@ func main() { SetTransactionID(hedera.TransactionIDGenerate(bobID)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer transaction") - return + panic(fmt.Sprintf("%v : error freezing transfer transaction", err)) } transferFreeze.Sign(bobKey) transactionResponse, err = transferFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing transfer transaction") - return + panic(fmt.Sprintf("%v : error executing transfer transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) @@ -212,28 +191,24 @@ func main() { ApproveHbarAllowance(aliceID, bobID, hedera.NewHbar(2)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account allowance adjust transaction") - return + panic(fmt.Sprintf("%v : error freezing account allowance adjust transaction", err)) } allowanceAdjust.Sign(aliceKey) transactionResponse, err = allowanceAdjust.Execute(client) if err != nil { - println(err.Error(), ": error executing account allowance adjust transaction") - return + panic(fmt.Sprintf("%v : error executing account allowance adjust transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account allowance adjust receipt") - return + panic(fmt.Sprintf("%v : error retrieving account allowance adjust receipt", err)) } err = printBalance(client, aliceID, bobID, charlieID, []hedera.AccountID{transactionResponse.NodeID}) if err != nil { - println(err.Error(), ": error retrieving balances") - return + panic(fmt.Sprintf("%v : error retrieving balances", err)) } println("Attempting to transfer 2 Hbar from Alice to Charlie using Bob's allowance again.") @@ -246,29 +221,25 @@ func main() { SetTransactionID(hedera.TransactionIDGenerate(bobID)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer transaction") - return + panic(fmt.Sprintf("%v : error freezing transfer transaction", err)) } transferFreeze.Sign(bobKey) transactionResponse, err = transferFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing transfer transaction") - return + panic(fmt.Sprintf("%v : error executing transfer transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ", error retrieving transfer transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer transaction receipt", err)) } println("Transfer succeeded.") err = printBalance(client, aliceID, bobID, charlieID, []hedera.AccountID{transactionResponse.NodeID}) if err != nil { - println(err.Error(), ": error retrieving balances") - return + panic(fmt.Sprintf("%v : error retrieving balances", err)) } println("Deleting Bob's allowance") @@ -278,22 +249,19 @@ func main() { ApproveHbarAllowance(aliceID, bobID, hedera.ZeroHbar). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account allowance approve transaction") - return + panic(fmt.Sprintf("%v : error freezing account allowance approve transaction", err)) } approvalFreeze.Sign(aliceKey) transactionResponse, err = approvalFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing account allowance approve transaction") - return + panic(fmt.Sprintf("%v : error executing account allowance approve transaction", err)) } _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting account allowance receipt") - return + panic(fmt.Sprintf("%v : error getting account allowance receipt", err)) } println("If Bob tries to use his allowance it should fail.") @@ -305,16 +273,14 @@ func main() { SetTransactionID(hedera.TransactionIDGenerate(bobID)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer transaction") - return + panic(fmt.Sprintf("%v : error freezing transfer transaction", err)) } transferFreeze.Sign(bobKey) transactionResponse, err = transferFreeze.Execute(client) if err != nil { - println(err.Error(), ": error executing transfer transaction") - return + panic(fmt.Sprintf("%v : error executing transfer transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) @@ -330,22 +296,19 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing alice's account deletion") - return + panic(fmt.Sprintf("%v : error freezing alice's account deletion", err)) } accountDelete.Sign(aliceKey) transactionResponse, err = accountDelete.Execute(client) if err != nil { - println(err.Error(), ": error executing alice's account deletion") - return + panic(fmt.Sprintf("%v : error executing alice's account deletion", err)) } _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving alice's account deletion receipt") - return + panic(fmt.Sprintf("%v : error retrieving alice's account deletion receipt", err)) } accountDelete, err = hedera.NewAccountDeleteTransaction(). @@ -354,22 +317,19 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing bob's account deletion") - return + panic(fmt.Sprintf("%v : error freezing bob's account deletion", err)) } accountDelete.Sign(bobKey) transactionResponse, err = accountDelete.Execute(client) if err != nil { - println(err.Error(), ": error executing bob's account deletion") - return + panic(fmt.Sprintf("%v : error executing bob's account deletion", err)) } _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving bob's account deletion receipt") - return + panic(fmt.Sprintf("%v : error retrieving bob's account deletion receipt", err)) } accountDelete, err = hedera.NewAccountDeleteTransaction(). @@ -378,28 +338,24 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing charlie's account deletion") - return + panic(fmt.Sprintf("%v : error freezing charlie's account deletion", err)) } accountDelete.Sign(charlieKey) transactionResponse, err = accountDelete.Execute(client) if err != nil { - println(err.Error(), ": error executing charlie's account deletion") - return + panic(fmt.Sprintf("%v : error executing charlie's account deletion", err)) } _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving charlie's account deletion receipt") - return + panic(fmt.Sprintf("%v : error retrieving charlie's account deletion receipt", err)) } err = client.Close() if err != nil { - println(err.Error(), ": error closing client") - return + panic(fmt.Sprintf("%v : error closing client", err)) } } diff --git a/examples/account_create_token_transfer/main.go b/examples/account_create_token_transfer/main.go index 556ecd662..c72dcf0c0 100644 --- a/examples/account_create_token_transfer/main.go +++ b/examples/account_create_token_transfer/main.go @@ -8,18 +8,29 @@ import ( ) func main() { - client := hedera.ClientForTestnet() - myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) + var client *hedera.Client + var err error + + // Retrieving network type from environment variable HEDERA_NETWORK + client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error creating client", err)) } - myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) + // Retrieving operator ID from environment variable OPERATOR_ID + operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } - client.SetOperator(myAccountId, myPrivateKey) + // Retrieving operator key from environment variable OPERATOR_KEY + operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) + if err != nil { + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) + } + + // Setting the client operator ID and key + client.SetOperator(operatorAccountID, operatorKey) // ## Example // Create a ECDSA private key @@ -38,8 +49,7 @@ func main() { // Create a ECDSA private key privateKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error()) - return + panic(err) } // Extract the ECDSA public key public key publicKey := privateKey.PublicKey() @@ -49,30 +59,26 @@ func main() { // Create an AccountID struct with EVM address evmAddressAccount, err := hedera.AccountIDFromEvmPublicAddress(evmAddress) if err != nil { - println("error creating account from EVM address", err.Error()) - return + panic(fmt.Sprintf("%v : error creating account from EVM address", err)) } // Transfer tokens using the `TransferTransaction` to the Etherum Account Address tx, err := hedera.NewTransferTransaction().AddHbarTransfer(evmAddressAccount, hedera.NewHbar(4)). - AddHbarTransfer(myAccountId, hedera.NewHbar(-4)).Execute(client) + AddHbarTransfer(operatorAccountID, hedera.NewHbar(-4)).Execute(client) if err != nil { - println(err.Error()) - return + panic(err) } // Get the child receipt or child record to return the Hedera Account ID for the new account that was created receipt, err := tx.GetReceiptQuery().SetIncludeChildren(true).Execute(client) if err != nil { - println("error with receipt: ", err.Error()) - return + panic(fmt.Sprintf("%v : error with receipt: ", err)) } newAccountId := *receipt.Children[0].AccountID // Get the `AccountInfo` on the new account and show it is a hollow account by not having a public key info, err := hedera.NewAccountInfoQuery().SetAccountID(newAccountId).Execute(client) if err != nil { - println(err.Error()) - return + panic(err) } // Verify account is created with the public address provided fmt.Println(info.ContractAccountID == publicKey.ToEvmAddress()) @@ -84,23 +90,20 @@ func main() { // Use the hollow account as a transaction fee payer in a HAPI transaction // Sign the transaction with ECDSA private key client.SetOperator(newAccountId, privateKey) - tx, err = hedera.NewTransferTransaction().AddHbarTransfer(myAccountId, hedera.NewHbar(1)). + tx, err = hedera.NewTransferTransaction().AddHbarTransfer(operatorAccountID, hedera.NewHbar(1)). AddHbarTransfer(newAccountId, hedera.NewHbar(-1)).Execute(client) if err != nil { - println(err.Error()) - return + panic(err) } receipt, err = tx.GetReceiptQuery().Execute(client) if err != nil { - println("error with receipt: ", err.Error()) - return + panic(fmt.Sprintf("%v : error with receipt: ", err)) } // Get the `AccountInfo` of the account and show the account is now a complete account by returning the public key on the account info, err = hedera.NewAccountInfoQuery().SetAccountID(newAccountId).Execute(client) if err != nil { - println(err.Error()) - return + panic(err) } // Verify account is created with the public address provided fmt.Println(info.ContractAccountID == publicKey.ToEvmAddress()) diff --git a/examples/account_create_with_hts/main.go b/examples/account_create_with_hts/main.go index 0c1b42f42..e75f603b8 100644 --- a/examples/account_create_with_hts/main.go +++ b/examples/account_create_with_hts/main.go @@ -10,21 +10,18 @@ func main() { client, err := hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } operatorId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromStringEd25519(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -32,18 +29,15 @@ func main() { supplyKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error(), ": error creating supply key") - return + panic(fmt.Sprintf("%v : error creating supply key", err)) } freezeKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error(), ": error creating freeze key") - return + panic(fmt.Sprintf("%v : error creating freeze key", err)) } wipeKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error(), ": error creating wipe key") - return + panic(fmt.Sprintf("%v : error creating wipe key", err)) } /** * Example 1 @@ -67,22 +61,19 @@ func main() { SetTreasuryAccountID(operatorId).SetSupplyType(hedera.TokenSupplyTypeFinite). SetAdminKey(operatorKey).SetFreezeKey(freezeKey).SetWipeKey(wipeKey).SetSupplyKey(supplyKey).FreezeWith(client) if err != nil { - println(err.Error(), ": error creating token transaction") - return + panic(fmt.Sprintf("%v : error creating token transaction", err)) } // Sign the transaction with the operator key nftSignTransaction := nftCreateTransaction.Sign(operatorKey) // Submit the transaction to the Hedera network nftCreateSubmit, err := nftSignTransaction.Execute(client) if err != nil { - println(err.Error(), ": error submitting transaction") - return + panic(fmt.Sprintf("%v : error submitting transaction", err)) } // Get transaction receipt information nftCreateReceipt, err := nftCreateSubmit.GetReceipt(client) if err != nil { - println(err.Error(), ": error receiving receipt") - return + panic(fmt.Sprintf("%v : error receiving receipt", err)) } // Get token id from the transaction nftTokenID := *nftCreateReceipt.TokenID @@ -99,18 +90,15 @@ func main() { for i, s := range cid { mintTransaction, err := hedera.NewTokenMintTransaction().SetTokenID(nftTokenID).SetMetadata([]byte(s)).FreezeWith(client) if err != nil { - println(err.Error(), ": error creating mint transaction") - return + panic(fmt.Sprintf("%v : error creating mint transaction", err)) } mintTransactionSubmit, err := mintTransaction.Sign(supplyKey).Execute(client) if err != nil { - println(err.Error(), ": error submitting transaction") - return + panic(fmt.Sprintf("%v : error submitting transaction", err)) } receipt, err := mintTransactionSubmit.GetReceipt(client) if err != nil { - println(err.Error(), ": error receiving receipt") - return + panic(fmt.Sprintf("%v : error receiving receipt", err)) } nftCollection = append(nftCollection, receipt) fmt.Println("Created NFT ", nftTokenID.String(), " with serial: ", nftCollection[i].SerialNumbers[0]) @@ -125,8 +113,7 @@ func main() { fmt.Println("Creating new account...") privateKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error(), ": error generating private key") - return + panic(fmt.Sprintf("%v : error generating private key", err)) } publicKey := privateKey.PublicKey() // Assuming that the target shard and realm are known. @@ -142,16 +129,14 @@ func main() { */ nftTransferTransaction, err := hedera.NewTransferTransaction().AddNftTransfer(exampleNftId, operatorId, *aliasAccountId).FreezeWith(client) if err != nil { - println(err.Error(), ": error creating transaction") - return + panic(fmt.Sprintf("%v : error creating transaction", err)) } // Sign the transaction with the operator key nftTransferTransactionSign := nftTransferTransaction.Sign(operatorKey) // Submit the transaction to the Hedera network nftTransferTransactionSubmit, err := nftTransferTransactionSign.Execute(client) if err != nil { - println(err.Error(), ": error submitting transaction") - return + panic(fmt.Sprintf("%v : error submitting transaction", err)) } // Get transaction receipt information here fmt.Println(nftTransferTransactionSubmit.GetReceipt(client)) @@ -165,8 +150,7 @@ func main() { //Returns the info for the specified NFT id nftInfo, err := hedera.NewTokenNftInfoQuery().SetNftID(exampleNftId).Execute(client) if err != nil { - println(err.Error(), ": error info query transaction") - return + panic(fmt.Sprintf("%v : error info query transaction", err)) } nftOwnerAccountId := nftInfo[0].AccountID fmt.Println("Current owner account id: ", nftOwnerAccountId) @@ -178,8 +162,7 @@ func main() { */ accountInfo, err := hedera.NewAccountInfoQuery().SetAccountID(*aliasAccountId).Execute(client) if err != nil { - println(err.Error(), ": error account info query") - return + panic(fmt.Sprintf("%v : error account info query", err)) } fmt.Println("The normal account ID of the given alias ", accountInfo.AccountID) @@ -202,23 +185,20 @@ func main() { SetTokenSymbol("H542").SetTokenType(hedera.TokenTypeFungibleCommon).SetTreasuryAccountID(operatorId). SetInitialSupply(10000).SetDecimals(2).SetAutoRenewAccount(operatorId).FreezeWith(client) if err != nil { - println(err.Error(), ": error creating transaction") - return + panic(fmt.Sprintf("%v : error creating transaction", err)) } // Sign the transaction with the operator key tokenCreateTransactionSign := tokenCreateTransaction.Sign(operatorKey) // Submit the transaction to the Hedera network tokenCreateTransactionSubmit, err := tokenCreateTransactionSign.Execute(client) if err != nil { - println(err.Error(), ": error submitting transaction") - return + panic(fmt.Sprintf("%v : error submitting transaction", err)) } // Get transaction receipt information tokenCreateTransactionReceipt, err := tokenCreateTransactionSubmit.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving receipt") - return + panic(fmt.Sprintf("%v : error retrieving receipt", err)) } tokenId := *tokenCreateTransactionReceipt.TokenID fmt.Println("Created token with token id: ", tokenId) @@ -230,8 +210,7 @@ func main() { */ privateKey2, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error(), ": error generating private key") - return + panic(fmt.Sprintf("%v : error generating private key", err)) } publicKey2 := privateKey2.PublicKey() // Assuming that the target shard and realm are known. @@ -250,16 +229,14 @@ func main() { AddTokenTransfer(tokenId, operatorId, -10).AddTokenTransfer(tokenId, aliasAccountId2, 10). FreezeWith(client) if err != nil { - println(err.Error(), ": error creating transaction") - return + panic(fmt.Sprintf("%v : error creating transaction", err)) } // Sign the transaction with the operator key tokenTransferTransactionSign := tokenTransferTransaction.Sign(operatorKey) // Submit the transaction to the Hedera network tokenTransferTransactionSubmit, err := tokenTransferTransactionSign.Execute(client) if err != nil { - println(err.Error(), ": error submitting transaction") - return + panic(fmt.Sprintf("%v : error submitting transaction", err)) } // Get transaction receipt information fmt.Println(tokenTransferTransactionSubmit.GetReceipt(client)) @@ -272,8 +249,7 @@ func main() { accountId2Info, err := hedera.NewAccountInfoQuery().SetAccountID(aliasAccountId2).Execute(client) if err != nil { - println(err.Error(), ": error executing acount info query") - return + panic(fmt.Sprintf("%v : error executing acount info query", err)) } accountId2 := accountId2Info.AccountID fmt.Println("The normal account ID of the given alias: ", accountId2) @@ -286,8 +262,7 @@ func main() { accountBalances, err := hedera.NewAccountBalanceQuery().SetAccountID(aliasAccountId2).Execute(client) if err != nil { - println(err.Error(), ": error receiving account balance") - return + panic(fmt.Sprintf("%v : error receiving account balance", err)) } tokenBalanceAccountId2 := accountBalances.Tokens.Get(tokenId) diff --git a/examples/alias_id_example/main.go b/examples/alias_id_example/main.go index a59c9de2c..d1e947598 100644 --- a/examples/alias_id_example/main.go +++ b/examples/alias_id_example/main.go @@ -1,13 +1,12 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" ) -const content = `Programming is the process of creating a set of instructions that tell a computer how to perform a task. Programming can be done using a variety of computer programming languages, such as JavaScript, Python, and C++` - func main() { var client *hedera.Client var err error @@ -15,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -64,8 +60,7 @@ func main() { key, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating private key") - return + panic(fmt.Sprintf("%v : error generating private key", err)) } publicKey := key.PublicKey() @@ -99,8 +94,7 @@ func main() { AddHbarTransfer(*aliasAccountID, hedera.NewHbar(1)). Execute(client) if err != nil { - println(err.Error(), ": error executing transfer transaction") - return + panic(fmt.Sprintf("%v : error executing transfer transaction", err)) } receipt, err := resp.GetReceipt(client) @@ -109,16 +103,14 @@ func main() { println(receipt.AccountID.String()) } if err != nil { - println(err.Error(), ": error getting transfer transaction receipt") - return + panic(fmt.Sprintf("%v : error getting transfer transaction receipt", err)) } balance, err := hedera.NewAccountBalanceQuery(). SetAccountID(*aliasAccountID). Execute(client) if err != nil { - println(err.Error(), ": error retrieving balance") - return + panic(fmt.Sprintf("%v : error retrieving balance", err)) } println("Balance of the new account:", balance.Hbars.String()) @@ -127,8 +119,7 @@ func main() { SetAccountID(*aliasAccountID). Execute(client) if err != nil { - println(err.Error(), ": error retrieving account info") - return + panic(fmt.Sprintf("%v : error retrieving account info", err)) } /* @@ -145,7 +136,6 @@ func main() { println("Example complete") err = client.Close() if err != nil { - println(err.Error(), ": error closing client") - return + panic(fmt.Sprintf("%v : error closing client", err)) } } diff --git a/examples/consensus_pub_sub/main.go b/examples/consensus_pub_sub/main.go index 61b323028..680e54781 100644 --- a/examples/consensus_pub_sub/main.go +++ b/examples/consensus_pub_sub/main.go @@ -17,22 +17,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -46,16 +43,14 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating topic") - return + panic(fmt.Sprintf("%v : error creating topic", err)) } // Get the receipt transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting topic create receipt") - return + panic(fmt.Sprintf("%v : error getting topic create receipt", err)) } // get the topic id from receipt @@ -76,8 +71,7 @@ func main() { }) if err != nil { - println(err.Error(), ": error subscribing to the topic") - return + panic(fmt.Sprintf("%v : error subscribing to the topic", err)) } // Loop submit transaction with "content" as message, wait a bit to make sure it propagates @@ -90,12 +84,11 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error submitting topic") - return + panic(fmt.Sprintf("%v : error submitting topic", err)) } // Setting up how long the loop wil run - if uint64(time.Since(start).Seconds()) > 60*10 { + if uint64(time.Since(start).Seconds()) > 16 { break } @@ -115,14 +108,12 @@ func main() { SetMaxTransactionFee(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error deleting topic") - return + panic(fmt.Sprintf("%v : error deleting topic", err)) } // Get the receipt to make sure everything went through _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for topic deletion") - return + panic(fmt.Sprintf("%v : error getting receipt for topic deletion", err)) } } diff --git a/examples/consensus_pub_sub_chunked/main.go b/examples/consensus_pub_sub_chunked/main.go index 1bd2d11bd..0c369fce6 100644 --- a/examples/consensus_pub_sub_chunked/main.go +++ b/examples/consensus_pub_sub_chunked/main.go @@ -15,22 +15,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -40,8 +37,7 @@ func main() { // generate a submit key to use with the topic submitKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } // Make a new topic ID to use @@ -59,15 +55,13 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating topic") - return + panic(fmt.Sprintf("%v : error creating topic", err)) } // Get the receipt that will contain topic ID transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic creation receipt", err)) } // Get the new topic ID @@ -95,8 +89,7 @@ func main() { }) if err != nil { - println(err.Error(), ": error subscribing") - return + panic(fmt.Sprintf("%v : error subscribing", err)) } // Prepare a message send transaction that requires a submit key from "somewhere else" @@ -112,23 +105,20 @@ func main() { // this is the party who will be charged the transaction fee SignWithOperator(client) if err != nil { - println(err.Error(), ": error signing with operator") - return + panic(fmt.Sprintf("%v : error signing with operator", err)) } // Serialize to bytes so it can be signed "somewhere else" by the submit key transactionBytes, err := transaction.ToBytes() if err != nil { - println(err.Error(), ": error serializing topic submit transaction to bytes") - return + panic(fmt.Sprintf("%v : error serializing topic submit transaction to bytes", err)) } // Now pretend we sent those bytes across the network // parse them into a transaction so we can sign with the submit key transactionFromBytes, err := hedera.TransactionFromBytes(transactionBytes) if err != nil { - println(err.Error(), ": error deserializing topic submit transaction") - return + panic(fmt.Sprintf("%v : error deserializing topic submit transaction", err)) } // Interface{} back to TopicMessageSubmitTransaction @@ -155,8 +145,7 @@ func main() { // Get the receipt to ensure there were no errors receipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic submit transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic submit transaction receipt", err)) } println("TransactionID to check if successfully sent:", transactionResponse.TransactionID.String()) @@ -169,14 +158,12 @@ func main() { SetMaxTransactionFee(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error deleting topic") - return + panic(fmt.Sprintf("%v : error deleting topic", err)) } _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic delete transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic delete transaction receipt", err)) } if wait { diff --git a/examples/consensus_pub_sub_with_submit_key/main.go b/examples/consensus_pub_sub_with_submit_key/main.go index c1420bbf1..43ec086d5 100644 --- a/examples/consensus_pub_sub_with_submit_key/main.go +++ b/examples/consensus_pub_sub_with_submit_key/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "math/rand" "os" "strconv" @@ -16,22 +17,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -40,8 +38,7 @@ func main() { //generate new submit key submitKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } println("acc", client.GetOperatorAccountID().String()) @@ -56,16 +53,14 @@ func main() { SetSubmitKey(submitKey.PublicKey()). Execute(client) if err != nil { - println(err.Error(), ": error creating topic") - return + panic(fmt.Sprintf("%v : error creating topic", err)) } // Get receipt transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic create transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic create transaction receipt", err)) } // Get topic ID from receipt @@ -87,8 +82,7 @@ func main() { println(message.ConsensusTimestamp.String(), " received topic message:", string(message.Contents)) }) if err != nil { - println(err.Error(), ": error subscribing") - return + panic(fmt.Sprintf("%v : error subscribing", err)) } for i := 0; i < 3; i++ { @@ -104,8 +98,7 @@ func main() { SetMessage([]byte(message)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing topic message submit transaction") - return + panic(fmt.Sprintf("%v : error freezing topic message submit transaction", err)) } // Sign with that submit key we gave the topic @@ -114,15 +107,13 @@ func main() { // Now actually submit the transaction submitTxResponse, err := submitTx.Execute(client) if err != nil { - println(err.Error(), ": error executing topic message submit transaction") - return + panic(fmt.Sprintf("%v : error executing topic message submit transaction", err)) } // Get the receipt to ensure there were no errors _, err = submitTxResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic message submit transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic message submit transaction receipt", err)) } // Wait a bit for it to propagate diff --git a/examples/construct_client/main.go b/examples/construct_client/main.go index 23c3214bc..b9902498c 100644 --- a/examples/construct_client/main.go +++ b/examples/construct_client/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -19,22 +20,19 @@ func main() { // Creating client from the set HEDERA_NETWORK environment variable namedNetworkClient, err := hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client for name") - return + panic(fmt.Sprintf("%v : error creating client for name", err)) } // Creating account ID of 0.0.3 id, err := hedera.AccountIDFromString("0.0.3") if err != nil { - println(err.Error(), ": error creating AccountID from string") - return + panic(fmt.Sprintf("%v : error creating AccountID from string", err)) } // Creating a PrivateKey from a random key string we have key, err := hedera.PrivateKeyFromString("302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10") if err != nil { - println(err.Error(), ": error creating PrivateKey from string") - return + panic(fmt.Sprintf("%v : error creating PrivateKey from string", err)) } // Set the operators for each client @@ -58,15 +56,13 @@ func main() { // Creating client from a file specified in environment variable CONFIG_FILE configClient, err := hedera.ClientFromConfigFile(os.Getenv("CONFIG_FILE")) if err != nil { - println(err.Error(), ": error creating Client from config file") - return + panic(fmt.Sprintf("%v : error creating Client from config file", err)) } // Closing the client from file err = configClient.Close() if err != nil { - println(err.Error(), ": error closing configClient") - return + panic(fmt.Sprintf("%v : error closing configClient", err)) } } @@ -74,28 +70,23 @@ func main() { // Can also do this by using defer in after setting up the client err = previewnetClient.Close() if err != nil { - println(err.Error(), ": error closing previewnetClient") - return + panic(fmt.Sprintf("%v : error closing previewnetClient", err)) } err = testnetClient.Close() if err != nil { - println(err.Error(), ": error closing testnetClient") - return + panic(fmt.Sprintf("%v : error closing testnetClient", err)) } err = mainnetClient.Close() if err != nil { - println(err.Error(), ": error closing mainnetClient") - return + panic(fmt.Sprintf("%v : error closing mainnetClient", err)) } err = namedNetworkClient.Close() if err != nil { - println(err.Error(), ": error closing namedNetworkClient") - return + panic(fmt.Sprintf("%v : error closing namedNetworkClient", err)) } err = customClient.Close() if err != nil { - println(err.Error(), ": error closing customClient") - return + panic(fmt.Sprintf("%v : error closing customClient", err)) } println("Success!") diff --git a/examples/contract_helper/contract_helper.go b/examples/contract_helper/contract_helper.go index 2abf1aa04..14dace195 100644 --- a/examples/contract_helper/contract_helper.go +++ b/examples/contract_helper/contract_helper.go @@ -1,6 +1,7 @@ package contract_helper import ( + "encoding/hex" "fmt" "strconv" @@ -9,12 +10,13 @@ import ( ) type ContractHelper struct { - contractID hedera.ContractID + ContractID hedera.ContractID stepResultValidators map[int32]func(hedera.ContractFunctionResult) bool stepParameterSuppliers map[int32]func() *hedera.ContractFunctionParameters stepPayableAmounts map[int32]*hedera.Hbar stepSigners map[int32][]hedera.PrivateKey stepFeePayers map[int32]*hedera.AccountID + stepLogic map[int32]func(address string) } func NewContractHelper(bytecode []byte, constructorParameters hedera.ContractFunctionParameters, client *hedera.Client) *ContractHelper { @@ -34,12 +36,13 @@ func NewContractHelper(bytecode []byte, constructorParameters hedera.ContractFun } if receipt.ContractID != nil { return &ContractHelper{ - contractID: *receipt.ContractID, + ContractID: *receipt.ContractID, stepResultValidators: make(map[int32]func(hedera.ContractFunctionResult) bool), stepParameterSuppliers: make(map[int32]func() *hedera.ContractFunctionParameters), stepPayableAmounts: make(map[int32]*hedera.Hbar), stepSigners: make(map[int32][]hedera.PrivateKey), stepFeePayers: make(map[int32]*hedera.AccountID), + stepLogic: make(map[int32]func(address string)), } } @@ -77,6 +80,11 @@ func (this *ContractHelper) SetFeePayerForStep(stepIndex int32, account hedera.A return this.AddSignerForStep(stepIndex, accountKey) } +func (this *ContractHelper) SetStepLogic(stepIndex int32, specialFunction func(address string)) *ContractHelper { + this.stepLogic[stepIndex] = specialFunction + return this +} + func (this *ContractHelper) GetResultValidator(stepIndex int32) func(hedera.ContractFunctionResult) bool { if _, ok := this.stepResultValidators[stepIndex]; ok { return this.stepResultValidators[stepIndex] @@ -119,7 +127,7 @@ func (this *ContractHelper) ExecuteSteps(firstStep int32, lastStep int32, client println("Attempting to execuite step", stepIndex) transaction := hedera.NewContractExecuteTransaction(). - SetContractID(this.contractID). + SetContractID(this.ContractID). SetGas(10000000) payableAmount := this.GetPayableAmount(stepIndex) @@ -162,6 +170,13 @@ func (this *ContractHelper) ExecuteSteps(firstStep int32, lastStep int32, client return &ContractHelper{}, err } + if this.stepLogic[stepIndex] != nil { + address := functionResult.GetAddress(1) + if function, exists := this.stepLogic[stepIndex]; exists && function != nil { + function(hex.EncodeToString(address)) + } + } + if this.GetResultValidator(stepIndex)(functionResult) { fmt.Printf("Step %d completed, and returned valid result. (TransactionId %s)", stepIndex, record.TransactionID.String()) } else { diff --git a/examples/create_account/main.go b/examples/create_account/main.go index 4f71a9873..a906189fd 100644 --- a/examples/create_account/main.go +++ b/examples/create_account/main.go @@ -13,22 +13,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,8 +34,7 @@ func main() { // Generate new key to use with new account newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey}") - return + panic(fmt.Sprintf("%v : error generating PrivateKey}", err)) } fmt.Printf("private = %v\n", newKey) @@ -62,15 +58,13 @@ func main() { // is deleted. Execute(client) if err != nil { - println(err.Error(), ": error executing account create transaction}") - return + panic(fmt.Sprintf("%v : error executing account create transaction}", err)) } // Get receipt to see if transaction succeeded, and has the account ID transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt}") - return + panic(fmt.Sprintf("%v : error getting receipt}", err)) } // Get account ID out of receipt diff --git a/examples/create_account_with_alias/main.go b/examples/create_account_with_alias/main.go index 12b4c5fc5..3972a33c8 100644 --- a/examples/create_account_with_alias/main.go +++ b/examples/create_account_with_alias/main.go @@ -8,19 +8,30 @@ import ( ) func main() { - // client := hedera.ClientForTestnet() - client := hedera.ClientForPreviewnet() - myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) + var client *hedera.Client + var err error + + // Retrieving network type from environment variable HEDERA_NETWORK + client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error creating client", err)) } - myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) + // Retrieving operator ID from environment variable OPERATOR_ID + operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } - client.SetOperator(myAccountId, myPrivateKey) + // Retrieving operator key from environment variable OPERATOR_KEY + operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) + if err != nil { + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) + } + + // Setting the client operator ID and key + client.SetOperator(operatorAccountID, operatorKey) + // ## Example // Create a ECDSA private key @@ -34,7 +45,6 @@ func main() { privateKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { println(err.Error()) - return } // Extract the ECDSA public key public key publicKey := privateKey.PublicKey() @@ -43,16 +53,14 @@ func main() { // Use the `AccountCreateTransaction` and set the EVM address field to the Ethereum public address response, err := hedera.NewAccountCreateTransaction().SetInitialBalance(hedera.HbarFromTinybar(100)). - SetKey(myPrivateKey).SetAlias(evmAddress).Sign(privateKey).Execute(client) + SetKey(operatorKey).SetAlias(evmAddress).Sign(privateKey).Execute(client) if err != nil { println(err.Error()) - return } transactionReceipt, err := response.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt}") - return + panic(fmt.Sprintf("%v : error getting receipt}", err)) } newAccountId := *transactionReceipt.AccountID @@ -61,7 +69,6 @@ func main() { info, err := hedera.NewAccountInfoQuery().SetAccountID(newAccountId).Execute(client) if err != nil { println(err.Error()) - return } // Verify account is created with the provided EVM address fmt.Println(info.ContractAccountID == evmAddress) diff --git a/examples/create_account_with_alias_and_receiver_signature_required/main.go b/examples/create_account_with_alias_and_receiver_signature_required/main.go index 68bbc322e..5e5818c54 100644 --- a/examples/create_account_with_alias_and_receiver_signature_required/main.go +++ b/examples/create_account_with_alias_and_receiver_signature_required/main.go @@ -8,19 +8,29 @@ import ( ) func main() { - // client := hedera.ClientForTestnet() - client := hedera.ClientForPreviewnet() - myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) + var client *hedera.Client + var err error + + // Retrieving network type from environment variable HEDERA_NETWORK + client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) + if err != nil { + panic(fmt.Sprintf("%v : error creating client", err)) + } + + // Retrieving operator ID from environment variable OPERATOR_ID + operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } - myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) + // Retrieving operator key from environment variable OPERATOR_KEY + operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - panic(err) + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } - client.SetOperator(myAccountId, myPrivateKey) + // Setting the client operator ID and key + client.SetOperator(operatorAccountID, operatorKey) // ## Example // Create an ED25519 admin private key and ECSDA private key @@ -33,14 +43,12 @@ func main() { // Create an ED25519 admin private key and ECSDA private key adminKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error()) - return + panic(err.Error()) } privateKey, err := hedera.PrivateKeyGenerateEcdsa() if err != nil { - println(err.Error()) - return + panic(err.Error()) } // Extract the ECDSA public key public key publicKey := privateKey.PublicKey() @@ -51,14 +59,12 @@ func main() { response, err := hedera.NewAccountCreateTransaction().SetReceiverSignatureRequired(true).SetInitialBalance(hedera.HbarFromTinybar(100)). SetKey(adminKey).SetAlias(evmAddress).Sign(adminKey).Sign(privateKey).Execute(client) if err != nil { - println(err.Error()) - return + panic(err.Error()) } transactionReceipt, err := response.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt}") - return + panic(fmt.Sprintf("%v : error getting receipt}", err)) } newAccountId := *transactionReceipt.AccountID @@ -66,8 +72,7 @@ func main() { // Get the `AccountInfo` on the new account and show that the account has contractAccountId info, err := hedera.NewAccountInfoQuery().SetAccountID(newAccountId).Execute(client) if err != nil { - println(err.Error()) - return + panic(err.Error()) } // Verify account is created with the provided EVM address fmt.Println(info.ContractAccountID == evmAddress) diff --git a/examples/create_account_with_threshold_keys/main.go b/examples/create_account_with_threshold_keys/main.go index 6cc3749c8..6f1531ba4 100644 --- a/examples/create_account_with_threshold_keys/main.go +++ b/examples/create_account_with_threshold_keys/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -46,8 +43,7 @@ func main() { for i := range keys { newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey}") - return + panic(fmt.Sprintf("%v : error generating PrivateKey}", err)) } fmt.Printf("Key %v:\n", i) @@ -78,8 +74,7 @@ func main() { SetTransactionMemo("sdk example create_account_with_threshold_keys/main.go"). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing create account transaction") - return + panic(fmt.Sprintf("%v : error freezing create account transaction", err)) } // Sign with all the private keys @@ -91,16 +86,14 @@ func main() { transactionResponse, err := transaction.Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } // Get the receipt to see everything worked transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account create receipt") - return + panic(fmt.Sprintf("%v : error retrieving account create receipt", err)) } // Get the new account ID @@ -120,8 +113,7 @@ func main() { FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer transaction") - return + panic(fmt.Sprintf("%v : error freezing transfer transaction", err)) } // Manually sign with 2 of the private keys provided in the threshold @@ -130,15 +122,13 @@ func main() { Sign(keys[1]). Execute(client) if err != nil { - println(err.Error(), ": error freezing create account transaction") - return + panic(fmt.Sprintf("%v : error freezing create account transaction", err)) } // Make sure the transaction executes properly transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer receipt", err)) } fmt.Printf("status of transfer transaction: %v\n", transactionReceipt.Status) @@ -151,8 +141,7 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{transactionResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error executing account balance query") - return + panic(fmt.Sprintf("%v : error executing account balance query", err)) } fmt.Printf("account balance after transfer: %v\n", balance.Hbars.String()) diff --git a/examples/create_file/main.go b/examples/create_file/main.go index 52e105074..bb90f9e58 100644 --- a/examples/create_file/main.go +++ b/examples/create_file/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -48,16 +45,14 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating file") - return + panic(fmt.Sprintf("%v : error creating file", err)) } // Make sure the transaction went through transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving file create transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving file create transaction receipt", err)) } // Get and then display the file ID from the receipt diff --git a/examples/create_simple_contract/main.go b/examples/create_simple_contract/main.go index c4de3c735..bb65fa173 100644 --- a/examples/create_simple_contract/main.go +++ b/examples/create_simple_contract/main.go @@ -23,24 +23,21 @@ func main() { net := os.Getenv("HEDERA_NETWORK") client, err = hedera.ClientForName(net) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } configOperatorID := os.Getenv("OPERATOR_ID") configOperatorKey := os.Getenv("OPERATOR_KEY") - if configOperatorID != "" && configOperatorKey != "" && client.GetOperatorPublicKey().Bytes() == nil { + if configOperatorID != "" && configOperatorKey != "" { operatorAccountID, err := hedera.AccountIDFromString(configOperatorID) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } operatorKey, err := hedera.PrivateKeyFromString(configOperatorKey) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } client.SetOperator(operatorAccountID, operatorKey) @@ -49,16 +46,14 @@ func main() { defer func() { err = client.Close() if err != nil { - println(err.Error(), ": error closing client") - return + panic(fmt.Sprintf("%v : error closing client", err)) } }() // R contents from hello_world.json file rawContract, err := os.ReadFile("./hello_world.json") if err != nil { - println(err.Error(), ": error reading hello_world.json") - return + panic(fmt.Sprintf("%v : error reading hello_world.json", err)) } // Initialize simple contract @@ -67,8 +62,7 @@ func main() { // Unmarshal the json read from the file into the simple contract err = json.Unmarshal([]byte(rawContract), &contract) if err != nil { - println(err.Error(), ": error unmarshaling the json file") - return + panic(fmt.Sprintf("%v : error unmarshaling the json file", err)) } // Convert contract to bytes @@ -87,15 +81,13 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating file") - return + panic(fmt.Sprintf("%v : error creating file", err)) } // Get the record byteCodeTransactionRecord, err := byteCodeTransactionID.GetRecord(client) if err != nil { - println(err.Error(), ": error getting file creation record") - return + panic(fmt.Sprintf("%v : error getting file creation record", err)) } fmt.Printf("contract bytecode file upload fee: %v\n", byteCodeTransactionRecord.TransactionFee) @@ -116,21 +108,18 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating contract") - return + panic(fmt.Sprintf("%v : error creating contract", err)) } // get the record for the contract we created contractRecord, err := contractTransactionResponse.GetRecord(client) if err != nil { - println(err.Error(), ": error retrieving contract creation record") - return + panic(fmt.Sprintf("%v : error retrieving contract creation record", err)) } contractCreateResult, err := contractRecord.GetContractCreateResult() if err != nil { - println(err.Error(), ": error retrieving contract creation result") - return + panic(fmt.Sprintf("%v : error retrieving contract creation result", err)) } // get the contract ID from the record @@ -155,8 +144,7 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing contract call query") - return + panic(fmt.Sprintf("%v : error executing contract call query", err)) } fmt.Printf("Call gas used: %v\n", callResult.GasUsed) @@ -166,17 +154,16 @@ func main() { deleteTransactionResponse, err := hedera.NewContractDeleteTransaction(). // Only thing required here is the contract ID SetContractID(newContractID). + SetTransferAccountID(client.GetOperatorAccountID()). Execute(client) if err != nil { - println(err.Error(), ": error deleting contract") - return + panic(fmt.Sprintf("%v : error deleting contract", err)) } deleteTransactionReceipt, err := deleteTransactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving contract delete receipt") - return + panic(fmt.Sprintf("%v : error retrieving contract delete receipt", err)) } fmt.Printf("Status of transaction deletion: %v\n", deleteTransactionReceipt.Status) diff --git a/examples/create_stateful_contract/main.go b/examples/create_stateful_contract/main.go index d283556c0..6fa06c94c 100644 --- a/examples/create_stateful_contract/main.go +++ b/examples/create_stateful_contract/main.go @@ -25,22 +25,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -50,16 +47,14 @@ func main() { defer func() { err = client.Close() if err != nil { - println(err.Error(), ": error closing client") - return + panic(fmt.Sprintf("%v : error closing client", err)) } }() // Read in the compiled contract from stateful.json rawSmartContract, err := os.ReadFile("./stateful.json") if err != nil { - println(err.Error(), ": error reading stateful.json") - return + panic(fmt.Sprintf("%v : error reading stateful.json", err)) } // Initialize contracts @@ -68,8 +63,7 @@ func main() { // Parse the rawSmartContract into smartContract err = json.Unmarshal([]byte(rawSmartContract), &smartContract) if err != nil { - println(err.Error(), ": error unmarshaling") - return + panic(fmt.Sprintf("%v : error unmarshaling", err)) } // Retrieve the bytecode from the parsed smart contract @@ -87,15 +81,13 @@ func main() { SetContents([]byte(smartContractByteCode)). Execute(client) if err != nil { - println(err.Error(), ": error creating file") - return + panic(fmt.Sprintf("%v : error creating file", err)) } // Retrieve the receipt to make sure the transaction went through and to get bytecode file ID byteCodeTransactionReceipt, err := byteCodeTransactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting file create transaction receipt") - return + panic(fmt.Sprintf("%v : error getting file create transaction receipt", err)) } // Retrieve bytecode file ID from the receipt @@ -124,22 +116,19 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating contract") - return + panic(fmt.Sprintf("%v : error creating contract", err)) } // Get the new contract record to make sure the transaction ran successfully contractRecord, err := contractTransactionID.GetRecord(client) if err != nil { - println(err.Error(), ": error retrieving contract creation record") - return + panic(fmt.Sprintf("%v : error retrieving contract creation record", err)) } // Get the contract create result from the record contractCreateResult, err := contractRecord.GetContractCreateResult() if err != nil { - println(err.Error(), ": error retrieving contract creation result") - return + panic(fmt.Sprintf("%v : error retrieving contract creation result", err)) } // Get the new contract ID from the receipt contained in the record @@ -163,16 +152,14 @@ func main() { SetFunction("getMessage", nil). Execute(client) if err != nil { - println(err.Error(), ": error executing contract call query") - return + panic(fmt.Sprintf("%v : error executing contract call query", err)) } fmt.Printf("Call gas used: %v\n", callResult.GasUsed) // Get the message from the result // The `0` is the index to fetch a particular type from // - // e.g. - // If the return type of `getMessage` was `(uint32, string)` + // e.g. type of `getMessage` was `(uint32, string)` // then you'd need to get each field separately using: // uint32 := callResult.getUint32(0); // string := callResult.getString(1); @@ -201,22 +188,19 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing contract") - return + panic(fmt.Sprintf("%v : error executing contract", err)) } // Retrieve the record to make sure the execute transaction ran contractExecuteRecord, err := contractExecuteID.GetRecord(client) if err != nil { - println(err.Error(), ": error retrieving contract execution record") - return + panic(fmt.Sprintf("%v : error retrieving contract execution record", err)) } // Get the contract execute result, that contains gas used contractExecuteResult, err := contractExecuteRecord.GetContractExecuteResult() if err != nil { - println(err.Error(), ": error retrieving contract exe") - return + panic(fmt.Sprintf("%v : error retrieving contract exe", err)) } // Print gas used @@ -236,8 +220,7 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing contract call query") - return + panic(fmt.Sprintf("%v : error executing contract call query", err)) } // Get gas used diff --git a/examples/custom_fees/main.go b/examples/custom_fees/main.go index c68a05f52..85a6251d5 100644 --- a/examples/custom_fees/main.go +++ b/examples/custom_fees/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -13,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,8 +35,7 @@ func main() { // Generate new key to be used with new account aliceKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } // Create three accounts, Alice, Bob, and Charlie. Alice will be the treasury for our example token. @@ -49,35 +46,30 @@ func main() { SetKey(aliceKey). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account create for alice") - return + panic(fmt.Sprintf("%v : error freezing account create for alice", err)) } aliceAccountCreate.Sign(aliceKey) resp, err := aliceAccountCreate.Execute(client) if err != nil { - println(err.Error(), ": error executing account create for alice") - return + panic(fmt.Sprintf("%v : error executing account create for alice", err)) } receipt, err := resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for alice account create") - return + panic(fmt.Sprintf("%v : error getting receipt for alice account create", err)) } var aliceId hedera.AccountID if receipt.AccountID != nil { aliceId = *receipt.AccountID } else { - println("Receipt didn't return alice's ID") - return + panic("Receipt didn't return alice's ID") } bobKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } bobAccountCreate, err := hedera.NewAccountCreateTransaction(). @@ -85,35 +77,30 @@ func main() { SetKey(bobKey). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account create for bob") - return + panic(fmt.Sprintf("%v : error freezing account create for bob", err)) } bobAccountCreate.Sign(bobKey) resp, err = bobAccountCreate.Execute(client) if err != nil { - println(err.Error(), ": error executing account create for bob") - return + panic(fmt.Sprintf("%v : error executing account create for bob", err)) } receipt, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for bob account create") - return + panic(fmt.Sprintf("%v : error getting receipt for bob account create", err)) } var bobId hedera.AccountID if receipt.AccountID != nil { bobId = *receipt.AccountID } else { - println("Receipt didn't return bob's ID") - return + panic("Receipt didn't return bob's ID") } charlieKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } charlieAccountCreate, err := hedera.NewAccountCreateTransaction(). @@ -121,29 +108,25 @@ func main() { SetKey(charlieKey). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account create for charlie") - return + panic(fmt.Sprintf("%v : error freezing account create for charlie", err)) } charlieAccountCreate.Sign(aliceKey) resp, err = charlieAccountCreate.Execute(client) if err != nil { - println(err.Error(), ": error executing account create for charlie") - return + panic(fmt.Sprintf("%v : error executing account create for charlie", err)) } receipt, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for charlie account create") - return + panic(fmt.Sprintf("%v : error getting receipt for charlie account create", err)) } var charlieId hedera.AccountID if receipt.AccountID != nil { charlieId = *receipt.AccountID } else { - println("Receipt didn't return charlie's ID") - return + panic("Receipt didn't return charlie's ID") } println("Alice:", aliceId.String()) @@ -193,23 +176,20 @@ func main() { SetInitialSupply(100). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token create transaction") - return + panic(fmt.Sprintf("%v : error freezing token create transaction", err)) } // Sign with alice's key before executing tokenCreate.Sign(aliceKey) resp, err = tokenCreate.Execute(client) if err != nil { - println(err.Error(), ": error executing token create transaction") - return + panic(fmt.Sprintf("%v : error executing token create transaction", err)) } // Get receipt to make sure the transaction passed through receipt, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for token create transaction") - return + panic(fmt.Sprintf("%v : error getting receipt for token create transaction", err)) } // Get the token out of the receipt @@ -218,7 +198,6 @@ func main() { tokenId = *receipt.TokenID } else { println("Token ID missing in the receipt") - return } println("TokenID:", tokenId.String()) @@ -244,22 +223,19 @@ func main() { SetTokenIDs(tokenId). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token associate transaction for bob") - return + panic(fmt.Sprintf("%v : error freezing token associate transaction for bob", err)) } // Signing with bob's key tokenAssociate.Sign(bobKey) resp, err = tokenAssociate.Execute(client) if err != nil { - println(err.Error(), ": error executing token associate transaction for bob") - return + panic(fmt.Sprintf("%v : error executing token associate transaction for bob", err)) } _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for token associate transaction for bob") - return + panic(fmt.Sprintf("%v : error getting receipt for token associate transaction for bob", err)) } // Associating charlie's account with the token @@ -270,22 +246,19 @@ func main() { SetTokenIDs(tokenId). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token associate transaction for charlie") - return + panic(fmt.Sprintf("%v : error freezing token associate transaction for charlie", err)) } // Signing with charlie's key tokenAssociate.Sign(charlieKey) resp, err = tokenAssociate.Execute(client) if err != nil { - println(err.Error(), ": error executing token associate transaction for charlie") - return + panic(fmt.Sprintf("%v : error executing token associate transaction for charlie", err)) } _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for token associate transaction for charlie") - return + panic(fmt.Sprintf("%v : error getting receipt for token associate transaction for charlie", err)) } // Give all 100 tokens to Bob @@ -296,23 +269,20 @@ func main() { AddTokenTransfer(tokenId, aliceId, -100). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token transfer transaction for alice") - return + panic(fmt.Sprintf("%v : error freezing token transfer transaction for alice", err)) } // Have to sign with alice's key as we are taking alice's tokens transferTransaction.Sign(aliceKey) resp, err = transferTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing token transfer transaction for alice") - return + panic(fmt.Sprintf("%v : error executing token transfer transaction for alice", err)) } // Make sure the transaction passed through _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for token transfer transaction for alice") - return + panic(fmt.Sprintf("%v : error getting receipt for token transfer transaction for alice", err)) } // Check alice's balance before Bob transfers 20 tokens to Charlie @@ -321,8 +291,7 @@ func main() { SetAccountID(aliceId). Execute(client) if err != nil { - println(err.Error(), ": error getting account balance 1 for alice") - return + panic(fmt.Sprintf("%v : error getting account balance 1 for alice", err)) } println("Alice's Hbar balance before Bob transfers 20 tokens to Charlie:", aliceBalance1.Hbars.String()) @@ -335,23 +304,20 @@ func main() { AddTokenTransfer(tokenId, charlieId, 20). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error freezing token transfer transaction for bob", err)) } // As we are taking from bob, bob has to sign this. transferTransaction.Sign(bobKey) resp, err = transferTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error executing token transfer transaction for bob", err)) } // Getting the record to show the assessed custom fees record1, err := resp.GetRecord(client) if err != nil { - println(err.Error(), ": error getting record for token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error getting record for token transfer transaction for bob", err)) } // Query to check alice's balance @@ -359,8 +325,7 @@ func main() { SetAccountID(aliceId). Execute(client) if err != nil { - println(err.Error(), ": error getting account balance 2 for alice") - return + panic(fmt.Sprintf("%v : error getting account balance 2 for alice", err)) } println("Alice's Hbar balance after Bob transfers 20 tokens to Charlie:", aliceBalance2.Hbars.String()) @@ -397,22 +362,19 @@ func main() { SetCustomFees([]hedera.Fee{*customFractionalFee}). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token fee update") - return + panic(fmt.Sprintf("%v : error freezing token fee update", err)) } // As the token is owned by alice and all keys are set to alice's key we have to sign with that tokenFeeUpdate.Sign(aliceKey) resp, err = tokenFeeUpdate.Execute(client) if err != nil { - println(err.Error(), ": error executing token fee update") - return + panic(fmt.Sprintf("%v : error executing token fee update", err)) } _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt for token fee update") - return + panic(fmt.Sprintf("%v : error getting receipt for token fee update", err)) } // Get token info, we can check if the custom fee is updated @@ -420,8 +382,7 @@ func main() { SetTokenID(tokenId). Execute(client) if err != nil { - println(err.Error(), ": error getting token info 2") - return + panic(fmt.Sprintf("%v : error getting token info 2", err)) } println("Custom Fees according to TokenInfoQuery:") @@ -437,8 +398,7 @@ func main() { SetAccountID(aliceId). Execute(client) if err != nil { - println(err.Error(), ": error getting account balance 3 for alice") - return + panic(fmt.Sprintf("%v : error getting account balance 3 for alice", err)) } println("Alice's token balance before Bob transfers 20 tokens to Charlie:", aliceBalance3.Tokens.Get(tokenId)) @@ -449,22 +409,19 @@ func main() { AddTokenTransfer(tokenId, charlieId, 20). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error freezing token transfer transaction for bob", err)) } // Bob's is losing 20 tokens again. so he has to sign this transfer transferTransaction.Sign(bobKey) resp, err = transferTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error executing token transfer transaction for bob", err)) } record2, err := resp.GetRecord(client) if err != nil { - println(err.Error(), ": error getting record for token transfer transaction for bob") - return + panic(fmt.Sprintf("%v : error getting record for token transfer transaction for bob", err)) } // Checking alice's token balance again @@ -472,8 +429,7 @@ func main() { SetAccountID(aliceId). Execute(client) if err != nil { - println(err.Error(), ": error getting account balance 2 for alice") - return + panic(fmt.Sprintf("%v : error getting account balance 2 for alice", err)) } println("Alice's token balance after Bob transfers 20 tokens to Charlie:", aliceBalance4.Tokens.Get(tokenId)) diff --git a/examples/delete_account/main.go b/examples/delete_account/main.go index a2d49f59a..5b08fd29f 100644 --- a/examples/delete_account/main.go +++ b/examples/delete_account/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -38,8 +35,7 @@ func main() { // Generate the key to use with the new account newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Println("Creating an account to delete:") @@ -56,14 +52,12 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving account creation receipt", err)) } newAccountID := *transactionReceipt.AccountID @@ -81,8 +75,7 @@ func main() { FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account delete transaction") - return + panic(fmt.Sprintf("%v : error freezing account delete transaction", err)) } // Manually sign the transaction with the private key of the account to be deleted @@ -92,14 +85,12 @@ func main() { deleteTransactionResponse, err := deleteTransaction.Execute(client) if err != nil { - println(err.Error(), ": error deleting account") - return + panic(fmt.Sprintf("%v : error deleting account", err)) } deleteTransactionReceipt, err := deleteTransactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account deletion receipt") - return + panic(fmt.Sprintf("%v : error retrieving account deletion receipt", err)) } fmt.Printf("account delete transaction status: %v\n", deleteTransactionReceipt.Status) diff --git a/examples/delete_file/main.go b/examples/delete_file/main.go index 743fa7944..67a68254a 100644 --- a/examples/delete_file/main.go +++ b/examples/delete_file/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -38,14 +35,13 @@ func main() { // Generate the key to be used with the new file newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Println("Creating a file to delete:") // First create a file - transactionResponse, err := hedera.NewFileCreateTransaction(). + freezeTransaction, err := hedera.NewFileCreateTransaction(). // Mock contents SetContents([]byte("The quick brown fox jumps over the lazy dog")). // All keys at the top level of a key list must sign to create or modify the file. Any one of @@ -53,18 +49,21 @@ func main() { SetKeys(newKey.PublicKey()). SetTransactionMemo("go sdk example delete_file/main.go"). SetMaxTransactionFee(hedera.HbarFrom(8, hedera.HbarUnits.Hbar)). - Execute(client) + FreezeWith(client) + + if err != nil { + panic(fmt.Sprintf("%v : error freezing transaction", err)) + } + transactionResponse, err := freezeTransaction.Sign(newKey).Execute(client) if err != nil { - println(err.Error(), ": error creating file") - return + panic(fmt.Sprintf("%v : error creating file", err)) } // Get the receipt to make sure transaction went through receipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving file creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving file creation receipt", err)) } // Retrieve file ID from the receipt @@ -80,8 +79,7 @@ func main() { FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing file delete transaction") - return + panic(fmt.Sprintf("%v : error freezing file delete transaction", err)) } // Sign with the key we used to create the file @@ -90,15 +88,13 @@ func main() { // Execute the file delete transaction deleteTransactionResponse, err := deleteTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing file delete transaction") - return + panic(fmt.Sprintf("%v : error executing file delete transaction", err)) } // Check that it went through deleteTransactionReceipt, err := deleteTransactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving file deletion receipt") - return + panic(fmt.Sprintf("%v : error retrieving file deletion receipt", err)) } fmt.Printf("file delete transaction status: %v\n", deleteTransactionReceipt.Status) @@ -111,8 +107,7 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing file info query") - return + panic(fmt.Sprintf("%v : error executing file info query", err)) } fmt.Printf("file %v was deleted: %v\n", newFileID, fileInfo.IsDeleted) diff --git a/examples/exempt_custom_fees/main.go b/examples/exempt_custom_fees/main.go index 25a568f10..dec4037d6 100644 --- a/examples/exempt_custom_fees/main.go +++ b/examples/exempt_custom_fees/main.go @@ -9,21 +9,18 @@ import ( func main() { client, err := hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - fmt.Println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } id, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - fmt.Println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY key, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - fmt.Println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -119,8 +116,7 @@ func main() { SetWipeKey(key.PublicKey()).SetInitialSupply(100000000). // Total supply = 100000000 / 10 ^ 2 SetDecimals(2).SetCustomFees([]hedera.Fee{fee1, fee2, fee3}).FreezeWith(client) if err != nil { - fmt.Println(err) - return + panic(err) } transactionResponse, err := tokenCreateTransaction.Sign(key). @@ -128,13 +124,11 @@ func main() { Sign(secondAccountPrivateKey). Sign(thirdAccountPrivateKey).Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } receipt, err := transactionResponse.GetReceipt(client) if err != nil { - fmt.Println(err) - return + panic(err) } tokenId := *receipt.TokenID fmt.Println("Created token with token id: ", tokenId) @@ -151,19 +145,16 @@ func main() { AddTokenTransfer(tokenId, id, -amount).AddTokenTransfer(tokenId, secondAccountId, amount). FreezeWith(client) if err != nil { - fmt.Println(err) - return + panic(err) } treasuryTokenTransferSubmit, err := treasuryTokenTransferTransaction.Sign(key).Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } treasuryTransferReceipt, err := treasuryTokenTransferSubmit.GetReceipt(client) if err != nil { - fmt.Println(err) - return + panic(err) } fmt.Println("Sending from treasury account to the second account - 'TransferTransaction' status: ", treasuryTransferReceipt.Status) @@ -173,20 +164,17 @@ func main() { AddTokenTransfer(tokenId, firstAccountId, amount). FreezeWith(client) if err != nil { - fmt.Println(err) - return + panic(err) } submitTransaction, err := tokenTransferTx.Sign(key).Sign(secondAccountPrivateKey).Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } record, err := submitTransaction.GetRecord(client) if err != nil { - fmt.Println(err) - return + panic(err) } fmt.Println("Transaction fee: ", record.TransactionFee) @@ -201,8 +189,7 @@ func main() { SetAccountID(firstAccountId). Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } fmt.Println("first's balance:", firstAccountBalanceAfter.Tokens.Get(tokenId)) @@ -210,8 +197,7 @@ func main() { SetAccountID(secondAccountId). Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } fmt.Println("second's balance:", secondAccountBalanceAfter.Tokens.Get(tokenId)) @@ -219,8 +205,7 @@ func main() { SetAccountID(thirdAccountId). Execute(client) if err != nil { - fmt.Println(err) - return + panic(err) } fmt.Println("third's balance:", secondAccountBalanceAfter.Tokens.Get(tokenId)) diff --git a/examples/file_append_chunked/main.go b/examples/file_append_chunked/main.go index 3f9054998..9d5b4a25e 100644 --- a/examples/file_append_chunked/main.go +++ b/examples/file_append_chunked/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -13,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -47,15 +45,13 @@ func main() { SetMaxTransactionFee(hedera.NewHbar(2)). Execute(client) if err != nil { - println(err.Error(), ": error creating file") - return + panic(fmt.Sprintf("%v : error creating file", err)) } // Get receipt to make sure the transaction worked receipt, err := newFileResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving file creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving file creation receipt", err)) } // Retrieve file ID from the receipt @@ -73,15 +69,13 @@ func main() { SetMaxTransactionFee(hedera.NewHbar(5)). Execute(client) if err != nil { - println(err.Error(), ": error executing file append transaction") - return + panic(fmt.Sprintf("%v : error executing file append transaction", err)) } // Checking if transaction went through receipt, err = fileResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving file append transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving file append transaction receipt", err)) } // Checking if append succeeded @@ -94,8 +88,7 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing file info query") - return + panic(fmt.Sprintf("%v : error executing file info query", err)) } println("File size according to `FileInfoQuery`:", info.Size) diff --git a/examples/generate_key/main.go b/examples/generate_key/main.go index f9a51f78d..90b866e58 100644 --- a/examples/generate_key/main.go +++ b/examples/generate_key/main.go @@ -10,8 +10,7 @@ func main() { // Generating key privateKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } // Retrieve the public key diff --git a/examples/generate_key_with_mnemonic/main.go b/examples/generate_key_with_mnemonic/main.go index 68ce3cd9c..e3afe4216 100644 --- a/examples/generate_key_with_mnemonic/main.go +++ b/examples/generate_key_with_mnemonic/main.go @@ -11,15 +11,13 @@ func main() { // Generate 24 word mnemonic mnemonic24, err := hedera.GenerateMnemonic24() if err != nil { - println(err.Error(), ": error generating 24 word mnemonic") - return + panic(fmt.Sprintf("%v : error generating 24 word mnemonic", err)) } // Generate 12 word mnemonic mnemonic12, err := hedera.GenerateMnemonic12() if err != nil { - println(err.Error(), ": error generating 12 word mnemonic") - return + panic(fmt.Sprintf("%v : error generating 12 word mnemonic", err)) } // Given legacy string @@ -28,8 +26,7 @@ func main() { // Initializing a legacy mnemonic from legacy string mnemonicLegacy, err := hedera.NewMnemonic(strings.Split(legacyString, ",")) if err != nil { - println(err.Error(), ": error generating mnemonic from legacy string") - return + panic(fmt.Sprintf("%v : error generating mnemonic from legacy string", err)) } fmt.Printf("mnemonic 24 word = %v\n", mnemonic24) @@ -39,22 +36,19 @@ func main() { // Creating a Private Key from 24 word mnemonic with an optional passphrase privateKey24, err := mnemonic24.ToPrivateKey( /* passphrase */ "") if err != nil { - println(err.Error(), ": error converting 24 word mnemonic to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting 24 word mnemonic to PrivateKey", err)) } // Creating a Private Key from 12 word mnemonic with an optional passphrase privateKey12, err := mnemonic12.ToPrivateKey( /* passphrase */ "") if err != nil { - println(err.Error(), ": error converting 12 word mnemonic to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting 12 word mnemonic to PrivateKey", err)) } // ToLegacyPrivateKey() doesn't support a passphrase privateLegacy, err := mnemonicLegacy.ToLegacyPrivateKey() if err != nil { - println(err.Error(), ": error converting legacy mnemonic to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting legacy mnemonic to PrivateKey", err)) } // Retrieving the Public Key diff --git a/examples/get_account_balance/main.go b/examples/get_account_balance/main.go index f010b70fb..1cae83d14 100644 --- a/examples/get_account_balance/main.go +++ b/examples/get_account_balance/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -42,8 +39,7 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing account balance query") - return + panic(fmt.Sprintf("%v : error executing account balance query", err)) } fmt.Printf("balance = %v\n", balance.Hbars.String()) diff --git a/examples/get_address_book/main.go b/examples/get_address_book/main.go index 914334dd8..9f337ae1b 100644 --- a/examples/get_address_book/main.go +++ b/examples/get_address_book/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -13,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -42,8 +40,7 @@ func main() { cost, err := fileQuery.GetCost(client) if err != nil { - println(err.Error(), ": error getting file contents query cost") - return + panic(fmt.Sprintf("%v : error getting file contents query cost", err)) } println("file contents cost:", cost.String()) @@ -54,33 +51,28 @@ func main() { // Execute the file content query contents, err := fileQuery.Execute(client) if err != nil { - println(err.Error(), ": error executing file contents query") - return + panic(fmt.Sprintf("%v : error executing file contents query", err)) } fileByte, err := os.OpenFile("address-book-byte.pb", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { - println(err.Error(), ": error opening address-book-byte.pb") - return + panic(fmt.Sprintf("%v : error opening address-book-byte.pb", err)) } fileString, err := os.OpenFile("address-book-string.pb", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { - println(err.Error(), ": error opening address-book-string.pb") - return + panic(fmt.Sprintf("%v : error opening address-book-string.pb", err)) } // Write the contents (string([]byte)) into the string file leng, err := fileString.WriteString(string(contents)) if err != nil { - println(err.Error(), ": error writing contents to file") - return + panic(fmt.Sprintf("%v : error writing contents to file", err)) } // Write the contents ([]byte) into the byte file _, err = fileByte.Write(contents) if err != nil { - println(err.Error(), ": error writing contents to file") - return + panic(fmt.Sprintf("%v : error writing contents to file", err)) } temp := make([]byte, leng) @@ -90,12 +82,10 @@ func main() { // Close the files err = fileString.Close() if err != nil { - println(err.Error(), ": error closing the file") - return + panic(fmt.Sprintf("%v : error closing the file", err)) } err = fileByte.Close() if err != nil { - println(err.Error(), ": error closing the file") - return + panic(fmt.Sprintf("%v : error closing the file", err)) } } diff --git a/examples/get_file_contents/main.go b/examples/get_file_contents/main.go index fda5d7328..310607894 100644 --- a/examples/get_file_contents/main.go +++ b/examples/get_file_contents/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -46,14 +43,12 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error executing file contents query") - return + panic(fmt.Sprintf("%v : error executing file contents query", err)) } exchangeRate, err := hedera.ExchangeRateFromBytes(contents) if err != nil { - println(err.Error(), ": error converting contents to exchange rate") - return + panic(fmt.Sprintf("%v : error converting contents to exchange rate", err)) } fmt.Printf("Contents for file %v :\n", fileID.String()) diff --git a/examples/logging/main.go b/examples/logging/main.go index 8565af1b0..93de1539e 100644 --- a/examples/logging/main.go +++ b/examples/logging/main.go @@ -13,8 +13,7 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // The client comes with default logger. @@ -31,15 +30,13 @@ func main() { // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -48,8 +45,7 @@ func main() { // Generate new key to use with new account newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey}") - return + panic(fmt.Sprintf("%v : error generating PrivateKey}", err)) } fmt.Printf("private = %v\n", newKey) @@ -60,8 +56,7 @@ func main() { SetKey(newKey.PublicKey()). Execute(client) if err != nil { - println(err.Error(), ": error executing account create transaction}") - return + panic(fmt.Sprintf("%v : error executing account create transaction}", err)) } // Disable default logging on client, to show logging functionality from transaction @@ -74,7 +69,6 @@ func main() { SetLogLevel(hedera.LoggerLevelTrace). Execute(client) if err != nil { - println(err.Error(), ": error executing account create transaction}") - return + panic(fmt.Sprintf("%v : error executing account create transaction}", err)) } } diff --git a/examples/multi_app_transfer/main.go b/examples/multi_app_transfer/main.go index a3b994d62..6218693d3 100644 --- a/examples/multi_app_transfer/main.go +++ b/examples/multi_app_transfer/main.go @@ -11,20 +11,23 @@ func main() { // Our hypothetical primary service only knows the operator/sender's account ID and the recipient's accountID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } operatorPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } recipientAccountID := hedera.AccountID{Account: 3} // We create a client without a set operator - client := hedera.ClientForTestnet().SetOperator(operatorAccountID, operatorPrivateKey) + client, err := hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) + if err != nil { + panic(fmt.Sprintf("%v : error creating client", err)) + } + + client.SetOperator(operatorAccountID, operatorPrivateKey) // We must manually construct a TransactionID with the accountID of the operator/sender // This is the account that will be charged the transaction fee @@ -43,15 +46,13 @@ func main() { FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing Transfer Transaction") - return + panic(fmt.Sprintf("%v : error freezing Transfer Transaction", err)) } // Marshal your transaction to bytes txBytes, err := transaction.ToBytes() if err != nil { - println(err.Error(), ": error converting transfer transaction to bytes") - return + panic(fmt.Sprintf("%v : error converting transfer transaction to bytes", err)) } fmt.Printf("Marshalled the unsigned transaction to bytes \n%v\n", txBytes) @@ -62,8 +63,7 @@ func main() { signedTxBytes, err := signingService(txBytes) if err != nil { - println(err.Error(), ": error signing transfer transaction") - return + panic(fmt.Sprintf("%v : error signing transfer transaction", err)) } fmt.Printf("Received bytes for signed transaction: \n%v\n", signedTxBytes) @@ -72,8 +72,7 @@ func main() { var signedTx hedera.TransferTransaction tx, err := hedera.TransactionFromBytes(signedTxBytes) if err != nil { - println(err.Error(), ": error converting bytes to transfer transaction") - return + panic(fmt.Sprintf("%v : error converting bytes to transfer transaction", err)) } // Converting from interface{} to TransferTransaction, if that's what we got @@ -88,16 +87,14 @@ func main() { response, err := signedTx.Execute(client) if err != nil { - println(err.Error(), ": error executing the transfer transaction") - return + panic(fmt.Sprintf("%v : error executing the transfer transaction", err)) } // Get the receipt of the transaction to check the status receipt, err := response.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer transaction receipt", err)) } // If Status Success is returned then everything is good diff --git a/examples/precompile_example/ExpiryHelper.sol b/examples/precompile_example/ExpiryHelper.sol index 089f2f011..374a4752c 100644 --- a/examples/precompile_example/ExpiryHelper.sol +++ b/examples/precompile_example/ExpiryHelper.sol @@ -2,22 +2,21 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 import "./HederaTokenService.sol"; -import "./FeeHelper.sol"; -contract ExpiryHelper is FeeHelper { +abstract contract ExpiryHelper { function createAutoRenewExpiry( address autoRenewAccount, - uint32 autoRenewPeriod - ) internal view returns (IHederaTokenService.Expiry memory expiry) { + int64 autoRenewPeriod + ) internal pure returns (IHederaTokenService.Expiry memory expiry) { expiry.autoRenewAccount = autoRenewAccount; expiry.autoRenewPeriod = autoRenewPeriod; } - function createSecondExpiry(uint32 second) internal view returns (IHederaTokenService.Expiry memory expiry) { + function createSecondExpiry(int64 second) internal pure returns (IHederaTokenService.Expiry memory expiry) { expiry.second = second; } -} +} \ No newline at end of file diff --git a/examples/precompile_example/FeeHelper.sol b/examples/precompile_example/FeeHelper.sol index 34c23ac70..550471d7c 100644 --- a/examples/precompile_example/FeeHelper.sol +++ b/examples/precompile_example/FeeHelper.sol @@ -2,15 +2,12 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 -import "./HederaTokenService.sol"; -import "./HederaResponseCodes.sol"; import "./IHederaTokenService.sol"; -import "./KeyHelper.sol"; -abstract contract FeeHelper is KeyHelper { - function createFixedHbarFee(uint32 amount, address feeCollector) +abstract contract FeeHelper { + function createFixedHbarFee(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) @@ -21,7 +18,7 @@ abstract contract FeeHelper is KeyHelper { } function createFixedTokenFee( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) { @@ -30,7 +27,7 @@ abstract contract FeeHelper is KeyHelper { fixedFee.feeCollector = feeCollector; } - function createFixedSelfDenominatedFee(uint32 amount, address feeCollector) + function createFixedSelfDenominatedFee(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) @@ -41,8 +38,8 @@ abstract contract FeeHelper is KeyHelper { } function createFractionalFee( - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, bool netOfTransfers, address feeCollector ) @@ -57,10 +54,10 @@ abstract contract FeeHelper is KeyHelper { } function createFractionalFeeWithMinAndMax( - uint32 numerator, - uint32 denominator, - uint32 minimumAmount, - uint32 maximumAmount, + int64 numerator, + int64 denominator, + int64 minimumAmount, + int64 maximumAmount, bool netOfTransfers, address feeCollector ) @@ -77,10 +74,10 @@ abstract contract FeeHelper is KeyHelper { } function createFractionalFeeWithLimits( - uint32 numerator, - uint32 denominator, - uint32 minimumAmount, - uint32 maximumAmount, + int64 numerator, + int64 denominator, + int64 minimumAmount, + int64 maximumAmount, bool netOfTransfers, address feeCollector ) @@ -97,8 +94,8 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFeeWithoutFallback( - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, address feeCollector ) internal pure returns (IHederaTokenService.RoyaltyFee memory royaltyFee) { royaltyFee.numerator = numerator; @@ -107,9 +104,9 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFeeWithHbarFallbackFee( - uint32 numerator, - uint32 denominator, - uint32 amount, + int64 numerator, + int64 denominator, + int64 amount, address feeCollector ) internal pure returns (IHederaTokenService.RoyaltyFee memory royaltyFee) { royaltyFee.numerator = numerator; @@ -120,9 +117,9 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFeeWithTokenDenominatedFallbackFee( - uint32 numerator, - uint32 denominator, - uint32 amount, + int64 numerator, + int64 denominator, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.RoyaltyFee memory royaltyFee) { @@ -135,7 +132,7 @@ abstract contract FeeHelper is KeyHelper { function createNAmountFixedFeesForHbars( uint8 numberOfFees, - uint32 amount, + int64 amount, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { fixedFees = new IHederaTokenService.FixedFee[](numberOfFees); @@ -148,7 +145,7 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFixedFeeForToken( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { @@ -162,7 +159,7 @@ abstract contract FeeHelper is KeyHelper { } function createFixedFeesForToken( - uint32 amount, + int64 amount, address tokenId, address firstFeeCollector, address secondFeeCollector @@ -182,7 +179,7 @@ abstract contract FeeHelper is KeyHelper { fixedFees[0] = fixedFee2; } - function createSingleFixedFeeForHbars(uint32 amount, address feeCollector) + function createSingleFixedFeeForHbars(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) @@ -196,7 +193,7 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFixedFeeForCurrentToken( - uint32 amount, + int64 amount, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { fixedFees = new IHederaTokenService.FixedFee[](1); @@ -209,7 +206,7 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFixedFeeWithInvalidFlags( - uint32 amount, + int64 amount, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { fixedFees = new IHederaTokenService.FixedFee[](1); @@ -222,7 +219,7 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFixedFeeWithTokenIdAndHbars( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { @@ -237,7 +234,7 @@ abstract contract FeeHelper is KeyHelper { } function createFixedFeesWithAllTypes( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee[] memory fixedFees) { @@ -264,7 +261,7 @@ abstract contract FeeHelper is KeyHelper { } function createFixedFeeForToken( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) { @@ -273,7 +270,7 @@ abstract contract FeeHelper is KeyHelper { fixedFee.feeCollector = feeCollector; } - function createFixedFeeForHbars(uint32 amount, address feeCollector) + function createFixedFeeForHbars(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) @@ -283,7 +280,7 @@ abstract contract FeeHelper is KeyHelper { fixedFee.feeCollector = feeCollector; } - function createFixedFeeForCurrentToken(uint32 amount, address feeCollector) + function createFixedFeeForCurrentToken(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) @@ -294,7 +291,7 @@ abstract contract FeeHelper is KeyHelper { } //Used for negative scenarios - function createFixedFeeWithInvalidFlags(uint32 amount, address feeCollector) + function createFixedFeeWithInvalidFlags(int64 amount, address feeCollector) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) @@ -307,7 +304,7 @@ abstract contract FeeHelper is KeyHelper { //Used for negative scenarios function createFixedFeeWithTokenIdAndHbars( - uint32 amount, + int64 amount, address tokenId, address feeCollector ) internal pure returns (IHederaTokenService.FixedFee memory fixedFee) { @@ -325,8 +322,8 @@ abstract contract FeeHelper is KeyHelper { function createNAmountFractionalFees( uint8 numberOfFees, - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, bool netOfTransfers, address feeCollector ) @@ -349,8 +346,8 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFractionalFee( - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, bool netOfTransfers, address feeCollector ) @@ -370,10 +367,10 @@ abstract contract FeeHelper is KeyHelper { } function createSingleFractionalFeeWithLimits( - uint32 numerator, - uint32 denominator, - uint32 minimumAmount, - uint32 maximumAmount, + int64 numerator, + int64 denominator, + int64 minimumAmount, + int64 maximumAmount, bool netOfTransfers, address feeCollector ) @@ -404,8 +401,8 @@ abstract contract FeeHelper is KeyHelper { function createNAmountRoyaltyFees( uint8 numberOfFees, - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, address feeCollector ) internal @@ -433,8 +430,8 @@ abstract contract FeeHelper is KeyHelper { } function createSingleRoyaltyFee( - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, address feeCollector ) internal @@ -452,9 +449,9 @@ abstract contract FeeHelper is KeyHelper { } function createSingleRoyaltyFeeWithFallbackFee( - uint32 numerator, - uint32 denominator, - uint32 amount, + int64 numerator, + int64 denominator, + int64 amount, address tokenId, bool useHbarsForPayment, address feeCollector @@ -478,9 +475,9 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFeesWithAllTypes( - uint32 numerator, - uint32 denominator, - uint32 amount, + int64 numerator, + int64 denominator, + int64 amount, address tokenId, address feeCollector ) @@ -519,8 +516,8 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFee( - uint32 numerator, - uint32 denominator, + int64 numerator, + int64 denominator, address feeCollector ) internal pure returns (IHederaTokenService.RoyaltyFee memory royaltyFee) { royaltyFee.numerator = numerator; @@ -529,9 +526,9 @@ abstract contract FeeHelper is KeyHelper { } function createRoyaltyFeeWithFallbackFee( - uint32 numerator, - uint32 denominator, - uint32 amount, + int64 numerator, + int64 denominator, + int64 amount, address tokenId, bool useHbarsForPayment, address feeCollector @@ -543,4 +540,4 @@ abstract contract FeeHelper is KeyHelper { royaltyFee.useHbarsForPayment = useHbarsForPayment; royaltyFee.feeCollector = feeCollector; } -} +} \ No newline at end of file diff --git a/examples/precompile_example/HederaResponseCodes.sol b/examples/precompile_example/HederaResponseCodes.sol index d2484a915..4f7194004 100644 --- a/examples/precompile_example/HederaResponseCodes.sol +++ b/examples/precompile_example/HederaResponseCodes.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.4.9 <0.9.0; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 -abstract contract HederaResponseCodes { +library HederaResponseCodes { // response codes int32 internal constant OK = 0; // The transaction passed the precheck validations. @@ -181,7 +181,6 @@ abstract contract HederaResponseCodes { int32 internal constant TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198; // Exceeded the number of token transfers (both from and to) allowed for token transfer list int32 internal constant EMPTY_TOKEN_TRANSFER_BODY = 199; // TokenTransfersTransactionBody has no TokenTransferList int32 internal constant EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200; // TokenTransfersTransactionBody has a TokenTransferList with no AccountAmounts - int32 internal constant INVALID_SCHEDULE_ID = 201; // The Scheduled entity does not exist; or has now expired, been deleted, or been executed int32 internal constant SCHEDULE_IS_IMMUTABLE = 202; // The Scheduled entity cannot be modified. Admin key not set int32 internal constant INVALID_SCHEDULE_PAYER_ID = 203; // The provided Scheduled Payer does not exist @@ -196,4 +195,119 @@ abstract contract HederaResponseCodes { int32 internal constant SCHEDULE_ALREADY_DELETED = 212; // A schedule being signed or deleted has already been deleted int32 internal constant SCHEDULE_ALREADY_EXECUTED = 213; // A schedule being signed or deleted has already been executed int32 internal constant MESSAGE_SIZE_TOO_LARGE = 214; // ConsensusSubmitMessage request's message size is larger than allowed. -} + int32 internal constant OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; // An operation was assigned to more than one throttle group in a given bucket + int32 internal constant BUCKET_CAPACITY_OVERFLOW = 216; // The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type + int32 internal constant NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; // Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased + int32 internal constant BUCKET_HAS_NO_THROTTLE_GROUPS = 218; // A bucket was defined without any throttle groups + int32 internal constant THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; // A throttle group was granted zero opsPerSec + int32 internal constant SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; // The throttle definitions file was updated, but some supported operations were not assigned a bucket + int32 internal constant UNPARSEABLE_THROTTLE_DEFINITIONS = 221; // The new contents for the throttle definitions system file were not valid protobuf + int32 internal constant INVALID_THROTTLE_DEFINITIONS = 222; // The new throttle definitions system file were invalid, and no more specific error could be divined + int32 internal constant ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223; // The transaction references an account which has passed its expiration without renewal funds available, and currently remains in the ledger only because of the grace period given to expired entities + int32 internal constant INVALID_TOKEN_MAX_SUPPLY = 224; // Invalid token max supply + int32 internal constant INVALID_TOKEN_NFT_SERIAL_NUMBER = 225; // Invalid token nft serial number + int32 internal constant INVALID_NFT_ID = 226; // Invalid nft id + int32 internal constant METADATA_TOO_LONG = 227; // Nft metadata is too long + int32 internal constant BATCH_SIZE_LIMIT_EXCEEDED = 228; // Repeated operations count exceeds the limit + int32 internal constant INVALID_QUERY_RANGE = 229; // The range of data to be gathered is out of the set boundaries + int32 internal constant FRACTION_DIVIDES_BY_ZERO = 230; // A custom fractional fee set a denominator of zero + int32 internal constant INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE = 231; // The transaction payer could not afford a custom fee + int32 internal constant CUSTOM_FEES_LIST_TOO_LONG = 232; // More than 10 custom fees were specified + int32 internal constant INVALID_CUSTOM_FEE_COLLECTOR = 233; // Any of the feeCollector accounts for customFees is invalid + int32 internal constant INVALID_TOKEN_ID_IN_CUSTOM_FEES = 234; // Any of the token Ids in customFees is invalid + int32 internal constant TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR = 235; // Any of the token Ids in customFees are not associated to feeCollector + int32 internal constant TOKEN_MAX_SUPPLY_REACHED = 236; // A token cannot have more units minted due to its configured supply ceiling + int32 internal constant SENDER_DOES_NOT_OWN_NFT_SERIAL_NO = 237; // The transaction attempted to move an NFT serial number from an account other than its owner + int32 internal constant CUSTOM_FEE_NOT_FULLY_SPECIFIED = 238; // A custom fee schedule entry did not specify either a fixed or fractional fee + int32 internal constant CUSTOM_FEE_MUST_BE_POSITIVE = 239; // Only positive fees may be assessed at this time + int32 internal constant TOKEN_HAS_NO_FEE_SCHEDULE_KEY = 240; // Fee schedule key is not set on token + int32 internal constant CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE = 241; // A fractional custom fee exceeded the range of a 64-bit signed integer + int32 internal constant ROYALTY_FRACTION_CANNOT_EXCEED_ONE = 242; // A royalty cannot exceed the total fungible value exchanged for an NFT + int32 internal constant FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT = 243; // Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount + int32 internal constant CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES = 244; // A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty + int32 internal constant CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON = 245; // Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations + int32 internal constant CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 246; // Only tokens of type FUNGIBLE_COMMON can have fractional fees + int32 internal constant INVALID_CUSTOM_FEE_SCHEDULE_KEY = 247; // The provided custom fee schedule key was invalid + int32 internal constant INVALID_TOKEN_MINT_METADATA = 248; // The requested token mint metadata was invalid + int32 internal constant INVALID_TOKEN_BURN_METADATA = 249; // The requested token burn metadata was invalid + int32 internal constant CURRENT_TREASURY_STILL_OWNS_NFTS = 250; // The treasury for a unique token cannot be changed until it owns no NFTs + int32 internal constant ACCOUNT_STILL_OWNS_NFTS = 251; // An account cannot be dissociated from a unique token if it owns NFTs for the token + int32 internal constant TREASURY_MUST_OWN_BURNED_NFT = 252; // A NFT can only be burned when owned by the unique token's treasury + int32 internal constant ACCOUNT_DOES_NOT_OWN_WIPED_NFT = 253; // An account did not own the NFT to be wiped + int32 internal constant ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 254; // An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON + int32 internal constant MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED = 255; // All the NFTs allowed in the current price regime have already been minted + int32 internal constant PAYER_ACCOUNT_DELETED = 256; // The payer account has been marked as deleted + int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH = 257; // The reference chain of custom fees for a transferred token exceeded the maximum length of 2 + int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS = 258; // More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments + int32 internal constant INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE = 259; // The sender account in the token transfer transaction could not afford a custom fee + int32 internal constant SERIAL_NUMBER_LIMIT_REACHED = 260; // Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type + int32 internal constant CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = 261; // Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees + int32 internal constant NO_REMAINING_AUTOMATIC_ASSOCIATIONS = 262; // The account has reached the limit on the automatic associations count. + int32 internal constant EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = 263; // Already existing automatic associations are more than the new maximum automatic associations. + int32 internal constant REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = 264; // Cannot set the number of automatic associations for an account more than the maximum allowed tokens.maxPerAccount. + int32 internal constant TOKEN_IS_PAUSED = 265; // Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + int32 internal constant TOKEN_HAS_NO_PAUSE_KEY = 266; // Pause key is not set on token + int32 internal constant INVALID_PAUSE_KEY = 267; // The provided pause key was invalid + int32 internal constant FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268; // The update file in a freeze transaction body must exist. + int32 internal constant FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269; // The hash of the update file in a freeze transaction body must match the in-memory hash. + int32 internal constant NO_UPGRADE_HAS_BEEN_PREPARED = 270; // A FREEZE_UPGRADE transaction was handled with no previous update prepared. + int32 internal constant NO_FREEZE_IS_SCHEDULED = 271; // A FREEZE_ABORT transaction was handled with no scheduled freeze. + int32 internal constant UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = 272; // The update file hash when handling a FREEZE_UPGRADE transaction differs from the file hash at the time of handling the PREPARE_UPGRADE transaction. + int32 internal constant FREEZE_START_TIME_MUST_BE_FUTURE = 273; // The given freeze start time was in the (consensus) past. + int32 internal constant PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274; // The prepared update file cannot be updated or appended until either the upgrade has been completed, or a FREEZE_ABORT has been handled. + int32 internal constant FREEZE_ALREADY_SCHEDULED = 275; // Once a freeze is scheduled, it must be aborted before any other type of freeze can be performed. + int32 internal constant FREEZE_UPGRADE_IN_PROGRESS = 276; // If an NMT upgrade has been prepared, the following operation must be a FREEZE_UPGRADE (To issue a FREEZE_ONLY, submit a FREEZE_ABORT first.) + int32 internal constant UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the id of the file to be used in the upgrade. + int32 internal constant UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the hash of the file to be used in the upgrade. + int32 internal constant CONSENSUS_GAS_EXHAUSTED = 279; // Consensus throttle did not allow execution of this transaction. System is throttled at consensus level. + int32 internal constant REVERTED_SUCCESS = 280; // A precompiled contract succeeded, but was later reverted. + int32 internal constant MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED = 281; // All contract storage allocated to the current price regime has been consumed. + int32 internal constant INVALID_ALIAS_KEY = 282; // An alias used in a CryptoTransfer transaction is not the serialization of a primitive Key message -- that is, a Key with a single Ed25519 or ECDSA(secp256k1) public key and no unknown protobuf fields. + int32 internal constant UNEXPECTED_TOKEN_DECIMALS = 283; // A fungible token transfer expected a different number of decimals than the involved type actually has. + int32 internal constant INVALID_PROXY_ACCOUNT_ID = 284; // [Deprecated] The proxy account id is invalid or does not exist. + int32 internal constant INVALID_TRANSFER_ACCOUNT_ID = 285; // The transfer account id in CryptoDelete transaction is invalid or does not exist. + int32 internal constant INVALID_FEE_COLLECTOR_ACCOUNT_ID = 286; // The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. + int32 internal constant ALIAS_IS_IMMUTABLE = 287; // The alias already set on an account cannot be updated using CryptoUpdate transaction. + int32 internal constant SPENDER_ACCOUNT_SAME_AS_OWNER = 288; // An approved allowance specifies a spender account that is the same as the hbar/token owner account. + int32 internal constant AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY = 289; // The establishment or adjustment of an approved allowance cause the token allowance to exceed the token maximum supply. + int32 internal constant NEGATIVE_ALLOWANCE_AMOUNT = 290; // The specified amount for an approved allowance cannot be negative. + int32 internal constant CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON = 291; // [Deprecated] The approveForAll flag cannot be set for a fungible token. + int32 internal constant SPENDER_DOES_NOT_HAVE_ALLOWANCE = 292; // The spender does not have an existing approved allowance with the hbar/token owner. + int32 internal constant AMOUNT_EXCEEDS_ALLOWANCE = 293; // The transfer amount exceeds the current approved allowance for the spender account. + int32 internal constant MAX_ALLOWANCES_EXCEEDED = 294; // The payer account of an approveAllowances or adjustAllowance transaction is attempting to go beyond the maximum allowed number of allowances. + int32 internal constant EMPTY_ALLOWANCES = 295; // No allowances have been specified in the approval transaction. + int32 internal constant SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES = 296; // [Deprecated] Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single CryptoApproveAllowance transaction. + int32 internal constant REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES = 297; // [Deprecated] Serial numbers are repeated in nft allowance for a single spender account + int32 internal constant FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES = 298; // Fungible common token used in NFT allowances + int32 internal constant NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES = 299; // Non fungible token used in fungible token allowances + int32 internal constant INVALID_ALLOWANCE_OWNER_ID = 300; // The account id specified as the owner is invalid or does not exist. + int32 internal constant INVALID_ALLOWANCE_SPENDER_ID = 301; // The account id specified as the spender is invalid or does not exist. + int32 internal constant REPEATED_ALLOWANCES_TO_DELETE = 302; // [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. + int32 internal constant INVALID_DELEGATING_SPENDER = 303; // If the account Id specified as the delegating spender is invalid or does not exist. + int32 internal constant DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL = 304; // The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. + int32 internal constant DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL = 305; // The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll granted on token-owner. + int32 internal constant SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE = 306; // The scheduled transaction could not be created because it's expiration_time was too far in the future. + int32 internal constant SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME = 307; // The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. + int32 internal constant SCHEDULE_FUTURE_THROTTLE_EXCEEDED = 308; // The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. + int32 internal constant SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED = 309; // The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. + int32 internal constant INVALID_ETHEREUM_TRANSACTION = 310; // The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. + int32 internal constant WRONG_CHAIN_ID = 311; // EthereumTransaction was signed against a chainId that this network does not support. + int32 internal constant WRONG_NONCE = 312; // This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. + int32 internal constant ACCESS_LIST_UNSUPPORTED = 313; // The ethereum transaction specified an access list, which the network does not support. + int32 internal constant SCHEDULE_PENDING_EXPIRATION = 314; // A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. + int32 internal constant CONTRACT_IS_TOKEN_TREASURY = 315; // A selfdestruct or ContractDelete targeted a contract that is a token treasury. + int32 internal constant CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES = 316; // A selfdestruct or ContractDelete targeted a contract with non-zero token balances. + int32 internal constant CONTRACT_EXPIRED_AND_PENDING_REMOVAL = 317; // A contract referenced by a transaction is "detached"; that is, expired and lacking any hbar funds for auto-renewal payment---but still within its post-expiry grace period. + int32 internal constant CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT = 318; // A ContractUpdate requested removal of a contract's auto-renew account, but that contract has no auto-renew account. + int32 internal constant PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION = 319; // A delete transaction submitted via HAPI set permanent_removal=true + int32 internal constant PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED = 320; // A CryptoCreate or ContractCreate used the deprecated proxyAccountID field. + int32 internal constant SELF_STAKING_IS_NOT_ALLOWED = 321; // An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. + int32 internal constant INVALID_STAKING_ID = 322; // The staking account id or staking node id given is invalid or does not exist. + int32 internal constant STAKING_NOT_ENABLED = 323; // Native staking, while implemented, has not yet enabled by the council. + int32 internal constant INVALID_PRNG_RANGE = 324; // The range provided in UtilPrng transaction is negative. + int32 internal constant MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED = 325; // The maximum number of entities allowed in the current price regime have been created. + int32 internal constant INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE = 326; // The full prefix signature for precompile is not valid + int32 internal constant INSUFFICIENT_BALANCES_FOR_STORAGE_RENT = 327; // The combined balances of a contract and its auto-renew account (if any) did not cover the rent charged for net new storage used in a transaction. + int32 internal constant MAX_CHILD_RECORDS_EXCEEDED = 328; // A contract transaction tried to use more than the allowed number of child records, via either system contract records or internal contract creations. + int32 internal constant INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES = 329; // The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover the auto-renewal fees in a transaction. +} \ No newline at end of file diff --git a/examples/precompile_example/HederaTokenService.sol b/examples/precompile_example/HederaTokenService.sol index a04437f17..6546e2586 100644 --- a/examples/precompile_example/HederaTokenService.sol +++ b/examples/precompile_example/HederaTokenService.sol @@ -2,24 +2,15 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 import "./HederaResponseCodes.sol"; import "./IHederaTokenService.sol"; -abstract contract HederaTokenService is HederaResponseCodes { - +abstract contract HederaTokenService { address constant precompileAddress = address(0x167); // 90 days in seconds - uint32 constant defaultAutoRenewPeriod = 7776000; - - uint constant ADMIN_KEY_TYPE = 1; - uint constant KYC_KEY_TYPE = 2; - uint constant FREEZE_KEY_TYPE = 4; - uint constant WIPE_KEY_TYPE = 8; - uint constant SUPPLY_KEY_TYPE = 16; - uint constant FEE_SCHEDULE_KEY_TYPE = 32; - uint constant PAUSE_KEY_TYPE = 64; + int32 constant defaultAutoRenewPeriod = 7776000; modifier nonEmptyExpiry(IHederaTokenService.HederaToken memory token) { @@ -29,14 +20,19 @@ abstract contract HederaTokenService is HederaResponseCodes { _; } - /// Initiates a Token Transfer + /// Generic event + event CallResponseEvent(bool, bytes); + + /// Performs transfers among combinations of tokens and hbars + /// @param transferList the list of hbar transfers to do /// @param tokenTransfers the list of transfers to do /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function cryptoTransfer(IHederaTokenService.TokenTransferList[] memory tokenTransfers) internal - returns (int responseCode) + /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) + function cryptoTransfer(IHederaTokenService.TransferList memory transferList, IHederaTokenService.TokenTransferList[] memory tokenTransfers) internal + returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.cryptoTransfer.selector, tokenTransfers)); + abi.encodeWithSelector(IHederaTokenService.cryptoTransfer.selector, transferList, tokenTransfers)); responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } @@ -51,16 +47,16 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs /// @return serialNumbers If the token is an NFT the newly generate serial numbers, otherwise empty. - function mintToken(address token, uint64 amount, bytes[] memory metadata) internal - returns (int responseCode, uint64 newTotalSupply, int64[] memory serialNumbers) + function mintToken(address token, int64 amount, bytes[] memory metadata) internal + returns (int responseCode, int64 newTotalSupply, int64[] memory serialNumbers) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.mintToken.selector, token, amount, metadata)); (responseCode, newTotalSupply, serialNumbers) = - success - ? abi.decode(result, (int32, uint64, int64[])) - : (HederaResponseCodes.UNKNOWN, 0, new int64[](0)); + success + ? abi.decode(result, (int32, int64, int64[])) + : (HederaResponseCodes.UNKNOWN, int64(0), new int64[](0)); } /// Burns an amount of the token from the defined treasury account @@ -72,16 +68,16 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param serialNumbers Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be burned. /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs - function burnToken(address token, uint64 amount, int64[] memory serialNumbers) internal - returns (int responseCode, uint64 newTotalSupply) + function burnToken(address token, int64 amount, int64[] memory serialNumbers) internal + returns (int responseCode, int64 newTotalSupply) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.burnToken.selector, token, amount, serialNumbers)); (responseCode, newTotalSupply) = - success - ? abi.decode(result, (int32, uint64)) - : (HederaResponseCodes.UNKNOWN, 0); + success + ? abi.decode(result, (int32, int64)) + : (HederaResponseCodes.UNKNOWN, int64(0)); } /// Associates the provided account with the provided tokens. Must be signed by the provided @@ -156,11 +152,10 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @return tokenAddress the created token's address function createFungibleToken( IHederaTokenService.HederaToken memory token, - uint initialTotalSupply, - uint decimals) nonEmptyExpiry(token) + int64 initialTotalSupply, + int32 decimals) nonEmptyExpiry(token) internal returns (int responseCode, address tokenAddress) { - - (bool success, bytes memory result) = precompileAddress.call{value: msg.value}( + (bool success, bytes memory result) = precompileAddress.call{value : msg.value}( abi.encodeWithSelector(IHederaTokenService.createFungibleToken.selector, token, initialTotalSupply, decimals)); @@ -179,13 +174,12 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @return tokenAddress the created token's address function createFungibleTokenWithCustomFees( IHederaTokenService.HederaToken memory token, - uint initialTotalSupply, - uint decimals, + int64 initialTotalSupply, + int32 decimals, IHederaTokenService.FixedFee[] memory fixedFees, IHederaTokenService.FractionalFee[] memory fractionalFees) nonEmptyExpiry(token) internal returns (int responseCode, address tokenAddress) { - - (bool success, bytes memory result) = precompileAddress.call{value: msg.value}( + (bool success, bytes memory result) = precompileAddress.call{value : msg.value}( abi.encodeWithSelector(IHederaTokenService.createFungibleTokenWithCustomFees.selector, token, initialTotalSupply, decimals, fixedFees, fractionalFees)); (responseCode, tokenAddress) = success ? abi.decode(result, (int32, address)) : (HederaResponseCodes.UNKNOWN, address(0)); @@ -197,8 +191,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @return tokenAddress the created token's address function createNonFungibleToken(IHederaTokenService.HederaToken memory token) nonEmptyExpiry(token) internal returns (int responseCode, address tokenAddress) { - - (bool success, bytes memory result) = precompileAddress.call{value: msg.value}( + (bool success, bytes memory result) = precompileAddress.call{value : msg.value}( abi.encodeWithSelector(IHederaTokenService.createNonFungibleToken.selector, token)); (responseCode, tokenAddress) = success ? abi.decode(result, (int32, address)) : (HederaResponseCodes.UNKNOWN, address(0)); } @@ -214,8 +207,7 @@ abstract contract HederaTokenService is HederaResponseCodes { IHederaTokenService.FixedFee[] memory fixedFees, IHederaTokenService.RoyaltyFee[] memory royaltyFees) nonEmptyExpiry(token) internal returns (int responseCode, address tokenAddress) { - - (bool success, bytes memory result) = precompileAddress.call{value: msg.value}( + (bool success, bytes memory result) = precompileAddress.call{value : msg.value}( abi.encodeWithSelector(IHederaTokenService.createNonFungibleTokenWithCustomFees.selector, token, fixedFees, royaltyFees)); (responseCode, tokenAddress) = success ? abi.decode(result, (int32, address)) : (HederaResponseCodes.UNKNOWN, address(0)); @@ -239,18 +231,6 @@ abstract contract HederaTokenService is HederaResponseCodes { (responseCode, tokenInfo) = success ? abi.decode(result, (int32, IHederaTokenService.TokenInfo)) : (HederaResponseCodes.UNKNOWN, defaultTokenInfo); } - /// Query token KeyValue - /// @param token The token address to check - /// @param keyType The keyType of the desired KeyValue - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return key KeyValue info for key of type `keyType` - function getTokenKey(address token, uint keyType) external returns (int64 responseCode, IHederaTokenService.KeyValue memory key){ - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.getTokenKey.selector, token, keyType)); - IHederaTokenService.KeyValue memory defaultKeyValue; - (responseCode, key) = success ? abi.decode(result, (int32, IHederaTokenService.KeyValue)) : (HederaResponseCodes.UNKNOWN, defaultKeyValue); - } - /// Retrieves non-fungible specific token info for a given NFT /// @param token The ID of the token as a solidity address function getNonFungibleTokenInfo(address token, int64 serialNumber) internal returns (int responseCode, IHederaTokenService.NonFungibleTokenInfo memory tokenInfo) { @@ -296,6 +276,37 @@ abstract contract HederaTokenService is HederaResponseCodes { responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } + /// Transfers `amount` tokens from `from` to `to` using the + // allowance mechanism. `amount` is then deducted from the caller's allowance. + /// Only applicable to fungible tokens + /// @param token The address of the fungible Hedera token to transfer + /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens + /// @param to The account address of the receiver of the `amount` tokens + /// @param amount The amount of tokens to transfer from `from` to `to` + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFrom(address token, address from, address to, uint256 amount) external returns (int64 responseCode) + { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.transferFrom.selector, + token, from, to, amount)); + responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; + } + + /// Transfers `serialNumber` of `token` from `from` to `to` using the allowance mechanism. + /// Only applicable to NFT tokens + /// @param token The address of the non-fungible Hedera token to transfer + /// @param from The account address of the owner of `serialNumber` of `token` + /// @param to The account address of the receiver of `serialNumber` + /// @param serialNumber The NFT serial number to transfer + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFromNFT(address token, address from, address to, uint256 serialNumber) external returns (int64 responseCode) + { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.transferFromNFT.selector, + token, from, to, serialNumber)); + responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; + } + /// Returns the amount which spender is still allowed to withdraw from owner. /// Only Applicable to Fungible Tokens /// @param token The Hedera token address to check the allowance of @@ -336,9 +347,9 @@ abstract contract HederaTokenService is HederaResponseCodes { abi.encodeWithSelector(IHederaTokenService.getApproved.selector, token, serialNumber)); (responseCode, approved) = - success - ? abi.decode(result, (int32, address)) - : (HederaResponseCodes.UNKNOWN, address(0)); + success + ? abi.decode(result, (int32, address)) + : (HederaResponseCodes.UNKNOWN, address(0)); } /// Query if token account is frozen @@ -346,10 +357,10 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param account The account address associated with the token /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return frozen True if `account` is frozen for `token` - function isFrozen(address token, address account)internal returns (int64 responseCode, bool frozen){ + function isFrozen(address token, address account) internal returns (int64 responseCode, bool frozen){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.isFrozen.selector, token, account)); - (responseCode, frozen) = success ? abi.decode(result, (int32,bool)) : (HederaResponseCodes.UNKNOWN,false); + (responseCode, frozen) = success ? abi.decode(result, (int32, bool)) : (HederaResponseCodes.UNKNOWN, false); } /// Query if token account has kyc granted @@ -357,30 +368,10 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param account The account address associated with the token /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return kycGranted True if `account` has kyc granted for `token` - function isKyc(address token, address account)external returns (int64 responseCode, bool kycGranted){ + function isKyc(address token, address account) internal returns (int64 responseCode, bool kycGranted){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.isKyc.selector, token, account)); - (responseCode, kycGranted) = success ? abi.decode(result, (int32,bool)) : (HederaResponseCodes.UNKNOWN,false); - } - - /// Query if valid token found for the given address - /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return isTokenFlag True if valid token found for the given address - function isToken(address token) internal returns (int64 responseCode, bool isTokenFlag) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.isToken.selector, token)); - (responseCode, isTokenFlag) = success ? abi.decode(result, (int32, bool)) : (HederaResponseCodes.UNKNOWN, false); - } - - /// Query to return the token type for a given address - /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED - function getTokenType(address token) internal returns (int64 responseCode, int32 tokenType) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.getTokenType.selector, token)); - (responseCode, tokenType) = success ? abi.decode(result, (int32, int32)) : (HederaResponseCodes.UNKNOWN, - 1); + (responseCode, kycGranted) = success ? abi.decode(result, (int32, bool)) : (HederaResponseCodes.UNKNOWN, false); } /// Operation to freeze token account @@ -397,7 +388,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param token The token address /// @param account The account address to be unfrozen /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function unfreezeToken(address token, address account)internal returns (int64 responseCode){ + function unfreezeToken(address token, address account) internal returns (int64 responseCode){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.unfreezeToken.selector, token, account)); (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; @@ -407,7 +398,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param token The token address /// @param account The account address to grant kyc /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function grantTokenKyc(address token, address account)external returns (int64 responseCode){ + function grantTokenKyc(address token, address account) internal returns (int64 responseCode){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.grantTokenKyc.selector, token, account)); (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; @@ -417,7 +408,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param token The token address /// @param account The account address to revoke kyc /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function revokeTokenKyc(address token, address account)external returns (int64 responseCode){ + function revokeTokenKyc(address token, address account) internal returns (int64 responseCode){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.revokeTokenKyc.selector, token, account)); (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; @@ -437,7 +428,6 @@ abstract contract HederaTokenService is HederaResponseCodes { responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } - /// Query if an address is an authorized operator for another address /// Only Applicable to NFT Tokens /// @param token The Hedera NFT token address to approve @@ -485,7 +475,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param accountIds account to do a transfer to/from /// @param amounts The amount from the accountId at the same index function transferTokens(address token, address[] memory accountIds, int64[] memory amounts) internal - returns (int responseCode) + returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.transferTokens.selector, @@ -499,7 +489,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param receiver the receiver of the nft sent by the same index at sender /// @param serialNumber the serial number of the nft sent by the same index at sender function transferNFTs(address token, address[] memory sender, address[] memory receiver, int64[] memory serialNumber) - internal returns (int responseCode) + internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.transferNFTs.selector, @@ -515,7 +505,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param receiver The receiver of the transaction /// @param amount Non-negative value to send. a negative value will result in a failure. function transferToken(address token, address sender, address receiver, int64 amount) internal - returns (int responseCode) + returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.transferToken.selector, @@ -531,7 +521,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param receiver The receiver of the transaction /// @param serialNumber The serial number of the NFT to transfer. function transferNFT(address token, address sender, address receiver, int64 serialNumber) internal - returns (int responseCode) + returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.transferNFT.selector, @@ -542,7 +532,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// Operation to pause token /// @param token The token address to be paused /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function pauseToken(address token) external returns (int responseCode) + function pauseToken(address token) internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.pauseToken.selector, token)); @@ -552,7 +542,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// Operation to unpause token /// @param token The token address to be unpaused /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function unpauseToken(address token) external returns (int responseCode) + function unpauseToken(address token) internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.unpauseToken.selector, token)); @@ -564,7 +554,7 @@ abstract contract HederaTokenService is HederaResponseCodes { /// @param account The account address to revoke kyc /// @param amount The number of tokens to wipe /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function wipeTokenAccount(address token, address account, uint32 amount) internal returns (int responseCode) + function wipeTokenAccount(address token, address account, int64 amount) internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.wipeTokenAccount.selector, token, account, amount)); @@ -594,21 +584,56 @@ abstract contract HederaTokenService is HederaResponseCodes { (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } - /// Operation to update token info + /// Operation to update token keys /// @param token The token address - /// @param tokenInfo The hedera token info to update token with + /// @param keys The token keys /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenInfo(address token, IHederaTokenService.HederaToken memory tokenInfo) internal returns (int responseCode) { + function updateTokenKeys(address token, IHederaTokenService.TokenKey[] memory keys) + internal returns (int64 responseCode){ (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.updateTokenInfo.selector, token, tokenInfo)); - responseCode = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; + abi.encodeWithSelector(IHederaTokenService.updateTokenKeys.selector, token, keys)); + (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; + } + + /// Query token KeyValue + /// @param token The token address to check + /// @param keyType The keyType of the desired KeyValue + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return key KeyValue info for key of type `keyType` + function getTokenKey(address token, uint keyType) + internal returns (int64 responseCode, IHederaTokenService.KeyValue memory key){ + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.getTokenKey.selector, token, keyType)); + IHederaTokenService.KeyValue memory defaultKeyValueInfo; + (responseCode, key) = success ? abi.decode(result, (int32,IHederaTokenService.KeyValue) ) : (HederaResponseCodes.UNKNOWN, defaultKeyValueInfo); + } + + + /// Query if valid token found for the given address + /// @param token The token address + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return isTokenFlag True if valid token found for the given address + function isToken(address token) internal returns (int64 responseCode, bool isTokenFlag) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.isToken.selector, token)); + (responseCode, isTokenFlag) = success ? abi.decode(result, (int32, bool)) : (HederaResponseCodes.UNKNOWN, false); + } + + /// Query to return the token type for a given address + /// @param token The token address + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED + function getTokenType(address token) internal returns (int64 responseCode, int32 tokenType) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.getTokenType.selector, token)); + (responseCode, tokenType) = success ? abi.decode(result, (int32, int32)) : (HederaResponseCodes.UNKNOWN, - 1); } /// Operation to get token expiry info /// @param token The token address /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return expiryInfo The expiry info of the token - function getTokenExpiryInfo(address token) external returns (int responseCode, IHederaTokenService.Expiry memory expiryInfo){ + function getTokenExpiryInfo(address token) internal returns (int responseCode, IHederaTokenService.Expiry memory expiryInfo){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.getTokenExpiryInfo.selector, token)); IHederaTokenService.Expiry memory defaultExpiryInfo; @@ -618,19 +643,33 @@ abstract contract HederaTokenService is HederaResponseCodes { /// Operation to update token expiry info /// @param token The token address /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenExpiryInfo(address token, IHederaTokenService.Expiry memory expiryInfo) external returns (int responseCode){ + function updateTokenExpiryInfo(address token, IHederaTokenService.Expiry memory expiryInfo) internal returns (int responseCode){ (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.updateTokenExpiryInfo.selector, token, expiryInfo)); (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } - /// Operation to update token expiry info + /// Operation to update token info /// @param token The token address - /// @param keys The token keys + /// @param tokenInfo The hedera token info to update token with /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenKeys(address token, IHederaTokenService.TokenKey[] memory keys) external returns (int64 responseCode){ + function updateTokenInfo(address token, IHederaTokenService.HederaToken memory tokenInfo) internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector(IHederaTokenService.updateTokenKeys.selector, token, keys)); + abi.encodeWithSelector(IHederaTokenService.updateTokenInfo.selector, token, tokenInfo)); (responseCode) = success ? abi.decode(result, (int32)) : HederaResponseCodes.UNKNOWN; } -} + + /// Redirect for token + /// @param token The token address + /// @param encodedFunctionSelector The function selector from the ERC20 interface + the bytes input for the function called + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return response The result of the call that had been encoded and sent for execution. + function redirectForToken(address token, bytes memory encodedFunctionSelector) external returns (int responseCode, bytes memory response) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector(IHederaTokenService.redirectForToken.selector, token, encodedFunctionSelector) + ); + + emit CallResponseEvent(success, result); + (responseCode, response) = success ? abi.decode(result, (int32, bytes)) : (HederaResponseCodes.UNKNOWN, bytes("")); + } +} \ No newline at end of file diff --git a/examples/precompile_example/IHederaTokenService.sol b/examples/precompile_example/IHederaTokenService.sol index 370303356..437a3c6c4 100644 --- a/examples/precompile_example/IHederaTokenService.sol +++ b/examples/precompile_example/IHederaTokenService.sol @@ -2,7 +2,7 @@ pragma solidity >=0.4.9 <0.9.0; pragma experimental ABIEncoderV2; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 interface IHederaTokenService { @@ -15,6 +15,7 @@ interface IHederaTokenService { /// transaction fee is still charged. This transaction must be signed by the keys for all the sending /// accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures /// are in the same order as the accounts, skipping those accounts that don't need a signature. + /// @custom:version 0.3.0 previous version did not include isApproval struct AccountAmount { // The Account ID, as a solidity address, that sends/receives cryptocurrency or tokens address accountID; @@ -22,11 +23,16 @@ interface IHederaTokenService { // The amount of the lowest denomination of the given token that // the account sends(negative) or receives(positive) int64 amount; + + // If true then the transfer is expected to be an approved allowance and the + // accountID is expected to be the owner. The default is false (omitted). + bool isApproval; } /// A sender account, a receiver account, and the serial number of an NFT of a Token with /// NON_FUNGIBLE_UNIQUE type. When minting NFTs the sender will be the default AccountID instance /// (0.0.0 aka 0x0) and when burning NFTs, the receiver will be the default AccountID instance. + /// @custom:version 0.3.0 previous version did not include isApproval struct NftTransfer { // The solidity address of the sender address senderAccountID; @@ -36,6 +42,10 @@ interface IHederaTokenService { // The serial number of the NFT int64 serialNumber; + + // If true then the transfer is expected to be an approved allowance and the + // accountID is expected to be the owner. The default is false (omitted). + bool isApproval; } struct TokenTransferList { @@ -51,18 +61,24 @@ interface IHederaTokenService { NftTransfer[] nftTransfers; } + struct TransferList { + // Multiple list of AccountAmounts, each of which has an account and amount. + // Used to transfer hbars between the accounts in the list. + AccountAmount[] transfers; + } + /// Expiry properties of a Hedera token - second, autoRenewAccount, autoRenewPeriod struct Expiry { // The epoch second at which the token should expire; if an auto-renew account and period are // specified, this is coerced to the current epoch second plus the autoRenewPeriod - uint32 second; + int64 second; // ID of an account which will be automatically charged to renew the token's expiration, at // autoRenewPeriod interval, expressed as a solidity address address autoRenewAccount; // The interval at which the auto-renew account will be charged to extend the token's expiry - uint32 autoRenewPeriod; + int64 autoRenewPeriod; } /// A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) signature schemes, where @@ -142,7 +158,7 @@ interface IHederaTokenService { // IWA Compatibility. Depends on TokenSupplyType. For tokens of type FUNGIBLE_COMMON - the // maximum number of tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - // the maximum number of NFTs (serial numbers) that can be minted. This field can never be changed! - uint32 maxSupply; + int64 maxSupply; // The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. If // true, an account must be unfrozen before it can receive the token @@ -157,8 +173,20 @@ interface IHederaTokenService { /// Additional post creation fungible and non fungible properties of a Hedera Token. struct TokenInfo { - /// The hedera token; - HederaToken hedera; + /// Basic properties of a Hedera Token + HederaToken token; + + /// The number of tokens (fungible) or serials (non-fungible) of the token + int64 totalSupply; + + /// Specifies whether the token is deleted or not + bool deleted; + + /// Specifies whether the token kyc was defaulted with KycNotApplicable (true) or Revoked (false) + bool defaultKycStatus; + + /// Specifies whether the token is currently paused or not + bool pauseStatus; /// The fixed fees collected when transferring the token FixedFee[] fixedFees; @@ -169,20 +197,8 @@ interface IHederaTokenService { /// The royalty fees collected when transferring the token RoyaltyFee[] royaltyFees; - /// Specifies whether the token kyc was defaulted with KycNotApplicable (true) or Revoked (false) - bool defaultKycStatus; - - /// Specifies whether the token is deleted or not - bool deleted; - /// The ID of the network ledger string ledgerId; - - /// Specifies whether the token is currently paused or not - bool pauseStatus; - - /// The number of tokens (fungible) or serials (non-fungible) of the token - uint64 totalSupply; } /// Additional fungible properties of a Hedera Token. @@ -191,7 +207,7 @@ interface IHederaTokenService { TokenInfo tokenInfo; /// The number of decimal places a token is divisible by - uint32 decimals; + int32 decimals; } /// Additional non fungible properties of a Hedera Token. @@ -221,7 +237,7 @@ interface IHederaTokenService { /// useCurrentTokenForPayment. Exactly one of the values should be set. struct FixedFee { - uint32 amount; + int64 amount; // Specifies ID of token that should be used for fixed fee denomination address tokenId; @@ -241,16 +257,16 @@ interface IHederaTokenService { /// denomination is always units of the token to which this fractional fee is attached. struct FractionalFee { // A rational number's numerator, used to set the amount of a value transfer to collect as a custom fee - uint32 numerator; + int64 numerator; // A rational number's denominator, used to set the amount of a value transfer to collect as a custom fee - uint32 denominator; + int64 denominator; // The minimum amount to assess - uint32 minimumAmount; + int64 minimumAmount; // The maximum amount to assess (zero implies no maximum) - uint32 maximumAmount; + int64 maximumAmount; bool netOfTransfers; // The ID of the account to receive the custom fee, expressed as a solidity address @@ -264,17 +280,17 @@ interface IHederaTokenService { /// Royalty fees can only be added to tokens of type type NON_FUNGIBLE_UNIQUE. struct RoyaltyFee { // A fraction's numerator of fungible value exchanged for an NFT to collect as royalty - uint32 numerator; + int64 numerator; // A fraction's denominator of fungible value exchanged for an NFT to collect as royalty - uint32 denominator; + int64 denominator; // If present, the fee to assess to the NFT receiver when no fungible value // is exchanged with the sender. Consists of: // amount: the amount to charge for the fee // tokenId: Specifies ID of token that should be used for fixed fee denomination // useHbarsForPayment: Specifies this fee should be denominated in Hbar - uint32 amount; + int64 amount; address tokenId; bool useHbarsForPayment; @@ -286,10 +302,11 @@ interface IHederaTokenService { * Direct HTS Calls * **********************/ - /// Initiates a Token Transfer - /// @param tokenTransfers the list of transfers to do - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function cryptoTransfer(TokenTransferList[] memory tokenTransfers) + /// Performs transfers among combinations of tokens and hbars + /// @param transferList the list of hbar transfers to do + /// @param tokenTransfers the list of token transfers to do + /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) + function cryptoTransfer(TransferList memory transferList, TokenTransferList[] memory tokenTransfers) external returns (int64 responseCode); @@ -306,13 +323,13 @@ interface IHederaTokenService { /// @return serialNumbers If the token is an NFT the newly generate serial numbers, othersise empty. function mintToken( address token, - uint64 amount, + int64 amount, bytes[] memory metadata ) external returns ( int64 responseCode, - uint64 newTotalSupply, + int64 newTotalSupply, int64[] memory serialNumbers ); @@ -327,9 +344,9 @@ interface IHederaTokenService { /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs function burnToken( address token, - uint64 amount, + int64 amount, int64[] memory serialNumbers - ) external returns (int64 responseCode, uint64 newTotalSupply); + ) external returns (int64 responseCode, int64 newTotalSupply); /// Associates the provided account with the provided tokens. Must be signed by the provided /// Account's key or called from the accounts contract key @@ -397,8 +414,8 @@ interface IHederaTokenService { /// @return tokenAddress the created token's address function createFungibleToken( HederaToken memory token, - uint initialTotalSupply, - uint decimals + int64 initialTotalSupply, + int32 decimals ) external payable returns (int64 responseCode, address tokenAddress); /// Creates a Fungible Token with the specified properties @@ -412,8 +429,8 @@ interface IHederaTokenService { /// @return tokenAddress the created token's address function createFungibleTokenWithCustomFees( HederaToken memory token, - uint initialTotalSupply, - uint decimals, + int64 initialTotalSupply, + int32 decimals, FixedFee[] memory fixedFees, FractionalFee[] memory fractionalFees ) external payable returns (int64 responseCode, address tokenAddress); @@ -506,6 +523,16 @@ interface IHederaTokenService { uint256 amount ) external returns (int64 responseCode); + /// Transfers `amount` tokens from `from` to `to` using the + // allowance mechanism. `amount` is then deducted from the caller's allowance. + /// Only applicable to fungible tokens + /// @param token The address of the fungible Hedera token to transfer + /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens + /// @param to The account address of the receiver of the `amount` tokens + /// @param amount The amount of tokens to transfer from `from` to `to` + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFrom(address token, address from, address to, uint256 amount) external returns (int64 responseCode); + /// Returns the amount which spender is still allowed to withdraw from owner. /// Only Applicable to Fungible Tokens /// @param token The Hedera token address to check the allowance of @@ -531,13 +558,22 @@ interface IHederaTokenService { uint256 serialNumber ) external returns (int64 responseCode); + /// Transfers `serialNumber` of `token` from `from` to `to` using the allowance mechanism. + /// Only applicable to NFT tokens + /// @param token The address of the non-fungible Hedera token to transfer + /// @param from The account address of the owner of `serialNumber` of `token` + /// @param to The account address of the receiver of `serialNumber` + /// @param serialNumber The NFT serial number to transfer + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFromNFT(address token, address from, address to, uint256 serialNumber) external returns (int64 responseCode); + /// Get the approved address for a single NFT /// Only Applicable to NFT Tokens /// @param token The Hedera NFT token address to check approval /// @param serialNumber The NFT to find the approved address for /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return approved The approved address for this NFT, or the zero address if there is none - function getApproved(address token, int64 serialNumber) + function getApproved(address token, uint256 serialNumber) external returns (int64 responseCode, address approved); @@ -606,7 +642,7 @@ interface IHederaTokenService { function getTokenDefaultFreezeStatus(address token) external returns (int64 responseCode, bool defaultFreezeStatus); - + /// Query token default kyc status /// @param token The token address to check /// @return responseCode The response code for the status of the request. SUCCESS is 22. @@ -707,7 +743,7 @@ interface IHederaTokenService { function wipeTokenAccount( address token, address account, - uint32 amount + int64 amount ) external returns (int64 responseCode); /// Operation to wipe non fungible tokens from account @@ -747,17 +783,24 @@ interface IHederaTokenService { /// Query if valid token found for the given address /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return isToken True if valid token found for the given address - function isToken(address token) - external returns + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return isToken True if valid token found for the given address + function isToken(address token) + external returns (int64 responseCode, bool isToken); /// Query to return the token type for a given address /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED function getTokenType(address token) - external returns + external returns (int64 responseCode, int32 tokenType); -} + + /// Initiates a Redirect For Token + /// @param token The token address + /// @param encodedFunctionSelector The function selector from the ERC20 interface + the bytes input for the function called + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return response The result of the call that had been encoded and sent for execution. + function redirectForToken(address token, bytes memory encodedFunctionSelector) external returns (int64 responseCode, bytes memory response); +} \ No newline at end of file diff --git a/examples/precompile_example/IPrngSystemContract.sol b/examples/precompile_example/IPrngSystemContract.sol index 8c3e4da0e..7c7325199 100644 --- a/examples/precompile_example/IPrngSystemContract.sol +++ b/examples/precompile_example/IPrngSystemContract.sol @@ -7,4 +7,4 @@ interface IPrngSystemContract { // Generates a 256-bit pseudorandom seed using the first 256-bits of running hash of n-3 transaction record. // Users can generate a pseudorandom number in a specified range using the seed by (integer value of seed % range) function getPseudorandomSeed() external returns (bytes32); -} +} \ No newline at end of file diff --git a/examples/precompile_example/KeyHelper.sol b/examples/precompile_example/KeyHelper.sol index 55785931f..aaf24ae72 100644 --- a/examples/precompile_example/KeyHelper.sol +++ b/examples/precompile_example/KeyHelper.sol @@ -2,49 +2,167 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; -// This file was copied from github.com/hashgraph/hedera-smart-contracts on Aug 31 2022 +// This file was copied from github.com/hashgraph/hedera-smart-contracts on Sep 27 2023 import "./HederaTokenService.sol"; -contract KeyHelper is HederaTokenService { +abstract contract KeyHelper { + using Bits for uint256; + address supplyContract; - uint constant INHERIT_ACCOUNT_KEY = 1; - uint constant CONTRACT_ID_KEY = 2; - uint constant ED25519_KEY = 3; - uint constant ECDSA_SECPK2561K1_KEY = 4; - uint constant DELEGATABLE_CONTRACT_ID_KEY = 5; + mapping(KeyType => uint256) keyTypes; - function createSingleKey( - uint keyType, - uint keyValueType, + enum KeyType { + ADMIN, + KYC, + FREEZE, + WIPE, + SUPPLY, + FEE, + PAUSE + } + enum KeyValueType { + INHERIT_ACCOUNT_KEY, + CONTRACT_ID, + ED25519, + SECP256K1, + DELEGETABLE_CONTRACT_ID + } + + constructor() { + keyTypes[KeyType.ADMIN] = 1; + keyTypes[KeyType.KYC] = 2; + keyTypes[KeyType.FREEZE] = 4; + keyTypes[KeyType.WIPE] = 8; + keyTypes[KeyType.SUPPLY] = 16; + keyTypes[KeyType.FEE] = 32; + keyTypes[KeyType.PAUSE] = 64; + } + + function getDefaultKeys() internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](2); + keys[0] = getSingleKey(KeyType.KYC, KeyValueType.CONTRACT_ID, ''); + keys[1] = IHederaTokenService.TokenKey( + getDuplexKeyType(KeyType.SUPPLY, KeyType.PAUSE), + getKeyValueType(KeyValueType.CONTRACT_ID, '') + ); + } + + function getAllTypeKeys(KeyValueType keyValueType, bytes memory key) + internal + view + returns (IHederaTokenService.TokenKey[] memory keys) + { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey(getAllKeyTypes(), getKeyValueType(keyValueType, key)); + } + + function getCustomSingleTypeKeys( + KeyType keyType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey(getKeyType(keyType), getKeyValueType(keyValueType, key)); + } + + function getCustomDuplexTypeKeys( + KeyType firstType, + KeyType secondType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey( + getDuplexKeyType(firstType, secondType), + getKeyValueType(keyValueType, key) + ); + } + + function getSingleKey( + KeyType keyType, + KeyValueType keyValueType, bytes memory key ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { - tokenKey = IHederaTokenService.TokenKey(keyType, createKeyValueType(keyValueType, key, address(0))); + tokenKey = IHederaTokenService.TokenKey(getKeyType(keyType), getKeyValueType(keyValueType, key)); } - function createSingleKey( - uint keyType, - uint keyValueType, + function getSingleKey( + KeyType keyType, + KeyValueType keyValueType, address key ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { - tokenKey = IHederaTokenService.TokenKey(keyType, createKeyValueType(keyValueType, "", key)); + tokenKey = IHederaTokenService.TokenKey(getKeyType(keyType), getKeyValueType(keyValueType, key)); } - function createKeyValueType( - uint keyValueType, - bytes memory key, - address keyAddress - ) internal view returns (IHederaTokenService.KeyValue memory keyValue) { - if (keyValueType == INHERIT_ACCOUNT_KEY) { + function getSingleKey( + KeyType firstType, + KeyType secondType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { + tokenKey = IHederaTokenService.TokenKey( + getDuplexKeyType(firstType, secondType), + getKeyValueType(keyValueType, key) + ); + } + + function getDuplexKeyType(KeyType firstType, KeyType secondType) internal pure returns (uint256 keyType) { + keyType = keyType.setBit(uint8(firstType)); + keyType = keyType.setBit(uint8(secondType)); + } + + function getAllKeyTypes() internal pure returns (uint256 keyType) { + keyType = keyType.setBit(uint8(KeyType.ADMIN)); + keyType = keyType.setBit(uint8(KeyType.KYC)); + keyType = keyType.setBit(uint8(KeyType.FREEZE)); + keyType = keyType.setBit(uint8(KeyType.WIPE)); + keyType = keyType.setBit(uint8(KeyType.SUPPLY)); + keyType = keyType.setBit(uint8(KeyType.FEE)); + keyType = keyType.setBit(uint8(KeyType.PAUSE)); + } + + function getKeyType(KeyType keyType) internal view returns (uint256) { + return keyTypes[keyType]; + } + + function getKeyValueType(KeyValueType keyValueType, bytes memory key) + internal + view + returns (IHederaTokenService.KeyValue memory keyValue) + { + if (keyValueType == KeyValueType.INHERIT_ACCOUNT_KEY) { keyValue.inheritAccountKey = true; - } else if (keyValueType == CONTRACT_ID_KEY) { - keyValue.contractId = keyAddress; - } else if (keyValueType == ED25519_KEY) { + } else if (keyValueType == KeyValueType.CONTRACT_ID) { + keyValue.contractId = supplyContract; + } else if (keyValueType == KeyValueType.ED25519) { keyValue.ed25519 = key; - } else if (keyValueType == ECDSA_SECPK2561K1_KEY) { + } else if (keyValueType == KeyValueType.SECP256K1) { keyValue.ECDSA_secp256k1 = key; - } else if (keyValueType == DELEGATABLE_CONTRACT_ID_KEY) { + } else if (keyValueType == KeyValueType.DELEGETABLE_CONTRACT_ID) { + keyValue.delegatableContractId = supplyContract; + } + } + + function getKeyValueType(KeyValueType keyValueType, address keyAddress) + internal + pure + returns (IHederaTokenService.KeyValue memory keyValue) + { + if (keyValueType == KeyValueType.CONTRACT_ID) { + keyValue.contractId = keyAddress; + } else if (keyValueType == KeyValueType.DELEGETABLE_CONTRACT_ID) { keyValue.delegatableContractId = keyAddress; } } } + +library Bits { + uint256 internal constant ONE = uint256(1); + + // Sets the bit at the given 'index' in 'self' to '1'. + // Returns the modified value. + function setBit(uint256 self, uint8 index) internal pure returns (uint256) { + return self | (ONE << index); + } +} \ No newline at end of file diff --git a/examples/precompile_example/PrecompileExample.json b/examples/precompile_example/PrecompileExample.json index 3131d7571..970bee123 100644 --- a/examples/precompile_example/PrecompileExample.json +++ b/examples/precompile_example/PrecompileExample.json @@ -1,748 +1,388 @@ { - "functionDebugData": { - "@_5162": { - "entryPoint": null, - "id": 5162, - "parameterSlots": 2, - "returnSlots": 0 + "abi": [ + { + "inputs": [ + { + "internalType": "address payable", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_aliceAccount", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" }, - "abi_decode_t_address_payable_fromMemory": { - "entryPoint": 192, - "id": null, - "parameterSlots": 2, - "returnSlots": 1 + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "CallResponseEvent", + "type": "event" }, - "abi_decode_tuple_t_address_payablet_address_payable_fromMemory": { - "entryPoint": 215, - "id": null, - "parameterSlots": 2, - "returnSlots": 2 + { + "inputs": [], + "name": "getPseudorandomSeed", + "outputs": [ + { + "internalType": "bytes32", + "name": "seedBytes", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, - "allocate_unbounded": { - "entryPoint": null, - "id": null, - "parameterSlots": 0, - "returnSlots": 1 + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "encodedFunctionSelector", + "type": "bytes" + } + ], + "name": "redirectForToken", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, - "cleanup_t_address_payable": { - "entryPoint": 286, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 + { + "inputs": [], + "name": "step0", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, - "cleanup_t_uint160": { - "entryPoint": 306, - "id": null, - "parameterSlots": 1, - "returnSlots": 1 + { + "inputs": [], + "name": "step1", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "payable", + "type": "function" }, - "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { - "entryPoint": null, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 + { + "inputs": [], + "name": "step10", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, - "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { - "entryPoint": 338, - "id": null, - "parameterSlots": 0, - "returnSlots": 0 + { + "inputs": [ + { + "internalType": "bytes", + "name": "keyBytes", + "type": "bytes" + } + ], + "name": "step11", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "metadatas", + "type": "bytes[]" + } + ], + "name": "step12", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step13", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step14", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step15", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step16", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step2", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step3", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step4", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step5", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step6", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step7", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step8", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "step9", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "int64", + "name": "responseCode", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, - "validator_revert_t_address_payable": { - "entryPoint": 343, - "id": null, - "parameterSlots": 1, - "returnSlots": 0 - } - }, - "generatedSources": [ { - "ast": { - "nodeType": "YulBlock", - "src": "0:1427:9", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "78:88:9", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "88:22:9", - "value": { - "arguments": [ - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "103:6:9" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "97:5:9" - }, - "nodeType": "YulFunctionCall", - "src": "97:13:9" - }, - "variableNames": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "88:5:9" - } - ] - }, - { - "expression": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "154:5:9" - } - ], - "functionName": { - "name": "validator_revert_t_address_payable", - "nodeType": "YulIdentifier", - "src": "119:34:9" - }, - "nodeType": "YulFunctionCall", - "src": "119:41:9" - }, - "nodeType": "YulExpressionStatement", - "src": "119:41:9" - } - ] - }, - "name": "abi_decode_t_address_payable_fromMemory", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "56:6:9", - "type": "" - }, - { - "name": "end", - "nodeType": "YulTypedName", - "src": "64:3:9", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "72:5:9", - "type": "" - } - ], - "src": "7:159:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "282:429:9", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "328:83:9", - "statements": [ - { - "expression": { - "arguments": [], - "functionName": { - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulIdentifier", - "src": "330:77:9" - }, - "nodeType": "YulFunctionCall", - "src": "330:79:9" - }, - "nodeType": "YulExpressionStatement", - "src": "330:79:9" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "303:7:9" - }, - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "312:9:9" - } - ], - "functionName": { - "name": "sub", - "nodeType": "YulIdentifier", - "src": "299:3:9" - }, - "nodeType": "YulFunctionCall", - "src": "299:23:9" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "324:2:9", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "slt", - "nodeType": "YulIdentifier", - "src": "295:3:9" - }, - "nodeType": "YulFunctionCall", - "src": "295:32:9" - }, - "nodeType": "YulIf", - "src": "292:119:9" - }, - { - "nodeType": "YulBlock", - "src": "421:136:9", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "436:15:9", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "450:1:9", - "type": "", - "value": "0" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "440:6:9", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "465:82:9", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "519:9:9" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "530:6:9" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "515:3:9" - }, - "nodeType": "YulFunctionCall", - "src": "515:22:9" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "539:7:9" - } - ], - "functionName": { - "name": "abi_decode_t_address_payable_fromMemory", - "nodeType": "YulIdentifier", - "src": "475:39:9" - }, - "nodeType": "YulFunctionCall", - "src": "475:72:9" - }, - "variableNames": [ - { - "name": "value0", - "nodeType": "YulIdentifier", - "src": "465:6:9" - } - ] - } - ] - }, - { - "nodeType": "YulBlock", - "src": "567:137:9", - "statements": [ - { - "nodeType": "YulVariableDeclaration", - "src": "582:16:9", - "value": { - "kind": "number", - "nodeType": "YulLiteral", - "src": "596:2:9", - "type": "", - "value": "32" - }, - "variables": [ - { - "name": "offset", - "nodeType": "YulTypedName", - "src": "586:6:9", - "type": "" - } - ] - }, - { - "nodeType": "YulAssignment", - "src": "612:82:9", - "value": { - "arguments": [ - { - "arguments": [ - { - "name": "headStart", - "nodeType": "YulIdentifier", - "src": "666:9:9" - }, - { - "name": "offset", - "nodeType": "YulIdentifier", - "src": "677:6:9" - } - ], - "functionName": { - "name": "add", - "nodeType": "YulIdentifier", - "src": "662:3:9" - }, - "nodeType": "YulFunctionCall", - "src": "662:22:9" - }, - { - "name": "dataEnd", - "nodeType": "YulIdentifier", - "src": "686:7:9" - } - ], - "functionName": { - "name": "abi_decode_t_address_payable_fromMemory", - "nodeType": "YulIdentifier", - "src": "622:39:9" - }, - "nodeType": "YulFunctionCall", - "src": "622:72:9" - }, - "variableNames": [ - { - "name": "value1", - "nodeType": "YulIdentifier", - "src": "612:6:9" - } - ] - } - ] - } - ] - }, - "name": "abi_decode_tuple_t_address_payablet_address_payable_fromMemory", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "headStart", - "nodeType": "YulTypedName", - "src": "244:9:9", - "type": "" - }, - { - "name": "dataEnd", - "nodeType": "YulTypedName", - "src": "255:7:9", - "type": "" - } - ], - "returnVariables": [ - { - "name": "value0", - "nodeType": "YulTypedName", - "src": "267:6:9", - "type": "" - }, - { - "name": "value1", - "nodeType": "YulTypedName", - "src": "275:6:9", - "type": "" - } - ], - "src": "172:539:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "757:35:9", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "767:19:9", - "value": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "783:2:9", - "type": "", - "value": "64" - } - ], - "functionName": { - "name": "mload", - "nodeType": "YulIdentifier", - "src": "777:5:9" - }, - "nodeType": "YulFunctionCall", - "src": "777:9:9" - }, - "variableNames": [ - { - "name": "memPtr", - "nodeType": "YulIdentifier", - "src": "767:6:9" - } - ] - } - ] - }, - "name": "allocate_unbounded", - "nodeType": "YulFunctionDefinition", - "returnVariables": [ - { - "name": "memPtr", - "nodeType": "YulTypedName", - "src": "750:6:9", - "type": "" - } - ], - "src": "717:75:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "851:51:9", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "861:35:9", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "890:5:9" - } - ], - "functionName": { - "name": "cleanup_t_uint160", - "nodeType": "YulIdentifier", - "src": "872:17:9" - }, - "nodeType": "YulFunctionCall", - "src": "872:24:9" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "861:7:9" - } - ] - } - ] - }, - "name": "cleanup_t_address_payable", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "833:5:9", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "843:7:9", - "type": "" - } - ], - "src": "798:104:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "953:81:9", - "statements": [ - { - "nodeType": "YulAssignment", - "src": "963:65:9", - "value": { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "978:5:9" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "985:42:9", - "type": "", - "value": "0xffffffffffffffffffffffffffffffffffffffff" - } - ], - "functionName": { - "name": "and", - "nodeType": "YulIdentifier", - "src": "974:3:9" - }, - "nodeType": "YulFunctionCall", - "src": "974:54:9" - }, - "variableNames": [ - { - "name": "cleaned", - "nodeType": "YulIdentifier", - "src": "963:7:9" - } - ] - } - ] - }, - "name": "cleanup_t_uint160", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "935:5:9", - "type": "" - } - ], - "returnVariables": [ - { - "name": "cleaned", - "nodeType": "YulTypedName", - "src": "945:7:9", - "type": "" - } - ], - "src": "908:126:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1129:28:9", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1146:1:9", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1149:1:9", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1139:6:9" - }, - "nodeType": "YulFunctionCall", - "src": "1139:12:9" - }, - "nodeType": "YulExpressionStatement", - "src": "1139:12:9" - } - ] - }, - "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", - "nodeType": "YulFunctionDefinition", - "src": "1040:117:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1252:28:9", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1269:1:9", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1272:1:9", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1262:6:9" - }, - "nodeType": "YulFunctionCall", - "src": "1262:12:9" - }, - "nodeType": "YulExpressionStatement", - "src": "1262:12:9" - } - ] - }, - "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", - "nodeType": "YulFunctionDefinition", - "src": "1163:117:9" - }, - { - "body": { - "nodeType": "YulBlock", - "src": "1337:87:9", - "statements": [ - { - "body": { - "nodeType": "YulBlock", - "src": "1402:16:9", - "statements": [ - { - "expression": { - "arguments": [ - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1411:1:9", - "type": "", - "value": "0" - }, - { - "kind": "number", - "nodeType": "YulLiteral", - "src": "1414:1:9", - "type": "", - "value": "0" - } - ], - "functionName": { - "name": "revert", - "nodeType": "YulIdentifier", - "src": "1404:6:9" - }, - "nodeType": "YulFunctionCall", - "src": "1404:12:9" - }, - "nodeType": "YulExpressionStatement", - "src": "1404:12:9" - } - ] - }, - "condition": { - "arguments": [ - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1360:5:9" - }, - { - "arguments": [ - { - "name": "value", - "nodeType": "YulIdentifier", - "src": "1393:5:9" - } - ], - "functionName": { - "name": "cleanup_t_address_payable", - "nodeType": "YulIdentifier", - "src": "1367:25:9" - }, - "nodeType": "YulFunctionCall", - "src": "1367:32:9" - } - ], - "functionName": { - "name": "eq", - "nodeType": "YulIdentifier", - "src": "1357:2:9" - }, - "nodeType": "YulFunctionCall", - "src": "1357:43:9" - } - ], - "functionName": { - "name": "iszero", - "nodeType": "YulIdentifier", - "src": "1350:6:9" - }, - "nodeType": "YulFunctionCall", - "src": "1350:51:9" - }, - "nodeType": "YulIf", - "src": "1347:71:9" - } - ] - }, - "name": "validator_revert_t_address_payable", - "nodeType": "YulFunctionDefinition", - "parameters": [ - { - "name": "value", - "nodeType": "YulTypedName", - "src": "1330:5:9", - "type": "" - } - ], - "src": "1286:138:9" - } - ] - }, - "contents": "{\n\n function abi_decode_t_address_payable_fromMemory(offset, end) -> value {\n value := mload(offset)\n validator_revert_t_address_payable(value)\n }\n\n function abi_decode_tuple_t_address_payablet_address_payable_fromMemory(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address_payable_fromMemory(add(headStart, offset), dataEnd)\n }\n\n {\n\n let offset := 32\n\n value1 := abi_decode_t_address_payable_fromMemory(add(headStart, offset), dataEnd)\n }\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function cleanup_t_address_payable(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function validator_revert_t_address_payable(value) {\n if iszero(eq(value, cleanup_t_address_payable(value))) { revert(0, 0) }\n }\n\n}\n", - "id": 9, - "language": "Yul", - "name": "#utility.yul" + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "serialNumber", + "type": "uint256" + } + ], + "name": "transferFromNFT", + "outputs": [ + { + "internalType": "int64", + "name": "responseCode", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" } ], - "linkReferences": {}, - "object": "60806040523480156200001157600080fd5b5060405162005392380380620053928339818101604052810190620000379190620000d7565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600081519050620000d18162000157565b92915050565b60008060408385031215620000f157620000f062000152565b5b60006200010185828601620000c0565b92505060206200011485828601620000c0565b9150509250929050565b60006200012b8262000132565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b62000162816200011e565b81146200016e57600080fd5b50565b61521180620001816000396000f3fe60806040526004361061019c5760003560e01c80638f8d7f99116100ec578063d40a71fb1161008a578063df4ec24911610064578063df4ec2491461061a578063eb7c6f7214610645578063f2c31ff414610670578063fb5d7376146106ae5761019c565b8063d40a71fb14610593578063d614cdb8146105b1578063d83bf9a1146105ef5761019c565b8063af99c633116100c6578063af99c633146104d5578063bdc7a42214610512578063bddd3a6b1461053d578063c30131c5146105685761019c565b80638f8d7f9914610442578063a3221c8e1461047f578063ade094b4146104aa5761019c565b80634fb4bcec116101595780637c41ad2c116101335780637c41ad2c146103725780637f990e8f146103af5780637fbaadba146103ec5780638f4ed333146104175761019c565b80634fb4bcec146102cd578063593d6e82146102f85780636fc3cbaf146103355761019c565b806323a452ad146101a157806336f46891146101d15780633b3bff0f146101fc5780633c4dd32e1461023957806344ac2d4814610277578063462a08df146102a2575b600080fd5b6101bb60048036038101906101b69190613f24565b6106d9565b6040516101c89190614b5d565b60405180910390f35b3480156101dd57600080fd5b506101e6610aa7565b6040516101f39190614b5d565b60405180910390f35b34801561020857600080fd5b50610223600480360381019061021e9190613d65565b610b58565b6040516102309190614b5d565b60405180910390f35b34801561024557600080fd5b50610260600480360381019061025b9190613e6e565b610c6d565b60405161026e929190614be5565b60405180910390f35b34801561028357600080fd5b5061028c610da1565b6040516102999190614b42565b60405180910390f35b3480156102ae57600080fd5b506102b7610e81565b6040516102c49190614b5d565b60405180910390f35b3480156102d957600080fd5b506102e2610fa8565b6040516102ef9190614b5d565b60405180910390f35b34801561030457600080fd5b5061031f600480360381019061031a9190613e2e565b611058565b60405161032c9190614b5d565b60405180910390f35b34801561034157600080fd5b5061035c60048036038101906103579190613dd2565b611170565b6040516103699190614ba1565b60405180910390f35b34801561037e57600080fd5b5061039960048036038101906103949190613d65565b611288565b6040516103a69190614b5d565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d19190613eae565b61139d565b6040516103e39190614b5d565b60405180910390f35b3480156103f857600080fd5b506104016114f1565b60405161040e9190614b5d565b60405180910390f35b34801561042357600080fd5b5061042c6115a2565b6040516104399190614b5d565b60405180910390f35b34801561044e57600080fd5b5061046960048036038101906104649190613d92565b6116a5565b6040516104769190614ba1565b60405180910390f35b34801561048b57600080fd5b506104946117bd565b6040516104a19190614b5d565b60405180910390f35b3480156104b657600080fd5b506104bf61186e565b6040516104cc9190614b5d565b60405180910390f35b3480156104e157600080fd5b506104fc60048036038101906104f79190613d92565b611965565b6040516105099190614ba1565b60405180910390f35b34801561051e57600080fd5b50610527611a7d565b6040516105349190614b5d565b60405180910390f35b34801561054957600080fd5b50610552611b2b565b60405161055f9190614b5d565b60405180910390f35b34801561057457600080fd5b5061057d611c38565b60405161058a9190614b5d565b60405180910390f35b61059b611ce8565b6040516105a89190614b5d565b60405180910390f35b3480156105bd57600080fd5b506105d860048036038101906105d39190613d65565b611fd0565b6040516105e6929190614b78565b60405180910390f35b3480156105fb57600080fd5b50610604612100565b6040516106119190614b42565b60405180910390f35b34801561062657600080fd5b5061062f612238565b60405161063c9190614b5d565b60405180910390f35b34801561065157600080fd5b5061065a6122e6565b6040516106679190614b5d565b60405180910390f35b34801561067c57600080fd5b5061069760048036038101906106929190613d92565b6123f3565b6040516106a5929190614bbc565b60405180910390f35b3480156106ba57600080fd5b506106c3612518565b6040516106d09190614b5d565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461073457600080fd5b6000600167ffffffffffffffff81111561075157610750615069565b5b60405190808252806020026020018201604052801561078a57816020015b610777613507565b81526020019060019003908161076f5790505b50905061079d60106001176003856125c9565b816000815181106107b1576107b061503a565b5b60200260200101819052506000600167ffffffffffffffff8111156107d9576107d8615069565b5b60405190808252806020026020018201604052801561081257816020015b6107ff613527565b8152602001906001900390816107f75790505b5090506108436305f5e10060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff166125fa565b816000815181106108575761085661503a565b5b60200260200101819052506109f16040518061012001604052806040518060400160405280601181526020017f4578616d706c65204e465420746f6b656e00000000000000000000000000000081525081526020016040518060400160405280600481526020017f454e46540000000000000000000000000000000000000000000000000000000081525081526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600481526020017f6d656d6f0000000000000000000000000000000000000000000000000000000081525081526020016001151581526020016103e863ffffffff168152602001600015158152602001848152602001610993600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16626acfc0612669565b81525082600067ffffffffffffffff8111156109b2576109b1615069565b5b6040519080825280602002602001820160405280156109eb57816020015b6109d861358c565b8152602001906001900390816109d05790505b506126c7565b600360008291906101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550819450505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610a9f573d6000803e3d6000fd5b505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b0257600080fd5b610b53600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001612846565b905090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16633b3bff0f60e01b85604051602401610b8f9190614984565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610bf9919061496d565b6000604051808303816000865af19150503d8060008114610c36576040519150601f19603f3d011682016040523d82523d6000602084013e610c3b565b606091505b509150915081610c4c576015610c61565b80806020019051810190610c609190613f9a565b5b60030b92505050919050565b6000610c77613602565b60008061016773ffffffffffffffffffffffffffffffffffffffff16633c4dd32e60e01b8787604051602401610cae929190614a9d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d18919061496d565b6000604051808303816000865af19150503d8060008114610d55576040519150601f19603f3d011682016040523d82523d6000602084013e610d5a565b606091505b5091509150610d67613602565b82610d7457601581610d89565b81806020019051810190610d889190614087565b5b8160030b915080955081965050505050509250929050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d83bf9a16040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610e4457600080fd5b505af1158015610e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7c9190613ef7565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610edc57600080fd5b6000600167ffffffffffffffff811115610ef957610ef8615069565b5b604051908082528060200260200182016040528015610f275781602001602082028036833780820191505090505b509050600381600081518110610f4057610f3f61503a565b5b602002602001019060070b908160070b815250506000610f84600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600084612964565b809250819450505060028167ffffffffffffffff1614610fa357600080fd5b505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461100357600080fd5b611053600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064612a8c565b905090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663593d6e8260e01b8686604051602401611091929190614a74565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516110fb919061496d565b6000604051808303816000865af19150503d8060008114611138576040519150601f19603f3d011682016040523d82523d6000602084013e61113d565b606091505b50915091508161114e576015611163565b808060200190518101906111629190613f9a565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16636fc3cbaf60e01b86866040516024016111a9929190614a44565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611213919061496d565b6000604051808303816000865af19150503d8060008114611250576040519150601f19603f3d011682016040523d82523d6000602084013e611255565b606091505b50915091508161126657601561127b565b8080602001905181019061127a9190613f9a565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16637c41ad2c60e01b856040516024016112bf9190614984565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611329919061496d565b6000604051808303816000865af19150503d8060008114611366576040519150601f19603f3d011682016040523d82523d6000602084013e61136b565b606091505b50915091508161137c576015611391565b808060200190518101906113909190613f9a565b5b60030b92505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113f857600080fd5b600382511461140657600080fd5b60006060611438600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600086612ba7565b80935081945082955050505060038267ffffffffffffffff161461145b57600080fd5b600381511461146957600080fd5b60018160008151811061147f5761147e61503a565b5b602002602001015160070b1461149457600080fd5b6002816001815181106114aa576114a961503a565b5b602002602001015160070b146114bf57600080fd5b6003816002815181106114d5576114d461503a565b5b602002602001015160070b146114ea57600080fd5b5050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461154c57600080fd5b61159a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612d1f565b60070b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115fd57600080fd5b6000606061167d600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064600067ffffffffffffffff81111561164457611643615069565b5b60405190808252806020026020018201604052801561167757816020015b60608152602001906001900390816116625790505b50612ba7565b80935081945082955050505060c88267ffffffffffffffff16146116a057600080fd5b505090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16638f8d7f9960e01b86866040516024016116de92919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611748919061496d565b6000604051808303816000865af19150503d8060008114611785576040519150601f19603f3d011682016040523d82523d6000602084013e61178a565b606091505b50915091508161179b5760156117b0565b808060200190518101906117af9190613f9a565b5b60030b9250505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461181857600080fd5b611866600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612e37565b60070b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118c957600080fd5b6000611942600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166032600067ffffffffffffffff81111561190e5761190d615069565b5b60405190808252806020026020018201604052801561193c5781602001602082028036833780820191505090505b50612964565b809250819350505060968167ffffffffffffffff161461196157600080fd5b5090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663af99c63360e01b868660405160240161199e92919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611a08919061496d565b6000604051808303816000865af19150503d8060008114611a45576040519150601f19603f3d011682016040523d82523d6000602084013e611a4a565b606091505b509150915081611a5b576015611a70565b80806020019051810190611a6f9190613f9a565b5b60030b9250505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ad857600080fd5b611b26600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612f4f565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b8657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16633b3bff0f600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401611be19190614984565b602060405180830381600087803b158015611bfb57600080fd5b505af1158015611c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c339190613f6d565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c9357600080fd5b611ce3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002613067565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d4357600080fd5b6000600167ffffffffffffffff811115611d6057611d5f615069565b5b604051908082528060200260200182016040528015611d9957816020015b611d86613507565b815260200190600190039081611d7e5790505b509050611dc160046040601060011717176001604051806020016040528060008152506125c9565b81600081518110611dd557611dd461503a565b5b6020026020010181905250611f1d6040518061012001604052806040518060400160405280601681526020017f4578616d706c652046756e6769626c6520746f6b656e0000000000000000000081525081526020016040518060400160405280600181526020017f450000000000000000000000000000000000000000000000000000000000000081525081526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600481526020017f6d656d6f0000000000000000000000000000000000000000000000000000000081525081526020016001151581526020016103e863ffffffff168152602001600015158152602001838152602001611f11600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16626acfc0612669565b81525060646000613182565b600260008291906101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550819350505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611fcb573d6000803e3d6000fd5b505090565b6000611fda61365f565b60008061016773ffffffffffffffffffffffffffffffffffffffff1663d614cdb860e01b8660405160240161200f9190614984565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612079919061496d565b6000604051808303816000865af19150503d80600081146120b6576040519150601f19603f3d011682016040523d82523d6000602084013e6120bb565b606091505b50915091506120c861365f565b826120d5576015816120ea565b818060200190518101906120e99190614047565b5b8160030b91508095508196505050505050915091565b600080600061016973ffffffffffffffffffffffffffffffffffffffff1663d83bf9a160e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612196919061496d565b6000604051808303816000865af19150503d80600081146121d3576040519150601f19603f3d011682016040523d82523d6000602084013e6121d8565b606091505b50915091508161221d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161221490614c15565b60405180910390fd5b808060200190518101906122319190613ef7565b9250505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461229357600080fd5b6122e1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612f4f565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461234157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16637c41ad2c600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b815260040161239c9190614984565b602060405180830381600087803b1580156123b657600080fd5b505af11580156123ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ee9190613f6d565b905090565b60008060008061016773ffffffffffffffffffffffffffffffffffffffff1663f2c31ff460e01b878760405160240161242d92919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612497919061496d565b6000604051808303816000865af19150503d80600081146124d4576040519150601f19603f3d011682016040523d82523d6000602084013e6124d9565b606091505b5091509150816124ec5760156000612501565b808060200190518101906125009190614007565b5b8160030b9150809450819550505050509250929050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461257357600080fd5b6125c4600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064613301565b905090565b6125d1613507565b60405180604001604052808581526020016125ee8585600061341f565b81525090509392505050565b612602613527565b82816000019063ffffffff16908163ffffffff1681525050600181604001901515908115158152505081816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505092915050565b61267161365f565b82816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081816040019063ffffffff16908163ffffffff168152505092915050565b6000808460008161010001516000015163ffffffff161480156126f9575060008161010001516040015163ffffffff16145b1561271f576276a7008161010001516040019063ffffffff16908163ffffffff16815250505b60008061016773ffffffffffffffffffffffffffffffffffffffff1634635bc7c0e660e01b8a8a8a60405160240161275993929190614c35565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516127c3919061496d565b60006040518083038185875af1925050503d8060008114612800576040519150601f19603f3d011682016040523d82523d6000602084013e612805565b606091505b509150915081612818576015600061282d565b8080602001905181019061282c9190613fc7565b5b8160030b91508095508196505050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16635cfc901160e01b8888888860405160240161288394939291906149c8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516128ed919061496d565b6000604051808303816000865af19150503d806000811461292a576040519150601f19603f3d011682016040523d82523d6000602084013e61292f565b606091505b509150915081612940576015612955565b808060200190518101906129549190613f9a565b5b60030b92505050949350505050565b60008060008061016773ffffffffffffffffffffffffffffffffffffffff1663acb9cff960e01b8888886040516024016129a093929190614b04565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612a0a919061496d565b6000604051808303816000865af19150503d8060008114612a47576040519150601f19603f3d011682016040523d82523d6000602084013e612a4c565b606091505b509150915081612a5f5760156000612a74565b80806020019051810190612a7391906140e3565b5b8160030b915080945081955050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663e1f21c6760e01b878787604051602401612ac793929190614a0d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612b31919061496d565b6000604051808303816000865af19150503d8060008114612b6e576040519150601f19603f3d011682016040523d82523d6000602084013e612b73565b606091505b509150915081612b84576015612b99565b80806020019051810190612b989190613f9a565b5b60030b925050509392505050565b600080606060008061016773ffffffffffffffffffffffffffffffffffffffff1663278e0b8860e01b898989604051602401612be593929190614ac6565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612c4f919061496d565b6000604051808303816000865af19150503d8060008114612c8c576040519150601f19603f3d011682016040523d82523d6000602084013e612c91565b606091505b509150915081612ced57601560008067ffffffffffffffff811115612cb957612cb8615069565b5b604051908082528060200260200182016040528015612ce75781602001602082028036833780820191505090505b50612d02565b80806020019051810190612d019190614123565b5b8260030b9250809550819650829750505050505093509350939050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff166352f9138760e01b8686604051602401612d5892919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612dc2919061496d565b6000604051808303816000865af19150503d8060008114612dff576040519150601f19603f3d011682016040523d82523d6000602084013e612e04565b606091505b509150915081612e15576015612e2a565b80806020019051810190612e299190613f9a565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16635b8f858460e01b8686604051602401612e7092919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612eda919061496d565b6000604051808303816000865af19150503d8060008114612f17576040519150601f19603f3d011682016040523d82523d6000602084013e612f1c565b606091505b509150915081612f2d576015612f42565b80806020019051810190612f419190613f9a565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff166349146bde60e01b8686604051602401612f8892919061499f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612ff2919061496d565b6000604051808303816000865af19150503d806000811461302f576040519150601f19603f3d011682016040523d82523d6000602084013e613034565b606091505b50915091508161304557601561305a565b808060200190518101906130599190613f9a565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16637336aaf060e01b8787876040516024016130a293929190614a0d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161310c919061496d565b6000604051808303816000865af19150503d8060008114613149576040519150601f19603f3d011682016040523d82523d6000602084013e61314e565b606091505b50915091508161315f576015613174565b808060200190518101906131739190613f9a565b5b60030b925050509392505050565b6000808460008161010001516000015163ffffffff161480156131b4575060008161010001516040015163ffffffff16145b156131da576276a7008161010001516040019063ffffffff16908163ffffffff16815250505b60008061016773ffffffffffffffffffffffffffffffffffffffff1634637812a04b60e01b8a8a8a60405160240161321493929190614c81565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161327e919061496d565b60006040518083038185875af1925050503d80600081146132bb576040519150601f19603f3d011682016040523d82523d6000602084013e6132c0565b606091505b5091509150816132d357601560006132e8565b808060200190518101906132e79190613fc7565b5b8160030b91508095508196505050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663eca3691760e01b8888888860405160240161333e94939291906149c8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516133a8919061496d565b6000604051808303816000865af19150503d80600081146133e5576040519150601f19603f3d011682016040523d82523d6000602084013e6133ea565b606091505b5091509150816133fb576015613410565b8080602001905181019061340f9190613f9a565b5b60030b92505050949350505050565b613427613602565b6001841415613446576001816000019015159081151581525050613500565b600284141561348c5781816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506134ff565b60038414156134a3578281604001819052506134fe565b60048414156134ba578281606001819052506134fd565b60058414156134fc5781816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b5b5b5b5b9392505050565b604051806040016040528060008152602001613521613602565b81525090565b6040518060a00160405280600063ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060c00160405280600063ffffffff168152602001600063ffffffff168152602001600063ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060a00160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060600160405280600063ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600063ffffffff1681525090565b60006136b56136b084614ce4565b614cbf565b905080838252602082019050828560208602820111156136d8576136d76150a7565b5b60005b8581101561372657813567ffffffffffffffff8111156136fe576136fd615098565b5b80860161370b89826139ba565b855260208501945060208401935050506001810190506136db565b5050509392505050565b600061374361373e84614d10565b614cbf565b90508083825260208201905082856020860282011115613766576137656150a7565b5b60005b85811015613796578161377c8882613a40565b845260208401935060208301925050600181019050613769565b5050509392505050565b60006137b36137ae84614d3c565b614cbf565b905080838252602082019050828560208602820111156137d6576137d56150a7565b5b60005b8581101561382457813567ffffffffffffffff8111156137fc576137fb615098565b5b8086016138098982613ca5565b855260208501945060208401935050506001810190506137d9565b5050509392505050565b600061384161383c84614d68565b614cbf565b90508281526020810184848401111561385d5761385c6150ac565b5b613868848285614fc7565b509392505050565b600061388361387e84614d68565b614cbf565b90508281526020810184848401111561389f5761389e6150ac565b5b6138aa848285614fd6565b509392505050565b6000813590506138c1816150f5565b92915050565b6000815190506138d6816150f5565b92915050565b6000815190506138eb8161510c565b92915050565b600082601f83011261390657613905615098565b5b81356139168482602086016136a2565b91505092915050565b600082601f83011261393457613933615098565b5b8151613944848260208601613730565b91505092915050565b600082601f83011261396257613961615098565b5b81356139728482602086016137a0565b91505092915050565b60008135905061398a81615123565b92915050565b60008151905061399f81615123565b92915050565b6000815190506139b48161513a565b92915050565b600082601f8301126139cf576139ce615098565b5b81356139df84826020860161382e565b91505092915050565b600082601f8301126139fd576139fc615098565b5b8151613a0d848260208601613870565b91505092915050565b600081519050613a2581615151565b92915050565b600081519050613a3a81615168565b92915050565b600081519050613a4f8161517f565b92915050565b600060608284031215613a6b57613a6a61509d565b5b613a756060614cbf565b90506000613a8584828501613d26565b6000830152506020613a99848285016138b2565b6020830152506040613aad84828501613d26565b60408301525092915050565b600060608284031215613acf57613ace61509d565b5b613ad96060614cbf565b90506000613ae984828501613d3b565b6000830152506020613afd848285016138c7565b6020830152506040613b1184828501613d3b565b60408301525092915050565b600060a08284031215613b3357613b3261509d565b5b613b3d60a0614cbf565b90506000613b4d8482850161397b565b6000830152506020613b61848285016138b2565b602083015250604082013567ffffffffffffffff811115613b8557613b846150a2565b5b613b91848285016139ba565b604083015250606082013567ffffffffffffffff811115613bb557613bb46150a2565b5b613bc1848285016139ba565b6060830152506080613bd5848285016138b2565b60808301525092915050565b600060a08284031215613bf757613bf661509d565b5b613c0160a0614cbf565b90506000613c1184828501613990565b6000830152506020613c25848285016138c7565b602083015250604082015167ffffffffffffffff811115613c4957613c486150a2565b5b613c55848285016139e8565b604083015250606082015167ffffffffffffffff811115613c7957613c786150a2565b5b613c85848285016139e8565b6060830152506080613c99848285016138c7565b60808301525092915050565b600060408284031215613cbb57613cba61509d565b5b613cc56040614cbf565b90506000613cd584828501613d11565b600083015250602082013567ffffffffffffffff811115613cf957613cf86150a2565b5b613d0584828501613b1d565b60208301525092915050565b600081359050613d2081615196565b92915050565b600081359050613d35816151ad565b92915050565b600081519050613d4a816151ad565b92915050565b600081519050613d5f816151c4565b92915050565b600060208284031215613d7b57613d7a6150b6565b5b6000613d89848285016138b2565b91505092915050565b60008060408385031215613da957613da86150b6565b5b6000613db7858286016138b2565b9250506020613dc8858286016138b2565b9150509250929050565b60008060408385031215613de957613de86150b6565b5b6000613df7858286016138b2565b925050602083013567ffffffffffffffff811115613e1857613e176150b1565b5b613e248582860161394d565b9150509250929050565b60008060808385031215613e4557613e446150b6565b5b6000613e53858286016138b2565b9250506020613e6485828601613a55565b9150509250929050565b60008060408385031215613e8557613e846150b6565b5b6000613e93858286016138b2565b9250506020613ea485828601613d11565b9150509250929050565b600060208284031215613ec457613ec36150b6565b5b600082013567ffffffffffffffff811115613ee257613ee16150b1565b5b613eee848285016138f1565b91505092915050565b600060208284031215613f0d57613f0c6150b6565b5b6000613f1b848285016139a5565b91505092915050565b600060208284031215613f3a57613f396150b6565b5b600082013567ffffffffffffffff811115613f5857613f576150b1565b5b613f64848285016139ba565b91505092915050565b600060208284031215613f8357613f826150b6565b5b6000613f9184828501613a16565b91505092915050565b600060208284031215613fb057613faf6150b6565b5b6000613fbe84828501613a2b565b91505092915050565b60008060408385031215613fde57613fdd6150b6565b5b6000613fec85828601613a2b565b9250506020613ffd858286016138dc565b9150509250929050565b6000806040838503121561401e5761401d6150b6565b5b600061402c85828601613a2b565b925050602061403d85828601613990565b9150509250929050565b6000806080838503121561405e5761405d6150b6565b5b600061406c85828601613a2b565b925050602061407d85828601613ab9565b9150509250929050565b6000806040838503121561409e5761409d6150b6565b5b60006140ac85828601613a2b565b925050602083015167ffffffffffffffff8111156140cd576140cc6150b1565b5b6140d985828601613be1565b9150509250929050565b600080604083850312156140fa576140f96150b6565b5b600061410885828601613a2b565b925050602061411985828601613d50565b9150509250929050565b60008060006060848603121561413c5761413b6150b6565b5b600061414a86828701613a2b565b935050602061415b86828701613d50565b925050604084015167ffffffffffffffff81111561417c5761417b6150b1565b5b6141888682870161391f565b9150509250925092565b600061419e83836144c6565b905092915050565b60006141b2838361453f565b60208301905092915050565b60006141ca838361463d565b60a08301905092915050565b60006141e28383614879565b60c08301905092915050565b60006141fa83836148f4565b905092915050565b61420b81614f1b565b82525050565b61421a81614f1b565b82525050565b600061422b82614de9565b6142358185614e77565b93508360208202850161424785614d99565b8060005b8581101561428357848403895281516142648582614192565b945061426f83614e36565b925060208a0199505060018101905061424b565b50829750879550505050505092915050565b60006142a082614df4565b6142aa8185614e88565b93506142b583614da9565b8060005b838110156142e65781516142cd88826141a6565b97506142d883614e43565b9250506001810190506142b9565b5085935050505092915050565b60006142fe82614dff565b6143088185614e99565b935061431383614db9565b8060005b8381101561434457815161432b88826141be565b975061433683614e50565b925050600181019050614317565b5085935050505092915050565b600061435c82614e0a565b6143668185614eaa565b935061437183614dc9565b8060005b838110156143a257815161438988826141d6565b975061439483614e5d565b925050600181019050614375565b5085935050505092915050565b60006143ba82614e15565b6143c48185614ebb565b9350836020820285016143d685614dd9565b8060005b8581101561441257848403895281516143f385826141ee565b94506143fe83614e6a565b925060208a019950506001810190506143da565b50829750879550505050505092915050565b600061442f82614e15565b6144398185614ecc565b93508360208202850161444b85614dd9565b8060005b85811015614487578484038952815161446885826141ee565b945061447383614e6a565b925060208a0199505060018101905061444f565b50829750879550505050505092915050565b6144a281614f3f565b82525050565b6144b181614f3f565b82525050565b6144c081614f4b565b82525050565b60006144d182614e20565b6144db8185614edd565b93506144eb818560208601614fd6565b6144f4816150bb565b840191505092915050565b600061450a82614e20565b6145148185614eee565b9350614524818560208601614fd6565b80840191505092915050565b61453981614f55565b82525050565b61454881614f6c565b82525050565b61455781614f6c565b82525050565b600061456882614e2b565b6145728185614ef9565b9350614582818560208601614fd6565b61458b816150bb565b840191505092915050565b60006145a3601783614f0a565b91506145ae826150cc565b602082019050919050565b6060820160008201516145cf600085018261494f565b5060208201516145e26020850182614202565b5060408201516145f5604085018261494f565b50505050565b606082016000820151614611600085018261494f565b5060208201516146246020850182614202565b506040820151614637604085018261494f565b50505050565b60a082016000820151614653600085018261494f565b5060208201516146666020850182614202565b5060408201516146796040850182614499565b50606082015161468c6060850182614499565b50608082015161469f6080850182614202565b50505050565b60006101608301600083015184820360008601526146c3828261455d565b915050602083015184820360208601526146dd828261455d565b91505060408301516146f26040860182614202565b506060830151848203606086015261470a828261455d565b915050608083015161471f6080860182614499565b5060a083015161473260a086018261494f565b5060c083015161474560c0860182614499565b5060e083015184820360e086015261475d82826143af565b9150506101008301516147746101008601826145b9565b508091505092915050565b600060a0830160008301516147976000860182614499565b5060208301516147aa6020860182614202565b50604083015184820360408601526147c282826144c6565b915050606083015184820360608601526147dc82826144c6565b91505060808301516147f16080860182614202565b508091505092915050565b600060a0830160008301516148146000860182614499565b5060208301516148276020860182614202565b506040830151848203604086015261483f82826144c6565b9150506060830151848203606086015261485982826144c6565b915050608083015161486e6080860182614202565b508091505092915050565b60c08201600082015161488f600085018261494f565b5060208201516148a2602085018261494f565b5060408201516148b5604085018261494f565b5060608201516148c86060850182614202565b5060808201516148db6080850182614499565b5060a08201516148ee60a0850182614202565b50505050565b600060408301600083015161490c6000860182614931565b5060208301518482036020860152614924828261477f565b9150508091505092915050565b61493a81614f99565b82525050565b61494981614f99565b82525050565b61495881614fa3565b82525050565b61496781614fb3565b82525050565b600061497982846144ff565b915081905092915050565b60006020820190506149996000830184614211565b92915050565b60006040820190506149b46000830185614211565b6149c16020830184614211565b9392505050565b60006080820190506149dd6000830187614211565b6149ea6020830186614211565b6149f76040830185614211565b614a04606083018461454e565b95945050505050565b6000606082019050614a226000830186614211565b614a2f6020830185614211565b614a3c6040830184614940565b949350505050565b6000604082019050614a596000830185614211565b8181036020830152614a6b8184614424565b90509392505050565b6000608082019050614a896000830185614211565b614a9660208301846145fb565b9392505050565b6000604082019050614ab26000830185614211565b614abf6020830184614940565b9392505050565b6000606082019050614adb6000830186614211565b614ae8602083018561495e565b8181036040830152614afa8184614220565b9050949350505050565b6000606082019050614b196000830186614211565b614b26602083018561495e565b8181036040830152614b388184614295565b9050949350505050565b6000602082019050614b5760008301846144b7565b92915050565b6000602082019050614b726000830184614530565b92915050565b6000608082019050614b8d6000830185614530565b614b9a60208301846145fb565b9392505050565b6000602082019050614bb6600083018461454e565b92915050565b6000604082019050614bd1600083018561454e565b614bde60208301846144a8565b9392505050565b6000604082019050614bfa600083018561454e565b8181036020830152614c0c81846147fc565b90509392505050565b60006020820190508181036000830152614c2e81614596565b9050919050565b60006060820190508181036000830152614c4f81866146a5565b90508181036020830152614c6381856142f3565b90508181036040830152614c778184614351565b9050949350505050565b60006060820190508181036000830152614c9b81866146a5565b9050614caa6020830185614940565b614cb76040830184614940565b949350505050565b6000614cc9614cda565b9050614cd58282615009565b919050565b6000604051905090565b600067ffffffffffffffff821115614cff57614cfe615069565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614d2b57614d2a615069565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614d5757614d56615069565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614d8357614d82615069565b5b614d8c826150bb565b9050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614f2682614f79565b9050919050565b6000614f3882614f79565b9050919050565b60008115159050919050565b6000819050919050565b6000819050919050565b60008160030b9050919050565b60008160070b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b82818337600083830152505050565b60005b83811015614ff4578082015181840152602081019050614fd9565b83811115615003576000848401525b50505050565b615012826150bb565b810181811067ffffffffffffffff8211171561503157615030615069565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f50524e472073797374656d2063616c6c206661696c6564000000000000000000600082015250565b6150fe81614f1b565b811461510957600080fd5b50565b61511581614f2d565b811461512057600080fd5b50565b61512c81614f3f565b811461513757600080fd5b50565b61514381614f4b565b811461514e57600080fd5b50565b61515a81614f55565b811461516557600080fd5b50565b61517181614f5f565b811461517c57600080fd5b50565b61518881614f6c565b811461519357600080fd5b50565b61519f81614f99565b81146151aa57600080fd5b50565b6151b681614fa3565b81146151c157600080fd5b50565b6151cd81614fb3565b81146151d857600080fd5b5056fea264697066735822122040b5abf572fe3f57d6162929ff2e8f6cfb993ce00172dbe0c256500d3a4be54464736f6c63430008070033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH3 0x11 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH3 0x5392 CODESIZE SUB DUP1 PUSH3 0x5392 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE DUP2 ADD SWAP1 PUSH3 0x37 SWAP2 SWAP1 PUSH3 0xD7 JUMP JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP1 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP POP PUSH3 0x171 JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH3 0xD1 DUP2 PUSH3 0x157 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH3 0xF1 JUMPI PUSH3 0xF0 PUSH3 0x152 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH3 0x101 DUP6 DUP3 DUP7 ADD PUSH3 0xC0 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH3 0x114 DUP6 DUP3 DUP7 ADD PUSH3 0xC0 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH3 0x12B DUP3 PUSH3 0x132 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH3 0x162 DUP2 PUSH3 0x11E JUMP JUMPDEST DUP2 EQ PUSH3 0x16E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x5211 DUP1 PUSH3 0x181 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x19C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x8F8D7F99 GT PUSH2 0xEC JUMPI DUP1 PUSH4 0xD40A71FB GT PUSH2 0x8A JUMPI DUP1 PUSH4 0xDF4EC249 GT PUSH2 0x64 JUMPI DUP1 PUSH4 0xDF4EC249 EQ PUSH2 0x61A JUMPI DUP1 PUSH4 0xEB7C6F72 EQ PUSH2 0x645 JUMPI DUP1 PUSH4 0xF2C31FF4 EQ PUSH2 0x670 JUMPI DUP1 PUSH4 0xFB5D7376 EQ PUSH2 0x6AE JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0xD40A71FB EQ PUSH2 0x593 JUMPI DUP1 PUSH4 0xD614CDB8 EQ PUSH2 0x5B1 JUMPI DUP1 PUSH4 0xD83BF9A1 EQ PUSH2 0x5EF JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0xAF99C633 GT PUSH2 0xC6 JUMPI DUP1 PUSH4 0xAF99C633 EQ PUSH2 0x4D5 JUMPI DUP1 PUSH4 0xBDC7A422 EQ PUSH2 0x512 JUMPI DUP1 PUSH4 0xBDDD3A6B EQ PUSH2 0x53D JUMPI DUP1 PUSH4 0xC30131C5 EQ PUSH2 0x568 JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0x8F8D7F99 EQ PUSH2 0x442 JUMPI DUP1 PUSH4 0xA3221C8E EQ PUSH2 0x47F JUMPI DUP1 PUSH4 0xADE094B4 EQ PUSH2 0x4AA JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0x4FB4BCEC GT PUSH2 0x159 JUMPI DUP1 PUSH4 0x7C41AD2C GT PUSH2 0x133 JUMPI DUP1 PUSH4 0x7C41AD2C EQ PUSH2 0x372 JUMPI DUP1 PUSH4 0x7F990E8F EQ PUSH2 0x3AF JUMPI DUP1 PUSH4 0x7FBAADBA EQ PUSH2 0x3EC JUMPI DUP1 PUSH4 0x8F4ED333 EQ PUSH2 0x417 JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0x4FB4BCEC EQ PUSH2 0x2CD JUMPI DUP1 PUSH4 0x593D6E82 EQ PUSH2 0x2F8 JUMPI DUP1 PUSH4 0x6FC3CBAF EQ PUSH2 0x335 JUMPI PUSH2 0x19C JUMP JUMPDEST DUP1 PUSH4 0x23A452AD EQ PUSH2 0x1A1 JUMPI DUP1 PUSH4 0x36F46891 EQ PUSH2 0x1D1 JUMPI DUP1 PUSH4 0x3B3BFF0F EQ PUSH2 0x1FC JUMPI DUP1 PUSH4 0x3C4DD32E EQ PUSH2 0x239 JUMPI DUP1 PUSH4 0x44AC2D48 EQ PUSH2 0x277 JUMPI DUP1 PUSH4 0x462A08DF EQ PUSH2 0x2A2 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1BB PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x1B6 SWAP2 SWAP1 PUSH2 0x3F24 JUMP JUMPDEST PUSH2 0x6D9 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1C8 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x1DD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1E6 PUSH2 0xAA7 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x1F3 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x208 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x223 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x21E SWAP2 SWAP1 PUSH2 0x3D65 JUMP JUMPDEST PUSH2 0xB58 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x230 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x245 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x260 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x25B SWAP2 SWAP1 PUSH2 0x3E6E JUMP JUMPDEST PUSH2 0xC6D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x26E SWAP3 SWAP2 SWAP1 PUSH2 0x4BE5 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x283 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x28C PUSH2 0xDA1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x299 SWAP2 SWAP1 PUSH2 0x4B42 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2B7 PUSH2 0xE81 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2C4 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2D9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2E2 PUSH2 0xFA8 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x2EF SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x304 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x31F PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x31A SWAP2 SWAP1 PUSH2 0x3E2E JUMP JUMPDEST PUSH2 0x1058 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x32C SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x341 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x35C PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x357 SWAP2 SWAP1 PUSH2 0x3DD2 JUMP JUMPDEST PUSH2 0x1170 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x369 SWAP2 SWAP1 PUSH2 0x4BA1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x37E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x399 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x394 SWAP2 SWAP1 PUSH2 0x3D65 JUMP JUMPDEST PUSH2 0x1288 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x3A6 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x3D6 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x3D1 SWAP2 SWAP1 PUSH2 0x3EAE JUMP JUMPDEST PUSH2 0x139D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x3E3 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x3F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x401 PUSH2 0x14F1 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x40E SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x423 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x42C PUSH2 0x15A2 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x439 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x44E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x469 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x464 SWAP2 SWAP1 PUSH2 0x3D92 JUMP JUMPDEST PUSH2 0x16A5 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x476 SWAP2 SWAP1 PUSH2 0x4BA1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x48B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x494 PUSH2 0x17BD JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x4A1 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4BF PUSH2 0x186E JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x4CC SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4FC PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x4F7 SWAP2 SWAP1 PUSH2 0x3D92 JUMP JUMPDEST PUSH2 0x1965 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x509 SWAP2 SWAP1 PUSH2 0x4BA1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x51E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x527 PUSH2 0x1A7D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x534 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x549 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x552 PUSH2 0x1B2B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x55F SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x574 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x57D PUSH2 0x1C38 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x58A SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x59B PUSH2 0x1CE8 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5A8 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5BD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5D8 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x5D3 SWAP2 SWAP1 PUSH2 0x3D65 JUMP JUMPDEST PUSH2 0x1FD0 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5E6 SWAP3 SWAP2 SWAP1 PUSH2 0x4B78 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x5FB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x604 PUSH2 0x2100 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x611 SWAP2 SWAP1 PUSH2 0x4B42 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x626 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x62F PUSH2 0x2238 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x63C SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x651 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x65A PUSH2 0x22E6 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x667 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x67C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x697 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x692 SWAP2 SWAP1 PUSH2 0x3D92 JUMP JUMPDEST PUSH2 0x23F3 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6A5 SWAP3 SWAP2 SWAP1 PUSH2 0x4BBC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6BA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6C3 PUSH2 0x2518 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x6D0 SWAP2 SWAP1 PUSH2 0x4B5D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x734 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x751 JUMPI PUSH2 0x750 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x78A JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x777 PUSH2 0x3507 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x76F JUMPI SWAP1 POP JUMPDEST POP SWAP1 POP PUSH2 0x79D PUSH1 0x10 PUSH1 0x1 OR PUSH1 0x3 DUP6 PUSH2 0x25C9 JUMP JUMPDEST DUP2 PUSH1 0x0 DUP2 MLOAD DUP2 LT PUSH2 0x7B1 JUMPI PUSH2 0x7B0 PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP2 SWAP1 MSTORE POP PUSH1 0x0 PUSH1 0x1 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x7D9 JUMPI PUSH2 0x7D8 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x812 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x7FF PUSH2 0x3527 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x7F7 JUMPI SWAP1 POP JUMPDEST POP SWAP1 POP PUSH2 0x843 PUSH4 0x5F5E100 PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x25FA JUMP JUMPDEST DUP2 PUSH1 0x0 DUP2 MLOAD DUP2 LT PUSH2 0x857 JUMPI PUSH2 0x856 PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP2 SWAP1 MSTORE POP PUSH2 0x9F1 PUSH1 0x40 MLOAD DUP1 PUSH2 0x120 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x11 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4578616D706C65204E465420746F6B656E000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x4 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x454E465400000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x4 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x6D656D6F00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x3E8 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x993 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH3 0x6ACFC0 PUSH2 0x2669 JUMP JUMPDEST DUP2 MSTORE POP DUP3 PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x9B2 JUMPI PUSH2 0x9B1 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x9EB JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x9D8 PUSH2 0x358C JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x9D0 JUMPI SWAP1 POP JUMPDEST POP PUSH2 0x26C7 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 DUP3 SWAP2 SWAP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP2 SWAP5 POP POP POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC SELFBALANCE SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0xA9F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xB02 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xB53 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ADDRESS PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH2 0x2846 JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x3B3BFF0F PUSH1 0xE0 SHL DUP6 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0xB8F SWAP2 SWAP1 PUSH2 0x4984 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0xBF9 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0xC36 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0xC3B JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0xC4C JUMPI PUSH1 0x15 PUSH2 0xC61 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0xC60 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xC77 PUSH2 0x3602 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x3C4DD32E PUSH1 0xE0 SHL DUP8 DUP8 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0xCAE SWAP3 SWAP2 SWAP1 PUSH2 0x4A9D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0xD18 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0xD55 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0xD5A JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP PUSH2 0xD67 PUSH2 0x3602 JUMP JUMPDEST DUP3 PUSH2 0xD74 JUMPI PUSH1 0x15 DUP2 PUSH2 0xD89 JUMP JUMPDEST DUP2 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0xD88 SWAP2 SWAP1 PUSH2 0x4087 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP6 POP DUP2 SWAP7 POP POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xDFC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD83BF9A1 PUSH1 0x40 MLOAD DUP2 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0xE44 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0xE58 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0xE7C SWAP2 SWAP1 PUSH2 0x3EF7 JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xEDC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0xEF9 JUMPI PUSH2 0xEF8 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0xF27 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP SWAP1 POP PUSH1 0x3 DUP2 PUSH1 0x0 DUP2 MLOAD DUP2 LT PUSH2 0xF40 JUMPI PUSH2 0xF3F PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD SWAP1 PUSH1 0x7 SIGNEXTEND SWAP1 DUP2 PUSH1 0x7 SIGNEXTEND DUP2 MSTORE POP POP PUSH1 0x0 PUSH2 0xF84 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 DUP5 PUSH2 0x2964 JUMP JUMPDEST DUP1 SWAP3 POP DUP2 SWAP5 POP POP POP PUSH1 0x2 DUP2 PUSH8 0xFFFFFFFFFFFFFFFF AND EQ PUSH2 0xFA3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1003 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1053 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x64 PUSH2 0x2A8C JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x593D6E82 PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x1091 SWAP3 SWAP2 SWAP1 PUSH2 0x4A74 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x10FB SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x1138 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x113D JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x114E JUMPI PUSH1 0x15 PUSH2 0x1163 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x1162 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x6FC3CBAF PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x11A9 SWAP3 SWAP2 SWAP1 PUSH2 0x4A44 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x1213 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x1250 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x1255 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x1266 JUMPI PUSH1 0x15 PUSH2 0x127B JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x127A SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x7C41AD2C PUSH1 0xE0 SHL DUP6 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x12BF SWAP2 SWAP1 PUSH2 0x4984 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x1329 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x1366 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x136B JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x137C JUMPI PUSH1 0x15 PUSH2 0x1391 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x1390 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x13F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP3 MLOAD EQ PUSH2 0x1406 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x60 PUSH2 0x1438 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x0 DUP7 PUSH2 0x2BA7 JUMP JUMPDEST DUP1 SWAP4 POP DUP2 SWAP5 POP DUP3 SWAP6 POP POP POP POP PUSH1 0x3 DUP3 PUSH8 0xFFFFFFFFFFFFFFFF AND EQ PUSH2 0x145B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP2 MLOAD EQ PUSH2 0x1469 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x1 DUP2 PUSH1 0x0 DUP2 MLOAD DUP2 LT PUSH2 0x147F JUMPI PUSH2 0x147E PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD MLOAD PUSH1 0x7 SIGNEXTEND EQ PUSH2 0x1494 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 DUP2 PUSH1 0x1 DUP2 MLOAD DUP2 LT PUSH2 0x14AA JUMPI PUSH2 0x14A9 PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD MLOAD PUSH1 0x7 SIGNEXTEND EQ PUSH2 0x14BF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x3 DUP2 PUSH1 0x2 DUP2 MLOAD DUP2 LT PUSH2 0x14D5 JUMPI PUSH2 0x14D4 PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD MLOAD PUSH1 0x7 SIGNEXTEND EQ PUSH2 0x14EA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x154C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x159A PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x2D1F JUMP JUMPDEST PUSH1 0x7 SIGNEXTEND SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x15FD JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x60 PUSH2 0x167D PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x64 PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1644 JUMPI PUSH2 0x1643 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1677 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x1662 JUMPI SWAP1 POP JUMPDEST POP PUSH2 0x2BA7 JUMP JUMPDEST DUP1 SWAP4 POP DUP2 SWAP5 POP DUP3 SWAP6 POP POP POP POP PUSH1 0xC8 DUP3 PUSH8 0xFFFFFFFFFFFFFFFF AND EQ PUSH2 0x16A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x8F8D7F99 PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x16DE SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x1748 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x1785 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x178A JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x179B JUMPI PUSH1 0x15 PUSH2 0x17B0 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x17AF SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1818 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1866 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x2E37 JUMP JUMPDEST PUSH1 0x7 SIGNEXTEND SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x18C9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x1942 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x32 PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x190E JUMPI PUSH2 0x190D PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x193C JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP PUSH2 0x2964 JUMP JUMPDEST DUP1 SWAP3 POP DUP2 SWAP4 POP POP POP PUSH1 0x96 DUP2 PUSH8 0xFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1961 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xAF99C633 PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x199E SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x1A08 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x1A45 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x1A4A JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x1A5B JUMPI PUSH1 0x15 PUSH2 0x1A70 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x1A6F SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1AD8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1B26 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x2F4F JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1B86 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x3B3BFF0F PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1BE1 SWAP2 SWAP1 PUSH2 0x4984 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x1BFB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x1C0F JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x1C33 SWAP2 SWAP1 PUSH2 0x3F6D JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1C93 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1CE3 PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 PUSH2 0x3067 JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1D43 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x1D60 JUMPI PUSH2 0x1D5F PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x1D99 JUMPI DUP2 PUSH1 0x20 ADD JUMPDEST PUSH2 0x1D86 PUSH2 0x3507 JUMP JUMPDEST DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 SWAP1 SUB SWAP1 DUP2 PUSH2 0x1D7E JUMPI SWAP1 POP JUMPDEST POP SWAP1 POP PUSH2 0x1DC1 PUSH1 0x4 PUSH1 0x40 PUSH1 0x10 PUSH1 0x1 OR OR OR PUSH1 0x1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x20 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE POP PUSH2 0x25C9 JUMP JUMPDEST DUP2 PUSH1 0x0 DUP2 MLOAD DUP2 LT PUSH2 0x1DD5 JUMPI PUSH2 0x1DD4 PUSH2 0x503A JUMP JUMPDEST JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP2 SWAP1 MSTORE POP PUSH2 0x1F1D PUSH1 0x40 MLOAD DUP1 PUSH2 0x120 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x16 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4578616D706C652046756E6769626C6520746F6B656E00000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x1 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4500000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x4 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x6D656D6F00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x3E8 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x1F11 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH3 0x6ACFC0 PUSH2 0x2669 JUMP JUMPDEST DUP2 MSTORE POP PUSH1 0x64 PUSH1 0x0 PUSH2 0x3182 JUMP JUMPDEST PUSH1 0x2 PUSH1 0x0 DUP3 SWAP2 SWAP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP2 SWAP4 POP POP POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC SELFBALANCE SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO DUP1 ISZERO PUSH2 0x1FCB JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1FDA PUSH2 0x365F JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD614CDB8 PUSH1 0xE0 SHL DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x200F SWAP2 SWAP1 PUSH2 0x4984 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2079 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x20B6 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x20BB JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP PUSH2 0x20C8 PUSH2 0x365F JUMP JUMPDEST DUP3 PUSH2 0x20D5 JUMPI PUSH1 0x15 DUP2 PUSH2 0x20EA JUMP JUMPDEST DUP2 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x20E9 SWAP2 SWAP1 PUSH2 0x4047 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP6 POP DUP2 SWAP7 POP POP POP POP POP POP SWAP2 POP SWAP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x169 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xD83BF9A1 PUSH1 0xE0 SHL PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2196 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x21D3 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x21D8 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x221D JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x2214 SWAP1 PUSH2 0x4C15 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2231 SWAP2 SWAP1 PUSH2 0x3EF7 JUMP JUMPDEST SWAP3 POP POP POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x2293 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x22E1 PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x2F4F JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x2341 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x7C41AD2C PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x40 MLOAD DUP3 PUSH4 0xFFFFFFFF AND PUSH1 0xE0 SHL DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x239C SWAP2 SWAP1 PUSH2 0x4984 JUMP JUMPDEST PUSH1 0x20 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP8 DUP1 EXTCODESIZE ISZERO DUP1 ISZERO PUSH2 0x23B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP GAS CALL ISZERO DUP1 ISZERO PUSH2 0x23CA JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP POP POP POP PUSH1 0x40 MLOAD RETURNDATASIZE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND DUP3 ADD DUP1 PUSH1 0x40 MSTORE POP DUP2 ADD SWAP1 PUSH2 0x23EE SWAP2 SWAP1 PUSH2 0x3F6D JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xF2C31FF4 PUSH1 0xE0 SHL DUP8 DUP8 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x242D SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2497 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x24D4 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x24D9 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x24EC JUMPI PUSH1 0x15 PUSH1 0x0 PUSH2 0x2501 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2500 SWAP2 SWAP1 PUSH2 0x4007 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP5 POP DUP2 SWAP6 POP POP POP POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x2573 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x25C4 PUSH1 0x2 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND ADDRESS PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x64 PUSH2 0x3301 JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH2 0x25D1 PUSH2 0x3507 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x25EE DUP6 DUP6 PUSH1 0x0 PUSH2 0x341F JUMP JUMPDEST DUP2 MSTORE POP SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0x2602 PUSH2 0x3527 JUMP JUMPDEST DUP3 DUP2 PUSH1 0x0 ADD SWAP1 PUSH4 0xFFFFFFFF AND SWAP1 DUP2 PUSH4 0xFFFFFFFF AND DUP2 MSTORE POP POP PUSH1 0x1 DUP2 PUSH1 0x40 ADD SWAP1 ISZERO ISZERO SWAP1 DUP2 ISZERO ISZERO DUP2 MSTORE POP POP DUP2 DUP2 PUSH1 0x80 ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x2671 PUSH2 0x365F JUMP JUMPDEST DUP3 DUP2 PUSH1 0x20 ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP DUP2 DUP2 PUSH1 0x40 ADD SWAP1 PUSH4 0xFFFFFFFF AND SWAP1 DUP2 PUSH4 0xFFFFFFFF AND DUP2 MSTORE POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x0 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ DUP1 ISZERO PUSH2 0x26F9 JUMPI POP PUSH1 0x0 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ JUMPDEST ISZERO PUSH2 0x271F JUMPI PUSH3 0x76A700 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x40 ADD SWAP1 PUSH4 0xFFFFFFFF AND SWAP1 DUP2 PUSH4 0xFFFFFFFF AND DUP2 MSTORE POP POP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLVALUE PUSH4 0x5BC7C0E6 PUSH1 0xE0 SHL DUP11 DUP11 DUP11 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2759 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4C35 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x27C3 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2800 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2805 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2818 JUMPI PUSH1 0x15 PUSH1 0x0 PUSH2 0x282D JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x282C SWAP2 SWAP1 PUSH2 0x3FC7 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP6 POP DUP2 SWAP7 POP POP POP POP POP POP SWAP4 POP SWAP4 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x5CFC9011 PUSH1 0xE0 SHL DUP9 DUP9 DUP9 DUP9 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2883 SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x49C8 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x28ED SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x292A JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x292F JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2940 JUMPI PUSH1 0x15 PUSH2 0x2955 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2954 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xACB9CFF9 PUSH1 0xE0 SHL DUP9 DUP9 DUP9 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x29A0 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4B04 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2A0A SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2A47 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2A4C JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2A5F JUMPI PUSH1 0x15 PUSH1 0x0 PUSH2 0x2A74 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2A73 SWAP2 SWAP1 PUSH2 0x40E3 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP5 POP DUP2 SWAP6 POP POP POP POP POP SWAP4 POP SWAP4 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xE1F21C67 PUSH1 0xE0 SHL DUP8 DUP8 DUP8 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2AC7 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4A0D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2B31 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2B6E JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2B73 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2B84 JUMPI PUSH1 0x15 PUSH2 0x2B99 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2B98 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x60 PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x278E0B88 PUSH1 0xE0 SHL DUP10 DUP10 DUP10 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2BE5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4AC6 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2C4F SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2C8C JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2C91 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2CED JUMPI PUSH1 0x15 PUSH1 0x0 DUP1 PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x2CB9 JUMPI PUSH2 0x2CB8 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x2CE7 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY DUP1 DUP3 ADD SWAP2 POP POP SWAP1 POP JUMPDEST POP PUSH2 0x2D02 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2D01 SWAP2 SWAP1 PUSH2 0x4123 JUMP JUMPDEST JUMPDEST DUP3 PUSH1 0x3 SIGNEXTEND SWAP3 POP DUP1 SWAP6 POP DUP2 SWAP7 POP DUP3 SWAP8 POP POP POP POP POP POP SWAP4 POP SWAP4 POP SWAP4 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x52F91387 PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2D58 SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2DC2 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2DFF JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2E04 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2E15 JUMPI PUSH1 0x15 PUSH2 0x2E2A JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2E29 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x5B8F8584 PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2E70 SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2EDA SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x2F17 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x2F1C JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x2F2D JUMPI PUSH1 0x15 PUSH2 0x2F42 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x2F41 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x49146BDE PUSH1 0xE0 SHL DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x2F88 SWAP3 SWAP2 SWAP1 PUSH2 0x499F JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x2FF2 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x302F JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x3034 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x3045 JUMPI PUSH1 0x15 PUSH2 0x305A JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x3059 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0x7336AAF0 PUSH1 0xE0 SHL DUP8 DUP8 DUP8 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x30A2 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4A0D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x310C SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x3149 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x314E JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x315F JUMPI PUSH1 0x15 PUSH2 0x3174 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x3173 SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP5 PUSH1 0x0 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ DUP1 ISZERO PUSH2 0x31B4 JUMPI POP PUSH1 0x0 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x40 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ JUMPDEST ISZERO PUSH2 0x31DA JUMPI PUSH3 0x76A700 DUP2 PUSH2 0x100 ADD MLOAD PUSH1 0x40 ADD SWAP1 PUSH4 0xFFFFFFFF AND SWAP1 DUP2 PUSH4 0xFFFFFFFF AND DUP2 MSTORE POP POP JUMPDEST PUSH1 0x0 DUP1 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLVALUE PUSH4 0x7812A04B PUSH1 0xE0 SHL DUP11 DUP11 DUP11 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x3214 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x4C81 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x327E SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x32BB JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x32C0 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x32D3 JUMPI PUSH1 0x15 PUSH1 0x0 PUSH2 0x32E8 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x32E7 SWAP2 SWAP1 PUSH2 0x3FC7 JUMP JUMPDEST JUMPDEST DUP2 PUSH1 0x3 SIGNEXTEND SWAP2 POP DUP1 SWAP6 POP DUP2 SWAP7 POP POP POP POP POP POP SWAP4 POP SWAP4 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH2 0x167 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH4 0xECA36917 PUSH1 0xE0 SHL DUP9 DUP9 DUP9 DUP9 PUSH1 0x40 MLOAD PUSH1 0x24 ADD PUSH2 0x333E SWAP5 SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x49C8 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND PUSH1 0x20 DUP3 ADD DUP1 MLOAD PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP4 DUP2 DUP4 AND OR DUP4 MSTORE POP POP POP POP PUSH1 0x40 MLOAD PUSH2 0x33A8 SWAP2 SWAP1 PUSH2 0x496D JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 PUSH1 0x0 DUP7 GAS CALL SWAP2 POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0x33E5 JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0x33EA JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0x33FB JUMPI PUSH1 0x15 PUSH2 0x3410 JUMP JUMPDEST DUP1 DUP1 PUSH1 0x20 ADD SWAP1 MLOAD DUP2 ADD SWAP1 PUSH2 0x340F SWAP2 SWAP1 PUSH2 0x3F9A JUMP JUMPDEST JUMPDEST PUSH1 0x3 SIGNEXTEND SWAP3 POP POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x3427 PUSH2 0x3602 JUMP JUMPDEST PUSH1 0x1 DUP5 EQ ISZERO PUSH2 0x3446 JUMPI PUSH1 0x1 DUP2 PUSH1 0x0 ADD SWAP1 ISZERO ISZERO SWAP1 DUP2 ISZERO ISZERO DUP2 MSTORE POP POP PUSH2 0x3500 JUMP JUMPDEST PUSH1 0x2 DUP5 EQ ISZERO PUSH2 0x348C JUMPI DUP2 DUP2 PUSH1 0x20 ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP PUSH2 0x34FF JUMP JUMPDEST PUSH1 0x3 DUP5 EQ ISZERO PUSH2 0x34A3 JUMPI DUP3 DUP2 PUSH1 0x40 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x34FE JUMP JUMPDEST PUSH1 0x4 DUP5 EQ ISZERO PUSH2 0x34BA JUMPI DUP3 DUP2 PUSH1 0x60 ADD DUP2 SWAP1 MSTORE POP PUSH2 0x34FD JUMP JUMPDEST PUSH1 0x5 DUP5 EQ ISZERO PUSH2 0x34FC JUMPI DUP2 DUP2 PUSH1 0x80 ADD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP POP JUMPDEST JUMPDEST JUMPDEST JUMPDEST JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP2 MSTORE PUSH1 0x20 ADD PUSH2 0x3521 PUSH2 0x3602 JUMP JUMPDEST DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0xA0 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0xC0 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0xA0 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x60 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x60 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 PUSH4 0xFFFFFFFF AND DUP2 MSTORE POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x36B5 PUSH2 0x36B0 DUP5 PUSH2 0x4CE4 JUMP JUMPDEST PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP DUP1 DUP4 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP DUP3 DUP6 PUSH1 0x20 DUP7 MUL DUP3 ADD GT ISZERO PUSH2 0x36D8 JUMPI PUSH2 0x36D7 PUSH2 0x50A7 JUMP JUMPDEST JUMPDEST PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x3726 JUMPI DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x36FE JUMPI PUSH2 0x36FD PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP1 DUP7 ADD PUSH2 0x370B DUP10 DUP3 PUSH2 0x39BA JUMP JUMPDEST DUP6 MSTORE PUSH1 0x20 DUP6 ADD SWAP5 POP PUSH1 0x20 DUP5 ADD SWAP4 POP POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x36DB JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3743 PUSH2 0x373E DUP5 PUSH2 0x4D10 JUMP JUMPDEST PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP DUP1 DUP4 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP DUP3 DUP6 PUSH1 0x20 DUP7 MUL DUP3 ADD GT ISZERO PUSH2 0x3766 JUMPI PUSH2 0x3765 PUSH2 0x50A7 JUMP JUMPDEST JUMPDEST PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x3796 JUMPI DUP2 PUSH2 0x377C DUP9 DUP3 PUSH2 0x3A40 JUMP JUMPDEST DUP5 MSTORE PUSH1 0x20 DUP5 ADD SWAP4 POP PUSH1 0x20 DUP4 ADD SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x3769 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x37B3 PUSH2 0x37AE DUP5 PUSH2 0x4D3C JUMP JUMPDEST PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP DUP1 DUP4 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP DUP3 DUP6 PUSH1 0x20 DUP7 MUL DUP3 ADD GT ISZERO PUSH2 0x37D6 JUMPI PUSH2 0x37D5 PUSH2 0x50A7 JUMP JUMPDEST JUMPDEST PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x3824 JUMPI DUP2 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x37FC JUMPI PUSH2 0x37FB PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP1 DUP7 ADD PUSH2 0x3809 DUP10 DUP3 PUSH2 0x3CA5 JUMP JUMPDEST DUP6 MSTORE PUSH1 0x20 DUP6 ADD SWAP5 POP PUSH1 0x20 DUP5 ADD SWAP4 POP POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x37D9 JUMP JUMPDEST POP POP POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3841 PUSH2 0x383C DUP5 PUSH2 0x4D68 JUMP JUMPDEST PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 ADD DUP5 DUP5 DUP5 ADD GT ISZERO PUSH2 0x385D JUMPI PUSH2 0x385C PUSH2 0x50AC JUMP JUMPDEST JUMPDEST PUSH2 0x3868 DUP5 DUP3 DUP6 PUSH2 0x4FC7 JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3883 PUSH2 0x387E DUP5 PUSH2 0x4D68 JUMP JUMPDEST PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP DUP3 DUP2 MSTORE PUSH1 0x20 DUP2 ADD DUP5 DUP5 DUP5 ADD GT ISZERO PUSH2 0x389F JUMPI PUSH2 0x389E PUSH2 0x50AC JUMP JUMPDEST JUMPDEST PUSH2 0x38AA DUP5 DUP3 DUP6 PUSH2 0x4FD6 JUMP JUMPDEST POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x38C1 DUP2 PUSH2 0x50F5 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x38D6 DUP2 PUSH2 0x50F5 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x38EB DUP2 PUSH2 0x510C JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x3906 JUMPI PUSH2 0x3905 PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP2 CALLDATALOAD PUSH2 0x3916 DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x36A2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x3934 JUMPI PUSH2 0x3933 PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP2 MLOAD PUSH2 0x3944 DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x3730 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x3962 JUMPI PUSH2 0x3961 PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP2 CALLDATALOAD PUSH2 0x3972 DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x37A0 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x398A DUP2 PUSH2 0x5123 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x399F DUP2 PUSH2 0x5123 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x39B4 DUP2 PUSH2 0x513A JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x39CF JUMPI PUSH2 0x39CE PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP2 CALLDATALOAD PUSH2 0x39DF DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x382E JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x39FD JUMPI PUSH2 0x39FC PUSH2 0x5098 JUMP JUMPDEST JUMPDEST DUP2 MLOAD PUSH2 0x3A0D DUP5 DUP3 PUSH1 0x20 DUP7 ADD PUSH2 0x3870 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x3A25 DUP2 PUSH2 0x5151 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x3A3A DUP2 PUSH2 0x5168 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x3A4F DUP2 PUSH2 0x517F JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3A6B JUMPI PUSH2 0x3A6A PUSH2 0x509D JUMP JUMPDEST JUMPDEST PUSH2 0x3A75 PUSH1 0x60 PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3A85 DUP5 DUP3 DUP6 ADD PUSH2 0x3D26 JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 PUSH2 0x3A99 DUP5 DUP3 DUP6 ADD PUSH2 0x38B2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x3AAD DUP5 DUP3 DUP6 ADD PUSH2 0x3D26 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3ACF JUMPI PUSH2 0x3ACE PUSH2 0x509D JUMP JUMPDEST JUMPDEST PUSH2 0x3AD9 PUSH1 0x60 PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3AE9 DUP5 DUP3 DUP6 ADD PUSH2 0x3D3B JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 PUSH2 0x3AFD DUP5 DUP3 DUP6 ADD PUSH2 0x38C7 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 PUSH2 0x3B11 DUP5 DUP3 DUP6 ADD PUSH2 0x3D3B JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3B33 JUMPI PUSH2 0x3B32 PUSH2 0x509D JUMP JUMPDEST JUMPDEST PUSH2 0x3B3D PUSH1 0xA0 PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3B4D DUP5 DUP3 DUP6 ADD PUSH2 0x397B JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 PUSH2 0x3B61 DUP5 DUP3 DUP6 ADD PUSH2 0x38B2 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3B85 JUMPI PUSH2 0x3B84 PUSH2 0x50A2 JUMP JUMPDEST JUMPDEST PUSH2 0x3B91 DUP5 DUP3 DUP6 ADD PUSH2 0x39BA JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3BB5 JUMPI PUSH2 0x3BB4 PUSH2 0x50A2 JUMP JUMPDEST JUMPDEST PUSH2 0x3BC1 DUP5 DUP3 DUP6 ADD PUSH2 0x39BA JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x3BD5 DUP5 DUP3 DUP6 ADD PUSH2 0x38B2 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3BF7 JUMPI PUSH2 0x3BF6 PUSH2 0x509D JUMP JUMPDEST JUMPDEST PUSH2 0x3C01 PUSH1 0xA0 PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3C11 DUP5 DUP3 DUP6 ADD PUSH2 0x3990 JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 PUSH2 0x3C25 DUP5 DUP3 DUP6 ADD PUSH2 0x38C7 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP PUSH1 0x40 DUP3 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3C49 JUMPI PUSH2 0x3C48 PUSH2 0x50A2 JUMP JUMPDEST JUMPDEST PUSH2 0x3C55 DUP5 DUP3 DUP6 ADD PUSH2 0x39E8 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD MSTORE POP PUSH1 0x60 DUP3 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3C79 JUMPI PUSH2 0x3C78 PUSH2 0x50A2 JUMP JUMPDEST JUMPDEST PUSH2 0x3C85 DUP5 DUP3 DUP6 ADD PUSH2 0x39E8 JUMP JUMPDEST PUSH1 0x60 DUP4 ADD MSTORE POP PUSH1 0x80 PUSH2 0x3C99 DUP5 DUP3 DUP6 ADD PUSH2 0x38C7 JUMP JUMPDEST PUSH1 0x80 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3CBB JUMPI PUSH2 0x3CBA PUSH2 0x509D JUMP JUMPDEST JUMPDEST PUSH2 0x3CC5 PUSH1 0x40 PUSH2 0x4CBF JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x3CD5 DUP5 DUP3 DUP6 ADD PUSH2 0x3D11 JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3CF9 JUMPI PUSH2 0x3CF8 PUSH2 0x50A2 JUMP JUMPDEST JUMPDEST PUSH2 0x3D05 DUP5 DUP3 DUP6 ADD PUSH2 0x3B1D JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x3D20 DUP2 PUSH2 0x5196 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x3D35 DUP2 PUSH2 0x51AD JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x3D4A DUP2 PUSH2 0x51AD JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP PUSH2 0x3D5F DUP2 PUSH2 0x51C4 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3D7B JUMPI PUSH2 0x3D7A PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3D89 DUP5 DUP3 DUP6 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3DA9 JUMPI PUSH2 0x3DA8 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3DB7 DUP6 DUP3 DUP7 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x3DC8 DUP6 DUP3 DUP7 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3DE9 JUMPI PUSH2 0x3DE8 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3DF7 DUP6 DUP3 DUP7 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3E18 JUMPI PUSH2 0x3E17 PUSH2 0x50B1 JUMP JUMPDEST JUMPDEST PUSH2 0x3E24 DUP6 DUP3 DUP7 ADD PUSH2 0x394D JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x80 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3E45 JUMPI PUSH2 0x3E44 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3E53 DUP6 DUP3 DUP7 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x3E64 DUP6 DUP3 DUP7 ADD PUSH2 0x3A55 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3E85 JUMPI PUSH2 0x3E84 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3E93 DUP6 DUP3 DUP7 ADD PUSH2 0x38B2 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x3EA4 DUP6 DUP3 DUP7 ADD PUSH2 0x3D11 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3EC4 JUMPI PUSH2 0x3EC3 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3EE2 JUMPI PUSH2 0x3EE1 PUSH2 0x50B1 JUMP JUMPDEST JUMPDEST PUSH2 0x3EEE DUP5 DUP3 DUP6 ADD PUSH2 0x38F1 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3F0D JUMPI PUSH2 0x3F0C PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3F1B DUP5 DUP3 DUP6 ADD PUSH2 0x39A5 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3F3A JUMPI PUSH2 0x3F39 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 DUP3 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x3F58 JUMPI PUSH2 0x3F57 PUSH2 0x50B1 JUMP JUMPDEST JUMPDEST PUSH2 0x3F64 DUP5 DUP3 DUP6 ADD PUSH2 0x39BA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3F83 JUMPI PUSH2 0x3F82 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3F91 DUP5 DUP3 DUP6 ADD PUSH2 0x3A16 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x3FB0 JUMPI PUSH2 0x3FAF PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3FBE DUP5 DUP3 DUP6 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x3FDE JUMPI PUSH2 0x3FDD PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x3FEC DUP6 DUP3 DUP7 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x3FFD DUP6 DUP3 DUP7 ADD PUSH2 0x38DC JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x401E JUMPI PUSH2 0x401D PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x402C DUP6 DUP3 DUP7 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x403D DUP6 DUP3 DUP7 ADD PUSH2 0x3990 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x80 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x405E JUMPI PUSH2 0x405D PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x406C DUP6 DUP3 DUP7 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x407D DUP6 DUP3 DUP7 ADD PUSH2 0x3AB9 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x409E JUMPI PUSH2 0x409D PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x40AC DUP6 DUP3 DUP7 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 DUP4 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x40CD JUMPI PUSH2 0x40CC PUSH2 0x50B1 JUMP JUMPDEST JUMPDEST PUSH2 0x40D9 DUP6 DUP3 DUP7 ADD PUSH2 0x3BE1 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x40 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x40FA JUMPI PUSH2 0x40F9 PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x4108 DUP6 DUP3 DUP7 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP3 POP POP PUSH1 0x20 PUSH2 0x4119 DUP6 DUP3 DUP7 ADD PUSH2 0x3D50 JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 PUSH1 0x60 DUP5 DUP7 SUB SLT ISZERO PUSH2 0x413C JUMPI PUSH2 0x413B PUSH2 0x50B6 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x414A DUP7 DUP3 DUP8 ADD PUSH2 0x3A2B JUMP JUMPDEST SWAP4 POP POP PUSH1 0x20 PUSH2 0x415B DUP7 DUP3 DUP8 ADD PUSH2 0x3D50 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x40 DUP5 ADD MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x417C JUMPI PUSH2 0x417B PUSH2 0x50B1 JUMP JUMPDEST JUMPDEST PUSH2 0x4188 DUP7 DUP3 DUP8 ADD PUSH2 0x391F JUMP JUMPDEST SWAP2 POP POP SWAP3 POP SWAP3 POP SWAP3 JUMP JUMPDEST PUSH1 0x0 PUSH2 0x419E DUP4 DUP4 PUSH2 0x44C6 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x41B2 DUP4 DUP4 PUSH2 0x453F JUMP JUMPDEST PUSH1 0x20 DUP4 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x41CA DUP4 DUP4 PUSH2 0x463D JUMP JUMPDEST PUSH1 0xA0 DUP4 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x41E2 DUP4 DUP4 PUSH2 0x4879 JUMP JUMPDEST PUSH1 0xC0 DUP4 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x41FA DUP4 DUP4 PUSH2 0x48F4 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x420B DUP2 PUSH2 0x4F1B JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x421A DUP2 PUSH2 0x4F1B JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x422B DUP3 PUSH2 0x4DE9 JUMP JUMPDEST PUSH2 0x4235 DUP2 DUP6 PUSH2 0x4E77 JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x4247 DUP6 PUSH2 0x4D99 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x4283 JUMPI DUP5 DUP5 SUB DUP10 MSTORE DUP2 MLOAD PUSH2 0x4264 DUP6 DUP3 PUSH2 0x4192 JUMP JUMPDEST SWAP5 POP PUSH2 0x426F DUP4 PUSH2 0x4E36 JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP11 ADD SWAP10 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x424B JUMP JUMPDEST POP DUP3 SWAP8 POP DUP8 SWAP6 POP POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x42A0 DUP3 PUSH2 0x4DF4 JUMP JUMPDEST PUSH2 0x42AA DUP2 DUP6 PUSH2 0x4E88 JUMP JUMPDEST SWAP4 POP PUSH2 0x42B5 DUP4 PUSH2 0x4DA9 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x42E6 JUMPI DUP2 MLOAD PUSH2 0x42CD DUP9 DUP3 PUSH2 0x41A6 JUMP JUMPDEST SWAP8 POP PUSH2 0x42D8 DUP4 PUSH2 0x4E43 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x42B9 JUMP JUMPDEST POP DUP6 SWAP4 POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x42FE DUP3 PUSH2 0x4DFF JUMP JUMPDEST PUSH2 0x4308 DUP2 DUP6 PUSH2 0x4E99 JUMP JUMPDEST SWAP4 POP PUSH2 0x4313 DUP4 PUSH2 0x4DB9 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4344 JUMPI DUP2 MLOAD PUSH2 0x432B DUP9 DUP3 PUSH2 0x41BE JUMP JUMPDEST SWAP8 POP PUSH2 0x4336 DUP4 PUSH2 0x4E50 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x4317 JUMP JUMPDEST POP DUP6 SWAP4 POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x435C DUP3 PUSH2 0x4E0A JUMP JUMPDEST PUSH2 0x4366 DUP2 DUP6 PUSH2 0x4EAA JUMP JUMPDEST SWAP4 POP PUSH2 0x4371 DUP4 PUSH2 0x4DC9 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x43A2 JUMPI DUP2 MLOAD PUSH2 0x4389 DUP9 DUP3 PUSH2 0x41D6 JUMP JUMPDEST SWAP8 POP PUSH2 0x4394 DUP4 PUSH2 0x4E5D JUMP JUMPDEST SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x4375 JUMP JUMPDEST POP DUP6 SWAP4 POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x43BA DUP3 PUSH2 0x4E15 JUMP JUMPDEST PUSH2 0x43C4 DUP2 DUP6 PUSH2 0x4EBB JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x43D6 DUP6 PUSH2 0x4DD9 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x4412 JUMPI DUP5 DUP5 SUB DUP10 MSTORE DUP2 MLOAD PUSH2 0x43F3 DUP6 DUP3 PUSH2 0x41EE JUMP JUMPDEST SWAP5 POP PUSH2 0x43FE DUP4 PUSH2 0x4E6A JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP11 ADD SWAP10 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x43DA JUMP JUMPDEST POP DUP3 SWAP8 POP DUP8 SWAP6 POP POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x442F DUP3 PUSH2 0x4E15 JUMP JUMPDEST PUSH2 0x4439 DUP2 DUP6 PUSH2 0x4ECC JUMP JUMPDEST SWAP4 POP DUP4 PUSH1 0x20 DUP3 MUL DUP6 ADD PUSH2 0x444B DUP6 PUSH2 0x4DD9 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP6 DUP2 LT ISZERO PUSH2 0x4487 JUMPI DUP5 DUP5 SUB DUP10 MSTORE DUP2 MLOAD PUSH2 0x4468 DUP6 DUP3 PUSH2 0x41EE JUMP JUMPDEST SWAP5 POP PUSH2 0x4473 DUP4 PUSH2 0x4E6A JUMP JUMPDEST SWAP3 POP PUSH1 0x20 DUP11 ADD SWAP10 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x444F JUMP JUMPDEST POP DUP3 SWAP8 POP DUP8 SWAP6 POP POP POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x44A2 DUP2 PUSH2 0x4F3F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x44B1 DUP2 PUSH2 0x4F3F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x44C0 DUP2 PUSH2 0x4F4B JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x44D1 DUP3 PUSH2 0x4E20 JUMP JUMPDEST PUSH2 0x44DB DUP2 DUP6 PUSH2 0x4EDD JUMP JUMPDEST SWAP4 POP PUSH2 0x44EB DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x4FD6 JUMP JUMPDEST PUSH2 0x44F4 DUP2 PUSH2 0x50BB JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x450A DUP3 PUSH2 0x4E20 JUMP JUMPDEST PUSH2 0x4514 DUP2 DUP6 PUSH2 0x4EEE JUMP JUMPDEST SWAP4 POP PUSH2 0x4524 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x4FD6 JUMP JUMPDEST DUP1 DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x4539 DUP2 PUSH2 0x4F55 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x4548 DUP2 PUSH2 0x4F6C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x4557 DUP2 PUSH2 0x4F6C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4568 DUP3 PUSH2 0x4E2B JUMP JUMPDEST PUSH2 0x4572 DUP2 DUP6 PUSH2 0x4EF9 JUMP JUMPDEST SWAP4 POP PUSH2 0x4582 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x4FD6 JUMP JUMPDEST PUSH2 0x458B DUP2 PUSH2 0x50BB JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x45A3 PUSH1 0x17 DUP4 PUSH2 0x4F0A JUMP JUMPDEST SWAP2 POP PUSH2 0x45AE DUP3 PUSH2 0x50CC JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x60 DUP3 ADD PUSH1 0x0 DUP3 ADD MLOAD PUSH2 0x45CF PUSH1 0x0 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x45E2 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x45F5 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x60 DUP3 ADD PUSH1 0x0 DUP3 ADD MLOAD PUSH2 0x4611 PUSH1 0x0 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x4624 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x4637 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0xA0 DUP3 ADD PUSH1 0x0 DUP3 ADD MLOAD PUSH2 0x4653 PUSH1 0x0 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x4666 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x4679 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x468C PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x469F PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x160 DUP4 ADD PUSH1 0x0 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x0 DUP7 ADD MSTORE PUSH2 0x46C3 DUP3 DUP3 PUSH2 0x455D JUMP JUMPDEST SWAP2 POP POP PUSH1 0x20 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x20 DUP7 ADD MSTORE PUSH2 0x46DD DUP3 DUP3 PUSH2 0x455D JUMP JUMPDEST SWAP2 POP POP PUSH1 0x40 DUP4 ADD MLOAD PUSH2 0x46F2 PUSH1 0x40 DUP7 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x60 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x60 DUP7 ADD MSTORE PUSH2 0x470A DUP3 DUP3 PUSH2 0x455D JUMP JUMPDEST SWAP2 POP POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x471F PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0xA0 DUP4 ADD MLOAD PUSH2 0x4732 PUSH1 0xA0 DUP7 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0xC0 DUP4 ADD MLOAD PUSH2 0x4745 PUSH1 0xC0 DUP7 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0xE0 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0xE0 DUP7 ADD MSTORE PUSH2 0x475D DUP3 DUP3 PUSH2 0x43AF JUMP JUMPDEST SWAP2 POP POP PUSH2 0x100 DUP4 ADD MLOAD PUSH2 0x4774 PUSH2 0x100 DUP7 ADD DUP3 PUSH2 0x45B9 JUMP JUMPDEST POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP4 ADD PUSH1 0x0 DUP4 ADD MLOAD PUSH2 0x4797 PUSH1 0x0 DUP7 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x47AA PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x40 DUP7 ADD MSTORE PUSH2 0x47C2 DUP3 DUP3 PUSH2 0x44C6 JUMP JUMPDEST SWAP2 POP POP PUSH1 0x60 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x60 DUP7 ADD MSTORE PUSH2 0x47DC DUP3 DUP3 PUSH2 0x44C6 JUMP JUMPDEST SWAP2 POP POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x47F1 PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0xA0 DUP4 ADD PUSH1 0x0 DUP4 ADD MLOAD PUSH2 0x4814 PUSH1 0x0 DUP7 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD PUSH2 0x4827 PUSH1 0x20 DUP7 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x40 DUP7 ADD MSTORE PUSH2 0x483F DUP3 DUP3 PUSH2 0x44C6 JUMP JUMPDEST SWAP2 POP POP PUSH1 0x60 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x60 DUP7 ADD MSTORE PUSH2 0x4859 DUP3 DUP3 PUSH2 0x44C6 JUMP JUMPDEST SWAP2 POP POP PUSH1 0x80 DUP4 ADD MLOAD PUSH2 0x486E PUSH1 0x80 DUP7 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0xC0 DUP3 ADD PUSH1 0x0 DUP3 ADD MLOAD PUSH2 0x488F PUSH1 0x0 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x48A2 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x40 DUP3 ADD MLOAD PUSH2 0x48B5 PUSH1 0x40 DUP6 ADD DUP3 PUSH2 0x494F JUMP JUMPDEST POP PUSH1 0x60 DUP3 ADD MLOAD PUSH2 0x48C8 PUSH1 0x60 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP PUSH1 0x80 DUP3 ADD MLOAD PUSH2 0x48DB PUSH1 0x80 DUP6 ADD DUP3 PUSH2 0x4499 JUMP JUMPDEST POP PUSH1 0xA0 DUP3 ADD MLOAD PUSH2 0x48EE PUSH1 0xA0 DUP6 ADD DUP3 PUSH2 0x4202 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP4 ADD PUSH1 0x0 DUP4 ADD MLOAD PUSH2 0x490C PUSH1 0x0 DUP7 ADD DUP3 PUSH2 0x4931 JUMP JUMPDEST POP PUSH1 0x20 DUP4 ADD MLOAD DUP5 DUP3 SUB PUSH1 0x20 DUP7 ADD MSTORE PUSH2 0x4924 DUP3 DUP3 PUSH2 0x477F JUMP JUMPDEST SWAP2 POP POP DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x493A DUP2 PUSH2 0x4F99 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x4949 DUP2 PUSH2 0x4F99 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x4958 DUP2 PUSH2 0x4FA3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x4967 DUP2 PUSH2 0x4FB3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4979 DUP3 DUP5 PUSH2 0x44FF JUMP JUMPDEST SWAP2 POP DUP2 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x4999 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x4211 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x49B4 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x49C1 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4211 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x80 DUP3 ADD SWAP1 POP PUSH2 0x49DD PUSH1 0x0 DUP4 ADD DUP8 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x49EA PUSH1 0x20 DUP4 ADD DUP7 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x49F7 PUSH1 0x40 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4A04 PUSH1 0x60 DUP4 ADD DUP5 PUSH2 0x454E JUMP JUMPDEST SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 ADD SWAP1 POP PUSH2 0x4A22 PUSH1 0x0 DUP4 ADD DUP7 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4A2F PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4A3C PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x4940 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x4A59 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x4A6B DUP2 DUP5 PUSH2 0x4424 JUMP JUMPDEST SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x80 DUP3 ADD SWAP1 POP PUSH2 0x4A89 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4A96 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x45FB JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x4AB2 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4ABF PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x4940 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 ADD SWAP1 POP PUSH2 0x4ADB PUSH1 0x0 DUP4 ADD DUP7 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4AE8 PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x495E JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x4AFA DUP2 DUP5 PUSH2 0x4220 JUMP JUMPDEST SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 ADD SWAP1 POP PUSH2 0x4B19 PUSH1 0x0 DUP4 ADD DUP7 PUSH2 0x4211 JUMP JUMPDEST PUSH2 0x4B26 PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x495E JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x4B38 DUP2 DUP5 PUSH2 0x4295 JUMP JUMPDEST SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x4B57 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x44B7 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x4B72 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x4530 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x80 DUP3 ADD SWAP1 POP PUSH2 0x4B8D PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x4530 JUMP JUMPDEST PUSH2 0x4B9A PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x45FB JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x4BB6 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x454E JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x4BD1 PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x454E JUMP JUMPDEST PUSH2 0x4BDE PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x44A8 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x4BFA PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x454E JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x4C0C DUP2 DUP5 PUSH2 0x47FC JUMP JUMPDEST SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x4C2E DUP2 PUSH2 0x4596 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x4C4F DUP2 DUP7 PUSH2 0x46A5 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x4C63 DUP2 DUP6 PUSH2 0x42F3 JUMP JUMPDEST SWAP1 POP DUP2 DUP2 SUB PUSH1 0x40 DUP4 ADD MSTORE PUSH2 0x4C77 DUP2 DUP5 PUSH2 0x4351 JUMP JUMPDEST SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x4C9B DUP2 DUP7 PUSH2 0x46A5 JUMP JUMPDEST SWAP1 POP PUSH2 0x4CAA PUSH1 0x20 DUP4 ADD DUP6 PUSH2 0x4940 JUMP JUMPDEST PUSH2 0x4CB7 PUSH1 0x40 DUP4 ADD DUP5 PUSH2 0x4940 JUMP JUMPDEST SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4CC9 PUSH2 0x4CDA JUMP JUMPDEST SWAP1 POP PUSH2 0x4CD5 DUP3 DUP3 PUSH2 0x5009 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x4CFF JUMPI PUSH2 0x4CFE PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x20 DUP3 MUL SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x4D2B JUMPI PUSH2 0x4D2A PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x20 DUP3 MUL SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x4D57 JUMPI PUSH2 0x4D56 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH1 0x20 DUP3 MUL SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT ISZERO PUSH2 0x4D83 JUMPI PUSH2 0x4D82 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST PUSH2 0x4D8C DUP3 PUSH2 0x50BB JUMP JUMPDEST SWAP1 POP PUSH1 0x20 DUP2 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4F26 DUP3 PUSH2 0x4F79 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4F38 DUP3 PUSH2 0x4F79 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 ISZERO ISZERO SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x3 SIGNEXTEND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x7 SIGNEXTEND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH4 0xFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH8 0xFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY PUSH1 0x0 DUP4 DUP4 ADD MSTORE POP POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x4FF4 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4FD9 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x5003 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x5012 DUP3 PUSH2 0x50BB JUMP JUMPDEST DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH2 0x5031 JUMPI PUSH2 0x5030 PUSH2 0x5069 JUMP JUMPDEST JUMPDEST DUP1 PUSH1 0x40 MSTORE POP POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x50524E472073797374656D2063616C6C206661696C6564000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH2 0x50FE DUP2 PUSH2 0x4F1B JUMP JUMPDEST DUP2 EQ PUSH2 0x5109 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x5115 DUP2 PUSH2 0x4F2D JUMP JUMPDEST DUP2 EQ PUSH2 0x5120 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x512C DUP2 PUSH2 0x4F3F JUMP JUMPDEST DUP2 EQ PUSH2 0x5137 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x5143 DUP2 PUSH2 0x4F4B JUMP JUMPDEST DUP2 EQ PUSH2 0x514E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x515A DUP2 PUSH2 0x4F55 JUMP JUMPDEST DUP2 EQ PUSH2 0x5165 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x5171 DUP2 PUSH2 0x4F5F JUMP JUMPDEST DUP2 EQ PUSH2 0x517C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x5188 DUP2 PUSH2 0x4F6C JUMP JUMPDEST DUP2 EQ PUSH2 0x5193 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x519F DUP2 PUSH2 0x4F99 JUMP JUMPDEST DUP2 EQ PUSH2 0x51AA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x51B6 DUP2 PUSH2 0x4FA3 JUMP JUMPDEST DUP2 EQ PUSH2 0x51C1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x51CD DUP2 PUSH2 0x4FB3 JUMP JUMPDEST DUP2 EQ PUSH2 0x51D8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 BLOCKHASH 0xB5 0xAB CREATE2 PUSH19 0xFE3F57D6162929FF2E8F6CFB993CE00172DBE0 0xC2 JUMP POP 0xD GASPRICE 0x4B 0xE5 DIFFICULTY PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ", - "sourceMap": "383:8215:7:-:0;;;563:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;648:6;640:5;;:14;;;;;;;;;;;;;;;;;;679:13;664:12;;:28;;;;;;;;;;;;;;;;;;563:136;;383:8215;;7:159:9;72:5;103:6;97:13;88:22;;119:41;154:5;119:41;:::i;:::-;7:159;;;;:::o;172:539::-;267:6;275;324:2;312:9;303:7;299:23;295:32;292:119;;;330:79;;:::i;:::-;292:119;450:1;475:72;539:7;530:6;519:9;515:22;475:72;:::i;:::-;465:82;;421:136;596:2;622:72;686:7;677:6;666:9;662:22;622:72;:::i;:::-;612:82;;567:137;172:539;;;;;:::o;798:104::-;843:7;872:24;890:5;872:24;:::i;:::-;861:35;;798:104;;;:::o;908:126::-;945:7;985:42;978:5;974:54;963:65;;908:126;;;:::o;1163:117::-;1272:1;1269;1262:12;1286:138;1367:32;1393:5;1367:32;:::i;:::-;1360:5;1357:43;1347:71;;1414:1;1411;1404:12;1347:71;1286:138;:::o;383:8215:7:-;;;;;;;" + "bytecode": "60806040523480156200001157600080fd5b50604051620049a5380380620049a5833981810160405281019062000037919062000304565b60018060008060068111156200005257620000516200034b565b5b60068111156200006757620000666200034b565b5b815260200190815260200160002081905550600260016000600160068111156200009657620000956200034b565b5b6006811115620000ab57620000aa6200034b565b5b81526020019081526020016000208190555060046001600060026006811115620000da57620000d96200034b565b5b6006811115620000ef57620000ee6200034b565b5b815260200190815260200160002081905550600860016000600360068111156200011e576200011d6200034b565b5b60068111156200013357620001326200034b565b5b815260200190815260200160002081905550601060016000600460068111156200016257620001616200034b565b5b60068111156200017757620001766200034b565b5b81526020019081526020016000208190555060206001600060056006811115620001a657620001a56200034b565b5b6006811115620001bb57620001ba6200034b565b5b815260200190815260200160002081905550604060016000600680811115620001e957620001e86200034b565b5b6006811115620001fe57620001fd6200034b565b5b81526020019081526020016000208190555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506200037a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002cc826200029f565b9050919050565b620002de81620002bf565b8114620002ea57600080fd5b50565b600081519050620002fe81620002d3565b92915050565b600080604083850312156200031e576200031d6200029a565b5b60006200032e85828601620002ed565b92505060206200034185828601620002ed565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b61461b806200038a6000396000f3fe60806040526004361061012a5760003560e01c80639b23d3d9116100ab578063c30131c51161006f578063c30131c514610403578063d40a71fb1461042e578063d83bf9a11461044c578063df4ec24914610477578063eb7c6f72146104a2578063fb5d7376146104cd5761012a565b80639b23d3d91461031a578063a3221c8e14610357578063ade094b414610382578063bdc7a422146103ad578063bddd3a6b146103d85761012a565b80634fb4bcec116100f25780634fb4bcec1461021e578063618dc65e146102495780637f990e8f146102875780637fbaadba146102c45780638f4ed333146102ef5761012a565b806315dacbea1461012f57806323a452ad1461016c57806336f468911461019d57806344ac2d48146101c8578063462a08df146101f3575b600080fd5b34801561013b57600080fd5b5061015660048036038101906101519190613240565b6104f8565b60405161016391906132c3565b60405180910390f35b61018660048036038101906101819190613424565b610616565b604051610194929190613495565b60405180910390f35b3480156101a957600080fd5b506101b26109ec565b6040516101bf91906134be565b60405180910390f35b3480156101d457600080fd5b506101dd610a9e565b6040516101ea91906134f2565b60405180910390f35b3480156101ff57600080fd5b50610208610b70565b60405161021591906134be565b60405180910390f35b34801561022a57600080fd5b50610233610c91565b60405161024091906134be565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b919061350d565b610d42565b60405161027e9291906135e8565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a991906136fe565b610eaf565b6040516102bb91906134be565b60405180910390f35b3480156102d057600080fd5b506102d9610ffd565b6040516102e691906134be565b60405180910390f35b3480156102fb57600080fd5b506103046110af565b60405161031191906134be565b60405180910390f35b34801561032657600080fd5b50610341600480360381019061033c9190613240565b6111ac565b60405161034e91906132c3565b60405180910390f35b34801561036357600080fd5b5061036c6112ca565b60405161037991906134be565b60405180910390f35b34801561038e57600080fd5b5061039761137c565b6040516103a491906134be565b60405180910390f35b3480156103b957600080fd5b506103c261146d565b6040516103cf91906134be565b60405180910390f35b3480156103e457600080fd5b506103ed61151c565b6040516103fa91906134be565b60405180910390f35b34801561040f57600080fd5b506104186115a8565b60405161042591906134be565b60405180910390f35b610436611659565b60405161044391906134be565b60405180910390f35b34801561045857600080fd5b506104616119c9565b60405161046e91906134f2565b60405180910390f35b34801561048357600080fd5b5061048c611b01565b60405161049991906134be565b60405180910390f35b3480156104ae57600080fd5b506104b7611bb0565b6040516104c491906134be565b60405180910390f35b3480156104d957600080fd5b506104e2611c3c565b6040516104ef91906134be565b60405180910390f35b600080600061016773ffffffffffffffffffffffffffffffffffffffff166315dacbea60e01b888888886040516024016105359493929190613756565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161059f91906137d7565b6000604051808303816000865af19150503d80600081146105dc576040519150601f19603f3d011682016040523d82523d6000602084013e6105e1565b606091505b5091509150816105f2576015610607565b808060200190518101906106069190613827565b5b60030b92505050949350505050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461067357600080fd5b6000600167ffffffffffffffff8111156106905761068f6132f9565b5b6040519080825280602002602001820160405280156106c957816020015b6106b661300f565b8152602001906001900390816106ae5790505b5090506106db60006004600287611cee565b816000815181106106ef576106ee613854565b5b60200260200101819052506000600167ffffffffffffffff811115610717576107166132f9565b5b60405190808252806020026020018201604052801561075057816020015b61073d61302f565b8152602001906001900390816107355790505b5090506107836305f5e100600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d27565b8160008151811061079757610796613854565b5b602002602001018190525061090c6040518061012001604052806040518060400160405280601181526020017f4578616d706c65204e465420746f6b656e00000000000000000000000000000081525081526020016040518060400160405280600481526020017f454e46540000000000000000000000000000000000000000000000000000000081525081526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600481526020017f6d656d6f0000000000000000000000000000000000000000000000000000000081525081526020016001151581526020016103e860070b81526020016000151581526020018481526020016108ae30626acfc0611d90565b81525082600067ffffffffffffffff8111156108cd576108cc6132f9565b5b60405190808252806020026020018201604052801561090657816020015b6108f3613091565b8152602001906001900390816108eb5790505b50611de8565b600560008291906101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508195505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156109bc573d6000803e3d6000fd5b5083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16935093505050915091565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a4857600080fd5b610a99600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001611f5e565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610afa57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1663d83bf9a16040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b91906138af565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bcc57600080fd5b6000600167ffffffffffffffff811115610be957610be86132f9565b5b604051908082528060200260200182016040528015610c175781602001602082028036833780820191505090505b509050600381600081518110610c3057610c2f613854565b5b602002602001019060070b908160070b815250506000610c74600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008461207c565b809250819450505060028160070b14610c8c57600080fd5b505090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ced57600080fd5b610d3d600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660646121a4565b905090565b6000606060008061016773ffffffffffffffffffffffffffffffffffffffff1663618dc65e60e01b8787604051602401610d7d9291906138dc565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610de791906137d7565b6000604051808303816000865af19150503d8060008114610e24576040519150601f19603f3d011682016040523d82523d6000602084013e610e29565b606091505b50915091507f4af4780e06fe8cb9df64b0794fa6f01399af979175bb988e35e0e57e594567bc8282604051610e5f929190613927565b60405180910390a181610e8357601560405180602001604052806000815250610e98565b80806020019051810190610e9791906139c7565b5b8160030b9150809450819550505050509250929050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f0b57600080fd5b6003825114610f1957600080fd5b60006060610f4b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000866122bf565b80935081945082955050505060038260070b14610f6757600080fd5b6003815114610f7557600080fd5b600181600081518110610f8b57610f8a613854565b5b602002602001015160070b14610fa057600080fd5b600281600181518110610fb657610fb5613854565b5b602002602001015160070b14610fcb57600080fd5b600381600281518110610fe157610fe0613854565b5b602002602001015160070b14610ff657600080fd5b5050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461105957600080fd5b6110a7600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612437565b60070b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461110b57600080fd5b6000606061118b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064600067ffffffffffffffff811115611152576111516132f9565b5b60405190808252806020026020018201604052801561118557816020015b60608152602001906001900390816111705790505b506122bf565b80935081945082955050505060c88260070b146111a757600080fd5b505090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16639b23d3d960e01b888888886040516024016111e99493929190613756565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161125391906137d7565b6000604051808303816000865af19150503d8060008114611290576040519150601f19603f3d011682016040523d82523d6000602084013e611295565b606091505b5091509150816112a65760156112bb565b808060200190518101906112ba9190613827565b5b60030b92505050949350505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132657600080fd5b611374600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661254f565b60070b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113d857600080fd5b6000611451600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166032600067ffffffffffffffff81111561141d5761141c6132f9565b5b60405190808252806020026020018201604052801561144b5781602001602082028036833780820191505090505b5061207c565b809250819350505060968160070b1461146957600080fd5b5090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114c957600080fd5b611517600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612667565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157857600080fd5b6115a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661277f565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461160457600080fd5b611654600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002612894565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b557600080fd5b6000600467ffffffffffffffff8111156116d2576116d16132f9565b5b60405190808252806020026020018201604052801561170b57816020015b6116f861300f565b8152602001906001900390816116f05790505b50905061172c60006006600060405180602001604052806000815250611cee565b816000815181106117405761173f613854565b5b602002602001018190525061176760026000604051806020016040528060008152506129af565b8160018151811061177b5761177a613854565b5b60200260200101819052506117a260036000604051806020016040528060008152506129af565b816002815181106117b6576117b5613854565b5b60200260200101819052506117dd60046000604051806020016040528060008152506129af565b816003815181106117f1576117f0613854565b5b60200260200101819052506119146040518061012001604052806040518060400160405280601681526020017f4578616d706c652046756e6769626c6520746f6b656e0000000000000000000081525081526020016040518060400160405280600181526020017f450000000000000000000000000000000000000000000000000000000000000081525081526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600481526020017f6d656d6f0000000000000000000000000000000000000000000000000000000081525081526020016001151581526020016103e860070b815260200160001515815260200183815260200161190830626acfc0611d90565b815250606460006129e6565b600460008291906101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508193505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156119c4573d6000803e3d6000fd5b505090565b600080600061016973ffffffffffffffffffffffffffffffffffffffff1663d83bf9a160e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611a5f91906137d7565b6000604051808303816000865af19150503d8060008114611a9c576040519150601f19603f3d011682016040523d82523d6000602084013e611aa1565b606091505b509150915081611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add90613a80565b60405180910390fd5b80806020019051810190611afa91906138af565b9250505090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b5d57600080fd5b611bab600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612667565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c0c57600080fd5b611c37600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612b5c565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c9857600080fd5b611ce9600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064612c71565b905090565b611cf661300f565b6040518060400160405280611d0b8787612d8f565b8152602001611d1a8585612de5565b8152509050949350505050565b611d2f61302f565b82816000019060070b908160070b81525050600181604001901515908115158152505081816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505092915050565b611d986130fe565b82816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081816040019060070b908160070b8152505092915050565b6000808460008161010001516000015160070b148015611e14575060008161010001516040015160070b145b15611e37576276a70060030b8161010001516040019060070b908160070b815250505b60008061016773ffffffffffffffffffffffffffffffffffffffff163463abb54eb560e01b8a8a8a604051602401611e7193929190614054565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611edb91906137d7565b60006040518083038185875af1925050503d8060008114611f18576040519150601f19603f3d011682016040523d82523d6000602084013e611f1d565b606091505b509150915081611f305760156000611f45565b80806020019051810190611f4491906140de565b5b8160030b91508095508196505050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16635cfc901160e01b88888888604051602401611f9b949392919061411e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161200591906137d7565b6000604051808303816000865af19150503d8060008114612042576040519150601f19603f3d011682016040523d82523d6000602084013e612047565b606091505b50915091508161205857601561206d565b8080602001905181019061206c9190613827565b5b60030b92505050949350505050565b60008060008061016773ffffffffffffffffffffffffffffffffffffffff1663d6910d0660e01b8888886040516024016120b893929190614212565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161212291906137d7565b6000604051808303816000865af19150503d806000811461215f576040519150601f19603f3d011682016040523d82523d6000602084013e612164565b606091505b509150915081612177576015600061218c565b8080602001905181019061218b919061427c565b5b8160030b915080945081955050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663e1f21c6760e01b8787876040516024016121df939291906142bc565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161224991906137d7565b6000604051808303816000865af19150503d8060008114612286576040519150601f19603f3d011682016040523d82523d6000602084013e61228b565b606091505b50915091508161229c5760156122b1565b808060200190518101906122b09190613827565b5b60030b925050509392505050565b600080606060008061016773ffffffffffffffffffffffffffffffffffffffff1663e0f4059a60e01b8989896040516024016122fd939291906143b5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161236791906137d7565b6000604051808303816000865af19150503d80600081146123a4576040519150601f19603f3d011682016040523d82523d6000602084013e6123a9565b606091505b50915091508161240557601560008067ffffffffffffffff8111156123d1576123d06132f9565b5b6040519080825280602002602001820160405280156123ff5781602001602082028036833780820191505090505b5061241a565b8080602001905181019061241991906144b6565b5b8260030b9250809550819650829750505050505093509350939050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff166352f9138760e01b8686604051602401612470929190614525565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516124da91906137d7565b6000604051808303816000865af19150503d8060008114612517576040519150601f19603f3d011682016040523d82523d6000602084013e61251c565b606091505b50915091508161252d576015612542565b808060200190518101906125419190613827565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16635b8f858460e01b8686604051602401612588929190614525565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516125f291906137d7565b6000604051808303816000865af19150503d806000811461262f576040519150601f19603f3d011682016040523d82523d6000602084013e612634565b606091505b50915091508161264557601561265a565b808060200190518101906126599190613827565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff166349146bde60e01b86866040516024016126a0929190614525565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161270a91906137d7565b6000604051808303816000865af19150503d8060008114612747576040519150601f19603f3d011682016040523d82523d6000602084013e61274c565b606091505b50915091508161275d576015612772565b808060200190518101906127719190613827565b5b60030b9250505092915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16633b3bff0f60e01b856040516024016127b6919061454e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161282091906137d7565b6000604051808303816000865af19150503d806000811461285d576040519150601f19603f3d011682016040523d82523d6000602084013e612862565b606091505b509150915081612873576015612888565b808060200190518101906128879190613827565b5b60030b92505050919050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16637336aaf060e01b8787876040516024016128cf939291906142bc565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161293991906137d7565b6000604051808303816000865af19150503d8060008114612976576040519150601f19603f3d011682016040523d82523d6000602084013e61297b565b606091505b50915091508161298c5760156129a1565b808060200190518101906129a09190613827565b5b60030b925050509392505050565b6129b761300f565b60405180604001604052806129cb86612fba565b81526020016129da8585612de5565b81525090509392505050565b6000808460008161010001516000015160070b148015612a12575060008161010001516040015160070b145b15612a35576276a70060030b8161010001516040019060070b908160070b815250505b60008061016773ffffffffffffffffffffffffffffffffffffffff1634630fb65bf360e01b8a8a8a604051602401612a6f93929190614578565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612ad991906137d7565b60006040518083038185875af1925050503d8060008114612b16576040519150601f19603f3d011682016040523d82523d6000602084013e612b1b565b606091505b509150915081612b2e5760156000612b43565b80806020019051810190612b4291906140de565b5b8160030b91508095508196505050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16637c41ad2c60e01b85604051602401612b93919061454e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612bfd91906137d7565b6000604051808303816000865af19150503d8060008114612c3a576040519150601f19603f3d011682016040523d82523d6000602084013e612c3f565b606091505b509150915081612c50576015612c65565b80806020019051810190612c649190613827565b5b60030b92505050919050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663eca3691760e01b88888888604051602401612cae949392919061411e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612d1891906137d7565b6000604051808303816000865af19150503d8060008114612d55576040519150601f19603f3d011682016040523d82523d6000602084013e612d5a565b606091505b509150915081612d6b576015612d80565b80806020019051810190612d7f9190613827565b5b60030b92505050949350505050565b6000612db6836006811115612da757612da66145b6565b5b82612ffb90919063ffffffff16565b9050612ddd826006811115612dce57612dcd6145b6565b5b82612ffb90919063ffffffff16565b905092915050565b612ded61313b565b60006004811115612e0157612e006145b6565b5b836004811115612e1457612e136145b6565b5b03612e2f576001816000019015159081151581525050612fb4565b60016004811115612e4357612e426145b6565b5b836004811115612e5657612e556145b6565b5b03612eb85760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612fb3565b60026004811115612ecc57612ecb6145b6565b5b836004811115612edf57612ede6145b6565b5b03612ef257818160400181905250612fb2565b60036004811115612f0657612f056145b6565b5b836004811115612f1957612f186145b6565b5b03612f2c57818160600181905250612fb1565b600480811115612f3f57612f3e6145b6565b5b836004811115612f5257612f516145b6565b5b03612fb05760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b5b5b5b5b92915050565b600060016000836006811115612fd357612fd26145b6565b5b6006811115612fe557612fe46145b6565b5b8152602001908152602001600020549050919050565b60008160ff166001901b8317905092915050565b60405180604001604052806000815260200161302961313b565b81525090565b6040518060a00160405280600060070b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060c00160405280600060070b8152602001600060070b8152602001600060070b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060600160405280600060070b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600060070b81525090565b6040518060a00160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006131d7826131ac565b9050919050565b6131e7816131cc565b81146131f257600080fd5b50565b600081359050613204816131de565b92915050565b6000819050919050565b61321d8161320a565b811461322857600080fd5b50565b60008135905061323a81613214565b92915050565b6000806000806080858703121561325a576132596131a2565b5b6000613268878288016131f5565b9450506020613279878288016131f5565b935050604061328a878288016131f5565b925050606061329b8782880161322b565b91505092959194509250565b60008160070b9050919050565b6132bd816132a7565b82525050565b60006020820190506132d860008301846132b4565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613331826132e8565b810181811067ffffffffffffffff821117156133505761334f6132f9565b5b80604052505050565b6000613363613198565b905061336f8282613328565b919050565b600067ffffffffffffffff82111561338f5761338e6132f9565b5b613398826132e8565b9050602081019050919050565b82818337600083830152505050565b60006133c76133c284613374565b613359565b9050828152602081018484840111156133e3576133e26132e3565b5b6133ee8482856133a5565b509392505050565b600082601f83011261340b5761340a6132de565b5b813561341b8482602086016133b4565b91505092915050565b60006020828403121561343a576134396131a2565b5b600082013567ffffffffffffffff811115613458576134576131a7565b5b613464848285016133f6565b91505092915050565b6000819050919050565b6134808161346d565b82525050565b61348f816131cc565b82525050565b60006040820190506134aa6000830185613477565b6134b76020830184613486565b9392505050565b60006020820190506134d36000830184613477565b92915050565b6000819050919050565b6134ec816134d9565b82525050565b600060208201905061350760008301846134e3565b92915050565b60008060408385031215613524576135236131a2565b5b6000613532858286016131f5565b925050602083013567ffffffffffffffff811115613553576135526131a7565b5b61355f858286016133f6565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156135a3578082015181840152602081019050613588565b60008484015250505050565b60006135ba82613569565b6135c48185613574565b93506135d4818560208601613585565b6135dd816132e8565b840191505092915050565b60006040820190506135fd6000830185613477565b818103602083015261360f81846135af565b90509392505050565b600067ffffffffffffffff821115613633576136326132f9565b5b602082029050602081019050919050565b600080fd5b600061365c61365784613618565b613359565b9050808382526020820190506020840283018581111561367f5761367e613644565b5b835b818110156136c657803567ffffffffffffffff8111156136a4576136a36132de565b5b8086016136b189826133f6565b85526020850194505050602081019050613681565b5050509392505050565b600082601f8301126136e5576136e46132de565b5b81356136f5848260208601613649565b91505092915050565b600060208284031215613714576137136131a2565b5b600082013567ffffffffffffffff811115613732576137316131a7565b5b61373e848285016136d0565b91505092915050565b6137508161320a565b82525050565b600060808201905061376b6000830187613486565b6137786020830186613486565b6137856040830185613486565b6137926060830184613747565b95945050505050565b600081905092915050565b60006137b182613569565b6137bb818561379b565b93506137cb818560208601613585565b80840191505092915050565b60006137e382846137a6565b915081905092915050565b60008160030b9050919050565b613804816137ee565b811461380f57600080fd5b50565b600081519050613821816137fb565b92915050565b60006020828403121561383d5761383c6131a2565b5b600061384b84828501613812565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61388c816134d9565b811461389757600080fd5b50565b6000815190506138a981613883565b92915050565b6000602082840312156138c5576138c46131a2565b5b60006138d38482850161389a565b91505092915050565b60006040820190506138f16000830185613486565b818103602083015261390381846135af565b90509392505050565b60008115159050919050565b6139218161390c565b82525050565b600060408201905061393c6000830185613918565b818103602083015261394e81846135af565b90509392505050565b600061396a61396584613374565b613359565b905082815260208101848484011115613986576139856132e3565b5b613991848285613585565b509392505050565b600082601f8301126139ae576139ad6132de565b5b81516139be848260208601613957565b91505092915050565b600080604083850312156139de576139dd6131a2565b5b60006139ec85828601613812565b925050602083015167ffffffffffffffff811115613a0d57613a0c6131a7565b5b613a1985828601613999565b9150509250929050565b600082825260208201905092915050565b7f50524e472073797374656d2063616c6c206661696c6564000000000000000000600082015250565b6000613a6a601783613a23565b9150613a7582613a34565b602082019050919050565b60006020820190508181036000830152613a9981613a5d565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000613ac782613aa0565b613ad18185613aab565b9350613ae1818560208601613585565b613aea816132e8565b840191505092915050565b613afe816131cc565b82525050565b613b0d8161390c565b82525050565b613b1c816132a7565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613b578161320a565b82525050565b600082825260208201905092915050565b6000613b7982613569565b613b838185613b5d565b9350613b93818560208601613585565b613b9c816132e8565b840191505092915050565b600060a083016000830151613bbf6000860182613b04565b506020830151613bd26020860182613af5565b5060408301518482036040860152613bea8282613b6e565b91505060608301518482036060860152613c048282613b6e565b9150506080830151613c196080860182613af5565b508091505092915050565b6000604083016000830151613c3c6000860182613b4e565b5060208301518482036020860152613c548282613ba7565b9150508091505092915050565b6000613c6d8383613c24565b905092915050565b6000602082019050919050565b6000613c8d82613b22565b613c978185613b2d565b935083602082028501613ca985613b3e565b8060005b85811015613ce55784840389528151613cc68582613c61565b9450613cd183613c75565b925060208a01995050600181019050613cad565b50829750879550505050505092915050565b606082016000820151613d0d6000850182613b13565b506020820151613d206020850182613af5565b506040820151613d336040850182613b13565b50505050565b6000610160830160008301518482036000860152613d578282613abc565b91505060208301518482036020860152613d718282613abc565b9150506040830151613d866040860182613af5565b5060608301518482036060860152613d9e8282613abc565b9150506080830151613db36080860182613b04565b5060a0830151613dc660a0860182613b13565b5060c0830151613dd960c0860182613b04565b5060e083015184820360e0860152613df18282613c82565b915050610100830151613e08610100860182613cf7565b508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60a082016000820151613e556000850182613b13565b506020820151613e686020850182613af5565b506040820151613e7b6040850182613b04565b506060820151613e8e6060850182613b04565b506080820151613ea16080850182613af5565b50505050565b6000613eb38383613e3f565b60a08301905092915050565b6000602082019050919050565b6000613ed782613e13565b613ee18185613e1e565b9350613eec83613e2f565b8060005b83811015613f1d578151613f048882613ea7565b9750613f0f83613ebf565b925050600181019050613ef0565b5085935050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60c082016000820151613f6c6000850182613b13565b506020820151613f7f6020850182613b13565b506040820151613f926040850182613b13565b506060820151613fa56060850182613af5565b506080820151613fb86080850182613b04565b5060a0820151613fcb60a0850182613af5565b50505050565b6000613fdd8383613f56565b60c08301905092915050565b6000602082019050919050565b600061400182613f2a565b61400b8185613f35565b935061401683613f46565b8060005b8381101561404757815161402e8882613fd1565b975061403983613fe9565b92505060018101905061401a565b5085935050505092915050565b6000606082019050818103600083015261406e8186613d39565b905081810360208301526140828185613ecc565b905081810360408301526140968184613ff6565b9050949350505050565b60006140ab826131ac565b9050919050565b6140bb816140a0565b81146140c657600080fd5b50565b6000815190506140d8816140b2565b92915050565b600080604083850312156140f5576140f46131a2565b5b600061410385828601613812565b9250506020614114858286016140c9565b9150509250929050565b60006080820190506141336000830187613486565b6141406020830186613486565b61414d6040830185613486565b61415a60608301846132b4565b95945050505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061419b8383613b13565b60208301905092915050565b6000602082019050919050565b60006141bf82614163565b6141c9818561416e565b93506141d48361417f565b8060005b838110156142055781516141ec888261418f565b97506141f7836141a7565b9250506001810190506141d8565b5085935050505092915050565b60006060820190506142276000830186613486565b61423460208301856132b4565b818103604083015261424681846141b4565b9050949350505050565b614259816132a7565b811461426457600080fd5b50565b60008151905061427681614250565b92915050565b60008060408385031215614293576142926131a2565b5b60006142a185828601613812565b92505060206142b285828601614267565b9150509250929050565b60006060820190506142d16000830186613486565b6142de6020830185613486565b6142eb6040830184613747565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061432b8383613b6e565b905092915050565b6000602082019050919050565b600061434b826142f3565b61435581856142fe565b9350836020820285016143678561430f565b8060005b858110156143a35784840389528151614384858261431f565b945061438f83614333565b925060208a0199505060018101905061436b565b50829750879550505050505092915050565b60006060820190506143ca6000830186613486565b6143d760208301856132b4565b81810360408301526143e98184614340565b9050949350505050565b600067ffffffffffffffff82111561440e5761440d6132f9565b5b602082029050602081019050919050565b600061443261442d846143f3565b613359565b9050808382526020820190506020840283018581111561445557614454613644565b5b835b8181101561447e578061446a8882614267565b845260208401935050602081019050614457565b5050509392505050565b600082601f83011261449d5761449c6132de565b5b81516144ad84826020860161441f565b91505092915050565b6000806000606084860312156144cf576144ce6131a2565b5b60006144dd86828701613812565b93505060206144ee86828701614267565b925050604084015167ffffffffffffffff81111561450f5761450e6131a7565b5b61451b86828701614488565b9150509250925092565b600060408201905061453a6000830185613486565b6145476020830184613486565b9392505050565b60006020820190506145636000830184613486565b92915050565b614572816137ee565b82525050565b600060608201905081810360008301526145928186613d39565b90506145a160208301856132b4565b6145ae6040830184614569565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220f9b7a70107280779fe1d24ca3491ff2674f160d598ac86c1f0374413bf96fdf364736f6c63430008120033" } diff --git a/examples/precompile_example/PrecompileExample.sol b/examples/precompile_example/PrecompileExample.sol index 35f90179e..249507aa1 100644 --- a/examples/precompile_example/PrecompileExample.sol +++ b/examples/precompile_example/PrecompileExample.sol @@ -4,12 +4,21 @@ pragma experimental ABIEncoderV2; import "./ExpiryHelper.sol"; import "./PrngSystemContract.sol"; +import "./KeyHelper.sol"; +import "./HederaTokenService.sol"; +import "./FeeHelper.sol"; // To alter the behavior of the SolidityPrecompileExample, re-compile this solidity file // (you will also need the other files in this directory) // and copy the outputted json file to ./PrecompileExample.json -contract PrecompileExample is ExpiryHelper, PrngSystemContract { +contract PrecompileExample is + PrngSystemContract, + HederaTokenService, + ExpiryHelper, + KeyHelper, + FeeHelper +{ address payable owner; address payable aliceAccount; address fungibleToken; @@ -33,10 +42,32 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { function step1() external payable returns (int responseCode) { require(msg.sender == owner); - IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1); - // Set the admin key, supply key, pause key, and freeze key to the key of the account that executed function (INHERIT_ACCOUNT_KEY). - keys[0] = createSingleKey(ADMIN_KEY_TYPE | SUPPLY_KEY_TYPE | PAUSE_KEY_TYPE | FREEZE_KEY_TYPE, INHERIT_ACCOUNT_KEY, bytes("")); + IHederaTokenService.TokenKey[] + memory keys = new IHederaTokenService.TokenKey[](4); + keys[0] = getSingleKey( + KeyType.ADMIN, + KeyType.PAUSE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + + keys[1] = getSingleKey( + KeyType.FREEZE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[2] = getSingleKey( + KeyType.WIPE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[3] = getSingleKey( + KeyType.SUPPLY, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + //KeyType.SUPPLY KeyType.FREEZE, (responseCode, fungibleToken) = createFungibleToken( IHederaTokenService.HederaToken( "Example Fungible token", // name @@ -47,9 +78,9 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { 1000, // max supply false, // freeze default (setting to false means that this token will not be initially frozen on creation) keys, // the keys for the new token - // auto-renew fee paid by aliceAccount every 7,000,000 seconds (approx. 81 days). - // This is the minimum auto renew period. - createAutoRenewExpiry(aliceAccount, 7000000) + // auto-renew fee paid by aliceAccount every 7,000,000 seconds (approx. 81 days). + // This is the minimum auto renew period. + createAutoRenewExpiry(address(this), 7000000) ), 100, // initial supply 0 // decimals @@ -62,7 +93,7 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { function step2() external returns (int responseCode) { require(msg.sender == owner); - uint64 newTotalSupply; + int64 newTotalSupply; int64[] memory mintedSerials; // applicable to NFT tokens only (responseCode, newTotalSupply, mintedSerials) = mintToken( fungibleToken, @@ -104,13 +135,13 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { function step6() external returns (int responseCode) { require(msg.sender == owner); - responseCode = this.pauseToken(fungibleToken); + responseCode = HederaTokenService.pauseToken(fungibleToken); } function step7() external returns (int responseCode) { require(msg.sender == owner); - responseCode = this.unpauseToken(fungibleToken); + responseCode = HederaTokenService.unpauseToken(fungibleToken); } function step8() external returns (int responseCode) { @@ -128,7 +159,7 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { function step10() external returns (int responseCode) { require(msg.sender == owner); - uint64 totalSupplyLeftAfterBurn; + int64 totalSupplyLeftAfterBurn; (responseCode, totalSupplyLeftAfterBurn) = burnToken( fungibleToken, 50, // amount to burn (applicable to fungible tokens only) @@ -138,15 +169,25 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { require(totalSupplyLeftAfterBurn == 100 + 100 - 50); } - function step11(bytes memory keyBytes) external payable returns (int responseCode) { + function step11( + bytes memory keyBytes + ) external payable returns (int responseCode, address) { require(msg.sender == owner); - IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1); + IHederaTokenService.TokenKey[] + memory keys = new IHederaTokenService.TokenKey[](1); // Set the admin key and the supply key to given ED25519 public key bytes. // These must be the key's raw bytes acquired via key.toBytesRaw() - keys[0] = createSingleKey(ADMIN_KEY_TYPE | SUPPLY_KEY_TYPE, ED25519_KEY, keyBytes); - IHederaTokenService.FixedFee[] memory fixedFees = new IHederaTokenService.FixedFee[](1); + keys[0] = getSingleKey( + KeyType.ADMIN, + KeyType.SUPPLY, + KeyValueType.ED25519, + keyBytes + ); + + IHederaTokenService.FixedFee[] + memory fixedFees = new IHederaTokenService.FixedFee[](1); // Create a fixed fee of 1 Hbar (100,000,000 tinybar) that is collected by owner fixedFees[0] = createFixedFeeForHbars(100000000, owner); @@ -160,9 +201,9 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { 1000, // max supply false, // freeze default (setting to false means that this token will not be initially frozen on creation) keys, // the keys for the new token - // auto-renew fee paid by aliceAccount every 7,000,000 seconds (approx. 81 days). - // This is the minimum auto renew period. - createAutoRenewExpiry(aliceAccount, 7000000) + // auto-renew fee paid by aliceAccount every 7,000,000 seconds (approx. 81 days). + // This is the minimum auto renew period. + createAutoRenewExpiry(address(this), 7000000) ), fixedFees, new IHederaTokenService.RoyaltyFee[](0) @@ -170,13 +211,16 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { // send any excess Hbar back to the owner owner.transfer(address(this).balance); + return (responseCode, nftToken); } - function step12(bytes[] memory metadatas) external returns (int responseCode) { + function step12( + bytes[] memory metadatas + ) external returns (int responseCode) { require(msg.sender == owner); require(metadatas.length == 3); - uint64 mintedCount; + int64 mintedCount; int64[] memory mintedSerials; // applicable to NFT tokens only (responseCode, mintedCount, mintedSerials) = mintToken( nftToken, @@ -222,7 +266,7 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { int64[] memory serialsToBurn = new int64[](1); serialsToBurn[0] = 3; - uint64 totalSupplyLeftAfterBurn; + int64 totalSupplyLeftAfterBurn; (responseCode, totalSupplyLeftAfterBurn) = burnToken( nftToken, 0, // amount to burn (applicable to fungible tokens only) @@ -231,5 +275,4 @@ contract PrecompileExample is ExpiryHelper, PrngSystemContract { require(totalSupplyLeftAfterBurn == 2); } -} - +} \ No newline at end of file diff --git a/examples/precompile_example/PrngSystemContract.sol b/examples/precompile_example/PrngSystemContract.sol index 77a69b59d..a20533c12 100644 --- a/examples/precompile_example/PrngSystemContract.sol +++ b/examples/precompile_example/PrngSystemContract.sol @@ -14,4 +14,4 @@ contract PrngSystemContract { require(success, "PRNG system call failed"); seedBytes = abi.decode(result, (bytes32)); } -} +} \ No newline at end of file diff --git a/examples/precompile_example/ZeroTokenOperations.json b/examples/precompile_example/ZeroTokenOperations.json index 891f5287e..4f5cb7704 100644 --- a/examples/precompile_example/ZeroTokenOperations.json +++ b/examples/precompile_example/ZeroTokenOperations.json @@ -1,421 +1,233 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "ZeroTokenOperations", - "sourceName": "contracts/ZeroTokenOperations.sol", - "abi": [ - { - "inputs": [ + "abi": [ { - "internalType": "address payable", - "name": "_owner", - "type": "address" + "inputs": [ + { + "internalType": "address payable", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_aliceAccount", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" }, { - "internalType": "address payable", - "name": "_aliceAccount", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTokenExpiryInfo", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "CallResponseEvent", + "type": "event" }, { - "components": [ - { - "internalType": "uint32", - "name": "second", - "type": "uint32" - }, - { - "internalType": "address", - "name": "autoRenewAccount", - "type": "address" - }, - { - "internalType": "uint32", - "name": "autoRenewPeriod", - "type": "uint32" - } - ], - "internalType": "struct IHederaTokenService.Expiry", - "name": "expiryInfo", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "getPseudorandomSeed", + "outputs": [ + { + "internalType": "bytes32", + "name": "seedBytes", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - } - ], - "name": "getTokenKey", - "outputs": [ - { - "internalType": "int64", - "name": "responseCode", - "type": "int64" + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "encodedFunctionSelector", + "type": "bytes" + } + ], + "name": "redirectForToken", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "components": [ - { - "internalType": "bool", - "name": "inheritAccountKey", - "type": "bool" - }, - { - "internalType": "address", - "name": "contractId", - "type": "address" - }, - { - "internalType": "bytes", - "name": "ed25519", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "ECDSA_secp256k1", - "type": "bytes" - }, - { - "internalType": "address", - "name": "delegatableContractId", - "type": "address" - } - ], - "internalType": "struct IHederaTokenService.KeyValue", - "name": "key", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "step0", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantTokenKyc", - "outputs": [ - { - "internalType": "int64", - "name": "responseCode", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "step1", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isKyc", - "outputs": [ - { - "internalType": "int64", - "name": "responseCode", - "type": "int64" + "inputs": [], + "name": "step2", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "internalType": "bool", - "name": "kycGranted", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "pauseToken", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "step3", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeTokenKyc", - "outputs": [ - { - "internalType": "int64", - "name": "responseCode", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "step0", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "step1", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "step2", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "step3", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "step4", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "step5", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "unpauseToken", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "step4", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "components": [ - { - "internalType": "uint32", - "name": "second", - "type": "uint32" - }, - { - "internalType": "address", - "name": "autoRenewAccount", - "type": "address" - }, - { - "internalType": "uint32", - "name": "autoRenewPeriod", - "type": "uint32" - } - ], - "internalType": "struct IHederaTokenService.Expiry", - "name": "expiryInfo", - "type": "tuple" - } - ], - "name": "updateTokenExpiryInfo", - "outputs": [ - { - "internalType": "int256", - "name": "responseCode", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" + "inputs": [], + "name": "step5", + "outputs": [ + { + "internalType": "int256", + "name": "responseCode", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "components": [ - { - "internalType": "uint256", - "name": "keyType", - "type": "uint256" - }, - { - "components": [ + "inputs": [ { - "internalType": "bool", - "name": "inheritAccountKey", - "type": "bool" + "internalType": "address", + "name": "token", + "type": "address" }, { - "internalType": "address", - "name": "contractId", - "type": "address" + "internalType": "address", + "name": "from", + "type": "address" }, { - "internalType": "bytes", - "name": "ed25519", - "type": "bytes" + "internalType": "address", + "name": "to", + "type": "address" }, { - "internalType": "bytes", - "name": "ECDSA_secp256k1", - "type": "bytes" - }, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ { - "internalType": "address", - "name": "delegatableContractId", - "type": "address" + "internalType": "int64", + "name": "responseCode", + "type": "int64" } - ], - "internalType": "struct IHederaTokenService.KeyValue", - "name": "key", - "type": "tuple" - } - ], - "internalType": "struct IHederaTokenService.TokenKey[]", - "name": "keys", - "type": "tuple[]" - } - ], - "name": "updateTokenKeys", - "outputs": [ + ], + "stateMutability": "nonpayable", + "type": "function" + }, { - "internalType": "int64", - "name": "responseCode", - "type": "int64" + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "serialNumber", + "type": "uint256" + } + ], + "name": "transferFromNFT", + "outputs": [ + { + "internalType": "int64", + "name": "responseCode", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001d7c38038062001d7c833981016040819052620000349162000083565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055620000ba565b80516001600160a01b03811681146200007e57600080fd5b919050565b6000806040838503121562000096578182fd5b620000a18362000066565b9150620000b16020840162000066565b90509250929050565b611cb280620000ca6000396000f3fe6080604052600436106100e85760003560e01c80638f4ed3331161008a578063d614cdb811610059578063d614cdb814610248578063df4ec24914610276578063f2c31ff41461028b578063fb5d7376146102c557600080fd5b80638f4ed333146101de5780638f8d7f99146101f3578063af99c63314610213578063d40a71fb1461023357600080fd5b80634fb4bcec116100c65780634fb4bcec14610156578063593d6e821461016b5780636fc3cbaf1461018b5780637c41ad2c146101be57600080fd5b80633b3bff0f146100ed5780633c4dd32e1461012057806344ac2d481461014e575b600080fd5b3480156100f957600080fd5b5061010d610108366004611246565b6102da565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b5061014061013b3660046114af565b6103b4565b604051610117929190611a01565b61010d61049b565b34801561016257600080fd5b5061010d610661565b34801561017757600080fd5b5061010d610186366004611434565b61069c565b34801561019757600080fd5b506101ab6101a636600461129a565b610779565b60405160079190910b8152602001610117565b3480156101ca57600080fd5b5061010d6101d9366004611246565b6107a5565b3480156101ea57600080fd5b5061010d6107d3565b3480156101ff57600080fd5b506101ab61020e366004611262565b61080b565b34801561021f57600080fd5b506101ab61022e366004611262565b610841565b34801561023f57600080fd5b5061010d610877565b34801561025457600080fd5b50610268610263366004611246565b6108ab565b6040516101179291906119ed565b34801561028257600080fd5b5061010d6109ba565b34801561029757600080fd5b506102ab6102a6366004611262565b610a38565b6040805160079390930b8352901515602083015201610117565b3480156102d157600080fd5b5061010d610b03565b6040516001600160a01b03821660248201526000908190819061016790633b3bff0f60e01b906044015b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161034291906118a4565b6000604051808303816000865af19150503d806000811461037f576040519150601f19603f3d011682016040523d82523d6000602084013e610384565b606091505b5091509150816103955760156103a9565b808060200190518101906103a991906114da565b60030b949350505050565b60006103be611104565b604080516001600160a01b0386166024820152604480820186905282518083039091018152606490910182526020810180516001600160e01b0316631e26e99760e11b1790529051600091829161016791610418916118a4565b6000604051808303816000865af19150503d8060008114610455576040519150601f19603f3d011682016040523d82523d6000602084013e61045a565b606091505b5091509150610467611104565b8261047457601581610488565b8180602001905181019061048891906115b3565b60039190910b9890975095505050505050565b600080546001600160a01b031633146104b357600080fd5b604080516001808252818301909252600091816020015b6104d2611147565b8152602001906001900390816104ca57505060408051602081019091526000815290915061050590605d90600190610b53565b8160008151811061052657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101919091526040805161016081018252601661012082019081527522bc30b6b8363290233ab733b4b13632903a37b5b2b760511b6101408301528152815180830183526001808252604560f81b828601528285019190915230828401528251808401845260048152636d656d6f60e01b81860152606080840191909152608083018290526103e860a0840152600060c0840181905260e084018790529154845191820185529181526001600160a01b0390911693810193909352626acfc0918301919091526106089161010082015260646000610b82565b600280546001600160a01b039283166001600160a01b031990911617905560008054604051939550909116914780156108fc0292909190818181858888f1935050505015801561065c573d6000803e3d6000fd5b505090565b600080546001600160a01b0316331461067957600080fd5b600254600154610697916001600160a01b0390811691166000610cb0565b905090565b60008060006101676001600160a01b031663593d6e8260e01b86866040516024016106c89291906118e4565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161070691906118a4565b6000604051808303816000865af19150503d8060008114610743576040519150601f19603f3d011682016040523d82523d6000602084013e610748565b606091505b50915091508161075957601561076d565b8080602001905181019061076d91906114da565b60030b95945050505050565b60008060006101676001600160a01b0316636fc3cbaf60e01b86866040516024016106c89291906118c0565b6040516001600160a01b03821660248201526000908190819061016790631f106b4b60e21b90604401610304565b600080546001600160a01b031633146107eb57600080fd5b600254600154610697916001600160a01b03908116913091166000610d91565b6040516001600160a01b038381166024830152821660448201526000908190819061016790638f8d7f9960e01b906064016106c8565b6040516001600160a01b03838116602483015282166044820152600090819081906101679063af99c63360e01b906064016106c8565b600080546001600160a01b0316331461088f57600080fd5b600154600254610697916001600160a01b039081169116610e79565b604080516060810182526000808252602080830182905282840182905283516001600160a01b038616602480830191909152855180830390910181526044909101855290810180516001600160e01b0316631ac299b760e31b17905292519092839182916101679161091d91906118a4565b6000604051808303816000865af19150503d806000811461095a576040519150601f19603f3d011682016040523d82523d6000602084013e61095f565b606091505b5091509150610987604080516060810182526000808252602082018190529181019190915290565b82610994576015816109a8565b818060200190518101906109a8919061154a565b60039190910b97909650945050505050565b600080546001600160a01b031633146109d257600080fd5b600254604080516000808252602082019092529091606091610a1b916001600160a01b031690849081610a15565b6060815260200190600190039081610a005790505b50610eaf565b9194509250905060646001600160401b0383161461065c57600080fd5b604080516001600160a01b038481166024830152831660448083019190915282518083039091018152606490910182526020810180516001600160e01b0316633cb0c7fd60e21b179052905160009182918291829161016791610a9a916118a4565b6000604051808303816000865af19150503d8060008114610ad7576040519150601f19603f3d011682016040523d82523d6000602084013e610adc565b606091505b509150915081610aef57601560006109a8565b808060200190518101906109a8919061151f565b600080546001600160a01b03163314610b1b57600080fd5b600254600090606090610b38906001600160a01b03168383610fad565b909350915060646001600160401b0383161461065c57600080fd5b610b5b611147565b6040518060400160405280858152602001610b7885856000611083565b9052949350505050565b600080848061010001516000015163ffffffff166000148015610bb257506101008101516040015163ffffffff16155b15610bc8576101008101516276a7006040909101525b6000806101676001600160a01b031634637812a04b60e01b8a8a8a604051602401610bf593929190611a1d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610c3391906118a4565b60006040518083038185875af1925050503d8060008114610c70576040519150601f19603f3d011682016040523d82523d6000602084013e610c75565b606091505b509150915081610c885760156000610c9c565b80806020019051810190610c9c91906114f4565b60039190910b999098509650505050505050565b604080516001600160a01b0385811660248301528416604482015263ffffffff831660648083019190915282518083039091018152608490910182526020810180516001600160e01b0316639790686d60e01b17905290516000918291829161016791610d1d91906118a4565b6000604051808303816000865af19150503d8060008114610d5a576040519150601f19603f3d011682016040523d82523d6000602084013e610d5f565b606091505b509150915081610d70576015610d84565b80806020019051810190610d8491906114da565b60030b9695505050505050565b604080516001600160a01b038681166024830152858116604483015284166064820152600783900b6084808301919091528251808303909101815260a490910182526020810180516001600160e01b031663eca3691760e01b17905290516000918291829161016791610e0491906118a4565b6000604051808303816000865af19150503d8060008114610e41576040519150601f19603f3d011682016040523d82523d6000602084013e610e46565b606091505b509150915081610e57576015610e6b565b80806020019051810190610e6b91906114da565b60030b979650505050505050565b6040516001600160a01b03838116602483015282166044820152600090819081906101679063248a35ef60e11b906064016106c8565b60008060606000806101676001600160a01b031663278e0b8860e01b898989604051602401610ee093929190611901565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610f1e91906118a4565b6000604051808303816000865af19150503d8060008114610f5b576040519150601f19603f3d011682016040523d82523d6000602084013e610f60565b606091505b509150915081610f83576040805160008082526020820190925260159190610f97565b80806020019051810190610f9791906116b8565b60039290920b9a90995090975095505050505050565b6000806000806101676001600160a01b031663acb9cff960e01b888888604051602401610fdc93929190611982565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161101a91906118a4565b6000604051808303816000865af19150503d8060008114611057576040519150601f19603f3d011682016040523d82523d6000602084013e61105c565b606091505b50915091508161106f5760156000610488565b808060200190518101906104889190611686565b61108b611104565b600184141561109d57600181526110fd565b60028414156110ba576001600160a01b03821660208201526110fd565b60038414156110cf57604081018390526110fd565b60048414156110e457606081018390526110fd565b60058414156110fd576001600160a01b03821660808201525b9392505050565b6040518060a0016040528060001515815260200160006001600160a01b03168152602001606081526020016060815260200160006001600160a01b031681525090565b604051806040016040528060008152602001611161611104565b905290565b803561117181611c44565b919050565b805161117181611c44565b600082601f830112611191578081fd5b81356111a461119f82611bd7565b611b84565b8181528460208386010111156111b8578283fd5b816020850160208301379081016020019190915292915050565b600082601f8301126111e2578081fd5b81516111f061119f82611bd7565b818152846020838601011115611204578283fd5b611215826020830160208701611bfe565b949350505050565b8051600381900b811461117157600080fd5b80516001600160401b038116811461117157600080fd5b600060208284031215611257578081fd5b81356110fd81611c44565b60008060408385031215611274578081fd5b823561127f81611c44565b9150602083013561128f81611c44565b809150509250929050565b600080604083850312156112ac578182fd5b6112b68335611c44565b823591506001600160401b0380602085013511156112d2578182fd5b6020840135840185601f8201126112e7578283fd5b6112f461119f8235611bb4565b808235825260208201915060208301886020853560051b8601011115611318578586fd5b855b8435811015611425578582351115611330578687fd5b81358501601f196040828d0382011215611348578889fd5b611350611b18565b60208301358152604083013589811115611368578a8bfd5b929092019160a0838e038301121561137e57898afd5b611386611b40565b9150602083013561139681611c5c565b82526113a460408401611166565b60208301526060830135898111156113ba578a8bfd5b6113c98e602083870101611181565b60408401525088608084013511156113df57898afd5b6113f28d60206080860135860101611181565b606083015261140360a08401611166565b608083015260208181019290925286529485019492909201915060010161131a565b50959890975095505050505050565b6000808284036080811215611447578283fd5b833561145281611c44565b92506060601f1982011215611465578182fd5b5061146e611b62565b602084013561147c81611c6a565b8152604084013561148c81611c44565b6020820152606084013561149f81611c6a565b6040820152919491935090915050565b600080604083850312156114c1578182fd5b82356114cc81611c44565b946020939093013593505050565b6000602082840312156114eb578081fd5b6110fd8261121d565b60008060408385031215611506578182fd5b61150f8361121d565b9150602083015161128f81611c44565b60008060408385031215611531578182fd5b61153a8361121d565b9150602083015161128f81611c5c565b600080828403608081121561155d578283fd5b6115668461121d565b92506060601f1982011215611579578182fd5b50611582611b62565b602084015161159081611c6a565b815260408401516115a081611c44565b6020820152606084015161149f81611c6a565b600080604083850312156115c5578182fd5b6115ce8361121d565b915060208301516001600160401b03808211156115e9578283fd5b9084019060a082870312156115fc578283fd5b611604611b40565b825161160f81611c5c565b815261161d60208401611176565b6020820152604083015182811115611633578485fd5b61163f888286016111d2565b604083015250606083015182811115611656578485fd5b611662888286016111d2565b60608301525061167460808401611176565b60808201528093505050509250929050565b60008060408385031215611698578182fd5b6116a18361121d565b91506116af6020840161122f565b90509250929050565b6000806000606084860312156116cc578081fd5b6116d58461121d565b925060206116e481860161122f565b925060408501516001600160401b038111156116fe578283fd5b8501601f8101871361170e578283fd5b805161171c61119f82611bb4565b8082825284820191508484018a868560051b870101111561173b578687fd5b8694505b8385101561176b5780518060070b8114611757578788fd5b83526001949094019391850191850161173f565b5080955050505050509250925092565b600081518084526020808501808196508360051b81019150828601855b858110156117d657828403895281518051855285015160408686018190526117c28187018361183a565b9a87019a9550505090840190600101611798565b5091979650505050505050565b600081518084526117fb816020860160208601611bfe565b601f01601f19169290920160200192915050565b805163ffffffff90811683526020808301516001600160a01b03169084015260409182015116910152565b8051151582526000602082015160018060a01b0380821660208601526040840151915060a0604086015261187160a08601836117e3565b91506060840151858303606087015261188a83826117e3565b925050806080850151166080860152508091505092915050565b600082516118b6818460208701611bfe565b9190910192915050565b6001600160a01b03831681526040602082018190526000906112159083018461177b565b6001600160a01b0383168152608081016110fd602083018461180f565b60006060820160018060a01b038616835260206001600160401b038616818501526060604085015281855180845260808601915060808160051b8701019350828701855b8281101561197357607f198887030184526119618683516117e3565b95509284019290840190600101611945565b50939998505050505050505050565b6001600160a01b03841681526001600160401b0383166020808301919091526060604083018190528351908301819052600091848101916080850190845b818110156119df57845160070b835293830193918301916001016119c0565b509098975050505050505050565b828152608081016110fd602083018461180f565b8260070b8152604060208201526000611215604083018461183a565b6060815260008451610160806060850152611a3c6101c08501836117e3565b91506020870151605f1980868503016080870152611a5a84836117e3565b935060408901519150611a7860a08701836001600160a01b03169052565b60608901519150808685030160c0870152611a9384836117e3565b935060808901519150611aaa60e087018315159052565b60a08901519150610100611ac58188018463ffffffff169052565b60c08a0151151561012088015260e08a015187860383016101408901529250611aee858461177b565b9450808a015192505050611b048286018261180f565b505060208301949094525060400152919050565b604080519081016001600160401b0381118282101715611b3a57611b3a611c2e565b60405290565b60405160a081016001600160401b0381118282101715611b3a57611b3a611c2e565b604051606081016001600160401b0381118282101715611b3a57611b3a611c2e565b604051601f8201601f191681016001600160401b0381118282101715611bac57611bac611c2e565b604052919050565b60006001600160401b03821115611bcd57611bcd611c2e565b5060051b60200190565b60006001600160401b03821115611bf057611bf0611c2e565b50601f01601f191660200190565b60005b83811015611c19578181015183820152602001611c01565b83811115611c28576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611c5957600080fd5b50565b8015158114611c5957600080fd5b63ffffffff81168114611c5957600080fdfea26469706673582212204ebf4993dc340cedf556b9b06b4ddaa31b7889a60dc7aba2ea3905fb328b3e3664736f6c63430008040033", - "deployedBytecode": "0x6080604052600436106100e85760003560e01c80638f4ed3331161008a578063d614cdb811610059578063d614cdb814610248578063df4ec24914610276578063f2c31ff41461028b578063fb5d7376146102c557600080fd5b80638f4ed333146101de5780638f8d7f99146101f3578063af99c63314610213578063d40a71fb1461023357600080fd5b80634fb4bcec116100c65780634fb4bcec14610156578063593d6e821461016b5780636fc3cbaf1461018b5780637c41ad2c146101be57600080fd5b80633b3bff0f146100ed5780633c4dd32e1461012057806344ac2d481461014e575b600080fd5b3480156100f957600080fd5b5061010d610108366004611246565b6102da565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b5061014061013b3660046114af565b6103b4565b604051610117929190611a01565b61010d61049b565b34801561016257600080fd5b5061010d610661565b34801561017757600080fd5b5061010d610186366004611434565b61069c565b34801561019757600080fd5b506101ab6101a636600461129a565b610779565b60405160079190910b8152602001610117565b3480156101ca57600080fd5b5061010d6101d9366004611246565b6107a5565b3480156101ea57600080fd5b5061010d6107d3565b3480156101ff57600080fd5b506101ab61020e366004611262565b61080b565b34801561021f57600080fd5b506101ab61022e366004611262565b610841565b34801561023f57600080fd5b5061010d610877565b34801561025457600080fd5b50610268610263366004611246565b6108ab565b6040516101179291906119ed565b34801561028257600080fd5b5061010d6109ba565b34801561029757600080fd5b506102ab6102a6366004611262565b610a38565b6040805160079390930b8352901515602083015201610117565b3480156102d157600080fd5b5061010d610b03565b6040516001600160a01b03821660248201526000908190819061016790633b3bff0f60e01b906044015b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161034291906118a4565b6000604051808303816000865af19150503d806000811461037f576040519150601f19603f3d011682016040523d82523d6000602084013e610384565b606091505b5091509150816103955760156103a9565b808060200190518101906103a991906114da565b60030b949350505050565b60006103be611104565b604080516001600160a01b0386166024820152604480820186905282518083039091018152606490910182526020810180516001600160e01b0316631e26e99760e11b1790529051600091829161016791610418916118a4565b6000604051808303816000865af19150503d8060008114610455576040519150601f19603f3d011682016040523d82523d6000602084013e61045a565b606091505b5091509150610467611104565b8261047457601581610488565b8180602001905181019061048891906115b3565b60039190910b9890975095505050505050565b600080546001600160a01b031633146104b357600080fd5b604080516001808252818301909252600091816020015b6104d2611147565b8152602001906001900390816104ca57505060408051602081019091526000815290915061050590605d90600190610b53565b8160008151811061052657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101919091526040805161016081018252601661012082019081527522bc30b6b8363290233ab733b4b13632903a37b5b2b760511b6101408301528152815180830183526001808252604560f81b828601528285019190915230828401528251808401845260048152636d656d6f60e01b81860152606080840191909152608083018290526103e860a0840152600060c0840181905260e084018790529154845191820185529181526001600160a01b0390911693810193909352626acfc0918301919091526106089161010082015260646000610b82565b600280546001600160a01b039283166001600160a01b031990911617905560008054604051939550909116914780156108fc0292909190818181858888f1935050505015801561065c573d6000803e3d6000fd5b505090565b600080546001600160a01b0316331461067957600080fd5b600254600154610697916001600160a01b0390811691166000610cb0565b905090565b60008060006101676001600160a01b031663593d6e8260e01b86866040516024016106c89291906118e4565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161070691906118a4565b6000604051808303816000865af19150503d8060008114610743576040519150601f19603f3d011682016040523d82523d6000602084013e610748565b606091505b50915091508161075957601561076d565b8080602001905181019061076d91906114da565b60030b95945050505050565b60008060006101676001600160a01b0316636fc3cbaf60e01b86866040516024016106c89291906118c0565b6040516001600160a01b03821660248201526000908190819061016790631f106b4b60e21b90604401610304565b600080546001600160a01b031633146107eb57600080fd5b600254600154610697916001600160a01b03908116913091166000610d91565b6040516001600160a01b038381166024830152821660448201526000908190819061016790638f8d7f9960e01b906064016106c8565b6040516001600160a01b03838116602483015282166044820152600090819081906101679063af99c63360e01b906064016106c8565b600080546001600160a01b0316331461088f57600080fd5b600154600254610697916001600160a01b039081169116610e79565b604080516060810182526000808252602080830182905282840182905283516001600160a01b038616602480830191909152855180830390910181526044909101855290810180516001600160e01b0316631ac299b760e31b17905292519092839182916101679161091d91906118a4565b6000604051808303816000865af19150503d806000811461095a576040519150601f19603f3d011682016040523d82523d6000602084013e61095f565b606091505b5091509150610987604080516060810182526000808252602082018190529181019190915290565b82610994576015816109a8565b818060200190518101906109a8919061154a565b60039190910b97909650945050505050565b600080546001600160a01b031633146109d257600080fd5b600254604080516000808252602082019092529091606091610a1b916001600160a01b031690849081610a15565b6060815260200190600190039081610a005790505b50610eaf565b9194509250905060646001600160401b0383161461065c57600080fd5b604080516001600160a01b038481166024830152831660448083019190915282518083039091018152606490910182526020810180516001600160e01b0316633cb0c7fd60e21b179052905160009182918291829161016791610a9a916118a4565b6000604051808303816000865af19150503d8060008114610ad7576040519150601f19603f3d011682016040523d82523d6000602084013e610adc565b606091505b509150915081610aef57601560006109a8565b808060200190518101906109a8919061151f565b600080546001600160a01b03163314610b1b57600080fd5b600254600090606090610b38906001600160a01b03168383610fad565b909350915060646001600160401b0383161461065c57600080fd5b610b5b611147565b6040518060400160405280858152602001610b7885856000611083565b9052949350505050565b600080848061010001516000015163ffffffff166000148015610bb257506101008101516040015163ffffffff16155b15610bc8576101008101516276a7006040909101525b6000806101676001600160a01b031634637812a04b60e01b8a8a8a604051602401610bf593929190611a1d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610c3391906118a4565b60006040518083038185875af1925050503d8060008114610c70576040519150601f19603f3d011682016040523d82523d6000602084013e610c75565b606091505b509150915081610c885760156000610c9c565b80806020019051810190610c9c91906114f4565b60039190910b999098509650505050505050565b604080516001600160a01b0385811660248301528416604482015263ffffffff831660648083019190915282518083039091018152608490910182526020810180516001600160e01b0316639790686d60e01b17905290516000918291829161016791610d1d91906118a4565b6000604051808303816000865af19150503d8060008114610d5a576040519150601f19603f3d011682016040523d82523d6000602084013e610d5f565b606091505b509150915081610d70576015610d84565b80806020019051810190610d8491906114da565b60030b9695505050505050565b604080516001600160a01b038681166024830152858116604483015284166064820152600783900b6084808301919091528251808303909101815260a490910182526020810180516001600160e01b031663eca3691760e01b17905290516000918291829161016791610e0491906118a4565b6000604051808303816000865af19150503d8060008114610e41576040519150601f19603f3d011682016040523d82523d6000602084013e610e46565b606091505b509150915081610e57576015610e6b565b80806020019051810190610e6b91906114da565b60030b979650505050505050565b6040516001600160a01b03838116602483015282166044820152600090819081906101679063248a35ef60e11b906064016106c8565b60008060606000806101676001600160a01b031663278e0b8860e01b898989604051602401610ee093929190611901565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610f1e91906118a4565b6000604051808303816000865af19150503d8060008114610f5b576040519150601f19603f3d011682016040523d82523d6000602084013e610f60565b606091505b509150915081610f83576040805160008082526020820190925260159190610f97565b80806020019051810190610f9791906116b8565b60039290920b9a90995090975095505050505050565b6000806000806101676001600160a01b031663acb9cff960e01b888888604051602401610fdc93929190611982565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161101a91906118a4565b6000604051808303816000865af19150503d8060008114611057576040519150601f19603f3d011682016040523d82523d6000602084013e61105c565b606091505b50915091508161106f5760156000610488565b808060200190518101906104889190611686565b61108b611104565b600184141561109d57600181526110fd565b60028414156110ba576001600160a01b03821660208201526110fd565b60038414156110cf57604081018390526110fd565b60048414156110e457606081018390526110fd565b60058414156110fd576001600160a01b03821660808201525b9392505050565b6040518060a0016040528060001515815260200160006001600160a01b03168152602001606081526020016060815260200160006001600160a01b031681525090565b604051806040016040528060008152602001611161611104565b905290565b803561117181611c44565b919050565b805161117181611c44565b600082601f830112611191578081fd5b81356111a461119f82611bd7565b611b84565b8181528460208386010111156111b8578283fd5b816020850160208301379081016020019190915292915050565b600082601f8301126111e2578081fd5b81516111f061119f82611bd7565b818152846020838601011115611204578283fd5b611215826020830160208701611bfe565b949350505050565b8051600381900b811461117157600080fd5b80516001600160401b038116811461117157600080fd5b600060208284031215611257578081fd5b81356110fd81611c44565b60008060408385031215611274578081fd5b823561127f81611c44565b9150602083013561128f81611c44565b809150509250929050565b600080604083850312156112ac578182fd5b6112b68335611c44565b823591506001600160401b0380602085013511156112d2578182fd5b6020840135840185601f8201126112e7578283fd5b6112f461119f8235611bb4565b808235825260208201915060208301886020853560051b8601011115611318578586fd5b855b8435811015611425578582351115611330578687fd5b81358501601f196040828d0382011215611348578889fd5b611350611b18565b60208301358152604083013589811115611368578a8bfd5b929092019160a0838e038301121561137e57898afd5b611386611b40565b9150602083013561139681611c5c565b82526113a460408401611166565b60208301526060830135898111156113ba578a8bfd5b6113c98e602083870101611181565b60408401525088608084013511156113df57898afd5b6113f28d60206080860135860101611181565b606083015261140360a08401611166565b608083015260208181019290925286529485019492909201915060010161131a565b50959890975095505050505050565b6000808284036080811215611447578283fd5b833561145281611c44565b92506060601f1982011215611465578182fd5b5061146e611b62565b602084013561147c81611c6a565b8152604084013561148c81611c44565b6020820152606084013561149f81611c6a565b6040820152919491935090915050565b600080604083850312156114c1578182fd5b82356114cc81611c44565b946020939093013593505050565b6000602082840312156114eb578081fd5b6110fd8261121d565b60008060408385031215611506578182fd5b61150f8361121d565b9150602083015161128f81611c44565b60008060408385031215611531578182fd5b61153a8361121d565b9150602083015161128f81611c5c565b600080828403608081121561155d578283fd5b6115668461121d565b92506060601f1982011215611579578182fd5b50611582611b62565b602084015161159081611c6a565b815260408401516115a081611c44565b6020820152606084015161149f81611c6a565b600080604083850312156115c5578182fd5b6115ce8361121d565b915060208301516001600160401b03808211156115e9578283fd5b9084019060a082870312156115fc578283fd5b611604611b40565b825161160f81611c5c565b815261161d60208401611176565b6020820152604083015182811115611633578485fd5b61163f888286016111d2565b604083015250606083015182811115611656578485fd5b611662888286016111d2565b60608301525061167460808401611176565b60808201528093505050509250929050565b60008060408385031215611698578182fd5b6116a18361121d565b91506116af6020840161122f565b90509250929050565b6000806000606084860312156116cc578081fd5b6116d58461121d565b925060206116e481860161122f565b925060408501516001600160401b038111156116fe578283fd5b8501601f8101871361170e578283fd5b805161171c61119f82611bb4565b8082825284820191508484018a868560051b870101111561173b578687fd5b8694505b8385101561176b5780518060070b8114611757578788fd5b83526001949094019391850191850161173f565b5080955050505050509250925092565b600081518084526020808501808196508360051b81019150828601855b858110156117d657828403895281518051855285015160408686018190526117c28187018361183a565b9a87019a9550505090840190600101611798565b5091979650505050505050565b600081518084526117fb816020860160208601611bfe565b601f01601f19169290920160200192915050565b805163ffffffff90811683526020808301516001600160a01b03169084015260409182015116910152565b8051151582526000602082015160018060a01b0380821660208601526040840151915060a0604086015261187160a08601836117e3565b91506060840151858303606087015261188a83826117e3565b925050806080850151166080860152508091505092915050565b600082516118b6818460208701611bfe565b9190910192915050565b6001600160a01b03831681526040602082018190526000906112159083018461177b565b6001600160a01b0383168152608081016110fd602083018461180f565b60006060820160018060a01b038616835260206001600160401b038616818501526060604085015281855180845260808601915060808160051b8701019350828701855b8281101561197357607f198887030184526119618683516117e3565b95509284019290840190600101611945565b50939998505050505050505050565b6001600160a01b03841681526001600160401b0383166020808301919091526060604083018190528351908301819052600091848101916080850190845b818110156119df57845160070b835293830193918301916001016119c0565b509098975050505050505050565b828152608081016110fd602083018461180f565b8260070b8152604060208201526000611215604083018461183a565b6060815260008451610160806060850152611a3c6101c08501836117e3565b91506020870151605f1980868503016080870152611a5a84836117e3565b935060408901519150611a7860a08701836001600160a01b03169052565b60608901519150808685030160c0870152611a9384836117e3565b935060808901519150611aaa60e087018315159052565b60a08901519150610100611ac58188018463ffffffff169052565b60c08a0151151561012088015260e08a015187860383016101408901529250611aee858461177b565b9450808a015192505050611b048286018261180f565b505060208301949094525060400152919050565b604080519081016001600160401b0381118282101715611b3a57611b3a611c2e565b60405290565b60405160a081016001600160401b0381118282101715611b3a57611b3a611c2e565b604051606081016001600160401b0381118282101715611b3a57611b3a611c2e565b604051601f8201601f191681016001600160401b0381118282101715611bac57611bac611c2e565b604052919050565b60006001600160401b03821115611bcd57611bcd611c2e565b5060051b60200190565b60006001600160401b03821115611bf057611bf0611c2e565b50601f01601f191660200190565b60005b83811015611c19578181015183820152602001611c01565b83811115611c28576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611c5957600080fd5b50565b8015158114611c5957600080fd5b63ffffffff81168114611c5957600080fdfea26469706673582212204ebf4993dc340cedf556b9b06b4ddaa31b7889a60dc7aba2ea3905fb328b3e3664736f6c63430008040033", - "linkReferences": {}, - "deployedLinkReferences": {} + ], + "bytecode": "60806040523480156200001157600080fd5b5060405162002e2338038062002e23833981810160405281019062000037919062000304565b60018060008060068111156200005257620000516200034b565b5b60068111156200006757620000666200034b565b5b815260200190815260200160002081905550600260016000600160068111156200009657620000956200034b565b5b6006811115620000ab57620000aa6200034b565b5b81526020019081526020016000208190555060046001600060026006811115620000da57620000d96200034b565b5b6006811115620000ef57620000ee6200034b565b5b815260200190815260200160002081905550600860016000600360068111156200011e576200011d6200034b565b5b60068111156200013357620001326200034b565b5b815260200190815260200160002081905550601060016000600460068111156200016257620001616200034b565b5b60068111156200017757620001766200034b565b5b81526020019081526020016000208190555060206001600060056006811115620001a657620001a56200034b565b5b6006811115620001bb57620001ba6200034b565b5b815260200190815260200160002081905550604060016000600680811115620001e957620001e86200034b565b5b6006811115620001fe57620001fd6200034b565b5b81526020019081526020016000208190555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506200037a565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002cc826200029f565b9050919050565b620002de81620002bf565b8114620002ea57600080fd5b50565b600081519050620002fe81620002d3565b92915050565b600080604083850312156200031e576200031d6200029a565b5b60006200032e85828601620002ed565b92505060206200034185828601620002ed565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b612a99806200038a6000396000f3fe6080604052600436106100915760003560e01c80639b23d3d9116100595780639b23d3d914610186578063d40a71fb146101c3578063d83bf9a1146101ee578063df4ec24914610219578063fb5d73761461024457610091565b806315dacbea1461009657806344ac2d48146100d35780634fb4bcec146100f2578063618dc65e1461011d5780638f4ed3331461015b575b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b89190611ad9565b61026f565b6040516100ca9190611b5c565b60405180910390f35b6100db61038d565b6040516100e9929190611b9f565b60405180910390f35b3480156100fe57600080fd5b50610107610727565b6040516101149190611bc8565b60405180910390f35b34801561012957600080fd5b50610144600480360381019061013f9190611d29565b6107d8565b604051610152929190611e04565b60405180910390f35b34801561016757600080fd5b50610170610945565b60405161017d9190611bc8565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190611ad9565b6109f7565b6040516101ba9190611b5c565b60405180910390f35b3480156101cf57600080fd5b506101d8610b15565b6040516101e59190611bc8565b60405180910390f35b3480156101fa57600080fd5b50610203610bc4565b6040516102109190611e4d565b60405180910390f35b34801561022557600080fd5b5061022e610cfc565b60405161023b9190611bc8565b60405180910390f35b34801561025057600080fd5b50610259610de8565b6040516102669190611bc8565b60405180910390f35b600080600061016773ffffffffffffffffffffffffffffffffffffffff166315dacbea60e01b888888886040516024016102ac9493929190611e77565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516103169190611ef8565b6000604051808303816000865af19150503d8060008114610353576040519150601f19603f3d011682016040523d82523d6000602084013e610358565b606091505b50915091508161036957601561037e565b8080602001905181019061037d9190611f48565b5b60030b92505050949350505050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103ea57600080fd5b6000600467ffffffffffffffff81111561040757610406611bfe565b5b60405190808252806020026020018201604052801561044057816020015b61042d611977565b8152602001906001900390816104255790505b50905061046160006006600060405180602001604052806000815250610ec8565b8160008151811061047557610474611f75565b5b602002602001018190525061049c6002600060405180602001604052806000815250610f01565b816001815181106104b0576104af611f75565b5b60200260200101819052506104d76003600060405180602001604052806000815250610f01565b816002815181106104eb576104ea611f75565b5b60200260200101819052506105126004600060405180602001604052806000815250610f01565b8160038151811061052657610525611f75565b5b60200260200101819052506106496040518061012001604052806040518060400160405280601681526020017f4578616d706c652046756e6769626c6520746f6b656e0000000000000000000081525081526020016040518060400160405280600181526020017f450000000000000000000000000000000000000000000000000000000000000081525081526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600481526020017f6d656d6f0000000000000000000000000000000000000000000000000000000081525081526020016001151581526020016103e860070b815260200160001515815260200183815260200161063d30626acfc0610f38565b81525060646000610f90565b600460008291906101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508194505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156106f9573d6000803e3d6000fd5b5082600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692509250509091565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461078357600080fd5b6107d3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000611106565b905090565b6000606060008061016773ffffffffffffffffffffffffffffffffffffffff1663618dc65e60e01b8787604051602401610813929190611fa4565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161087d9190611ef8565b6000604051808303816000865af19150503d80600081146108ba576040519150601f19603f3d011682016040523d82523d6000602084013e6108bf565b606091505b50915091507f4af4780e06fe8cb9df64b0794fa6f01399af979175bb988e35e0e57e594567bc82826040516108f5929190611fef565b60405180910390a1816109195760156040518060200160405280600081525061092e565b8080602001905181019061092d919061208f565b5b8160030b9150809450819550505050509250929050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a157600080fd5b6109f2600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000611221565b905090565b600080600061016773ffffffffffffffffffffffffffffffffffffffff16639b23d3d960e01b88888888604051602401610a349493929190611e77565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610a9e9190611ef8565b6000604051808303816000865af19150503d8060008114610adb576040519150601f19603f3d011682016040523d82523d6000602084013e610ae0565b606091505b509150915081610af1576015610b06565b80806020019051810190610b059190611f48565b5b60030b92505050949350505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b7157600080fd5b610bbf600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661133f565b905090565b600080600061016973ffffffffffffffffffffffffffffffffffffffff1663d83bf9a160e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c5a9190611ef8565b6000604051808303816000865af19150503d8060008114610c97576040519150601f19603f3d011682016040523d82523d6000602084013e610c9c565b606091505b509150915081610ce1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd890612148565b60405180910390fd5b80806020019051810190610cf59190612194565b9250505090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d5857600080fd5b60006060610dd7600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008067ffffffffffffffff811115610d9e57610d9d611bfe565b5b604051908082528060200260200182016040528015610dd157816020015b6060815260200190600190039081610dbc5790505b50611457565b809350819450829550505050505090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e4457600080fd5b6000610ebc600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008067ffffffffffffffff811115610e8857610e87611bfe565b5b604051908082528060200260200182016040528015610eb65781602001602082028036833780820191505090505b506115cf565b80925081935050505090565b610ed0611977565b6040518060400160405280610ee587876116f7565b8152602001610ef4858561174d565b8152509050949350505050565b610f09611977565b6040518060400160405280610f1d86611922565b8152602001610f2c858561174d565b81525090509392505050565b610f40611997565b82816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081816040019060070b908160070b8152505092915050565b6000808460008161010001516000015160070b148015610fbc575060008161010001516040015160070b145b15610fdf576276a70060030b8161010001516040019060070b908160070b815250505b60008061016773ffffffffffffffffffffffffffffffffffffffff1634630fb65bf360e01b8a8a8a60405160240161101993929190612543565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516110839190611ef8565b60006040518083038185875af1925050503d80600081146110c0576040519150601f19603f3d011682016040523d82523d6000602084013e6110c5565b606091505b5091509150816110d857601560006110ed565b808060200190518101906110ec91906125bf565b5b8160030b91508095508196505050505050935093915050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663efef57f960e01b878787604051602401611141939291906125ff565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516111ab9190611ef8565b6000604051808303816000865af19150503d80600081146111e8576040519150601f19603f3d011682016040523d82523d6000602084013e6111ed565b606091505b5091509150816111fe576015611213565b808060200190518101906112129190611f48565b5b60030b925050509392505050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff1663eca3691760e01b8888888860405160240161125e9493929190612636565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516112c89190611ef8565b6000604051808303816000865af19150503d8060008114611305576040519150601f19603f3d011682016040523d82523d6000602084013e61130a565b606091505b50915091508161131b576015611330565b8080602001905181019061132f9190611f48565b5b60030b92505050949350505050565b600080600061016773ffffffffffffffffffffffffffffffffffffffff166349146bde60e01b868660405160240161137892919061267b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516113e29190611ef8565b6000604051808303816000865af19150503d806000811461141f576040519150601f19603f3d011682016040523d82523d6000602084013e611424565b606091505b50915091508161143557601561144a565b808060200190518101906114499190611f48565b5b60030b9250505092915050565b600080606060008061016773ffffffffffffffffffffffffffffffffffffffff1663e0f4059a60e01b89898960405160240161149593929190612766565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516114ff9190611ef8565b6000604051808303816000865af19150503d806000811461153c576040519150601f19603f3d011682016040523d82523d6000602084013e611541565b606091505b50915091508161159d57601560008067ffffffffffffffff81111561156957611568611bfe565b5b6040519080825280602002602001820160405280156115975781602001602082028036833780820191505090505b506115b2565b808060200190518101906115b19190612898565b5b8260030b9250809550819650829750505050505093509350939050565b60008060008061016773ffffffffffffffffffffffffffffffffffffffff1663d6910d0660e01b88888860405160240161160b939291906129b6565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516116759190611ef8565b6000604051808303816000865af19150503d80600081146116b2576040519150601f19603f3d011682016040523d82523d6000602084013e6116b7565b606091505b5091509150816116ca57601560006116df565b808060200190518101906116de91906129f4565b5b8160030b915080945081955050505050935093915050565b600061171e83600681111561170f5761170e612a34565b5b8261196390919063ffffffff16565b905061174582600681111561173657611735612a34565b5b8261196390919063ffffffff16565b905092915050565b6117556119d4565b6000600481111561176957611768612a34565b5b83600481111561177c5761177b612a34565b5b0361179757600181600001901515908115158152505061191c565b600160048111156117ab576117aa612a34565b5b8360048111156117be576117bd612a34565b5b036118205760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061191b565b6002600481111561183457611833612a34565b5b83600481111561184757611846612a34565b5b0361185a5781816040018190525061191a565b6003600481111561186e5761186d612a34565b5b83600481111561188157611880612a34565b5b0361189457818160600181905250611919565b6004808111156118a7576118a6612a34565b5b8360048111156118ba576118b9612a34565b5b036119185760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b5b5b5b5b92915050565b60006001600083600681111561193b5761193a612a34565b5b600681111561194d5761194c612a34565b5b8152602001908152602001600020549050919050565b60008160ff166001901b8317905092915050565b6040518060400160405280600081526020016119916119d4565b81525090565b6040518060600160405280600060070b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600060070b81525090565b6040518060a00160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a7082611a45565b9050919050565b611a8081611a65565b8114611a8b57600080fd5b50565b600081359050611a9d81611a77565b92915050565b6000819050919050565b611ab681611aa3565b8114611ac157600080fd5b50565b600081359050611ad381611aad565b92915050565b60008060008060808587031215611af357611af2611a3b565b5b6000611b0187828801611a8e565b9450506020611b1287828801611a8e565b9350506040611b2387828801611a8e565b9250506060611b3487828801611ac4565b91505092959194509250565b60008160070b9050919050565b611b5681611b40565b82525050565b6000602082019050611b716000830184611b4d565b92915050565b6000819050919050565b611b8a81611b77565b82525050565b611b9981611a65565b82525050565b6000604082019050611bb46000830185611b81565b611bc16020830184611b90565b9392505050565b6000602082019050611bdd6000830184611b81565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611c3682611bed565b810181811067ffffffffffffffff82111715611c5557611c54611bfe565b5b80604052505050565b6000611c68611a31565b9050611c748282611c2d565b919050565b600067ffffffffffffffff821115611c9457611c93611bfe565b5b611c9d82611bed565b9050602081019050919050565b82818337600083830152505050565b6000611ccc611cc784611c79565b611c5e565b905082815260208101848484011115611ce857611ce7611be8565b5b611cf3848285611caa565b509392505050565b600082601f830112611d1057611d0f611be3565b5b8135611d20848260208601611cb9565b91505092915050565b60008060408385031215611d4057611d3f611a3b565b5b6000611d4e85828601611a8e565b925050602083013567ffffffffffffffff811115611d6f57611d6e611a40565b5b611d7b85828601611cfb565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611dbf578082015181840152602081019050611da4565b60008484015250505050565b6000611dd682611d85565b611de08185611d90565b9350611df0818560208601611da1565b611df981611bed565b840191505092915050565b6000604082019050611e196000830185611b81565b8181036020830152611e2b8184611dcb565b90509392505050565b6000819050919050565b611e4781611e34565b82525050565b6000602082019050611e626000830184611e3e565b92915050565b611e7181611aa3565b82525050565b6000608082019050611e8c6000830187611b90565b611e996020830186611b90565b611ea66040830185611b90565b611eb36060830184611e68565b95945050505050565b600081905092915050565b6000611ed282611d85565b611edc8185611ebc565b9350611eec818560208601611da1565b80840191505092915050565b6000611f048284611ec7565b915081905092915050565b60008160030b9050919050565b611f2581611f0f565b8114611f3057600080fd5b50565b600081519050611f4281611f1c565b92915050565b600060208284031215611f5e57611f5d611a3b565b5b6000611f6c84828501611f33565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000604082019050611fb96000830185611b90565b8181036020830152611fcb8184611dcb565b90509392505050565b60008115159050919050565b611fe981611fd4565b82525050565b60006040820190506120046000830185611fe0565b81810360208301526120168184611dcb565b90509392505050565b600061203261202d84611c79565b611c5e565b90508281526020810184848401111561204e5761204d611be8565b5b612059848285611da1565b509392505050565b600082601f83011261207657612075611be3565b5b815161208684826020860161201f565b91505092915050565b600080604083850312156120a6576120a5611a3b565b5b60006120b485828601611f33565b925050602083015167ffffffffffffffff8111156120d5576120d4611a40565b5b6120e185828601612061565b9150509250929050565b600082825260208201905092915050565b7f50524e472073797374656d2063616c6c206661696c6564000000000000000000600082015250565b60006121326017836120eb565b915061213d826120fc565b602082019050919050565b6000602082019050818103600083015261216181612125565b9050919050565b61217181611e34565b811461217c57600080fd5b50565b60008151905061218e81612168565b92915050565b6000602082840312156121aa576121a9611a3b565b5b60006121b88482850161217f565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006121e8826121c1565b6121f281856121cc565b9350612202818560208601611da1565b61220b81611bed565b840191505092915050565b61221f81611a65565b82525050565b61222e81611fd4565b82525050565b61223d81611b40565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61227881611aa3565b82525050565b600082825260208201905092915050565b600061229a82611d85565b6122a4818561227e565b93506122b4818560208601611da1565b6122bd81611bed565b840191505092915050565b600060a0830160008301516122e06000860182612225565b5060208301516122f36020860182612216565b506040830151848203604086015261230b828261228f565b91505060608301518482036060860152612325828261228f565b915050608083015161233a6080860182612216565b508091505092915050565b600060408301600083015161235d600086018261226f565b506020830151848203602086015261237582826122c8565b9150508091505092915050565b600061238e8383612345565b905092915050565b6000602082019050919050565b60006123ae82612243565b6123b8818561224e565b9350836020820285016123ca8561225f565b8060005b8581101561240657848403895281516123e78582612382565b94506123f283612396565b925060208a019950506001810190506123ce565b50829750879550505050505092915050565b60608201600082015161242e6000850182612234565b5060208201516124416020850182612216565b5060408201516124546040850182612234565b50505050565b600061016083016000830151848203600086015261247882826121dd565b9150506020830151848203602086015261249282826121dd565b91505060408301516124a76040860182612216565b50606083015184820360608601526124bf82826121dd565b91505060808301516124d46080860182612225565b5060a08301516124e760a0860182612234565b5060c08301516124fa60c0860182612225565b5060e083015184820360e086015261251282826123a3565b915050610100830151612529610100860182612418565b508091505092915050565b61253d81611f0f565b82525050565b6000606082019050818103600083015261255d818661245a565b905061256c6020830185611b4d565b6125796040830184612534565b949350505050565b600061258c82611a45565b9050919050565b61259c81612581565b81146125a757600080fd5b50565b6000815190506125b981612593565b92915050565b600080604083850312156125d6576125d5611a3b565b5b60006125e485828601611f33565b92505060206125f5858286016125aa565b9150509250929050565b60006060820190506126146000830186611b90565b6126216020830185611b90565b61262e6040830184611b4d565b949350505050565b600060808201905061264b6000830187611b90565b6126586020830186611b90565b6126656040830185611b90565b6126726060830184611b4d565b95945050505050565b60006040820190506126906000830185611b90565b61269d6020830184611b90565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60006126dc838361228f565b905092915050565b6000602082019050919050565b60006126fc826126a4565b61270681856126af565b935083602082028501612718856126c0565b8060005b85811015612754578484038952815161273585826126d0565b9450612740836126e4565b925060208a0199505060018101905061271c565b50829750879550505050505092915050565b600060608201905061277b6000830186611b90565b6127886020830185611b4d565b818103604083015261279a81846126f1565b9050949350505050565b6127ad81611b40565b81146127b857600080fd5b50565b6000815190506127ca816127a4565b92915050565b600067ffffffffffffffff8211156127eb576127ea611bfe565b5b602082029050602081019050919050565b600080fd5b600061281461280f846127d0565b611c5e565b90508083825260208201905060208402830185811115612837576128366127fc565b5b835b81811015612860578061284c88826127bb565b845260208401935050602081019050612839565b5050509392505050565b600082601f83011261287f5761287e611be3565b5b815161288f848260208601612801565b91505092915050565b6000806000606084860312156128b1576128b0611a3b565b5b60006128bf86828701611f33565b93505060206128d0868287016127bb565b925050604084015167ffffffffffffffff8111156128f1576128f0611a40565b5b6128fd8682870161286a565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061293f8383612234565b60208301905092915050565b6000602082019050919050565b600061296382612907565b61296d8185612912565b935061297883612923565b8060005b838110156129a95781516129908882612933565b975061299b8361294b565b92505060018101905061297c565b5085935050505092915050565b60006060820190506129cb6000830186611b90565b6129d86020830185611b4d565b81810360408301526129ea8184612958565b9050949350505050565b60008060408385031215612a0b57612a0a611a3b565b5b6000612a1985828601611f33565b9250506020612a2a858286016127bb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122080d095b929d69bf2993c0ada140e68a546067b4fc5560f722ce775f2da8a70ad64736f6c63430008120033" } diff --git a/examples/precompile_example/ZeroTokenOperations.sol b/examples/precompile_example/ZeroTokenOperations.sol index 45d50a0d0..eaa6ed928 100644 --- a/examples/precompile_example/ZeroTokenOperations.sol +++ b/examples/precompile_example/ZeroTokenOperations.sol @@ -3,16 +3,25 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; import "./ExpiryHelper.sol"; +import "./PrngSystemContract.sol"; +import "./KeyHelper.sol"; +import "./HederaTokenService.sol"; +import "./FeeHelper.sol"; // To alter the behavior of the SolidityPrecompileExample, re-compile this solidity file // (you will also need the other files in this directory) // and copy the outputted json file to ./PrecompileExample.json -contract ZeroTokenOperations is ExpiryHelper { +contract ZeroTokenOperations is + PrngSystemContract, + HederaTokenService, + ExpiryHelper, + KeyHelper, + FeeHelper +{ address payable owner; address payable aliceAccount; address fungibleToken; - address nftToken; constructor(address payable _owner, address payable _aliceAccount) { owner = _owner; @@ -23,19 +32,31 @@ contract ZeroTokenOperations is ExpiryHelper { // the function call. We are using ContractExecuteTransaction.setPayableAmount() to transfer some Hbar // to the contract's account at each step (which means this function must be payable), and then transferring // the excess Hbar back to the owner at the end of each step. - function step0() external payable returns (int responseCode) { + function step0() external payable returns (int responseCode, address) { require(msg.sender == owner); IHederaTokenService.TokenKey[] - memory keys = new IHederaTokenService.TokenKey[](1); - // Set the admin key, supply key, pause key, and freeze key to the key of the account that executed function (INHERIT_ACCOUNT_KEY). - keys[0] = createSingleKey( - ADMIN_KEY_TYPE | - SUPPLY_KEY_TYPE | - PAUSE_KEY_TYPE | - FREEZE_KEY_TYPE | - WIPE_KEY_TYPE, - INHERIT_ACCOUNT_KEY, + memory keys = new IHederaTokenService.TokenKey[](4); + keys[0] = getSingleKey( + KeyType.ADMIN, + KeyType.PAUSE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + + keys[1] = getSingleKey( + KeyType.FREEZE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[2] = getSingleKey( + KeyType.WIPE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[3] = getSingleKey( + KeyType.SUPPLY, + KeyValueType.INHERIT_ACCOUNT_KEY, bytes("") ); @@ -51,7 +72,7 @@ contract ZeroTokenOperations is ExpiryHelper { keys, // the keys for the new token // auto-renew fee paid by aliceAccount every 7,000,000 seconds (approx. 81 days). // This is the minimum auto renew period. - createAutoRenewExpiry(aliceAccount, 7000000) + createAutoRenewExpiry(address(this), 7000000) ), 100, // initial supply 0 // decimals @@ -59,6 +80,7 @@ contract ZeroTokenOperations is ExpiryHelper { // send any excess Hbar back to the owner owner.transfer(address(this).balance); + return (responseCode, fungibleToken); } function step1() external returns (int responseCode) { @@ -81,7 +103,7 @@ contract ZeroTokenOperations is ExpiryHelper { function step3() external returns (int responseCode) { require(msg.sender == owner); - uint64 newTotalSupply; + int64 newTotalSupply; int64[] memory mintedSerials; // applicable to NFT tokens only (responseCode, newTotalSupply, mintedSerials) = mintToken( fungibleToken, @@ -89,21 +111,20 @@ contract ZeroTokenOperations is ExpiryHelper { new bytes[](0) // metadatas (applicable to NFT tokens only) ); - require(newTotalSupply == 100 + 0); + // require(newTotalSupply == 100); } function step4() external returns (int responseCode) { require(msg.sender == owner); - uint64 newTotalSupply; - int64[] memory mintedSerials; // applicable to NFT tokens only - (responseCode, newTotalSupply) = burnToken( + int64 totalSupplyLeftAfterBurn; + (responseCode, totalSupplyLeftAfterBurn) = burnToken( fungibleToken, - 0, // amount (applicable to fungible tokens only) - mintedSerials // metadatas (applicable to NFT tokens only) + 0, // amount to burn (applicable to fungible tokens only) + new int64[](0) // serial numbers to burn (applicable to NFT tokens only) ); - require(newTotalSupply == 100 + 0); + // require(totalSupplyLeftAfterBurn == 100); } function step5() external returns (int responseCode) { @@ -115,4 +136,4 @@ contract ZeroTokenOperations is ExpiryHelper { 0 // amount to transfer ); } -} +} \ No newline at end of file diff --git a/examples/precompile_example/main.go b/examples/precompile_example/main.go index 527cc5d1f..a2dc9441a 100644 --- a/examples/precompile_example/main.go +++ b/examples/precompile_example/main.go @@ -4,18 +4,35 @@ import ( _ "embed" "encoding/hex" "encoding/json" + "fmt" + "os" + "github.com/hashgraph/hedera-sdk-go/v2" "github.com/hashgraph/hedera-sdk-go/v2/examples/contract_helper" - "os" ) //go:embed PrecompileExample.json var precompileExample []byte -type JsonObject struct { - Object string `json:"object"` +type AbiObject struct { + ByteCode string `json:"bytecode"` } +func additionalLogic(privateKey hedera.PrivateKey, keyList *hedera.KeyList, address string, client *hedera.Client) { + id, err := hedera.TokenIDFromSolidityAddress(address) + if err != nil { + panic(err) + } + asd, err := hedera.NewTokenUpdateTransaction().SetTokenID(id).SetAdminKey(keyList).SetSupplyKey(keyList).Sign(privateKey).Execute(client) + if err != nil { + panic(err) + } + rec, err := asd.GetReceipt(client) + if err != nil { + panic(err) + } + fmt.Printf("asd: %v\n", rec) +} func main() { var client *hedera.Client var err error @@ -23,22 +40,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -46,8 +60,7 @@ func main() { alicePrivateKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating Alice's private key") - return + panic(fmt.Sprintf("%v : error generating Alice's private key", err)) } alicePublicKey := alicePrivateKey.PublicKey() accountCreateResponse, err := hedera.NewAccountCreateTransaction(). @@ -55,45 +68,76 @@ func main() { SetInitialBalance(hedera.NewHbar(1)). Execute(client) if err != nil { - println(err.Error(), ": error creating Alice's account") - return + panic(fmt.Sprintf("%v : error creating Alice's account", err)) } accountCreateReceipt, err := accountCreateResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account create receipt") - return + panic(fmt.Sprintf("%v : error retrieving account create receipt", err)) } var aliceAccountID hedera.AccountID if accountCreateReceipt.AccountID != nil { aliceAccountID = *accountCreateReceipt.AccountID } else { - println("Alice's account id from receipt is nil") - return + panic("Alice's account id from receipt is nil") } - var bytecodeFromJson JsonObject - if json.Unmarshal(precompileExample, &bytecodeFromJson) != nil { - println(err.Error(), ": error reading from json") - return + var abiObject AbiObject + err = json.Unmarshal(precompileExample, &abiObject) + if err != nil { + panic("error reading from json") } contractFunctionParameters, err := hedera.NewContractFunctionParameters(). AddAddress(client.GetOperatorAccountID().ToSolidityAddress()) if err != nil { - println(err.Error(), ": error making contract function parameters") - return + panic(fmt.Sprintf("%v : error making contract function parameters", err)) } contractFunctionParameters, err = contractFunctionParameters. AddAddress(aliceAccountID.ToSolidityAddress()) if err != nil { - println(err.Error(), ": error adding alice's address to contract function parameters") - return + panic(fmt.Sprintf("%v : error adding alice's address to contract function parameters", err)) } - contractHelper := contract_helper.NewContractHelper([]byte(bytecodeFromJson.Object), *contractFunctionParameters, client) + contractHelper := contract_helper.NewContractHelper([]byte(abiObject.ByteCode), *contractFunctionParameters, client) + + keyList := hedera.KeyListWithThreshold(1).Add(operatorKey.PublicKey()).Add(contractHelper.ContractID) + + tx, err := hedera.NewAccountUpdateTransaction().SetAccountID(operatorAccountID).SetKey(keyList).Execute(client) + if err != nil { + panic(fmt.Sprintf("%v : error updating alice's account", err)) + } + _, err = tx.GetReceipt(client) + if err != nil { + panic(err) + } + keyList = hedera.KeyListWithThreshold(1).Add(alicePublicKey).Add(contractHelper.ContractID) + + tx, err = hedera.NewAccountUpdateTransaction().SetAccountID(aliceAccountID).SetKey(keyList).Sign(alicePrivateKey).Execute(client) + if err != nil { + panic(fmt.Sprintf("%v : error updating alice's account", err)) + } + _, err = tx.GetReceipt(client) + if err != nil { + panic(err) + } + + tokenUpdateFunction := func(address string) { + id, err := hedera.TokenIDFromSolidityAddress(address) + if err != nil { + panic(err) + } + tx, err := hedera.NewTokenUpdateTransaction().SetTokenID(id).SetAdminKey(keyList).SetSupplyKey(keyList).Sign(alicePrivateKey).Execute(client) + if err != nil { + panic(err) + } + _, err = tx.GetReceipt(client) + if err != nil { + panic(err) + } + } contractHelper. SetResultValidatorForStep(0, func(contractFunctionResult hedera.ContractFunctionResult) bool { @@ -113,6 +157,7 @@ func main() { // Because we're setting the adminKey for the created NFT token to Alice's key, // Alice must sign the ContractExecuteTransaction. AddSignerForStep(11, alicePrivateKey). + SetStepLogic(11, tokenUpdateFunction). // and Alice must sign for minting because her key is the supply key. AddSignerForStep(12, alicePrivateKey). SetParameterSupplierForStep(12, func() *hedera.ContractFunctionParameters { @@ -129,19 +174,18 @@ func main() { // step 2 mints it // step 3 associates Alice with it // step 4 transfers it to Alice. - // step 5 approves an allowance of the fungible token with operator as the owner and Alice as the spender [NOT WORKING] + // step 5 approves an allowance of the fungible token with operator as the owner and Alice as the spender // steps 6 - 10 test misc functions on the fungible token (see PrecompileExample.sol for details). // step 11 creates an NFT token with a custom fee, and with the admin and supply set to Alice's key // step 12 mints some NFTs // step 13 associates Alice with the NFT token // step 14 transfers some NFTs to Alice - // step 15 approves an NFT allowance with operator as the owner and Alice as the spender [NOT WORKING] + // step 15 approves an NFT allowance with operator as the owner and Alice as the spender // step 16 burn some NFTs - + _, err = contractHelper. ExecuteSteps( /* from step */ 0 /* to step */, 16, client) if err != nil { - println(err.Error(), ": error executing steps") - return + panic(fmt.Sprintf("%v : error executing steps", err)) } } diff --git a/examples/rng_transaction/main.go b/examples/rng_transaction/main.go index 9279fc51e..108dff959 100644 --- a/examples/rng_transaction/main.go +++ b/examples/rng_transaction/main.go @@ -1,8 +1,10 @@ package main import ( - "github.com/hashgraph/hedera-sdk-go/v2" + "fmt" "os" + + "github.com/hashgraph/hedera-sdk-go/v2" ) func main() { @@ -12,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -38,19 +37,16 @@ func main() { SetRange(12). Execute(client) if err != nil { - println(err.Error(), ": error executing rng transaction") - return + panic(fmt.Sprintf("%v : error executing rng transaction", err)) } transactionRecord, err := createResponse.GetRecord(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } - - if transactionRecord.PrngNumber != nil { - println(err.Error(), ": error, pseudo-random number is nil") - return + fmt.Printf("transactionRecord: %v\n", transactionRecord) + if transactionRecord.PrngNumber == nil { + panic(fmt.Sprintf("%v : error, pseudo-random number is nil", err)) } println("The pseudo-random number is:", *transactionRecord.PrngNumber) diff --git a/examples/schedule_identical_transaction/main.go b/examples/schedule_identical_transaction/main.go index bfe70f30d..5ffc61475 100644 --- a/examples/schedule_identical_transaction/main.go +++ b/examples/schedule_identical_transaction/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -48,8 +45,7 @@ func main() { for i := range pubKeys { newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Printf("Key %v:\n", i) @@ -65,21 +61,18 @@ func main() { SetInitialBalance(hedera.NewHbar(1)). Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } // Make sure the transaction succeeded transactionReceipt, err := createResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt 1") - return + panic(fmt.Sprintf("%v : error getting receipt 1", err)) } newClient, err := hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } newClient = newClient.SetOperator(*transactionReceipt.AccountID, newKey) @@ -103,15 +96,13 @@ func main() { SetInitialBalance(hedera.NewHbar(10)). Execute(client) if err != nil { - println(err.Error(), ": error executing create account transaction") - return + panic(fmt.Sprintf("%v : error executing create account transaction", err)) } // Make sure the transaction succeeded transactionReceipt, err := createResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt 2") - return + panic(fmt.Sprintf("%v : error getting receipt 2", err)) } thresholdAccount := *transactionReceipt.AccountID @@ -130,21 +121,18 @@ func main() { tx, err := tx.FreezeWith(client) if err != nil { - println(err.Error(), ": error while freezing transaction for client ") - return + panic(fmt.Sprintf("%v : error while freezing transaction for client ", err)) } signedTransaction, err := tx.SignWithOperator(client) if err != nil { - println(err.Error(), ": error while signing with operator client ", operator) - return + panic(fmt.Sprintf("%v : error while signing with operator client ", operator)) } scheduledTx, err := hedera.NewScheduleCreateTransaction(). SetScheduledTransaction(signedTransaction) if err != nil { - println(err.Error(), ": error while setting scheduled transaction with operator client", operator) - return + panic(fmt.Sprintf("%v : error while setting scheduled transaction with operator client", operator)) } scheduledTx = scheduledTx. @@ -152,8 +140,7 @@ func main() { response, err := scheduledTx.Execute(client) if err != nil { - println(err.Error(), ": error while executing schedule create transaction with operator", operator) - return + panic(fmt.Sprintf("%v : error while executing schedule create transaction with operator", operator)) } receipt, err := hedera.NewTransactionReceiptQuery(). @@ -161,8 +148,7 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{response.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error while getting schedule create receipt transaction with operator", operator) - return + panic(fmt.Sprintf("%v : error while getting schedule create receipt transaction with operator", operator)) } fmt.Printf("operator [%s]: scheduleID = %v\n", operator, receipt.ScheduleID) @@ -173,8 +159,7 @@ func main() { } if scheduleID.String() != receipt.ScheduleID.String() { - println("invalid generated schedule id, expected ", scheduleID.String(), ", got ", receipt.ScheduleID.String()) - return + panic("invalid generated schedule id, expected " + scheduleID.String() + ", got "+ receipt.ScheduleID.String()) } // If the status return by the receipt is related to already created, execute a schedule sign transaction @@ -185,15 +170,13 @@ func main() { Execute(client) if err != nil { - println(err.Error(), ": error while executing scheduled sign with operator", operator) - return + panic(fmt.Sprintf("%v : error while executing scheduled sign with operator", operator)) } _, err = signTransaction.GetReceipt(client) if err != nil { if err.Error() != "exceptional receipt status: SCHEDULE_ALREADY_EXECUTED" { - println(err.Error(), ": error while getting scheduled sign with operator ", operator) - return + panic(fmt.Sprintf("%v : error while getting scheduled sign with operator ", operator)) } } } @@ -205,14 +188,14 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{createResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error retrieving schedule info after signing") - return + panic(fmt.Sprintf("%v : error retrieving schedule info after signing", err)) } // Checking if the scheduled transaction was executed and signed, and retrieving the signatories if !info.ExecutedAt.IsZero() { println("Signing success, signed at: ", info.ExecutedAt.String()) println("Signatories: ", info.Signatories.String()) - return + }else{ + panic("Signing failed") } } diff --git a/examples/schedule_multisig_transaction/main.go b/examples/schedule_multisig_transaction/main.go index e40f5025c..84fdce94b 100644 --- a/examples/schedule_multisig_transaction/main.go +++ b/examples/schedule_multisig_transaction/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -45,8 +42,7 @@ func main() { for i := range keys { newKey, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey}") - return + panic(fmt.Sprintf("%v : error generating PrivateKey}", err)) } fmt.Printf("Key %v:\n", i) @@ -71,15 +67,13 @@ func main() { SetInitialBalance(hedera.NewHbar(10)). Execute(client) if err != nil { - println(err.Error(), ": error executing create account transaction") - return + panic(fmt.Sprintf("%v : error executing create account transaction", err)) } // Make sure the transaction succeeded transactionReceipt, err := createResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } // Pre-generating transaction id for the scheduled transaction so we can track it @@ -102,22 +96,19 @@ func main() { // Scheduling it, this gives us hedera.ScheduleCreateTransaction scheduled, err := transferTx.Schedule() if err != nil { - println(err.Error(), ": error scheduling Transfer Transaction") - return + panic(fmt.Sprintf("%v : error scheduling Transfer Transaction", err)) } // Executing the scheduled transaction scheduleResponse, err := scheduled.Execute(client) if err != nil { - println(err.Error(), ": error executing schedule create") - return + panic(fmt.Sprintf("%v : error executing schedule create", err)) } // Make sure it executed successfully scheduleReceipt, err := scheduleResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting schedule create receipt") - return + panic(fmt.Sprintf("%v : error getting schedule create receipt", err)) } // Taking out the schedule ID @@ -129,15 +120,13 @@ func main() { SetScheduleID(scheduleID). Execute(client) if err != nil { - println(err.Error(), ": error getting schedule info") - return + panic(fmt.Sprintf("%v : error getting schedule info", err)) } // Taking out the TransferTransaction from earlier transfer, err := info.GetScheduledTransaction() if err != nil { - println(err.Error(), ": error getting transaction from schedule info") - return + panic(fmt.Sprintf("%v : error getting transaction from schedule info", err)) } // Converting it from interface to hedera.TransferTransaction() and retrieving the amount of transfers @@ -150,7 +139,6 @@ func main() { if len(transfers) != 2 { println("more transfers than expected") - return } // Checking if the Hbar values are correct @@ -171,8 +159,7 @@ func main() { SetScheduleID(scheduleID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing sign transaction") - return + panic(fmt.Sprintf("%v : error freezing sign transaction", err)) } // Signing the scheduled transaction @@ -182,15 +169,13 @@ func main() { resp, err := signTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing schedule sign transaction") - return + panic(fmt.Sprintf("%v : error executing schedule sign transaction", err)) } // Getting the receipt to make sure the signing executed properly _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error executing schedule sign receipt") - return + panic(fmt.Sprintf("%v : error executing schedule sign receipt", err)) } // Making sure the scheduled transaction executed properly with schedule info query @@ -199,14 +184,14 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{createResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error retrieving schedule info after signing") - return + panic(fmt.Sprintf("%v : error retrieving schedule info after signing", err)) } // Checking if the scheduled transaction was executed and signed, and retrieving the signatories if !info.ExecutedAt.IsZero() { println("Singing success, signed at: ", info.ExecutedAt.String()) println("Signatories: ", info.Signatories.String()) - return + }else{ + panic("Signing failed") } } diff --git a/examples/schedule_transfer_example/main.go b/examples/schedule_transfer_example/main.go index 81a7735e0..9986f266a 100644 --- a/examples/schedule_transfer_example/main.go +++ b/examples/schedule_transfer_example/main.go @@ -1,8 +1,10 @@ package main import ( - "github.com/hashgraph/hedera-sdk-go/v2" + "fmt" "os" + + "github.com/hashgraph/hedera-sdk-go/v2" ) func main() { @@ -12,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -35,8 +34,7 @@ func main() { bobsKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating Bob's key") - return + panic(fmt.Sprintf("%v : error generating Bob's key", err)) } bobsAccountCreate, err := hedera.NewAccountCreateTransaction(). @@ -45,27 +43,23 @@ func main() { SetInitialBalance(hedera.NewHbar(10)). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account creation") - return + panic(fmt.Sprintf("%v : error freezing account creation", err)) } bobsAccountCreate.Sign(bobsKey) response, err := bobsAccountCreate.Execute(client) if err != nil { - println(err.Error(), ": error creating Bob's account") - return + panic(fmt.Sprintf("%v : error creating Bob's account", err)) } transactionReceipt, err := response.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } if transactionReceipt.AccountID == nil { - println(err.Error(), ": missing Bob's AccountID") - return + panic(fmt.Sprintf("%v : missing Bob's AccountID", err)) } bobsID := *transactionReceipt.AccountID @@ -77,8 +71,7 @@ func main() { SetAccountID(bobsID). Execute(client) if err != nil { - println(err.Error(), ": error getting Bob's balance") - return + panic(fmt.Sprintf("%v : error getting Bob's balance", err)) } println("Bob's initial balance:", bobsInitialBalance.Hbars.String()) @@ -92,41 +85,35 @@ func main() { scheduleTransaction, err := transferToSchedule.Schedule() if err != nil { - println(err.Error(), ": error setting schedule transaction") - return + panic(fmt.Sprintf("%v : error setting schedule transaction", err)) } frozenScheduleTransaction, err := scheduleTransaction.FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing scheduled transaction") - return + panic(fmt.Sprintf("%v : error freezing scheduled transaction", err)) } frozenScheduleTransaction.Sign(bobsKey) response, err = frozenScheduleTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing create scheduled transaction") - return + panic(fmt.Sprintf("%v : error executing create scheduled transaction", err)) } transactionReceipt, err = response.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting schedule create receipt") - return + panic(fmt.Sprintf("%v : error getting schedule create receipt", err)) } if transactionReceipt.ScheduleID == nil { - println(err.Error(), ": missing Bob's ScheduleID") - return + panic(fmt.Sprintf("%v : missing Bob's ScheduleID", err)) } bobsBalanceAfterSchedule, err := hedera.NewAccountBalanceQuery(). SetAccountID(bobsID). Execute(client) if err != nil { - println(err.Error(), ": error getting Bob's balance") - return + panic(fmt.Sprintf("%v : error getting Bob's balance", err)) } println("Bob's balance after schedule:", bobsBalanceAfterSchedule.Hbars.String()) @@ -138,21 +125,18 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error cleaning up") - return + panic(fmt.Sprintf("%v : error cleaning up", err)) } deleteAccount.Sign(bobsKey) response, err = deleteAccount.Execute(client) if err != nil { - println(err.Error(), ": error cleaning up") - return + panic(fmt.Sprintf("%v : error cleaning up", err)) } _, err = response.GetReceipt(client) if err != nil { - println(err.Error(), ": error cleaning up") - return + panic(fmt.Sprintf("%v : error cleaning up", err)) } } diff --git a/examples/schedule_with_expiration/main.go b/examples/schedule_with_expiration/main.go index 391cdb4ec..f3c3323cc 100644 --- a/examples/schedule_with_expiration/main.go +++ b/examples/schedule_with_expiration/main.go @@ -15,22 +15,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -46,8 +43,7 @@ func main() { for i := range keys { newKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey}") - return + panic(fmt.Sprintf("%v : error generating PrivateKey}", err)) } fmt.Printf("Key %v:\n", i) @@ -73,15 +69,13 @@ func main() { SetInitialBalance(hedera.NewHbar(10)). Execute(client) if err != nil { - println(err.Error(), ": error executing create account transaction") - return + panic(fmt.Sprintf("%v : error executing create account transaction", err)) } // Make sure the transaction succeeded transactionReceipt, err := createResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } // Pre-generating transaction id for the scheduled transaction so we can track it @@ -104,8 +98,7 @@ func main() { // Scheduling it, this gives us hedera.ScheduleCreateTransaction scheduled, err := transferTx.Schedule() if err != nil { - println(err.Error(), ": error scheduling Transfer Transaction") - return + panic(fmt.Sprintf("%v : error scheduling Transfer Transaction", err)) } // Executing the scheduled transaction @@ -113,15 +106,13 @@ func main() { SetExpirationTime(time.Now().Add(30 * time.Minute)). Execute(client) if err != nil { - println(err.Error(), ": error executing schedule create") - return + panic(fmt.Sprintf("%v : error executing schedule create", err)) } // Make sure it executed successfully scheduleRecord, err := scheduleResponse.GetRecord(client) if err != nil { - println(err.Error(), ": error getting schedule create record") - return + panic(fmt.Sprintf("%v : error getting schedule create record", err)) } // Taking out the schedule ID @@ -137,8 +128,7 @@ func main() { SetScheduleID(scheduleID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing sign transaction") - return + panic(fmt.Sprintf("%v : error freezing sign transaction", err)) } // Signing the scheduled transaction @@ -146,15 +136,13 @@ func main() { resp, err := signTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing schedule sign transaction") - return + panic(fmt.Sprintf("%v : error executing schedule sign transaction", err)) } // Getting the receipt to make sure the signing executed properly _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error executing schedule sign receipt") - return + panic(fmt.Sprintf("%v : error executing schedule sign receipt", err)) } // Making sure the scheduled transaction executed properly with schedule info query @@ -163,8 +151,7 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{createResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error retrieving schedule info after signing") - return + panic(fmt.Sprintf("%v : error retrieving schedule info after signing", err)) } println("Signers: ", info.Signatories.String()) @@ -176,8 +163,7 @@ func main() { SetScheduleID(scheduleID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing sign transaction") - return + panic(fmt.Sprintf("%v : error freezing sign transaction", err)) } // Signing the scheduled transaction @@ -185,15 +171,13 @@ func main() { resp, err = signTransaction.Execute(client) if err != nil { - println(err.Error(), ": error executing schedule sign transaction") - return + panic(fmt.Sprintf("%v : error executing schedule sign transaction", err)) } // Getting the receipt to make sure the signing executed properly _, err = resp.GetReceipt(client) if err != nil { - println(err.Error(), ": error executing schedule sign receipt") - return + panic(fmt.Sprintf("%v : error executing schedule sign receipt", err)) } info, err = hedera.NewScheduleInfoQuery(). @@ -201,14 +185,12 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{createResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error retrieving schedule info after signing") - return + panic(fmt.Sprintf("%v : error retrieving schedule info after signing", err)) } println("Signers: ", info.Signatories.String()) if info.ExecutedAt != nil { println("Singing success, executed at: ", info.ExecutedAt.String()) - return } } diff --git a/examples/staking/main.go b/examples/staking/main.go index d9d97c7af..1d87471f9 100644 --- a/examples/staking/main.go +++ b/examples/staking/main.go @@ -13,22 +13,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,8 +34,7 @@ func main() { // Generate new key to use with new account newKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Printf("private = %v\n", newKey) @@ -62,15 +58,13 @@ func main() { SetInitialBalance(hedera.NewHbar(20)). Execute(client) if err != nil { - println(err.Error(), ": error executing account create transaction") - return + panic(fmt.Sprintf("%v : error executing account create transaction", err)) } // Get receipt to see if transaction succeeded, and has the account ID transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } accountID := *transactionReceipt.AccountID @@ -81,8 +75,7 @@ func main() { SetAccountID(accountID). Execute(client) if err != nil { - println(err.Error(), ": error retrieving account info") - return + panic(fmt.Sprintf("%v : error retrieving account info", err)) } println("Staked Node Account ID:", info.StakingInfo.StakedAccountID.String()) diff --git a/examples/staking_with_update/main.go b/examples/staking_with_update/main.go index bb85ecbb3..fe18e6cfe 100644 --- a/examples/staking_with_update/main.go +++ b/examples/staking_with_update/main.go @@ -13,22 +13,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,8 +34,7 @@ func main() { // Generate new key to use with new account newKey, err := hedera.PrivateKeyGenerateEd25519() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Printf("private = %v\n", newKey) @@ -60,19 +56,17 @@ func main() { // The account is charged to extend its expiration date every this many seconds. If it doesn't // have enough balance, it extends as long as possible. If it is empty when it expires, then it // is deleted. - SetStakedNodeID(3). + SetStakedAccountID(hedera.AccountID{Account: 3}). SetInitialBalance(hedera.NewHbar(20)). Execute(client) if err != nil { - println(err.Error(), ": error executing account create transaction") - return + panic(fmt.Sprintf("%v : error executing account create transaction", err)) } // Get receipt to see if transaction succeeded, and has the account ID transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt") - return + panic(fmt.Sprintf("%v : error getting receipt", err)) } accountID := *transactionReceipt.AccountID @@ -81,11 +75,10 @@ func main() { SetAccountID(accountID). Execute(client) if err != nil { - println(err.Error(), ": error retrieving account info") - return + panic(fmt.Sprintf("%v : error retrieving account info", err)) } - println("Staked node id:", *info.StakingInfo.StakedNodeID) + println("Staked account id:", info.StakingInfo.StakedAccountID.String()) freezeUpdate, err := hedera.NewAccountUpdateTransaction(). SetNodeAccountIDs([]hedera.AccountID{transactionResponse.NodeID}). @@ -94,30 +87,26 @@ func main() { SetStakedNodeID(0). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account update transaction") - return + panic(fmt.Sprintf("%v : error freezing account update transaction", err)) } freezeUpdate.Sign(newKey) transactionResponse, err = freezeUpdate.Execute(client) if err != nil { - println(err.Error(), ": error executing account update transaction") - return + panic(fmt.Sprintf("%v : error executing account update transaction", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error getting receipt}") - return + panic(fmt.Sprintf("%v : error getting receipt}", err)) } info, err = hedera.NewAccountInfoQuery(). SetAccountID(accountID). Execute(client) if err != nil { - println(err.Error(), ": error retrieving account info") - return + panic(fmt.Sprintf("%v : error retrieving account info", err)) } println("Staked node id after update:", *info.StakingInfo.StakedNodeID) diff --git a/examples/topic_with_admin_key/main.go b/examples/topic_with_admin_key/main.go index 6401d7dbd..34ed19bef 100644 --- a/examples/topic_with_admin_key/main.go +++ b/examples/topic_with_admin_key/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -13,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -40,8 +38,7 @@ func main() { for i := range initialAdminKeys { key, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } initialAdminKeys[i] = key } @@ -61,8 +58,7 @@ func main() { SetAdminKey(keyList). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing topic create transaction") - return + panic(fmt.Sprintf("%v : error freezing topic create transaction", err)) } // Signing ConsensusTopicCreateTransaction with initialAdminKeys @@ -74,15 +70,13 @@ func main() { // Executing ConsensusTopicCreateTransaction response, err := topicTx.Execute(client) if err != nil { - println(err.Error(), ": error creating topic") - return + panic(fmt.Sprintf("%v : error creating topic", err)) } // Make sure it executed properly receipt, err := response.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic creation receipt", err)) } // Get the topic ID out of the receipt @@ -96,8 +90,7 @@ func main() { for i := range newAdminKeys { key, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } newAdminKeys[i] = key } @@ -115,8 +108,7 @@ func main() { SetAdminKey(keyList). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing topic update transaction") - return + panic(fmt.Sprintf("%v : error freezing topic update transaction", err)) } // Have to sign with the initial admin keys first @@ -134,15 +126,13 @@ func main() { // Now to execute the topic update transaction response, err = topicUpdate.Execute(client) if err != nil { - println(err.Error(), ": error updating topic") - return + panic(fmt.Sprintf("%v : error updating topic", err)) } // Make sure the transaction ran properly receipt, err = response.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving topic update receipt") - return + panic(fmt.Sprintf("%v : error retrieving topic update receipt", err)) } println("Updated topic ", topicID.String(), " with 3-of-4 threshold key as adminKey") @@ -152,8 +142,7 @@ func main() { SetTopicID(topicID). Execute(client) if err != nil { - println(err.Error(), ": error executing topic info query") - return + panic(fmt.Sprintf("%v : error executing topic info query", err)) } // Should be "updated topic demo" diff --git a/examples/transfer_crypto/main.go b/examples/transfer_crypto/main.go index 17c972a33..dd472b7b0 100644 --- a/examples/transfer_crypto/main.go +++ b/examples/transfer_crypto/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -41,23 +38,21 @@ func main() { transactionResponse, err := hedera.NewTransferTransaction(). // Hbar has to be negated to denote we are taking out from that account - AddHbarTransfer(client.GetOperatorAccountID(), hedera.NewHbar(-1000000)). + AddHbarTransfer(client.GetOperatorAccountID(), hedera.NewHbar(-1)). // If the amount of these 2 transfers is not the same, the transaction will throw an error - AddHbarTransfer(hedera.AccountID{Account: 1153}, hedera.NewHbar(1000000)). + AddHbarTransfer(hedera.AccountID{Account: 3}, hedera.NewHbar(1)). SetTransactionMemo("go sdk example send_hbar/main.go"). Execute(client) if err != nil { - println(err.Error(), ": error executing transfer") - return + panic(fmt.Sprintf("%v : error executing transfer", err)) } // Retrieve the receipt to make sure the transaction went through transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer receipt", err)) } fmt.Printf("crypto transfer status: %v\n", transactionReceipt.Status) diff --git a/examples/transfer_tokens/main.go b/examples/transfer_tokens/main.go index ecead246c..3c8449874 100644 --- a/examples/transfer_tokens/main.go +++ b/examples/transfer_tokens/main.go @@ -14,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,13 +34,11 @@ func main() { key1, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } key2, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } fmt.Printf("privateKey = %v\n", key1.String()) @@ -58,15 +53,13 @@ func main() { SetKey(key1.PublicKey()). Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } // First receipt with account ID 1, will error if transaction failed transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving account creation receipt", err)) } // Retrieving account ID out of the first receipt @@ -81,15 +74,13 @@ func main() { SetKey(key2.PublicKey()). Execute(client) if err != nil { - println(err.Error(), ": error creating second account") - return + panic(fmt.Sprintf("%v : error creating second account", err)) } // Second receipt with account ID 2, will error if transaction failed transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving second account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving second account creation receipt", err)) } // Retrieving account ID out of the second receipt @@ -137,15 +128,13 @@ func main() { SetFreezeDefault(false). Execute(client) if err != nil { - println(err.Error(), ": error creating token") - return + panic(fmt.Sprintf("%v : error creating token", err)) } // Make sure the token create transaction ran transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving token creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving token creation receipt", err)) } // Retrieve the token out of the receipt @@ -162,8 +151,7 @@ func main() { SetTokenIDs(tokenID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing token associate transaction") - return + panic(fmt.Sprintf("%v : error freezing token associate transaction", err)) } // Has to be signed by the account1's key @@ -171,45 +159,41 @@ func main() { Sign(key1). Execute(client) if err != nil { - println(err.Error(), ": error associating token") - return + panic(fmt.Sprintf("%v : error associating token", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving token associate transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving token associate transaction receipt", err)) } fmt.Printf("Associated account %v with token %v\n", accountID1.String(), tokenID.String()) - // Associating the token with the second account, so it can interact with the token + // Associating the token with the first account, so it can interact with the token transaction, err = hedera.NewTokenAssociateTransaction(). // The account ID to be associated SetAccountID(accountID2). SetNodeAccountIDs([]hedera.AccountID{transactionResponse.NodeID}). // The token ID that the account will be associated to + SetTokenIDs(tokenID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing second token associate transaction") - return + panic(fmt.Sprintf("%v : error freezing token associate transaction", err)) } - // Has to be signed by the account2's key + // Has to be signed by the account1's key transactionResponse, err = transaction. Sign(key2). Execute(client) if err != nil { - println(err.Error(), ": error executing second token associate transaction") - return + panic(fmt.Sprintf("%v : error associating token", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving second token associate transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving token associate transaction receipt", err)) } fmt.Printf("Associated account %v with token %v\n", accountID2.String(), tokenID.String()) @@ -225,14 +209,12 @@ func main() { // as it's done automatically by execute for the operator Execute(client) if err != nil { - println(err.Error(), ": error granting kyc") - return + panic(fmt.Sprintf("%v : error granting kyc", err)) } transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving grant kyc transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving grant kyc transaction receipt", err)) } fmt.Printf("Granted KYC for account %v on token %v\n", accountID1.String(), tokenID.String()) @@ -247,15 +229,13 @@ func main() { // as it's done automatically by execute for the operator Execute(client) if err != nil { - println(err.Error(), ": error granting kyc to second account") - return + panic(fmt.Sprintf("%v : error granting kyc to second account", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving grant kyc transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving grant kyc transaction receipt", err)) } fmt.Printf("Granted KYC for account %v on token %v\n", accountID2.String(), tokenID.String()) @@ -268,15 +248,13 @@ func main() { // We don't have to sign this one as we are transferring tokens from the operator Execute(client) if err != nil { - println(err.Error(), ": error transferring from operator to account1") - return + panic(fmt.Sprintf("%v : error transferring from operator to account1", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer from operator to account1 receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer from operator to account1 receipt", err)) } fmt.Printf( @@ -293,8 +271,7 @@ func main() { AddTokenTransfer(tokenID, accountID2, 10). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer from account1 to account2") - return + panic(fmt.Sprintf("%v : error freezing transfer from account1 to account2", err)) } // As we are now transferring tokens from accountID1 to accountID2, this has to be signed by accountID1's key @@ -303,15 +280,13 @@ func main() { // Execute the transfer transaction transactionResponse, err = transferTransaction.Execute(client) if err != nil { - println(err.Error(), ": error transferring from account1 to account2") - return + panic(fmt.Sprintf("%v : error transferring from account1 to account2", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer from account1 to account2 receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer from account1 to account2 receipt", err)) } fmt.Printf( @@ -328,8 +303,7 @@ func main() { AddTokenTransfer(tokenID, accountID1, 10). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing transfer from account2 to account1") - return + panic(fmt.Sprintf("%v : error freezing transfer from account2 to account1", err)) } // As we are now transferring tokens from accountID2 back to accountID1, this has to be signed by accountID2's key @@ -338,15 +312,13 @@ func main() { // Executing the transfer transaction transactionResponse, err = transferTransaction.Execute(client) if err != nil { - println(err.Error(), ": error transferring from account2 to account1") - return + panic(fmt.Sprintf("%v : error transferring from account2 to account1", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer from account2 to account1 receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer from account2 to account1 receipt", err)) } fmt.Printf( @@ -370,15 +342,13 @@ func main() { SetAmount(10). Execute(client) if err != nil { - println(err.Error(), ": error wiping from token") - return + panic(fmt.Sprintf("%v : error wiping from token", err)) } // Make sure the transaction succeeded _, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving token wipe transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving token wipe transaction receipt", err)) } fmt.Printf("Wiped account %v on token %v\n", accountID1.String(), tokenID.String()) @@ -390,15 +360,13 @@ func main() { SetNodeAccountIDs([]hedera.AccountID{transactionResponse.NodeID}). Execute(client) if err != nil { - println(err.Error(), ": error deleting token") - return + panic(fmt.Sprintf("%v : error deleting token", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving token delete transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving token delete transaction receipt", err)) } fmt.Printf("DeletedAt token %v\n", tokenID.String()) @@ -411,8 +379,7 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account delete transaction") - return + panic(fmt.Sprintf("%v : error freezing account delete transaction", err)) } // Account deletion has to always be signed by the key for the account @@ -420,15 +387,13 @@ func main() { Sign(key1). Execute(client) if err != nil { - println(err.Error(), ": error deleting account 1") - return + panic(fmt.Sprintf("%v : error deleting account 1", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving transfer transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving transfer transaction receipt", err)) } fmt.Printf("DeletedAt account %v\n", accountID1.String()) @@ -440,8 +405,7 @@ func main() { SetTransferAccountID(client.GetOperatorAccountID()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account delete transaction") - return + panic(fmt.Sprintf("%v : error freezing account delete transaction", err)) } // Account deletion has to always be signed by the key for the account @@ -449,15 +413,13 @@ func main() { Sign(key2). Execute(client) if err != nil { - println(err.Error(), ": error deleting account2") - return + panic(fmt.Sprintf("%v : error deleting account2", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account delete transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving account delete transaction receipt", err)) } fmt.Printf("DeletedAt account %v\n", accountID2.String()) diff --git a/examples/update_account_public_key/main.go b/examples/update_account_public_key/main.go index 0d6c9b7e0..21ae4d3a9 100644 --- a/examples/update_account_public_key/main.go +++ b/examples/update_account_public_key/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/hashgraph/hedera-sdk-go/v2" @@ -13,22 +14,19 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } // Retrieving operator ID from environment variable OPERATOR_ID operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) if err != nil { - println(err.Error(), ": error converting string to AccountID") - return + panic(fmt.Sprintf("%v : error converting string to AccountID", err)) } // Retrieving operator key from environment variable OPERATOR_KEY operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return + panic(fmt.Sprintf("%v : error converting string to PrivateKey", err)) } // Setting the client operator ID and key @@ -37,15 +35,13 @@ func main() { // Generating key for the new account key1, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } // Generating the key to update to key2, err := hedera.GeneratePrivateKey() if err != nil { - println(err.Error(), ": error generating PrivateKey") - return + panic(fmt.Sprintf("%v : error generating PrivateKey", err)) } // Creating new account @@ -59,8 +55,7 @@ func main() { SetTransactionMemo("sdk example create_account__with_manual_signing/main.go"). Execute(client) if err != nil { - println(err.Error(), ": error creating account") - return + panic(fmt.Sprintf("%v : error creating account", err)) } println("transaction ID:", accountTxResponse.TransactionID.String()) @@ -68,8 +63,7 @@ func main() { // Get the receipt making sure transaction worked accountTxReceipt, err := accountTxResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving account creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving account creation receipt", err)) } // Retrieve the account ID out of the Receipt @@ -86,8 +80,7 @@ func main() { SetKey(key2.PublicKey()). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing account update transaction") - return + panic(fmt.Sprintf("%v : error freezing account update transaction", err)) } // Have to sign with both keys, the initial key first @@ -97,8 +90,7 @@ func main() { // Executing the account update transaction accountUpdateTxResponse, err := accountUpdateTx.Execute(client) if err != nil { - println(err.Error(), ": error updating account") - return + panic(fmt.Sprintf("%v : error updating account", err)) } println("transaction ID:", accountUpdateTxResponse.TransactionID.String()) @@ -111,8 +103,7 @@ func main() { SetAccountID(accountID). Execute(client) if err != nil { - println(err.Error(), ": error executing account info query") - return + panic(fmt.Sprintf("%v : error executing account info query", err)) } // This should be same as key2 diff --git a/examples/validate_checksum/main.go b/examples/validate_checksum/main.go deleted file mode 100644 index 6a3ca3cdb..000000000 --- a/examples/validate_checksum/main.go +++ /dev/null @@ -1,121 +0,0 @@ -package main - -import ( - "bufio" - "os" - "strings" - - "github.com/hashgraph/hedera-sdk-go/v2" -) - -func main() { - var client *hedera.Client - var err error - - // Retrieving network type from environment variable HEDERA_NETWORK - client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) - if err != nil { - println(err.Error(), ": error creating client") - return - } - - // Retrieving operator ID from environment variable OPERATOR_ID - operatorAccountID, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID")) - if err != nil { - println(err.Error(), ": error converting string to AccountID") - return - } - - // Retrieving operator key from environment variable OPERATOR_KEY - operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY")) - if err != nil { - println(err.Error(), ": error converting string to PrivateKey") - return - } - - // Setting the client operator ID and key - client.SetOperator(operatorAccountID, operatorKey) - - println("An example of manual checksum validation.") - reader := bufio.NewReader(os.Stdin) - print("Enter an account ID with checksum: ") - text, _ := reader.ReadString('\n') - text = strings.TrimSuffix(text, "\n") - - // Making a new account ID from a string that we read in - id, err := hedera.AccountIDFromString(text) - if err != nil { - println(err.Error(), ": error converting string to AccountID") - return - } - - // Getting the checksum of the account ID we just created - println("The ID with no checksum is", id.String()) - idWithChecksum, err := id.ToStringWithChecksum(client) - if err != nil { - println(err.Error(), ": error generating ID checksum") - return - } - - println("The ID with correct checksum is", idWithChecksum) - if id.GetChecksum() == nil { - println("You must enter a checksum.") - return - } - - println("The checksum entered was", *id.GetChecksum()) - - // Validating the checksum, will error if not valid - err = id.ValidateChecksum(client) - if err != nil { - println(err.Error(), ": error validating checksum.") - return - } - - // Executing with the created account ID with autoValidateChecksum being false - balance, err := hedera.NewAccountBalanceQuery(). - SetAccountID(id). - Execute(client) - if err != nil { - println(err.Error(), ": error executing account balance query.") - return - } - println(balance.Hbars.String()) - - println("An example of automatic checksum validation: ") - - // Setting autoValidateChecksum to true, any operation with an ID will fail if the checksum is wrong - client.SetAutoValidateChecksums(true) - - print("Enter an account ID with checksum: ") - text, _ = reader.ReadString('\n') - text = strings.TrimSuffix(text, "\n") - - // Making a new account ID from a string that we read in - id, err = hedera.AccountIDFromString(text) - if err != nil { - println(err.Error(), ": error converting string to AccountID.") - return - } - - // Checking if checksum exists - if id.GetChecksum() == nil { - println("You must enter a checksum.") - return - } - - // Executing with the created account ID with autoValidateChecksum being true - balance, err = hedera.NewAccountBalanceQuery(). - SetAccountID(id). - Execute(client) - if err != nil { - println(err.Error(), ": error executing account balance query.") - return - } - - // Print out the account balance - println(balance.Hbars.String()) - - println("Example complete!") - _ = client.Close() -} diff --git a/examples/zero_token_operations/main.go b/examples/zero_token_operations/main.go index 16f2eacb7..038bd8af7 100644 --- a/examples/zero_token_operations/main.go +++ b/examples/zero_token_operations/main.go @@ -21,8 +21,7 @@ func main() { // Retrieving network type from environment variable HEDERA_NETWORK, i.e. testnet client, err = hedera.ClientForName(os.Getenv("HEDERA_NETWORK")) if err != nil { - println(err.Error(), ": error creating client") - return + panic(fmt.Sprintf("%v : error creating client", err)) } //Grab your testnet account ID and private key from the environment variable @@ -76,32 +75,48 @@ func main() { rawContract, err := os.ReadFile("../precompile_example/ZeroTokenOperations.json") if err != nil { - println(err.Error(), ": error reading json") - return + panic(fmt.Sprintf("%v : error reading json", err)) } err = json.Unmarshal([]byte(rawContract), &contract) if err != nil { - println(err.Error(), ": error unmarshaling the json file") - return + panic(fmt.Sprintf("%v : error unmarshaling the json file", err)) } params, err := hedera.NewContractFunctionParameters().AddAddress(myAccountId.ToSolidityAddress()) if err != nil { - println(err.Error(), ": error adding first address to contract function parameters") - return + panic(fmt.Sprintf("%v : error adding first address to contract function parameters", err)) } params, err = params.AddAddress(aliceAccountId.ToSolidityAddress()) if err != nil { - println(err.Error(), ": error adding second address to contract function parameters") - return + panic(fmt.Sprintf("%v : error adding second address to contract function parameters", err)) } helper := contract_helper.NewContractHelper([]byte(contract.Bytecode), *params, client) helper.SetPayableAmountForStep(0, hedera.NewHbar(20)).AddSignerForStep(1, alicePrivateKey) + + keyList := hedera.KeyListWithThreshold(1).Add(myPrivateKey.PublicKey()).Add(helper.ContractID) + tx, err := hedera.NewAccountUpdateTransaction().SetAccountID(myAccountId).SetKey(keyList).Sign(myPrivateKey).Execute(client) + if err != nil { + panic(fmt.Sprintf("%v : error updating alice's account", err)) + } + _, err = tx.GetReceipt(client) + if err != nil { + panic(err) + } + keyList = hedera.KeyListWithThreshold(1).Add(alicePrivateKey.PublicKey()).Add(helper.ContractID) + + tx, err = hedera.NewAccountUpdateTransaction().SetAccountID(aliceAccountId).SetKey(keyList).Sign(alicePrivateKey).Execute(client) + if err != nil { + panic(fmt.Sprintf("%v : error updating alice's account", err)) + } + _, err = tx.GetReceipt(client) + if err != nil { + panic(err) + } + _, err = helper.ExecuteSteps(0, 5, client) if err != nil { - println(err.Error(), ": error in helper") - return + panic(fmt.Sprintf("%v : error in helper", err)) } transactionResponse, err := hedera.NewTokenCreateTransaction(). SetTokenName("Black Sea LimeChain Token"). @@ -113,15 +128,13 @@ func main() { SetFreezeDefault(false). Execute(client) if err != nil { - println(err.Error(), ": error creating token") - return + panic(fmt.Sprintf("%v : error creating token", err)) } // Make sure the token create transaction ran transactionReceipt, err := transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving token creation receipt") - return + panic(fmt.Sprintf("%v : error retrieving token creation receipt", err)) } // Retrieve the token out of the receipt @@ -138,23 +151,20 @@ func main() { SetTokenIDs(tokenID). FreezeWith(client) if err != nil { - println(err.Error(), ": error freezing second token associate transaction") - return + panic(fmt.Sprintf("%v : error freezing second token associate transaction", err)) } // Has to be signed by the account2's key transactionResponse, err = associatingTransaction. Sign(alicePrivateKey). Execute(client) if err != nil { - println(err.Error(), ": error executing second token associate transaction") - return + panic(fmt.Sprintf("%v : error executing second token associate transaction", err)) } // Make sure the transaction succeeded transactionReceipt, err = transactionResponse.GetReceipt(client) if err != nil { - println(err.Error(), ": error retrieving second token associate transaction receipt") - return + panic(fmt.Sprintf("%v : error retrieving second token associate transaction receipt", err)) } fmt.Printf("Associated account %v with token %v\n", aliceAccountId.String(), tokenID.String()) @@ -163,12 +173,10 @@ func main() { transactionResponse, err = hedera.NewTransferTransaction(). AddTokenTransfer(tokenID, myAccountId, 0).AddTokenTransfer(tokenID, aliceAccountId, 0).Execute(client) if err != nil { - println(err.Error(), ": error transfering token") - return + panic(fmt.Sprintf("%v : error transfering token", err)) } _, err = transactionResponse.GetRecord(client) if err != nil { - println(err.Error(), ": error retrieving transaction") - return + panic(fmt.Sprintf("%v : error retrieving transaction", err)) } }