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")
1063
-
return
1064
-
}
1065
-
tx=replacementTx
1066
-
default:
1067
-
// do nothing, just wait again until it's mined
1068
-
}
1069
-
L.Debug().Str("Current error", retryErr.Error()).Uint("Attempt", i+1).Msg("Waiting for contract to be deployed")
1070
-
}),
1071
-
retry.DelayType(retry.FixedDelay),
1072
-
// 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.)
1073
-
// downside is that if retries are enabled and their number is low other retry errors will be retried only that number of times
1074
-
// (we could have custom logic for different retry count per error, but that seemed like an overkill, so it wasn't implemented)
1075
-
retry.Attempts(func() uint {
1076
-
ifm.Cfg.GasBumpRetries() !=0 {
1077
-
returnm.Cfg.GasBumpRetries()
1078
-
}
1079
-
return10
1080
-
}()),
1081
-
retry.RetryIf(func(errerror) bool {
1082
-
returnstrings.Contains(strings.ToLower(err.Error()), "no contract code at given address") ||
1083
-
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
1067
+
// 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
1068
+
// 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")
1100
+
return
1101
+
}
1102
+
tx=replacementTx
1103
+
default:
1104
+
// do nothing, just wait again until it's mined
1105
+
}
1106
+
L.Debug().Str("Current error", retryErr.Error()).Uint("Attempt", i+1).Msg("Waiting for contract to be deployed")
1107
+
}),
1108
+
retry.DelayType(retry.FixedDelay),
1109
+
// 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.)
1110
+
// downside is that if retries are enabled and their number is low other retry errors will be retried only that number of times
1111
+
// (we could have custom logic for different retry count per error, but that seemed like an overkill, so it wasn't implemented)
1112
+
retry.Attempts(func() uint {
1113
+
ifm.Cfg.GasBumpRetries() !=0 {
1114
+
returnm.Cfg.GasBumpRetries()
1115
+
}
1116
+
return10
1117
+
}()),
1118
+
retry.RetryIf(func(errerror) bool {
1119
+
returnstrings.Contains(strings.ToLower(err.Error()), "no contract code at given address") ||
1120
+
strings.Contains(strings.ToLower(err.Error()), "no contract code after deployment") ||
// if err, ok := auth.Context.Value(ContextErrorKey{}).(error); ok {
1143
+
// return DeploymentData{}, errors.Wrapf(err, "aborted contract deployment for %s, because context passed in transaction options had an error set", name)
// 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")
1192
+
// return
1193
+
// }
1194
+
// tx = replacementTx
1195
+
// default:
1196
+
// // do nothing, just wait again until it's mined
1197
+
// }
1198
+
// L.Debug().Str("Current error", retryErr.Error()).Uint("Attempt", i+1).Msg("Waiting for contract to be deployed")
1199
+
// }),
1200
+
// retry.DelayType(retry.FixedDelay),
1201
+
// // 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.)
1202
+
// // downside is that if retries are enabled and their number is low other retry errors will be retried only that number of times
1203
+
// // (we could have custom logic for different retry count per error, but that seemed like an overkill, so it wasn't implemented)
1204
+
// retry.Attempts(func() uint {
1205
+
// if m.Cfg.GasBumpRetries() != 0 {
1206
+
// return m.Cfg.GasBumpRetries()
1207
+
// }
1208
+
// return 10
1209
+
// }()),
1210
+
// retry.RetryIf(func(err error) bool {
1211
+
// return strings.Contains(strings.ToLower(err.Error()), "no contract code at given address") ||
1212
+
// strings.Contains(strings.ToLower(err.Error()), "no contract code after deployment") ||
0 commit comments