镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

DoS Vector: Transfering relatively large amounts of DN404 always oogs #72

Open

Description

@akshatmittal

This shouldn't be a surprise, but if you create a DN404 with higher than 2.7k supply (in units, aka 18dec) and attempt to transfer ~2.7k tokens to another address, the gas consumption to mint the NFTs is over 30m reverting with oog on mainnet.

There's probably no workaround for this, but it's at least worth documenting somewhere.

Fairly easy to verify:

contract RevertTest is SoladyTest {
    SimpleDN404 dn;

    function setUp() public {
        dn = new SimpleDN404("DN404", "DN", 2700 * 10 ** 18, address(this));
    }

    function testTransfer() public { // gas: 30715623
        dn.transfer(address(1), 2_700 * 10 ** 18);
    }
}

Activity

  1. Vectorized commented on Feb 16, 2024

    @Vectorized
    Owner

    Ok, we should add a cautionary comment. Nice suggestion.

  2. Vectorized commented on Feb 16, 2024

    @Vectorized
    Owner

    WTF. kekw. @zerotwodao

  3. akshatmittal commented on Feb 16, 2024

    @akshatmittal
    Author

    @zerotwodao If it's another PoG token I'll lose my mind lol. We have enough XEN in this world. 😹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions