Tutorial 2: Example automation using AutoStation
Last updated
Last updated
In this tutorial we will use AutoStation to change a NFT image based on an arbitrary condition, essentially allowing NFT's to evolve or shape-shift automatically. The Mystique contract is a simple ERC721 contract that has the ability to change URI when a certain condition is met, thereby ‘shapeshifting’. You can change the baseURI by calling the setNewBaseURI function. To automatically change the appearance of the NFT's from the Mystique contract follow the steps below: 1) Enter AutoStation connect your wallet and click the Manage tab. Deposit some native currency to fund your automations. You can withdraw at any time.
2) Head back to the Automate tab, and click on the 'Create Automation' button.
3) Input automation name, and pick an action card ( you can easily switch between action and condition by clicking the arrows). This view also shows many different cards, essentially there are three sets of cards, there is custom cards ( cards that let you specify any contract verified or non-verified ), autonomy preset cards (cards built by the Autonomy Team) and community cards (cards that are uploaded by anyone in the community, to view them unselect curated). For this example we will select the custom card, if your contract is not verified then there will be a field to manually input that.
4) Once you have clicked on custom and added the address input you should be able to see a function selector. For this example you should select the setNewBaseURI function.
5) Fill in the _newURI parameter and click on the + button at the bottom of the page. (You can also collapse the card by clicking on the - button)
6) Now we are going to set a specific time for when we want the URI to change, so we are going to create a condition card. This time we are going to pick an Autonomy Preset card ( they are different from custom because the Autonomy team designed a more friendly interface to interact with certain contracts). We will pick the Time Condition Card.
7) We will select the one-time automation and fill in the inputs, to when you want your NFT to evolve or shape-shift. Then click on the Automate button.
8) Once your transaction has been mined we are DONE! you can see your newRequest on the Autonomy Registry by looking up the address here
, you can now sit back and relax. Once the time condition is met, the Autonomy Bots will execute your request and the new URI will be set for the Mystique contract. You can setup more complex conditions, for example you could make it such that an NFT evolves based on the price of ETH or based on your USDC balance etc.
* IMPORTANT: Depending on what contracts you use or how you set up your contracts, you might need to define if you need to verify the user or send some native currency with the request, for example using a recurring automation typically requires user verification. For more information please refer to the last 29 minutes of this video or read the docs carefully. When setting up a custom automation you are able to set this variables by clicking on the cog button.