Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable gas sufficiency check for SAFE #142

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/widget/src/components/GasMessage/GasMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ export const GasMessage: React.FC<GasMessageProps> = ({ route, ...props }) => {
const { sdkConfig } = useWidgetConfig();
const isMultisigSigner = sdkConfig?.multisigConfig?.isMultisigSigner;

const validInsufficientGas = insufficientGas?.length && !isMultisigSigner;
const selectedTool = route?.steps[0]?.tool;
const bridgesForGasWarning = ['connext', 'stargate'];
chybisov marked this conversation as resolved.
Show resolved Hide resolved

// Connext and Stargate require gas to be paid in the native token of the chain
// Hence, SAFE wallet would required a minimum amount of native token to be present in the wallet
const showGasWarningForSAFE =
isMultisigSigner && selectedTool
? bridgesForGasWarning.includes(selectedTool)
: true;

const validInsufficientGas = insufficientGas?.length && showGasWarningForSAFE;

return (
<Collapse
Expand Down