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

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

Open
akshatmittal opened this issue Feb 16, 2024 · 6 comments

Comments

@akshatmittal
Copy link

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);
    }
}
@Vectorized
Copy link
Owner

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

@ghost
Copy link

ghost commented Feb 16, 2024

@akshatmittal This is intentional and I have degen'd this feature to build something new on DN404 😈

@Vectorized
Copy link
Owner

WTF. kekw. @zerotwodao

@ghost
Copy link

ghost commented Feb 16, 2024

@Vectorized Although I think if there is a function that could disable NFT transfers on behalf of other EOAs would be super cool and would increase adoption of DN404 tokens from centralized exchanges, I think it would be great if we have a simple oracle contract of merkle root to verify inclusion proofs that contains deposit wallets

@akshatmittal
Copy link
Author

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

@ghost
Copy link

ghost commented Feb 16, 2024

@akshatmittal

8g0r4d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants