Harrison Zokyo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## Gas Token "Revoke" Scam        As blockchain technologies continue to foster innovation and new ideologies, we must recognize that malicious users will do the same. To use certain smart contracts, users may give approve smart contracts to use X amount of their tokens. Most platforms give infinite approvals to their smart contracts meaning that a user could have limitless losses in the event the contract was exploited. To mitigate this, some users only approve a certain amount per transaction. However, this creates a worse user experience and can be more expensive depending on what chain each approval is sent.        When a smart contract is exploited, users are told to revoke all approvals to the exploited contract. Revoking approvals is done to not be susceptible to non-approved transactions. After an exploit, it is common to see many websites that will mimic the exploited platform and try to trick users into signing an approval of all their assets. These phishing platforms will state "Please revoke your tokens". Instead of protecting yourself, you are signing all your assets over.        However, this new exploit encompasses a new technique of scamming via tokenized gas. Due to the absence of [eip-3529](https://eips.ethereum.org/EIPS/eip-3529) on the BNB chain, the scammer was able to steal some of the users' transaction fee. The malicious behavior occurs when a “[revoke](https://revoke.cash/)” is issued to safeguard a user’s funds, but instead it maliciously mints tokenized gas to the scammer. Consequently, all EVM chains that have not implemented eip-3529 are strongly advised to do so.        The user’s funds, outside of the large transaction fee, of this revoke approval scam are “safe”. Compared to [previous approval scams](https://ethereum.org/en/security/#:~:text=You%20will%20get%20prompted%20to,private%20keys%20to%20the%20scammer.) that steals all the user's assets, this exploit only steals money via the large [transaction fee](https://bscscan.com/tx/0x7d3e1abaf857abd39e557ccb908c8273c436fd11d22f63c2791c73473bef63ad). Users should be careful about what they are signing. Transaction fees on networks such as BNB should not be $65. ### What Are Gas Tokens? ![](https://hackmd.io/_uploads/BJQn8TB5h.png)        On the Ethereum network, gwei is auctioned off each block. As users could not predict the future gas price, gas tokens were introduced to hedge against gwei volatility. The [Chi Token](https://blog.1inch.io/1inch-introduces-chi-gastoken/) was introduced by [1nch](https://app.1inch.io/) as the most efficient gas token. By tokenizing gas, users and developers could "lock" the current gwei rate and save later on. Other considerations such as [eip-1559](https://eips.ethereum.org/EIPS/eip-1559) have been implemented to protect users from the transaction fee volatility and attempting to make block fees more predictable.        Tokenization of gas came with disadvantages such as filling up unnecessary block space. As a consequence of users exploiting higher refund costs, [eip-3529](https://eips.ethereum.org/EIPS/eip-3529) was introduced to remove tokenizing gas. However, not all EVM chains implemented this. As such, the exploit explained below was on BNB network. ### How Do Gas Tokens Really Work?        Gas tokens work by filling up the blockchain with junk data. When storage is cleared on Ethereum before eip-3529, users were granted large gas refunds. During a transaction, there is a refund counter that separately counts the amount of gas to be refunded at the end of the transaction. `SELFDESTRUCT` and `SSTORE` refunds were introduced for ["good state hygiene"](https://eips.ethereum.org/EIPS/eip-3298). By clearing or deleting storage, a user could get a refund of 15,000 gas. If the user self-destructed the contract, the refund was 24,000 gas. When gas is lower, a user can write to the state and use it to help pay for a transaction when the gas is higher. Since the maximum refund can only equal half of the gas consumed, it can be a sizable savings if the gas price is high. ### What Happened?        The exploit works by tricking the user to assuming the transaction fee to revoke is expensive. A fake [Dai Token](https://bscscan.com/address/0x1af32e8488822bf8e2fff374de8d737ecfb368c3) is used to spoof users into thinking their fund will be lost. Users pay a large transaction fee to mint the exploiter. This [Scam Transaction](https://bscscan.com/tx/0x7d3e1abaf857abd39e557ccb908c8273c436fd11d22f63c2791c73473bef63ad) will be used for the following example: 1. User signs transaction spoofed revoke. - This looks completely harmless to the user signing as they will not lose any funds other than the transaction fee charged. 2. Approval method takes in the correct amount to the correct revoked address. ![](https://hackmd.io/_uploads/SJ5I93B5h.png) 4. Emits the proper revoke. - The transaction appears to be harmless! ![](https://hackmd.io/_uploads/rk427Tr5n.png) 4. Calls the function `0x1c5e()`. - This funciton is where the scam occurs. ![](https://hackmd.io/_uploads/BJOSqhH5n.png) The storage slot 75 is equal to the Chi Token. ![](https://hackmd.io/_uploads/BJDaLiS52.png) ![](https://hackmd.io/_uploads/Hkmewsr9h.png) 6. `0x1c5e()` then uses the amount of gas sent for the transaction to. mint the phishing contrac Tokens. ![](https://hackmd.io/_uploads/BJiw4pB9n.png) 6. The return is hard coded to always be true. ### Asset Tracing The [Chi Tokens](https://blog.1inch.io/1inch-introduces-chi-gastoken/) currently reside inside of the [Fake Dai Token](https://bscscan.com/token/0x0000000000004946c0e9f43f4dee607b0ef1fa1c?a=0x1af32e8488822bf8e2fff374de8d737ecfb368c3) contract. However, the [exploiter](https://bscscan.com/address/0x8639b763e40a8b42fd9008b7d3d1f3a9caba87a4) that created the [Fake Dai Token](https://bscscan.com/token/0x0000000000004946c0e9f43f4dee607b0ef1fa1c?a=0x1af32e8488822bf8e2fff374de8d737ecfb368c3) received funds from [0xe964c0..2db5](https://bscscan.com/address/0xe964c0adb82465e15c58468b5a8298f38db02db5) which was [funded](https://bscscan.com/tx/0x9f4ecfbd4d6b2851fe28ba24d5ae3577354ef47a8c7c13e9ceb3ad0d04a8ddf9) by Tornado Cash. Total Assets lost is just roughly $3000-4000, but the scammer can only receive $400-500 as the price in the LP is much lower than the transaction fee charged. ## Notices for EVM Compatible Chains        All EVM compatible chains should implement [eip-3529](https://eips.ethereum.org/EIPS/eip-3529) as to stop this scam from happening. As we cannot stop malicious users from exploiting users funds, we can implement eip's to mitigate as is feasible. ## Key Takeaways and Recommendations Proper key management and password management is crucial to ensuring your wallet is safe. Below are some critical security measures that everyone should use. - 2FA should be enabled on all accounts. - Since 2FA SMS spoofing is possible, a security key can be used to mitigate this concern. - A password manager for more complex passwords and ensuring that passwords are not reused on each platform. - Proper education around wallet security. - Careful consideration of what a user is signing. - A User can check the smart contract on the respective blockchain they are signing. ## Copy paste Zokyo Disclaimer portion

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully