Deploying Smart Contracts to Stacks
Inspiration
We built Smart Contract GPT to help developers deploy clarity smart contracts to the Stacks blockchain using programing languages they are used to like Solidity, or just through prompting. With the variety of smart contract blockchains available today a tool that can convert syntax and fill in the knowledge gaps for someone coming to a new platform can be very useful. Our goal is to onboard Stacks smart contract developers easier than ever before.
What We Learned
Throughout the development of this project, we delved deeply into Clarity, Clarinet, Stacks.js and Stacks. The understandably long block times present on Stacks (even testnet) can be a blocker during the development process. Our app can be a great help to push changes and test prototypes on testnet quicker than ever before. Additionally, users can deploy to devnet for the most optimal developer experience.
How We Built It
We built this using Next.js Vercel-AI, Open AI, Stacks.js and Clarinet. Our Chatbot is tuned with SIP-009 smart contract examples and prompted to guide the user in writing and converting smart contract code. At the core of our project lies a schema tailored for our AI chatbot. This schema is adept at interpreting user deployment requests for contracts, offering them options to specify the network (testnet, mainnet, or devnet), and inputting the contract's name and source code.
We further fused this with the Stacks JS library, which takes on the mantle of actual deployment to the chosen network. Users can deploy with their own wallet or deploy without needing a wallet at all using our sponsored deployment option.
We planned on adding l402 to our backend deployment API but ran out of time. However our API is still publicly accessible at smart-contract-gpt.vercel.app/api/deploy-contract for anyone wanting to deploy contracts to Stacks using a REST API (testnet only atm).
Challenges We Faced
One of the largest challenges was working with the long block times on testnet as a new Clarity / Stacks developer. The solution to this was setting up a devnet however that had it's own learning curve and some difficulty. Another challenge was generating good, up to date practices for Clarity smart contracts. To overcome this we added SIP-009 examples from popular NFT contracts from Stacks Mainnet.



Log in or sign up for Devpost to join the conversation.