# EOSIO Side Setup

### Steps:

[Install Zeus](https://docs.liquidapps.io/liquidapps-documentation/working-with-zeus-sdk/overview/install-zeus-and-unboxing) if not installed, zeus is used to unbox or install all the necessary dependencies to compile and deploy the necessary contracts.

{% hint style="warning" %}
Ensure you're using node version 16, IPFS can be picky with other versions
{% endhint %}

[**Unbox**](https://docs.liquidapps.io/liquidapps-documentation/working-with-zeus-sdk/overview/install-zeus-and-unboxing) **`binancetokenpeg` box**

```bash
mkdir binancetokenpeg
cd binancetokenpeg
zeus box create
zeus unbox binancetokenpeg
```

**Compile contracts**

```bash
zeus compile
```

**Create 3 Kylin and 3 Binance Smart Chain Testnet accounts using these guides:**

* Kylin Testnet: [link](https://app.gitbook.com/@liquidapps/s/liquidapps-documentation/~/drafts/-Mb1Zoyox7XB-SUm-Ssl/eosio-guides/creating-cryptokylin-account)
* Binance Smart Chain Testnet: [link](https://app.gitbook.com/@liquidapps/s/liquidapps-documentation/~/drafts/-Mb1Zoyox7XB-SUm-Ssl/eosio-guides/create-binance-smart-chain-testnet-account-1)

**Kylin Accounts:**

* Kylin token contract account (token being bridged `eosio.token.cpp`)
* Kylin bridge contract account (`binancetokenpeg.cpp`)
* Kylin test Account **no contract**

**BSC Testnet Accounts**

* BSCTestnet token contract account (token on BSCTestnet to mint/burn tokens `BEP20TokenImplementation.sol`)
* BSCTestnet bridge contract Account (`binancetokenpeg.sol`)
* BSCTestnet test Account **no contract**

```bash
export KYLIN_BRIDGE_ACCOUNT=bsctestbridg
export KYLIN_TOKEN_ACCOUNT=bsctesttoken
export KYLIN_TEST_ACCOUNT=natdeveloper
export KYLIN_ENDPOINT=https://kylin.eosn.io
```

**Import our keys into zeus to deploy contracts to Kylin, or can use cleos as well**

{% tabs %}
{% tab title="Zeus" %}

```bash
zeus key import $KYLIN_BRIDGE_ACCOUNT --network kylin --active-private-key 5JB... --owner-private-key 5JB...
zeus key import $KYLIN_TOKEN_ACCOUNT --network kylin --active-private-key 5JB... --owner-private-key 5JB...
```

{% endtab %}

{% tab title="cleos" %}

```bash
# import owner private key
cleos wallet import --private-key 5JB...
# import active private key
cleos wallet import --private-key 5JB...
```

{% endtab %}
{% endtabs %}

**Create contract deployment files to migrate contracts to Kylin, located in** `./zeus_boxes/contract-migrations-extensions/models/contract-deployments/`

```bash
zeus create contract-deployment binancetokenpeg $KYLIN_BRIDGE_ACCOUNT kylin
zeus create contract-deployment eosio.token $KYLIN_TOKEN_ACCOUNT kylin
```

**Migrate contracts to Kylin/Jungle**

{% tabs %}
{% tab title="Zeus Migrate" %}

```bash
zeus migrate binancetokenpeg --network=kylin --creator $KYLIN_BRIDGE_ACCOUNT --no-reset --no-compile-all --creator-key=""
zeus migrate eosio.token --network=kylin --creator $KYLIN_TOKEN_ACCOUNT --no-reset --no-compile-all --creator-key=""
```

{% endtab %}

{% tab title="cleos set contract" %}

```bash
# if migration fails
cd contracts/eos
cleos -u $KYLIN_ENDPOINT set contract $KYLIN_BRIDGE_ACCOUNT binancetokenpeg
cleos -u $KYLIN_ENDPOINT set contract $KYLIN_TOKEN_ACCOUNT eosio.token
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you use cleos to set the contract, be sure to set the `eosio.code` permission level, see [here](https://docs.liquidapps.io/liquidapps-documentation/eosio-guides/testnet-creation-guides/creating-cryptokylin-account)
{% endhint %}

### **Initialize Kylin token contract**

**Create tokens**

For Kylin, we'll set the `issuer` to the token contract, this is to simulate a pre-existing token that is being bridged to another chain. &#x20;

{% tabs %}
{% tab title="Kylin" %}

```bash
export MAX_SUPPLY="1000000.0000 TKN"
export ISSUER=$KYLIN_TOKEN_ACCOUNT # token contract itself
cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT create "[\"$ISSUER\",\"$MAX_SUPPLY\"]" -p $KYLIN_TOKEN_ACCOUNT@active
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you get errors such as **Transaction exceeded the current network usage limit imposed on the transaction**, see the [Kylin](https://docs.liquidapps.io/liquidapps-documentation/eosio-guides/testnet-creation-guides/creating-cryptokylin-account) account setup guide to get more tokens and to stake for more resources.
{% endhint %}

**Issue test tokens**

We will issue some test tokens to our test account.

```bash
export TO=$KYLIN_TOKEN_ACCOUNT
export QUANTITY="10.0000 TKN"
export MEMO="issuing tokens"
cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT issue "[\"$TO\",\"$QUANTITY\",\"$MEMO\"]" -p $KYLIN_TOKEN_ACCOUNT@active
```

**Transfer test tokens**

Now we will transfer the issued tokens to the test account so that it may be sent to the bridge.

```bash
export FROM=$KYLIN_TOKEN_ACCOUNT
export TO=$KYLIN_TEST_ACCOUNT
export QUANTITY="10.0000 TKN"
export MEMO="don't spend it all in one place!"
cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT transfer "[\"$FROM\",\"$TO\",\"$QUANTITY\",\"$MEMO\"]" -p $KYLIN_TOKEN_ACCOUNT@active
```

**Stake for services**

Now that we've prepared that part let's move onto staking DAPP for services. First stop is the faucet for some DAPP tokens [here](https://kylin-dapp-faucet.liquidapps.io/). Use the account that has the `binancetokenpeg` contract set to it.

**Stake to required services vRAM, LiquidHarmony Oracles, LiquidScheduler, LiquidLink**

Using the DSP Portal we can see these packages, stake 10 DAPP to each (**Amount to Stake**):

Below we'll select each package then stake for it.

{% tabs %}
{% tab title="vRAM" %}

```bash
export PROVIDER=uuddlrlrbass
export PACKAGE=ipfs2
export SERVICE=ipfsservice1
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
```

{% endtab %}

{% tab title="LiquidHarmony" %}

```bash
export PROVIDER=uuddlrlrbass
export PACKAGE=oracleservi2
export SERVICE=oracleservic
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
```

{% endtab %}

{% tab title="LiquidScheduler" %}

```bash
export PROVIDER=uuddlrlrbass
export PACKAGE=cronservice2
export SERVICE=cronservices
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
```

{% endtab %}

{% tab title="LiquidLink" %}

```bash
export PROVIDER=uuddlrlrbass
export PACKAGE=sign
export SERVICE=signfndspsvc
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Use the **command line** login option, *top right*, this will auto-create the cleos commands for you!
{% endhint %}

Now let's head over to the EVM side.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liquidapps.io/liquidapps-documentation/cross-chain-bridges/getting-started-with-liquidbridge/eosio-less-than-greater-than-evm/eosio-side-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
