From 4e31ceb267bdf49a803fbca059e583eaff3af0b5 Mon Sep 17 00:00:00 2001 From: Daniel Lima Date: Wed, 9 Oct 2024 12:27:33 -0300 Subject: [PATCH] Fix: safe nonce overrider --- evm/generators.go | 2 +- examples/ownable-erc-721/OwnableERC721.go | 20 ++++++++++---------- version/version.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/evm/generators.go b/evm/generators.go index 1d6b4bd..c01da6c 100644 --- a/evm/generators.go +++ b/evm/generators.go @@ -1156,7 +1156,7 @@ func CreateSafeProposal(client *ethclient.Client, key *keystore.Key, safeAddress } nonce := safeNonce - if safeNonce == nil { + if safeNonce == big.NewInt(0) { // Fetch the current nonce from the Safe contract fetchedNonce, err := safeInstance.Nonce(&bind.CallOpts{}) if err != nil { diff --git a/examples/ownable-erc-721/OwnableERC721.go b/examples/ownable-erc-721/OwnableERC721.go index 36d8110..57934dd 100644 --- a/examples/ownable-erc-721/OwnableERC721.go +++ b/examples/ownable-erc-721/OwnableERC721.go @@ -1385,7 +1385,7 @@ func CreateOwnableERC721DeploymentCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -2281,7 +2281,7 @@ func CreateApproveCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -2499,7 +2499,7 @@ func CreateMintCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -2712,7 +2712,7 @@ func CreateRenounceOwnershipCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -2910,7 +2910,7 @@ func CreateSafeTransferFromCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -3142,7 +3142,7 @@ func CreateSafeTransferFrom0Command() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -3383,7 +3383,7 @@ func CreateSetApprovalForAllCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -3607,7 +3607,7 @@ func CreateTransferFromCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -3833,7 +3833,7 @@ func CreateTransferOwnershipCommand() *cobra.Command { } if safeNonceRaw == "" { - fmt.Println("--safe-nonce not specified, using default (0)") + fmt.Println("--safe-nonce not specified, fetching nonce from Safe contract") safeNonce = big.NewInt(0) } else { safeNonce = new(big.Int) @@ -4254,7 +4254,7 @@ func CreateSafeProposal(client *ethclient.Client, key *keystore.Key, safeAddress } nonce := safeNonce - if safeNonce == nil { + if safeNonce == big.NewInt(0) { // Fetch the current nonce from the Safe contract fetchedNonce, err := safeInstance.Nonce(&bind.CallOpts{}) if err != nil { diff --git a/version/version.go b/version/version.go index 9c975c4..609d487 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -var SeerVersion string = "0.3.1" +var SeerVersion string = "0.3.2"