# Simplifying Smart Contract Deployment with Bako Safe

By [Bako Safe](https://paragraph.com/@bako-safe) · 2024-07-23

---

Simplifying Smart Contract Deployment with Bako Safe
====================================================

In this article, we introduce an exciting new feature of Bako Safe. You can now create an API token in your vault wallet, and visualize contract deployments directly within the app. This feature, together with the [SDK](https://mirror.xyz/0x28931bEad4067cc68C3A1917D06c2f216100EdA8/VoR_lMgirQDiWFkGpc1NwhMCObIMdqkE9NkLspIp7cw) and the [Connector](https://mirror.xyz/0x28931bEad4067cc68C3A1917D06c2f216100EdA8/q-S-WOJJjPKA5actCIMDDCrkhxESDeB95Nj_BCFh8hw), significantly improves the developer experience and moves us closer to being a complete asset management solution for the Fuel ecosystem.

Follow the steps below for the full process.

[![]({{DOMAIN}}/editor/youtube/play.png)](https://www.youtube.com/watch?v=ues4PTLVivM)

Setting Up Your Environment
---------------------------

### Step 1: Install Fuel Toolchain on Your Machine

Open your terminal and run:

    curl https://install.fuel.network | sh
    

### Step 2: Ensure the Toolchain is Updated

    fuelup self update
    fuelup update
    fuelup default latest
    

Creating and Using an API Token in Bako Safe
--------------------------------------------

### Step 3: Log in to Bako Safe

Go to [Bako Safe](https://safe.bako.global/) and select a vault. If you don’t have a vault with funds, you will need to create one using the `Create Vault` button, go to the new vault dashboard, and click on `+Faucet` to add funds.

### Step 4: Generate an API Token

Under `Settings`, navigate to `API Token` on the right side menu and create a new API token for the vault.

![Locate the API Token under the Settings panel](https://storage.googleapis.com/papyrus_images/12ccd11c0ec660db9f2ddffbe33976fa11b77b4dba950dbe578f7df21e86198d.png)

Locate the API Token under the Settings panel

Example token:

Copy the API token.

Deploying a Contract
--------------------

### Step 5: Prepare the Contract for Deployment

For this tutorial, we've prepared a zip file with three contracts of varying bytecode sizes. You can download it, or write your own contract.

[https://github.com/infinitybase/bako-safe-doc/tree/main/snippets/contracts](https://github.com/infinitybase/bako-safe-doc/tree/main/snippets/contracts)

Navigate to the folder of the contract you want to deploy:

    # Small bytecode contract
    cd ./contract
    
    # Medium bytecode contract
    cd ./string-list
    
    # Large bytecode contract
    cd ./nft
    

### Step 6: Open Terminal in the Contract Folder

Within the desired contract folder, open your terminal and deploy the contract using the gateway URL:

    forc deploy --default-signer --node-url 'https://api.bako.global/v1/graphql?api_token=APITOKEN'
    

Replace `APITOKEN` with your actual API token, and hit Enter. If everything works correctly, the terminal will display something like this:

    Contract contract Deployed!
    
    Network: https://api.bako.global/v1/graphql?api_token=f8da721c83c5da37000691027ccb4d629128ffe4071bd044af2d9c8052da7811dc8349c006173cdf05f265f7717d0010ea406ae74d0f0969359e97554d991d791786777f7c21a866dc1c3538defe5875
    Contract ID: 0x21edbc61306958039c28e8076bc21279b800b0fa188c8d9feec72f946b8cd520
    Deployed in block 00000000
    

### Step 7: Finalize the Deployment

Now, you will be able to see the deployment within the Bako Safe app and sign accordingly with the vault conditions.

![Visualizing contract deployed within the Vault](https://storage.googleapis.com/papyrus_images/0c170ec5619a557caad5ee672788311dbe0eefbcb414ecaebb91dd95a66b98cb.png)

Visualizing contract deployed within the Vault

In order to sign the transaction just make shure you have enough balance in your vault to pay for the gas fees. You can add token from the Fuel Faucet by clicking the Faucet button on the Vault home.

Conclusion
----------

By following these steps, you can streamline your contract deployment process with the new API token feature in Bako Safe. This enhancement not only simplifies deployment but also ensures better integration and management of assets within the Fuel ecosystem. Happy coding!

We invite you to join us on our social networks to stay updated and connect with the community:

[https://discord.gg/RNPqvQhMDD](https://discord.gg/RNPqvQhMDD)

---

*Originally published on [Bako Safe](https://paragraph.com/@bako-safe/simplifying-smart-contract-deployment-with-bako-safe)*
