Using Antegen
Antegen lets you create simple Ante Tests without writing code! All you need to do is look up a few addresses. Here's how to do it:
NFT balance check test
NFT collection address
To find the address of an NFT collection, go to the collection page on your preferred NFT marketplace and click “View on Etherscan”. (Some NFT marketplaces: OpenSea, SuperRare, Rarible)
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252F2zfT2xb8Mie8zWKw8f5k%252Fnft-link.png%3Falt%3Dmedia%26token%3D2d406c98-1b9c-402c-b5c0-c99d19758ffd&width=768&dpr=4&quality=100&sign=1a288d51&sv=1)
In Etherscan, click the “Copy” button by the contract address, then paste this into the "NFT collection address" field.
NFT holder address
From the NFT collection Etherscan page, click on the "Token Tracker" link:
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252F7bFn81XYKsIbxKBn82Lv%252FGroup%252024.png%3Falt%3Dmedia%26token%3Da49c7a78-7543-4789-a96e-39dda5fd6088&width=768&dpr=4&quality=100&sign=302a1248&sv=1)
Then select the "Holders" tab to view top holders of that NFT collection:
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252FcXkZnPxuQrjBpuj9CyE3%252Fimage.png%3Falt%3Dmedia%26token%3Dfcf4aa70-3ea7-42aa-bc08-2da6ad1e109e&width=300&dpr=4&quality=100&sign=accfce6c&sv=1)
Minimum balance held
Choose a number between 1 and the number of NFTs from the collection the holder currently holds.
If the holder has fewer than this number of NFTs from the collection, the test will fail.
Token balance check
Token address
Go to Etherscan (or other block explorer for the chain) and select a token.
Under "Other Info", click the Copy icon next to "Token Contract" to copy the contract address.
Token holder address
On the Etherscan page for the token, click the "Holders" tab to view top token holders.
Select one of the addresses and click the Copy icon to copy the holder address.
Minimum balance held
Choose a number between 1 and the current token balance of the holder.
If the holder's token balance drops below this number, the test will fail.
Submitting a Pull Request (PR)
If you used Antegen to generate code without deploying, here's how you can submit it to us:
Go to tests.ante.xyz and click the "Fork" button (create a free GitHub account if necessary).
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252FAsbKYedOhuY4dhxKi6ol%252Fimage.png%3Falt%3Dmedia%26token%3Db7ee34ba-40fb-4f49-861a-85ba35bc3da2&width=768&dpr=4&quality=100&sign=e3a59ea0&sv=1)
Keep the default fork settings and click "Create fork"
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252Fd0sUST81Pfb97I2ADhmR%252Fimage.png%3Falt%3Dmedia%26token%3Dd0b3c9ea-c149-4877-867b-5778bcd0e1c9&width=768&dpr=4&quality=100&sign=874592b0&sv=1)
In your forked repository, under "Add file", select "Upload files"
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252FvM8MJ1Gd5PhRLiylAe44%252Fupload.png%3Falt%3Dmedia%26token%3D209c3f7c-b86c-4185-a9d0-c80c370cddda&width=768&dpr=4&quality=100&sign=f16fa957&sv=1)
Upload the Antegen code file, enter a description, and click "Commit changes".
Open a pull request by clicking “Contribute” > “Open pull request”.
![](https://docs.ante.finance/~gitbook/image?url=https%3A%2F%2F3703626754-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYcWJGD2fAVyIUH34sMhH%252Fuploads%252FEfxoGIk8sLa4Ag0tT3fs%252Fimage.png%3Falt%3Dmedia%26token%3D4c7d0104-ad22-4edd-8ced-b202d94b239c&width=768&dpr=4&quality=100&sign=3c77f9d0&sv=1)
Enter any comments for the reviewers and click “Create pull request” to submit your test. That’s it!
Last updated