Most Ethereum layer 2 solutions come with two types of fees: the Layer 1 (L1) fee and the Layer 2 (L2) fee. Right now, MetaMask can only estimate L2 fees and doesn't consider L1 fees. Interestingly, due to the high gas costs on Ethereum, the L1 data fee often ends up being the main contributor to the total transaction cost. This situation can take many L2 users by surprise, leaving them feeling confused and frustrated when they end up paying more than they expected. This MetaMask Snap (extension) provides a clear preview of the fees you'll face before you confirm your transaction.
![metamask-lowEth](https://private-user-images.githubusercontent.com/19164358/261875078-1dde7d1e-644c-4899-bf9d-0b07429b145b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MzczMzMsIm5iZiI6MTcyNTgzNzAzMywicGF0aCI6Ii8xOTE2NDM1OC8yNjE4NzUwNzgtMWRkZTdkMWUtNjQ0Yy00ODk5LWJmOWQtMGIwNzQyOWIxNDViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDIzMTAzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4M2ViNDA2NDUzOTE4ZTk3MWE3MzQ4NmFhNjM2NzIzNmYzZDk5ZWIwODMzOThlM2ZhMmIwMDJhZjBjODJiMDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tmwfKG-sk0_YPAY_3wM7H66NnnxgMor7vkWgGiQHfzo)
![metamask-normal-tx](https://private-user-images.githubusercontent.com/19164358/261875081-42c609f0-6739-4728-a9ed-77086896c915.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MzczMzMsIm5iZiI6MTcyNTgzNzAzMywicGF0aCI6Ii8xOTE2NDM1OC8yNjE4NzUwODEtNDJjNjA5ZjAtNjczOS00NzI4LWE5ZWQtNzcwODY4OTZjOTE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDIzMTAzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzOWNhNzEwZmYwM2RjOTQ2YzNlMTM4Zjk4YjdhMTg2ZTg3Y2NmY2IzYTRmZTNmZjE3ODE2OWI0MGIxNTViM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DZg2PD55Bb2u_w2n8cfw_3QisUg4jy1SWaJwhNIArLk)
![metamask-maxEth](https://private-user-images.githubusercontent.com/19164358/261875083-bad1229f-cf5e-436f-80b7-381cd1f25794.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MzczMzMsIm5iZiI6MTcyNTgzNzAzMywicGF0aCI6Ii8xOTE2NDM1OC8yNjE4NzUwODMtYmFkMTIyOWYtY2Y1ZS00MzZmLTgwYjctMzgxY2QxZjI1Nzk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDIzMTAzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjMmQ5ZjI0YzYwMDEzOGE0MTAyOTg5ZTZjYmFmYmZlYWZkOTgyOTllMmVkZjg5ODc3MzlmNDVmMGE1NjMxZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.NwCunb8tIZwIgx-UcngSDONC_buQTECcpT2BaF8EgdA)
- Optimism
- Optimism Goerli
- Base
- Base Goerli
- Scroll Mainnet
- Scroll Sepolia Testnet
- Scroll Alpha Testnet
More chains to come!
MetaMask Flask is required. You can install the latest version Here
Clone this repository and setup the development environment:
yarn install && yarn start
Run yarn test
to run the tests once.
Run yarn lint
to run the linter, or run yarn lint:fix
to run the linter and fix any automatically fixable issues.
- Babel is used for transpiling TypeScript to JavaScript, so when building with the CLI,
transpilationMode
must be set tolocalOnly
(default) orlocalAndDeps
.
- Write unit and integrated tests
- build and deploy to NPM automatically