You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// DeployContract deploys contract using ABI and bytecode passed to it, waits for transaction to be minted and contract really
1006
+
// available at the address, so that when the method returns it's safe to interact with it. It also saves the contract address and ABI name
1007
+
// to the contract map, so that we can use that, when tracing transactions. It is suggested to use name identical to the name of the contract Solidity file.
L.Debug().Str("Current error", retryErr.Error()).Str("Replacement error", replacementErr.Error()).Uint("Attempt", i+1).Msg("Failed to prepare replacement transaction for contract deployment. Retrying with the original one")
1078
+
return
1079
+
}
1080
+
tx=replacementTx
1081
+
default:
1082
+
// do nothing, just wait again until it's mined
1083
+
}
1084
+
L.Debug().Str("Current error", retryErr.Error()).Uint("Attempt", i+1).Msg("Waiting for contract to be deployed")
1085
+
}),
1086
+
retry.DelayType(retry.FixedDelay),
1087
+
// if gas bump retries are set to 0, we still want to retry 10 times, because what we will be retrying will be other errors (no code at address, etc.)
1088
+
// downside is that if retries are enabled and their number is low other retry errors will be retried only that number of times
1089
+
// (we could have custom logic for different retry count per error, but that seemed like an overkill, so it wasn't implemented)
1090
+
retry.Attempts(func() uint {
1091
+
ifm.Cfg.GasBumpRetries() !=0 {
1092
+
returnm.Cfg.GasBumpRetries()
1093
+
}
1094
+
return10
1095
+
}()),
1096
+
retry.RetryIf(func(errerror) bool {
1097
+
returnstrings.Contains(strings.ToLower(err.Error()), "no contract code at given address") ||
1098
+
strings.Contains(strings.ToLower(err.Error()), "no contract code after deployment") ||
// DeployContract deploys contract using ABI and bytecode passed to it, waits for transaction to be minted and contract really
1065
-
// available at the address, so that when the method returns it's safe to interact with it. It also saves the contract address and ABI name
1066
-
// to the contract map, so that we can use that, when tracing transactions. It is suggested to use name identical to the name of the contract Solidity file.
// WithReadOnlyMode sets the client to read-only mode. It removes all private keys from all Networks and disables nonce protection and ephemeral addresses.
0 commit comments