bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 38쪽
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "string",
"name": "uri",
"type": "string"
}
],
"name": "safeMint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "tokenURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
```
{% endcode %}
{% endstep %}
{% step %}
In Input - **function\_name**, enter `safeMint`.
{% endstep %}
{% step %}
In Input - **args**, select **Code mode** and add the code below.
{% code lineNumbers="true" %}
```json
[
"{{Context.USER_WALLET}}",
"ipfs://{{Task.Metadata Uploader#1.result.IpfsHash}}"
]
```
{% endcode %}
{% endstep %}
{% endstepper %}
In the **Output** section, add 3 new variables, edit the Variable names by **Select Output**, and choose the variables accordingly
* Variable 1: `Context/reply` -> Task/DeepSeek R1#1/reply
* Variable 2: `Context/image` -> Task/Flux.1-dev#1/url
* Variable 3: `Context/calldata` -> Task/Contract Call Encoder#1/encoded\_data
### Create a new state: Display
In the **Output** section, add a new variable, edit the Variable name as `Context/story` by **Select Output**, select **Code mode** and add the code below.
```
{{Context.story}}
{{Context.reply}}
```
In the **Message** section, set Text and Image variables as:
* Text -> (Ref mode) Context/reply
* Image -> (Ref mode) Context/image
Then add 3 buttons:
* Button#1: Auto write
* Button#2: Restart
* Button#3: Mint
### Duplicate the Generate state and name it: Auto-write
After duplication, delete all the **Input**s.
In the **Task** section, edit the `DeepSeek R1` widget by replacing the prompts with:
```
# Role
You are a Picture Story Completer who assists users in creating imaginative sentences for each page of a picture book based on user-provided unfinished stories. Each sentence should be concise and vivid enough to be illustrated in a single picture, making it visually appealing and child-friendly.
## Skills
### Skill 1: Understand Story and Continue
- When a user provides an unfinished story, understand the story's plots, characters, and themes.
- Continue with a sentence that is vivid and suitable for illustration, aligning with the story's plots, characters, and themes.
- Maintain a child-friendly tone and ensure the sentence is easy to visualize.
### Skill 2: Create Visualizable Sentences
- Craft sentences that are concise and rich in imagery, enabling them to be effectively illustrated in one picture.
- Focus on key elements that engage and spark imagination in children.
## Output Format
Provide the output as it is, without enclosing it in single (') or double quotes (").
## Constraints:
- Only enhance or create sentences based on user prompts.
- Ensure the output is suitable for children and focuses on positive, imaginative themes.
- Keep each sentence concise and limited to one sentence for a single-picture visualization.
- Each sentence should have fewer than 30 words.
- Do not add any details beyond what the user provides.
```
In Input - **user\_prompt** (inside the DeepSeek widget settings), select **Ref mode** and choose `Context` / `Story`.
### Create a new state: Restart
In the **Output** section, add a new variable, edit the Variable names as `Context/story` by **Select Output**.
### Connect all the states
We’ve completed all necessary states at ShellAgent, now you need to add transitions to make the state machine running. The `“+”` sign on the left and right side of each state node represents the flow of states. Under the Transition section of each state represents where user interaction will change the flow of states.
Le’s go there one by one:
* `Start` to `Intro` , that’s default.
* `Intro` uses the type box connects to `Generate` , this means that `Generate` gets input from user’s input at `Intro`'s type box.
* `Generate` connects to `Display` via the `“+”` sign, means no additional user action is needed
* At `Display` state
* `Auto-write` button connects to `Auto-write` state
* `Restart` button connects to `Restart` state
* `Mint` button connects to `Display` state
* Type box (means users wants to keep writing the story) goes to `Generate`
* `Auto-write` connects to `Display` via the `“+”` sign
* `Restart` connects to Intro via the `“+”` sign
### Save
Make sure to click the **save** button in ShellAgent (even we have the auto-save function).
That’s it! You’ve completed the creation of your agent in ShellAgent, congrats!
We will introduce how to deploy the MyShell Agent you've created on MyShell in the next chapter.
## Deployment
### Create a new agent
[Create a new agent](https://app.myshell.ai/robot-workshop/create) from MyShell Workshop for deployment and fill in the required fields.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F94HdYkgjE2BeDVlRuH0C%2Fimage.png?alt=media&token=62bbe5ff-3eed-4fd6-9efe-dc4094f04393" alt="" width="563"><figcaption></figcaption></figure>
### Choose ShellAgent Mode
Choose **ShellAgent Mode** and select the configuration you created in ShellAgent.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F5YSES3quqqBHTpecQ2LO%2Fimage.png?alt=media&token=c00a145a-766c-4faa-b792-47f15c44fc54" alt=""><figcaption></figcaption></figure>
### Save and publish
Save it and you may publish it if you have a creator pass.
Enjoy your AI agent on MyShell.
***
## Notice
You may need to **Clear Memory** first to avoid errors while using.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Ff7pjVXUrsIx48MMLbQxO%2Fimage.png?alt=media&token=5c404d10-8c17-46fb-b0b4-6433cfb30c22" alt="" width="321"><figcaption></figcaption></figure>
# DeFAI Agent w/ BNB Chain
Unlocking ShellAgent’s DeFAI Features in Crypto
## Introduction
ShellAgent already provides a robust suite of multi-modal development tools, making AI agent creation more powerful and accessible than ever. But for many creators, the missing piece has been DeFAI integration, from token transfers and swaps to seamless token deployments.
If you’ve been waiting for this, good news! MyShell has now introduced blockchain functionality to ShellAgent, unlocking a new realm of possibilities for AI agents.
This document will walk you through the process, ensuring you can seamlessly build and launch on-chain AI agents. Let’s get started!
## How to Import a Template?
You can choose either ShellAgent local upload or ShellAgent cloud selection.
### ShellAgent Local Upload
Go to <https://app.myshell.ai/robot-workshop/create> and select ShellAgent Mode
If you’ve already created an agent in ShellAgent Cloud, click “Cloud” and select your agent.
If you haven’t created any agents in Cloud yet, you can import a JSON file in Local Mode instead.
{% file src="/files/QtAAW8XEiJM04PqqlDVf" %}
{% hint style="info" %}
Right-click on the above .json link and select "**Save link as...**" to download the .json file.
{% endhint %}
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fct2RdPPu3GroLfASKpms%2FScreenshot%202025-02-18%20at%204.42.38%E2%80%AFPM.png?alt=media&token=cce2ae0e-4b01-4887-aa2c-56c565ca2cea" alt=""><figcaption></figcaption></figure>
### ShellAgent Cloud Selection
{% stepper %}
{% step %}
**Create an agent from templates**
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FubhDHIOfsZ87SQBlO2XC%2Fimage.png?alt=media&token=0c387666-7d0f-4a43-9145-95d3ea90301b" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% step %}
**Choose the template**
Choose the template of <mark style="color:purple;">DeFAI Agent</mark>.
{% endstep %}
{% step %}
**Save your configuration**
Click the **Save** button on the top right corner of the interface
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FLM4IbMvVbQAzkwcFfjzY%2Fimage.png?alt=media&token=2fdaf3f5-8247-4788-bca1-c35d6f4bd3cb" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
## Setting up the Greeting Message
Create a greeting message here to define your agent’s personality and clearly communicate its purpose to users.
{% code overflow="wrap" lineNumbers="true" %}
```json
👋 Hello there! I'm your BSC agent. 💼
I'm here to help you navigate the blockchain safely and efficiently!
🛡️ Without my help, you may accidentally authorize phishing contracts, so I'm here to assist with secure transactions. 🎣
Ready to get started? Here are your options:
🔄 To transfer assets, tap "Transfer Token"
💱 To swap assets, hit "Swap Tokens"
🚀 To deploy tokens in one click, select "Deploy Token"
⚠️ Swap Tokens Protection: we offer only a select group of popular tokens to minimize slippage issues in illiquid pairs. If you observe significant price drops during swapping, please cancel the transaction immediately!
⚠️ Swap Tokens Protection: Only WBNB pools are supported. Make sure either the base token or the quote token is WBNB.
```
{% endcode %}
## Transfer Function
The Transfer workflow is structured into three key states, managing your agent’s transfer functionality. The default settings are optimized to work seamlessly without the need for modifications.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FcskWBMoGa0pSQJUCtgsQ%2Fimage.png?alt=media&token=c10adc92-a33d-4be6-936f-967d735e1eae" alt=""><figcaption></figcaption></figure>
#### Transfer Form
When users initiate the “Transfer Token” workflow, they can define the token type, transfer amount, and recipient address. These details are then passed to the next state for processing.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FKdEaqUBWhpeLgVARXNUj%2Fimage.png?alt=media&token=8273b3d1-b5ca-44c4-872b-98728a5330b4" alt="" width="375"><figcaption></figcaption></figure>
#### Token Info
Once the Transfer Form input is received, the system queries the Wallet Asset Explorer widget and utilizes LLM to generate the transfer details.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F8xD8eCKMrpYQxFy1tt2E%2Fimage.png?alt=media&token=60f41d49-6922-4e31-8f91-e5fb783a8e21" alt=""><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F0QvbWpUgJqMVhlBcWtlQ%2Fimage.png?alt=media&token=e73a9031-1f75-4f1c-9263-758b17cd939a" alt=""><figcaption></figcaption></figure>
#### Transfer BNB / Transfer ERC-20
Once the information is displayed, the process advances to its final state.
The transition is smooth and intuitive, allowing users to review the recipient address and details before proceeding.
When users click the “Transfer” button, a wallet popup will appear, prompting them to sign the transaction.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FcHrV7g1b3qj9sggA9q8C%2Fimage.png?alt=media&token=195639d6-9e08-46e6-80c8-bf5f473445a7" alt=""><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fjdb2uXsfsZBFROA0wKvo%2Fimage.png?alt=media&token=ed222791-6965-4cd4-8e2a-c4b70bc7b87a" alt="" width="196"><figcaption></figcaption></figure>
### Swap Token
The Swap token workflow has three states designed to guide users through the token swapping process.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fmv4Et92JbvTuMPinEbuM%2Fimage.png?alt=media&token=56de9420-3eb0-47d9-bb29-b25af417525f" alt=""><figcaption></figcaption></figure>
**Swap form**:
⚠️ Swap Tokens Protection: To minimize slippage in illiquid pairs, only a curated selection of popular tokens is available.
⚠️ Only WBNB pools are supported. Make sure either the base token or the quote token is WBNB.
The Swap function is a predefined feature, not a widget. Do not modify the token options in the list or the token variables in the output, as this will cause errors.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FBIB4D3S37KerAphGpnDI%2Fimage.png?alt=media&token=94266432-acfe-49cc-9d46-6a6e87d3d809" alt="" width="375"><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F8iCFpkt7QyiYrjqiYzJt%2Fimage.png?alt=media&token=825c2597-4586-4885-8c40-13a2ef520e68" alt=""><figcaption></figcaption></figure>
Once the “Swap Token” workflow is triggered, users can enter the swap amount (how much base token to pay) and select the From/To tokens using the dropdown menu.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Ft7xGrInWgHArgLOV458x%2Fimage.png?alt=media&token=812510c9-6e68-419f-8cd9-7a44b65be4d4" alt="" width="375"><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F8AdjV3plAd996ZXXIrSW%2Fimage.png?alt=media&token=fa680993-b5df-4338-a9f5-bd8216a2417f" alt="" width="375"><figcaption></figcaption></figure>
### Approve Token
Before placing a swap order, users must grant approval for the PancakeSwap v3 contract to access their tokens.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FMPy5mxOIuoRlS5Jxy0Bb%2Fimage.png?alt=media&token=1e8c616f-419e-451f-af15-1e5f28d65990" alt=""><figcaption></figcaption></figure>
Clicking the "Approve" button in this state triggers an authorization popup.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FcVvgbYK0oRtXfAJoedGJ%2Fimage.png?alt=media&token=e44c05d9-905a-4a7b-8b54-bb36d65310c3" alt="" width="563"><figcaption></figcaption></figure>
Clicking "Skip" automatically advances to the next state.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FJnjoEjLiSlQVKNpuJaFJ%2Fimage.png?alt=media&token=97afed23-98fd-4ddd-89c1-91b3ff1702c8" alt="" width="199"><figcaption></figcaption></figure>
### Swap
In this state, users can review and confirm their trading pair. Clicking “Swap” will trigger the wallet plugin to process the transaction.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fb2CYWJLWhu2BzfU9HHTj%2Fimage.png?alt=media&token=a5c90fd6-2809-40f8-abba-ef60d827ee99" alt="" width="163"><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FDWjLlOjMfyODkoAMxQL2%2Fimage.png?alt=media&token=6028fbc0-522f-447d-a0b4-e5a7ded109eb" alt="" width="198"><figcaption></figcaption></figure>
## Deploy Token on BSC
The process consists of two main states, making it simple and easy to follow.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FHVCL5OcNZ5bX0D4ok00c%2Fimage.png?alt=media&token=a027a2e5-485f-4f01-88bd-96f789dad5e0" alt=""><figcaption></figcaption></figure>
### Deploy Form
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FT8TTfrRI2j2g4RbC0JMF%2Fimage.png?alt=media&token=625c9e8f-05ba-4da4-afda-301add9de2e4" alt="" width="184"><figcaption></figcaption></figure>
When users start the “Deploy Token” workflow, they only need to enter their desired token name and symbol to get started.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F7Fg5CxmbEl7Vpzr1PLP7%2Fimage.png?alt=media&token=82b1e230-7073-429b-a14d-b21eed377bf4" alt="" width="375"><figcaption></figcaption></figure>
### Deploy BEP20
The deployment process is powered by the “Contract Call Encoder” widget.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FOtqKi06lSqbHiVs99QkK%2Fimage.png?alt=media&token=7de9af2f-b64c-4baa-9603-4143dd97bf06" alt=""><figcaption></figcaption></figure>
Once users confirm the format and options, clicking “Deploy” will trigger a wallet popup to finalize the process.
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FtqZBURqOCkh6oZAnuTX2%2Fimage.png?alt=media&token=6fb401e5-57dc-4819-af01-d6c748555ef0" alt=""><figcaption></figcaption></figure>
<figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FmyInTkF2sioqwFrs5q4L%2Fimage.png?alt=media&to프로젝트로 돌아가기