How to deploy contracts using OP Credits with thirdweb Engine

This guide requires the use of thirdweb Engine. If you do not have a thirdweb Engine, you can request one here

Step 1: Deploy Account Factory

To get started, we will first deploy an Account Factory Contract on the OP Superchain of our choice, in this case, we are deploying on OP Mainnet.

Step 2: Create a smart account via thirdweb Engine

Once you have deployed your Account Factory, now we will create a smart account via thirdweb Engine.

Head over to your Engine instance and select the Explorer tab. From there, scroll down to the Account Factory dropdown and select Create smart account

Notion image

Enter the Chain, the contract address of the Account Factory, and the backend wallet address for your Engine instance.

 

In the Request body, ensure you set the adminAddress to your instance’s backend wallet address.

Notion image
 

Execute the transaction, and you should see a response similar to the one below, containing the queueId and the deployedAddress (the smart wallet address)

Notion image
 

Step 3: Deploy an NFT Collection

Now that we have our smart account deployed, and our backend wallet set as admin for it, we can deploy a contract using our OP credits! Staying in the Engine → Explorer tab, scroll up to find the Deploy dropdown. In our case, we are going to deploy an NFT Collection.

Notion image

As before, we set the chain and the backend wallet; however, this time, we will also use x-account-address which will be the smart account we deployed previously.

 
Notion image

Update your contractMetadata and click Execute

Notion image

Here, we can see the Response shows the queueId and deployedAddress (Our NFT Collection)

 

Back on our Engine dashboard, we can check the transaction, grab the transaction hash, and see that the contract was deployed and the gas was paid without any OP funds in the smart account we created.

Notion image
 

And just like that! You have successfully deployed a contract using your OP Credits! This guide can be applied to any on-chain action with Engine using your OP Credits.

 

Have any questions about this guide or need support? Reach out to us here!

 
Did this answer your question?
😞
😐
🤩