<p><strong>Goal</strong></p>
<p>I want to be able to use the <code>cardano-cli</code> to swap some tokens on SundaeSwap.</p>
<p><strong>What I have</strong></p>
<ul>
<li>Working local <code>cardano-node</code></li>
<li><code>cardano-cli</code></li>
</ul>
<p><strong>What is missing</strong></p>
<p>If I understood this correctly (please correct me if I'm wrong), I need to get the source code of the SundaeSwap smart contract, compile it somehow and then send a transaction with the correct data (datum) to the contract address. But I'm not sure how to do this and where to find the contract source code. Any help is much appreciated!</p>

CC BY-SA 4.0
2022-02-28T08:13:35.140Z
The contract code is not open source.
George - APEX Stake Pool
CC BY-SA 4.0
2022-02-28T13:06:58.800Z
Do I need the source code of the contract to call it from the CLI?
eddex
CC BY-SA 4.0
2022-02-28T16:17:06.190Z
You need the compiled version, but without the source you will not know how to use it, I assume.
George - APEX Stake Pool
CC BY-SA 4.0
2022-04-01T12:09:34.363Z
All compiled plutus scripts are on-chain, the nodes need something to run the code. You can view the compiled plutus core via almost any blockchain explorer. For example, cardanoscan.io provides this. Given a transaction that uses a smart contract you can view the tab contract (for the plutus core) and the used datum/redeemer. All this data is in CBOR encode to save space onchain. You can decode it via cbor.me. Good luck hacking/reverse engineering a way to post swap request via the client! It is possible :)
Fermat
<cardano-cli><smart-contract><transaction>
How can I execute a SundaeSwap transaction from the Cardano-CLI?
# How can I execute a SundaeSwap transaction from the Cardano-CLI?

(Asked by: username_0 on 2022-02-28)

**Goal**

I want to be able to use the `cardano-cli` to swap some tokens on SundaeSwap.

**What I have**

* Working local `cardano-node`
* `cardano-cli`

**What is missing**

If I understood this correctly (please correct me if I'm wrong), I need to get the source code of the SundaeSwap smart contract, compile it somehow and then send a transaction with the correct data (datum) to the contract address. But I'm not sure how to do this and where to find the contract source code. Any help is much appreciated!

**Tags:** cardano-cli, smart-contract, transaction
> **Comments:**
> **username_1**: The contract code is not open source.  
> **username_0**: Do I need the source code of the contract to call it from the CLI?  
> **username_1**: You need the compiled version, but without the source you will not know how to use it, I assume.  
> **username_2**: All compiled plutus scripts are on-chain, the nodes need something to run the code. You can view the compiled plutus core via almost any blockchain explorer. For example, cardanoscan.io provides this. Given a transaction that uses a smart contract you can view the tab contract (for the plutus core) and the used datum/redeemer. All this data is in CBOR encode to save space onchain. You can decode it via cbor.me. Good luck hacking/reverse engineering a way to post swap request via the client! It is possible :)  

---

## 0 answers

