diff --git a/evm/generators.go b/evm/generators.go index b0a701e..c33c983 100644 --- a/evm/generators.go +++ b/evm/generators.go @@ -13,6 +13,7 @@ import ( "go/printer" "go/token" "regexp" + "sort" "strconv" "strings" "text/template" @@ -616,7 +617,7 @@ func DeriveMethodReturnValues(parameters []ABIBoundParameter) ([]MethodReturnVal } // Produces a CLI specification for the structure with the given name, provided the AST nodes representing -// the deployment method, the tranasaction methods, and the view methods for the corresponding smart contract. +// the deployment method, the transaction methods, and the view methods for the corresponding smart contract. // // The value of the deployMethod argument is used to determine if the deployment functionality will be // added to the CLI. If deployMethod is nil, then a deployment command is not generated. This is signified @@ -656,7 +657,15 @@ func ParseCLISpecification(structName string, deployMethod *ast.FuncDecl, viewMe result.ViewHandlers = make([]HandlerDefinition, len(viewMethods)) currentViewHandler := 0 - for methodName, methodNode := range viewMethods { + + viewMethodNames := make([]string, 0, len(viewMethods)) + for viewMethodName := range viewMethods { + viewMethodNames = append(viewMethodNames, viewMethodName) + } + sort.Strings(viewMethodNames) + + for _, methodName := range viewMethodNames { + methodNode := viewMethods[methodName] parameters := make([]ABIBoundParameter, len(methodNode.Type.Params.List)) // Every view method, when bound to Go, will retrun an error as its last return value. @@ -701,7 +710,15 @@ func ParseCLISpecification(structName string, deployMethod *ast.FuncDecl, viewMe result.TransactHandlers = make([]HandlerDefinition, len(transactMethods)) currentTransactHandler := 0 - for methodName, methodNode := range transactMethods { + + transactMethodNames := make([]string, 0, len(transactMethods)) + for transactMethodName := range transactMethods { + transactMethodNames = append(transactMethodNames, transactMethodName) + } + sort.Strings(transactMethodNames) + + for _, methodName := range transactMethodNames { + methodNode := transactMethods[methodName] parameters := make([]ABIBoundParameter, len(methodNode.Type.Params.List)) for i, arg := range methodNode.Type.Params.List { parameter, parameterErr := ParseBoundParameter(arg) diff --git a/examples/ownable-erc-721/OwnableERC721.go b/examples/ownable-erc-721/OwnableERC721.go index 5978c69..7dd4604 100644 --- a/examples/ownable-erc-721/OwnableERC721.go +++ b/examples/ownable-erc-721/OwnableERC721.go @@ -1,5 +1,5 @@ // This file was generated by seer: https://github.com/moonstream-to/seer. -// seer version: 0.1.1 +// seer version: 0.1.19 // seer command: seer evm generate --package main --cli --includemain --abi fixtures/OwnableERC721.json --bytecode fixtures/OwnableERC721.bin --struct OwnableERC721 --output examples/ownable-erc-721/OwnableERC721.go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. @@ -1301,7 +1301,7 @@ func CreateOwnableERC721DeploymentCommand() *cobra.Command { var simulate bool var timeout uint - var name string + var name_0 string var symbol string @@ -1353,7 +1353,7 @@ func CreateOwnableERC721DeploymentCommand() *cobra.Command { address, deploymentTransaction, _, deploymentErr := DeployOwnableERC721( transactionOpts, client, - name, + name_0, symbol, owner, ) @@ -1403,14 +1403,14 @@ func CreateOwnableERC721DeploymentCommand() *cobra.Command { cmd.Flags().BoolVar(&simulate, "simulate", false, "Simulate the transaction without sending it") cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") - cmd.Flags().StringVar(&name, "name", "", "name argument") + cmd.Flags().StringVar(&name_0, "name-0", "", "name-0 argument") cmd.Flags().StringVar(&symbol, "symbol", "", "symbol argument") - cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument") + cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument (common.Address)") return cmd } -func CreateTokenUriCommand() *cobra.Command { +func CreateBalanceOfCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1418,14 +1418,14 @@ func CreateTokenUriCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var tokenId *big.Int - var tokenIdRaw string + var owner common.Address + var ownerRaw string - var capture0 string + var capture0 *big.Int cmd := &cobra.Command{ - Use: "token-uri", - Short: "Call the TokenURI view method on a OwnableERC721 contract", + Use: "balance-of", + Short: "Call the BalanceOf view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1434,11 +1434,12 @@ func CreateTokenUriCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") + if ownerRaw == "" { + return fmt.Errorf("--owner argument not specified") + } else if !common.IsHexAddress(ownerRaw) { + return fmt.Errorf("--owner argument is not a valid Ethereum address") } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) + owner = common.HexToAddress(ownerRaw) return nil }, @@ -1462,14 +1463,14 @@ func CreateTokenUriCommand() *cobra.Command { } var callErr error - capture0, callErr = session.TokenURI( - tokenId, + capture0, callErr = session.BalanceOf( + owner, ) if callErr != nil { return callErr } - cmd.Printf("0: %s\n", capture0) + cmd.Printf("0: %s\n", capture0.String()) return nil }, @@ -1482,11 +1483,11 @@ func CreateTokenUriCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument (common.Address)") return cmd } -func CreateOwnerCommand() *cobra.Command { +func CreateGetApprovedCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1494,11 +1495,14 @@ func CreateOwnerCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool + var tokenId *big.Int + var tokenIdRaw string + var capture0 common.Address cmd := &cobra.Command{ - Use: "owner", - Short: "Call the Owner view method on a OwnableERC721 contract", + Use: "get-approved", + Short: "Call the GetApproved view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1507,6 +1511,12 @@ func CreateOwnerCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") + } + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) + return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -1529,7 +1539,9 @@ func CreateOwnerCommand() *cobra.Command { } var callErr error - capture0, callErr = session.Owner() + capture0, callErr = session.GetApproved( + tokenId, + ) if callErr != nil { return callErr } @@ -1547,9 +1559,11 @@ func CreateOwnerCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + return cmd } -func CreateOwnerOfCommand() *cobra.Command { +func CreateIsApprovedForAllCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1557,14 +1571,16 @@ func CreateOwnerOfCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var tokenId *big.Int - var tokenIdRaw string + var owner common.Address + var ownerRaw string + var operator common.Address + var operatorRaw string - var capture0 common.Address + var capture0 bool cmd := &cobra.Command{ - Use: "owner-of", - Short: "Call the OwnerOf view method on a OwnableERC721 contract", + Use: "is-approved-for-all", + Short: "Call the IsApprovedForAll view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1573,11 +1589,19 @@ func CreateOwnerOfCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") + if ownerRaw == "" { + return fmt.Errorf("--owner argument not specified") + } else if !common.IsHexAddress(ownerRaw) { + return fmt.Errorf("--owner argument is not a valid Ethereum address") } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) + owner = common.HexToAddress(ownerRaw) + + if operatorRaw == "" { + return fmt.Errorf("--operator argument not specified") + } else if !common.IsHexAddress(operatorRaw) { + return fmt.Errorf("--operator argument is not a valid Ethereum address") + } + operator = common.HexToAddress(operatorRaw) return nil }, @@ -1601,14 +1625,15 @@ func CreateOwnerOfCommand() *cobra.Command { } var callErr error - capture0, callErr = session.OwnerOf( - tokenId, + capture0, callErr = session.IsApprovedForAll( + owner, + operator, ) if callErr != nil { return callErr } - cmd.Printf("0: %s\n", capture0.Hex()) + cmd.Printf("0: %t\n", capture0) return nil }, @@ -1621,11 +1646,12 @@ func CreateOwnerOfCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument (common.Address)") + cmd.Flags().StringVar(&operatorRaw, "operator", "", "operator argument (common.Address)") return cmd } -func CreateSupportsInterfaceCommand() *cobra.Command { +func CreateNameCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1633,14 +1659,11 @@ func CreateSupportsInterfaceCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var interfaceId [4]byte - var interfaceIdRaw string - - var capture0 bool + var capture0 string cmd := &cobra.Command{ - Use: "supports-interface", - Short: "Call the SupportsInterface view method on a OwnableERC721 contract", + Use: "name", + Short: "Call the Name view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1649,15 +1672,6 @@ func CreateSupportsInterfaceCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - var hexDecodeinterfaceIdErr error - - var intermediateinterfaceIdLeaf []byte - intermediateinterfaceIdLeaf, hexDecodeinterfaceIdErr = hex.DecodeString(interfaceIdRaw) - if hexDecodeinterfaceIdErr != nil { - return hexDecodeinterfaceIdErr - } - interfaceId = [4]byte(intermediateinterfaceIdLeaf[:4]) - return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -1680,14 +1694,12 @@ func CreateSupportsInterfaceCommand() *cobra.Command { } var callErr error - capture0, callErr = session.SupportsInterface( - interfaceId, - ) + capture0, callErr = session.Name() if callErr != nil { return callErr } - cmd.Printf("0: %t\n", capture0) + cmd.Printf("0: %s\n", capture0) return nil }, @@ -1700,11 +1712,9 @@ func CreateSupportsInterfaceCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&interfaceIdRaw, "interface-id", "", "interface-id argument") - return cmd } -func CreateSymbolCommand() *cobra.Command { +func CreateOwnerCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1712,11 +1722,11 @@ func CreateSymbolCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var capture0 string + var capture0 common.Address cmd := &cobra.Command{ - Use: "symbol", - Short: "Call the Symbol view method on a OwnableERC721 contract", + Use: "owner", + Short: "Call the Owner view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1747,12 +1757,12 @@ func CreateSymbolCommand() *cobra.Command { } var callErr error - capture0, callErr = session.Symbol() + capture0, callErr = session.Owner() if callErr != nil { return callErr } - cmd.Printf("0: %s\n", capture0) + cmd.Printf("0: %s\n", capture0.Hex()) return nil }, @@ -1767,7 +1777,7 @@ func CreateSymbolCommand() *cobra.Command { return cmd } -func CreateBalanceOfCommand() *cobra.Command { +func CreateOwnerOfCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1775,14 +1785,14 @@ func CreateBalanceOfCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var owner common.Address - var ownerRaw string + var tokenId *big.Int + var tokenIdRaw string - var capture0 *big.Int + var capture0 common.Address cmd := &cobra.Command{ - Use: "balance-of", - Short: "Call the BalanceOf view method on a OwnableERC721 contract", + Use: "owner-of", + Short: "Call the OwnerOf view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1791,12 +1801,11 @@ func CreateBalanceOfCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if ownerRaw == "" { - return fmt.Errorf("--owner argument not specified") - } else if !common.IsHexAddress(ownerRaw) { - return fmt.Errorf("--owner argument is not a valid Ethereum address") + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") } - owner = common.HexToAddress(ownerRaw) + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) return nil }, @@ -1820,14 +1829,14 @@ func CreateBalanceOfCommand() *cobra.Command { } var callErr error - capture0, callErr = session.BalanceOf( - owner, + capture0, callErr = session.OwnerOf( + tokenId, ) if callErr != nil { return callErr } - cmd.Printf("0: %s\n", capture0.String()) + cmd.Printf("0: %s\n", capture0.Hex()) return nil }, @@ -1840,11 +1849,11 @@ func CreateBalanceOfCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") return cmd } -func CreateGetApprovedCommand() *cobra.Command { +func CreateSupportsInterfaceCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1852,14 +1861,14 @@ func CreateGetApprovedCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var tokenId *big.Int - var tokenIdRaw string + var interfaceId [4]byte + var interfaceIdRaw string - var capture0 common.Address + var capture0 bool cmd := &cobra.Command{ - Use: "get-approved", - Short: "Call the GetApproved view method on a OwnableERC721 contract", + Use: "supports-interface", + Short: "Call the SupportsInterface view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1868,11 +1877,15 @@ func CreateGetApprovedCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") + var interfaceIdIntermediate []byte + + var interfaceIdIntermediateHexDecodeErr error + interfaceIdIntermediate, interfaceIdIntermediateHexDecodeErr = hex.DecodeString(interfaceIdRaw) + if interfaceIdIntermediateHexDecodeErr != nil { + return interfaceIdIntermediateHexDecodeErr } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) + + copy(interfaceId[:], interfaceIdIntermediate) return nil }, @@ -1896,14 +1909,14 @@ func CreateGetApprovedCommand() *cobra.Command { } var callErr error - capture0, callErr = session.GetApproved( - tokenId, + capture0, callErr = session.SupportsInterface( + interfaceId, ) if callErr != nil { return callErr } - cmd.Printf("0: %s\n", capture0.Hex()) + cmd.Printf("0: %t\n", capture0) return nil }, @@ -1916,11 +1929,11 @@ func CreateGetApprovedCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&interfaceIdRaw, "interface-id", "", "interface-id argument ([4]byte)") return cmd } -func CreateIsApprovedForAllCommand() *cobra.Command { +func CreateSymbolCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -1928,16 +1941,11 @@ func CreateIsApprovedForAllCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool - var owner common.Address - var ownerRaw string - var operator common.Address - var operatorRaw string - - var capture0 bool + var capture0 string cmd := &cobra.Command{ - Use: "is-approved-for-all", - Short: "Call the IsApprovedForAll view method on a OwnableERC721 contract", + Use: "symbol", + Short: "Call the Symbol view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -1946,20 +1954,6 @@ func CreateIsApprovedForAllCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if ownerRaw == "" { - return fmt.Errorf("--owner argument not specified") - } else if !common.IsHexAddress(ownerRaw) { - return fmt.Errorf("--owner argument is not a valid Ethereum address") - } - owner = common.HexToAddress(ownerRaw) - - if operatorRaw == "" { - return fmt.Errorf("--operator argument not specified") - } else if !common.IsHexAddress(operatorRaw) { - return fmt.Errorf("--operator argument is not a valid Ethereum address") - } - operator = common.HexToAddress(operatorRaw) - return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -1982,15 +1976,12 @@ func CreateIsApprovedForAllCommand() *cobra.Command { } var callErr error - capture0, callErr = session.IsApprovedForAll( - owner, - operator, - ) + capture0, callErr = session.Symbol() if callErr != nil { return callErr } - cmd.Printf("0: %t\n", capture0) + cmd.Printf("0: %s\n", capture0) return nil }, @@ -2003,12 +1994,9 @@ func CreateIsApprovedForAllCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") - cmd.Flags().StringVar(&ownerRaw, "owner", "", "owner argument") - cmd.Flags().StringVar(&operatorRaw, "operator", "", "operator argument") - return cmd } -func CreateNameCommand() *cobra.Command { +func CreateTokenUriCommand() *cobra.Command { var contractAddressRaw, rpc string var contractAddress common.Address var timeout uint @@ -2016,11 +2004,14 @@ func CreateNameCommand() *cobra.Command { var blockNumberRaw, fromAddressRaw string var pending bool + var tokenId *big.Int + var tokenIdRaw string + var capture0 string cmd := &cobra.Command{ - Use: "name", - Short: "Call the Name view method on a OwnableERC721 contract", + Use: "token-uri", + Short: "Call the TokenURI view method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if contractAddressRaw == "" { return fmt.Errorf("--contract not specified") @@ -2029,6 +2020,12 @@ func CreateNameCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") + } + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) + return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -2051,7 +2048,9 @@ func CreateNameCommand() *cobra.Command { } var callErr error - capture0, callErr = session.Name() + capture0, callErr = session.TokenURI( + tokenId, + ) if callErr != nil { return callErr } @@ -2069,28 +2068,26 @@ func CreateNameCommand() *cobra.Command { cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") cmd.Flags().StringVar(&fromAddressRaw, "from", "", "Optional address for caller of the view method") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + return cmd } -func CreateSafeTransferFrom0Command() *cobra.Command { +func CreateApproveCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var from0 common.Address - var from0Raw string var to0 common.Address var to0Raw string var tokenId *big.Int var tokenIdRaw string - var data []byte - var dataRaw string cmd := &cobra.Command{ - Use: "safe-transfer-from-0", - Short: "Execute the SafeTransferFrom0 method on a OwnableERC721 contract", + Use: "approve", + Short: "Execute the Approve method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2103,13 +2100,6 @@ func CreateSafeTransferFrom0Command() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if from0Raw == "" { - return fmt.Errorf("--from-0 argument not specified") - } else if !common.IsHexAddress(from0Raw) { - return fmt.Errorf("--from-0 argument is not a valid Ethereum address") - } - from0 = common.HexToAddress(from0Raw) - if to0Raw == "" { return fmt.Errorf("--to-0 argument not specified") } else if !common.IsHexAddress(to0Raw) { @@ -2123,13 +2113,6 @@ func CreateSafeTransferFrom0Command() *cobra.Command { tokenId = new(big.Int) tokenId.SetString(tokenIdRaw, 0) - var hexDecodedataErr error - - data, hexDecodedataErr = hex.DecodeString(dataRaw) - if hexDecodedataErr != nil { - return hexDecodedataErr - } - return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -2167,11 +2150,9 @@ func CreateSafeTransferFrom0Command() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.SafeTransferFrom0( - from0, + transaction, transactionErr := session.Approve( to0, tokenId, - data, ) if transactionErr != nil { return transactionErr @@ -2221,28 +2202,26 @@ func CreateSafeTransferFrom0Command() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument") - cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument") + cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument (common.Address)") cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") - cmd.Flags().StringVar(&dataRaw, "data", "", "data argument") return cmd } -func CreateSetApprovalForAllCommand() *cobra.Command { +func CreateMintCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var operator common.Address - var operatorRaw string - var approved bool - var approvedRaw string + var to0 common.Address + var to0Raw string + var tokenId *big.Int + var tokenIdRaw string cmd := &cobra.Command{ - Use: "set-approval-for-all", - Short: "Execute the SetApprovalForAll method on a OwnableERC721 contract", + Use: "mint", + Short: "Execute the Mint method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2255,22 +2234,18 @@ func CreateSetApprovalForAllCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if operatorRaw == "" { - return fmt.Errorf("--operator argument not specified") - } else if !common.IsHexAddress(operatorRaw) { - return fmt.Errorf("--operator argument is not a valid Ethereum address") + if to0Raw == "" { + return fmt.Errorf("--to-0 argument not specified") + } else if !common.IsHexAddress(to0Raw) { + return fmt.Errorf("--to-0 argument is not a valid Ethereum address") } - operator = common.HexToAddress(operatorRaw) + to0 = common.HexToAddress(to0Raw) - approvedRawLower := strings.ToLower(approvedRaw) - switch approvedRawLower { - case "true", "t", "y", "yes", "1": - approved = true - case "false", "f", "n", "no", "0": - approved = false - default: - return fmt.Errorf("--approved argument is not valid (value: %s)", approvedRaw) + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") } + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) return nil }, @@ -2309,9 +2284,9 @@ func CreateSetApprovalForAllCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.SetApprovalForAll( - operator, - approved, + transaction, transactionErr := session.Mint( + to0, + tokenId, ) if transactionErr != nil { return transactionErr @@ -2361,28 +2336,21 @@ func CreateSetApprovalForAllCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&operatorRaw, "operator", "", "operator argument") - cmd.Flags().StringVar(&approvedRaw, "approved", "", "approved argument (true, t, y, yes, 1 OR false, f, n, no, 0)") + cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument (common.Address)") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") return cmd } -func CreateTransferFromCommand() *cobra.Command { +func CreateRenounceOwnershipCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var from0 common.Address - var from0Raw string - var to0 common.Address - var to0Raw string - var tokenId *big.Int - var tokenIdRaw string - cmd := &cobra.Command{ - Use: "transfer-from", - Short: "Execute the TransferFrom method on a OwnableERC721 contract", + Use: "renounce-ownership", + Short: "Execute the RenounceOwnership method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2395,26 +2363,6 @@ func CreateTransferFromCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if from0Raw == "" { - return fmt.Errorf("--from-0 argument not specified") - } else if !common.IsHexAddress(from0Raw) { - return fmt.Errorf("--from-0 argument is not a valid Ethereum address") - } - from0 = common.HexToAddress(from0Raw) - - if to0Raw == "" { - return fmt.Errorf("--to-0 argument not specified") - } else if !common.IsHexAddress(to0Raw) { - return fmt.Errorf("--to-0 argument is not a valid Ethereum address") - } - to0 = common.HexToAddress(to0Raw) - - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") - } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) - return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -2451,12 +2399,8 @@ func CreateTransferFromCommand() *cobra.Command { Contract: &contract.OwnableERC721Transactor, TransactOpts: *transactionOpts, } - - transaction, transactionErr := session.TransferFrom( - from0, - to0, - tokenId, - ) + + transaction, transactionErr := session.RenounceOwnership() if transactionErr != nil { return transactionErr } @@ -2505,25 +2449,25 @@ func CreateTransferFromCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument") - cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") - return cmd } -func CreateTransferOwnershipCommand() *cobra.Command { +func CreateSafeTransferFromCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var newOwner common.Address - var newOwnerRaw string + var from0 common.Address + var from0Raw string + var to0 common.Address + var to0Raw string + var tokenId *big.Int + var tokenIdRaw string cmd := &cobra.Command{ - Use: "transfer-ownership", - Short: "Execute the TransferOwnership method on a OwnableERC721 contract", + Use: "safe-transfer-from", + Short: "Execute the SafeTransferFrom method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2536,12 +2480,25 @@ func CreateTransferOwnershipCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if newOwnerRaw == "" { - return fmt.Errorf("--new-owner argument not specified") - } else if !common.IsHexAddress(newOwnerRaw) { - return fmt.Errorf("--new-owner argument is not a valid Ethereum address") + if from0Raw == "" { + return fmt.Errorf("--from-0 argument not specified") + } else if !common.IsHexAddress(from0Raw) { + return fmt.Errorf("--from-0 argument is not a valid Ethereum address") } - newOwner = common.HexToAddress(newOwnerRaw) + from0 = common.HexToAddress(from0Raw) + + if to0Raw == "" { + return fmt.Errorf("--to-0 argument not specified") + } else if !common.IsHexAddress(to0Raw) { + return fmt.Errorf("--to-0 argument is not a valid Ethereum address") + } + to0 = common.HexToAddress(to0Raw) + + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") + } + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) return nil }, @@ -2580,8 +2537,10 @@ func CreateTransferOwnershipCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.TransferOwnership( - newOwner, + transaction, transactionErr := session.SafeTransferFrom( + from0, + to0, + tokenId, ) if transactionErr != nil { return transactionErr @@ -2631,25 +2590,31 @@ func CreateTransferOwnershipCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&newOwnerRaw, "new-owner", "", "new-owner argument") + cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument (common.Address)") + cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument (common.Address)") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") return cmd } -func CreateApproveCommand() *cobra.Command { +func CreateSafeTransferFrom0Command() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address + var from0 common.Address + var from0Raw string var to0 common.Address var to0Raw string var tokenId *big.Int var tokenIdRaw string + var data []byte + var dataRaw string cmd := &cobra.Command{ - Use: "approve", - Short: "Execute the Approve method on a OwnableERC721 contract", + Use: "safe-transfer-from-0", + Short: "Execute the SafeTransferFrom0 method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2662,6 +2627,13 @@ func CreateApproveCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) + if from0Raw == "" { + return fmt.Errorf("--from-0 argument not specified") + } else if !common.IsHexAddress(from0Raw) { + return fmt.Errorf("--from-0 argument is not a valid Ethereum address") + } + from0 = common.HexToAddress(from0Raw) + if to0Raw == "" { return fmt.Errorf("--to-0 argument not specified") } else if !common.IsHexAddress(to0Raw) { @@ -2675,6 +2647,16 @@ func CreateApproveCommand() *cobra.Command { tokenId = new(big.Int) tokenId.SetString(tokenIdRaw, 0) + var dataIntermediate []byte + + var dataIntermediateHexDecodeErr error + dataIntermediate, dataIntermediateHexDecodeErr = hex.DecodeString(dataRaw) + if dataIntermediateHexDecodeErr != nil { + return dataIntermediateHexDecodeErr + } + + copy(data[:], dataIntermediate) + return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -2712,9 +2694,11 @@ func CreateApproveCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.Approve( + transaction, transactionErr := session.SafeTransferFrom0( + from0, to0, tokenId, + data, ) if transactionErr != nil { return transactionErr @@ -2764,26 +2748,28 @@ func CreateApproveCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument") + cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument (common.Address)") + cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument (common.Address)") cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&dataRaw, "data", "", "data argument ([]byte)") return cmd } -func CreateMintCommand() *cobra.Command { +func CreateSetApprovalForAllCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var to0 common.Address - var to0Raw string - var tokenId *big.Int - var tokenIdRaw string + var operator common.Address + var operatorRaw string + var approved bool + var approvedRaw string cmd := &cobra.Command{ - Use: "mint", - Short: "Execute the Mint method on a OwnableERC721 contract", + Use: "set-approval-for-all", + Short: "Execute the SetApprovalForAll method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2796,18 +2782,22 @@ func CreateMintCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if to0Raw == "" { - return fmt.Errorf("--to-0 argument not specified") - } else if !common.IsHexAddress(to0Raw) { - return fmt.Errorf("--to-0 argument is not a valid Ethereum address") + if operatorRaw == "" { + return fmt.Errorf("--operator argument not specified") + } else if !common.IsHexAddress(operatorRaw) { + return fmt.Errorf("--operator argument is not a valid Ethereum address") } - to0 = common.HexToAddress(to0Raw) + operator = common.HexToAddress(operatorRaw) - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") + approvedRawLower := strings.ToLower(approvedRaw) + switch approvedRawLower { + case "true", "t", "y", "yes", "1": + approved = true + case "false", "f", "n", "no", "0": + approved = false + default: + return fmt.Errorf("--approved argument is not valid (value: %s)", approvedRaw) } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) return nil }, @@ -2846,9 +2836,9 @@ func CreateMintCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.Mint( - to0, - tokenId, + transaction, transactionErr := session.SetApprovalForAll( + operator, + approved, ) if transactionErr != nil { return transactionErr @@ -2898,21 +2888,28 @@ func CreateMintCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&operatorRaw, "operator", "", "operator argument (common.Address)") + cmd.Flags().StringVar(&approvedRaw, "approved", "", "approved argument (true, t, y, yes, 1 OR false, f, n, no, 0)") return cmd } -func CreateRenounceOwnershipCommand() *cobra.Command { +func CreateTransferFromCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address + var from0 common.Address + var from0Raw string + var to0 common.Address + var to0Raw string + var tokenId *big.Int + var tokenIdRaw string + cmd := &cobra.Command{ - Use: "renounce-ownership", - Short: "Execute the RenounceOwnership method on a OwnableERC721 contract", + Use: "transfer-from", + Short: "Execute the TransferFrom method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -2925,6 +2922,26 @@ func CreateRenounceOwnershipCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) + if from0Raw == "" { + return fmt.Errorf("--from-0 argument not specified") + } else if !common.IsHexAddress(from0Raw) { + return fmt.Errorf("--from-0 argument is not a valid Ethereum address") + } + from0 = common.HexToAddress(from0Raw) + + if to0Raw == "" { + return fmt.Errorf("--to-0 argument not specified") + } else if !common.IsHexAddress(to0Raw) { + return fmt.Errorf("--to-0 argument is not a valid Ethereum address") + } + to0 = common.HexToAddress(to0Raw) + + if tokenIdRaw == "" { + return fmt.Errorf("--token-id argument not specified") + } + tokenId = new(big.Int) + tokenId.SetString(tokenIdRaw, 0) + return nil }, RunE: func(cmd *cobra.Command, args []string) error { @@ -2962,7 +2979,11 @@ func CreateRenounceOwnershipCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.RenounceOwnership() + transaction, transactionErr := session.TransferFrom( + from0, + to0, + tokenId, + ) if transactionErr != nil { return transactionErr } @@ -3011,25 +3032,25 @@ func CreateRenounceOwnershipCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") + cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument (common.Address)") + cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument (common.Address)") + cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + return cmd } -func CreateSafeTransferFromCommand() *cobra.Command { +func CreateTransferOwnershipCommand() *cobra.Command { var keyfile, nonce, password, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas, rpc, contractAddressRaw string var gasLimit uint64 var simulate bool var timeout uint var contractAddress common.Address - var from0 common.Address - var from0Raw string - var to0 common.Address - var to0Raw string - var tokenId *big.Int - var tokenIdRaw string + var newOwner common.Address + var newOwnerRaw string cmd := &cobra.Command{ - Use: "safe-transfer-from", - Short: "Execute the SafeTransferFrom method on a OwnableERC721 contract", + Use: "transfer-ownership", + Short: "Execute the TransferOwnership method on a OwnableERC721 contract", PreRunE: func(cmd *cobra.Command, args []string) error { if keyfile == "" { return fmt.Errorf("--keystore not specified") @@ -3042,25 +3063,12 @@ func CreateSafeTransferFromCommand() *cobra.Command { } contractAddress = common.HexToAddress(contractAddressRaw) - if from0Raw == "" { - return fmt.Errorf("--from-0 argument not specified") - } else if !common.IsHexAddress(from0Raw) { - return fmt.Errorf("--from-0 argument is not a valid Ethereum address") - } - from0 = common.HexToAddress(from0Raw) - - if to0Raw == "" { - return fmt.Errorf("--to-0 argument not specified") - } else if !common.IsHexAddress(to0Raw) { - return fmt.Errorf("--to-0 argument is not a valid Ethereum address") - } - to0 = common.HexToAddress(to0Raw) - - if tokenIdRaw == "" { - return fmt.Errorf("--token-id argument not specified") + if newOwnerRaw == "" { + return fmt.Errorf("--new-owner argument not specified") + } else if !common.IsHexAddress(newOwnerRaw) { + return fmt.Errorf("--new-owner argument is not a valid Ethereum address") } - tokenId = new(big.Int) - tokenId.SetString(tokenIdRaw, 0) + newOwner = common.HexToAddress(newOwnerRaw) return nil }, @@ -3099,10 +3107,8 @@ func CreateSafeTransferFromCommand() *cobra.Command { TransactOpts: *transactionOpts, } - transaction, transactionErr := session.SafeTransferFrom( - from0, - to0, - tokenId, + transaction, transactionErr := session.TransferOwnership( + newOwner, ) if transactionErr != nil { return transactionErr @@ -3152,9 +3158,7 @@ func CreateSafeTransferFromCommand() *cobra.Command { cmd.Flags().UintVar(&timeout, "timeout", 60, "Timeout (in seconds) for interactions with the JSONRPC API") cmd.Flags().StringVar(&contractAddressRaw, "contract", "", "Address of the contract to interact with") - cmd.Flags().StringVar(&from0Raw, "from-0", "", "from-0 argument") - cmd.Flags().StringVar(&to0Raw, "to-0", "", "to-0 argument") - cmd.Flags().StringVar(&tokenIdRaw, "token-id", "", "token-id argument") + cmd.Flags().StringVar(&newOwnerRaw, "new-owner", "", "new-owner argument (common.Address)") return cmd } @@ -3293,21 +3297,6 @@ func CreateOwnableERC721Command() *cobra.Command { cmdDeployOwnableERC721.GroupID = DeployGroup.ID cmd.AddCommand(cmdDeployOwnableERC721) - cmdViewTokenURI := CreateTokenUriCommand() - cmdViewTokenURI.GroupID = ViewGroup.ID - cmd.AddCommand(cmdViewTokenURI) - cmdViewOwner := CreateOwnerCommand() - cmdViewOwner.GroupID = ViewGroup.ID - cmd.AddCommand(cmdViewOwner) - cmdViewOwnerOf := CreateOwnerOfCommand() - cmdViewOwnerOf.GroupID = ViewGroup.ID - cmd.AddCommand(cmdViewOwnerOf) - cmdViewSupportsInterface := CreateSupportsInterfaceCommand() - cmdViewSupportsInterface.GroupID = ViewGroup.ID - cmd.AddCommand(cmdViewSupportsInterface) - cmdViewSymbol := CreateSymbolCommand() - cmdViewSymbol.GroupID = ViewGroup.ID - cmd.AddCommand(cmdViewSymbol) cmdViewBalanceOf := CreateBalanceOfCommand() cmdViewBalanceOf.GroupID = ViewGroup.ID cmd.AddCommand(cmdViewBalanceOf) @@ -3320,19 +3309,22 @@ func CreateOwnableERC721Command() *cobra.Command { cmdViewName := CreateNameCommand() cmdViewName.GroupID = ViewGroup.ID cmd.AddCommand(cmdViewName) + cmdViewOwner := CreateOwnerCommand() + cmdViewOwner.GroupID = ViewGroup.ID + cmd.AddCommand(cmdViewOwner) + cmdViewOwnerOf := CreateOwnerOfCommand() + cmdViewOwnerOf.GroupID = ViewGroup.ID + cmd.AddCommand(cmdViewOwnerOf) + cmdViewSupportsInterface := CreateSupportsInterfaceCommand() + cmdViewSupportsInterface.GroupID = ViewGroup.ID + cmd.AddCommand(cmdViewSupportsInterface) + cmdViewSymbol := CreateSymbolCommand() + cmdViewSymbol.GroupID = ViewGroup.ID + cmd.AddCommand(cmdViewSymbol) + cmdViewTokenURI := CreateTokenUriCommand() + cmdViewTokenURI.GroupID = ViewGroup.ID + cmd.AddCommand(cmdViewTokenURI) - cmdTransactSafeTransferFrom0 := CreateSafeTransferFrom0Command() - cmdTransactSafeTransferFrom0.GroupID = TransactGroup.ID - cmd.AddCommand(cmdTransactSafeTransferFrom0) - cmdTransactSetApprovalForAll := CreateSetApprovalForAllCommand() - cmdTransactSetApprovalForAll.GroupID = TransactGroup.ID - cmd.AddCommand(cmdTransactSetApprovalForAll) - cmdTransactTransferFrom := CreateTransferFromCommand() - cmdTransactTransferFrom.GroupID = TransactGroup.ID - cmd.AddCommand(cmdTransactTransferFrom) - cmdTransactTransferOwnership := CreateTransferOwnershipCommand() - cmdTransactTransferOwnership.GroupID = TransactGroup.ID - cmd.AddCommand(cmdTransactTransferOwnership) cmdTransactApprove := CreateApproveCommand() cmdTransactApprove.GroupID = TransactGroup.ID cmd.AddCommand(cmdTransactApprove) @@ -3345,6 +3337,18 @@ func CreateOwnableERC721Command() *cobra.Command { cmdTransactSafeTransferFrom := CreateSafeTransferFromCommand() cmdTransactSafeTransferFrom.GroupID = TransactGroup.ID cmd.AddCommand(cmdTransactSafeTransferFrom) + cmdTransactSafeTransferFrom0 := CreateSafeTransferFrom0Command() + cmdTransactSafeTransferFrom0.GroupID = TransactGroup.ID + cmd.AddCommand(cmdTransactSafeTransferFrom0) + cmdTransactSetApprovalForAll := CreateSetApprovalForAllCommand() + cmdTransactSetApprovalForAll.GroupID = TransactGroup.ID + cmd.AddCommand(cmdTransactSetApprovalForAll) + cmdTransactTransferFrom := CreateTransferFromCommand() + cmdTransactTransferFrom.GroupID = TransactGroup.ID + cmd.AddCommand(cmdTransactTransferFrom) + cmdTransactTransferOwnership := CreateTransferOwnershipCommand() + cmdTransactTransferOwnership.GroupID = TransactGroup.ID + cmd.AddCommand(cmdTransactTransferOwnership) return cmd } diff --git a/version/version.go b/version/version.go index e6b5f38..b1723b9 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -var SeerVersion string = "0.1.19" +var SeerVersion string = "0.1.20"