Skip to content

Commit 8038f4d

Browse files
authored
feat: Enable BSC for smart transactions (#29747)
## **Description** Enables BSC for smart transactions and reduces status check time to 1s. We can turn off BSC support for smart transactions remotely if needed. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29747?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Make sure smart transactions are enabled in Advanced Settings 2. Be on the BNB Chain 3. Submit a tx. It will be submitted as a smart transaction Happy paths tested for Swaps, Send and dapp transactions, but this will require extensive testing before it goes to production. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 8f82ac4 commit 8038f4d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

shared/constants/smartTransactions.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ describe('smartTransactions', () => {
2121
expect(allowedChainIds).toStrictEqual([
2222
CHAIN_IDS.MAINNET,
2323
CHAIN_IDS.SEPOLIA,
24+
CHAIN_IDS.BSC,
2425
]);
2526
});
2627

2728
it('should return the correct chain IDs for production environment', () => {
2829
mockIsProduction.mockReturnValue(true);
2930
const allowedChainIds = getAllowedSmartTransactionsChainIds();
30-
expect(allowedChainIds).toStrictEqual([CHAIN_IDS.MAINNET]);
31+
expect(allowedChainIds).toStrictEqual([CHAIN_IDS.MAINNET, CHAIN_IDS.BSC]);
3132
});
3233
});
3334
});

shared/constants/smartTransactions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ export const FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER: number = 2;
1111
const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_DEVELOPMENT: string[] = [
1212
CHAIN_IDS.MAINNET,
1313
CHAIN_IDS.SEPOLIA,
14+
CHAIN_IDS.BSC,
1415
];
1516

1617
const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_PRODUCTION: string[] = [
1718
CHAIN_IDS.MAINNET,
19+
CHAIN_IDS.BSC,
1820
];
1921

2022
export const getAllowedSmartTransactionsChainIds = (): string[] => {

0 commit comments

Comments
 (0)