Deploying an FAssets Agent#
The FAssets agents play an essential role and help to run the system, allowing tokens on blockchains that do not support smart contracts to be used trustlessly with smart contracts on the Flare blockchain.
This guide provides the following information:
- How to set up the FAssets command line interface;
- How to set up access keys for interacting with the Flare test and FAssets underlying networks;
- How to set up an FAssets agent and provide collateral;
- How to run the agent so FAssets system users can convert (mint and redeem) assets from the underlying networks to the Flare test network and back.
Open Beta
The FAssets system is currently in the Open Beta period. During this phase, user-friendly tools are still being developed.
Some web browsers and ad blockers might prevent this functionality.
Alternatively, you can contact support@flarelabs.org.
Contract Addresses#
These are important FAssets smart contract addresses representing test tokens and notable system components, provided for your convenience during the Open Beta on the Coston test network. Please note that these addresses are exclusive to the Coston test network and unavailable on other Flare networks.
Test Tokens#
These are ERC-20 representations of test tokens to be used by the FAssets system:
FAssets System Contracts#
-
AgentOwnerRegistry
: 0xDb6c11b8D074D4488f5fFd0129AA5F91C4f00fb6Allows whitelisting agents, and setting, and retrieving information like their work and management address, name, description and icon.
-
FTestXRP
: 0x51B1ac96027e55c29Ece8a6fD99DdDdd01F22F6cThe FAsset-wrapped TestXRP token, ready to be used on Coston.
-
FTestBTC
: 0xe01b2151b684b83C771449D8A6D1d1764f03829eThe FAsset-wrapped TextBTC token, ready to be used on Coston.
-
FTestDOGE
: 0x353D20c6eB0C7bfcE3B828665C992DE995eF67bdThe FAsset-wrapped TextDOGE token, ready to be used on Coston.
Prerequisites#
You need a server with at least a minimum of 2 CPUs and 4GB RAM, or 2GB if the database is on a separate server.
You need knowledge of the following tools:
- Git version control system
- Yarn package manager
- A wallet configured for Flare networks
- Command-line terminal
- Code editor
- MySQL or PostgreSQL server
Warning
If you are using Windows, it is strongly recommended to use Windows Subsystem for Linux, version 2 (WSL 2).
Setting up the FAssets tools#
Setting up After Testnet XRP Reset#
Info
This section is only for users using FAssets before the testnet XRP reset, so please read more.
Suppose you previously ran the FAssets agent before the XRP testnet reset. You will need to skip the whitelisting part but still need to:
- pull the latest changes from the repository by
git pull
; - build then with
yarn && yarn build
; - installing the MySQL database and setting it up following the guide later in this document;
- create a new agent using the existing management address following the guide.
Clone and Setup the Tools Repository#
Info
If you set up an FAssets agent, bot or user, please use a separate directory for each role.
-
Clone the repository and enter the working directory:
git clone https://github.com/flare-labs-ltd/fasset-bots.git cd fasset-bots
-
Switch to the
open_beta
branch:git checkout open_beta
-
Install dependencies and build the project:
yarn && yarn build
Info
Fresh installation can take more than 10 minutes, depending on if you have cached dependencies before.
-
Copy the environment file from a template
.env.template
to.env
:cp .env.template .env
Setting up Database for FAssets Agent#
To proceed with this process, you must set up a database, either MySQL or PostgreSQL.
Setting up MySQL Database#
You have two options to set up a MySQL database: using Docker (preferred) or installing it manually.
Setting up MySQL Database with Docker
- Download and install Docker Desktop.
- Create a
docker-compose.yml
file in your directory, add the following lines, and change the value ofVerySafePassword
according to your security standards:services: mysql: image: mysql:8.0 environment: MYSQL_ROOT_PASSWORD: 'root' MYSQL_DATABASE: 'fasset_bots' MYSQL_USER: 'fassetbot' MYSQL_PASSWORD: 'my1beta2password3' volumes: - mysql_data:/var/lib/mysql - ./init.mysql.sql:/docker-entrypoint-initdb.d/init.mysql.sql ports: - "3306:3306" healthcheck: test: ['CMD', 'mysqladmin', 'ping', '-h', '127.0.0.1', '-u', 'root', '-p$MYSQL_ROOT_PASSWORD'] timeout: 20s retries: 10 volumes: mysql_data:
- Create a file named
init.mysql.sql
in the same directory, add the following lines, and change the value ofVerySafePassword
according to your security standards:CREATE USER IF NOT EXISTS 'fassetbot'@'%' IDENTIFIED BY 'my1beta2password3'; GRANT ALL PRIVILEGES ON *.* TO 'fassetbot'@'%' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON fasset_bots.* TO 'fassetbot'@'%' WITH GRANT OPTION;
- Start the MySQL server as a Docker container by running
docker-compose up -d
. After the MySQL database is started, it will continue to run in the background every time you run the agent. - In the
secrets.json
file, add this block to the list to set the databaseuser
andpassword
, and change the value ofpassword
to the same password you have been using."database": { "user": "fassetbot", "password": "my1beta2password3" }
Setting up MySQL Database Manually
To install the MySQL database manually, refer to the official MySQL documentation.
The MySQL database connection parameters are listed in the file as the value for the variable FASSET_BOT_CONFIG
in the .env
file.
Create a new user in MySQL that will be used by the fasset-bots
to connect to the database. In this example, we will create a user with the username fassetbot
and password VerySafePassword
, which you must replace with a secure value.
Warning
You only need to create the user in the database and grant privileges to that user. Do not create the database.
-
Open your terminal or command prompt and login to MySQL database using the
mysql
command with the appropriate credentials: -
Create a new user
fassetbot
in MySQL database using the "CREATE USER" command with the password "VerySafePassword":CREATE USER 'fassetbot'@'localhost' IDENTIFIED BY 'VerySafePassword';
-
Grant all privileges on all databases to the user by using the
GRANT
statement:GRANT ALL PRIVILEGES ON *.* TO 'fassetbot'@'localhost' WITH GRANT OPTION;
-
Grant Privileges: After creating the user, you need to grant appropriate privileges to the user. Use the
GRANT
statement to give permissions to the user. For example, to grant all privileges on thefasset_bots
database:GRANT ALL PRIVILEGES ON fasset_bots.* TO 'fassetbot'@'localhost' WITH GRANT OPTION;
-
Exit the MySQL database prompt by typing:
exit;
Setting up PostgreSQL Database#
To set up a PostgreSQL database, you have two options: using Docker (preferred) or installing it manually.
Setting up PostgreSQL Database with Docker
- Download and install Docker Desktop.
-
Create a
docker-compose.yml
file in your directory, add the following lines, and change the value ofVerySafePassword
according to your security standards:services: postgres: image: postgres:15 container_name: postgres_db environment: POSTGRES_USER: fassetbot POSTGRES_PASSWORD: my1beta2password3 POSTGRES_DB: fasset_bots ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data - ./init.postgresql.sql:/docker-entrypoint-initdb.d/init.postgresql.sql healthcheck: test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB -h 127.0.0.1"] timeout: 20s retries: 10 volumes: pgdata:
-
Start the PostgreSQL server as a Docker container by running
docker-compose up -d
. After the PostgreSQL database is started, it will continue to run in the background every time you run the agent. - In the
secrets.json
file, add this block to the list to set the databaseuser
andpassword
, and change the value ofpassword
to the same password you have been using."database": { "user": "fassetbot", "password": "my1beta2password3" }
- Modify the
FASSET_BOT_CONFIG variable
in the.env
file located in the root of the repository.FASSET_BOT_CONFIG="./packages/fasset-bots-core/run-config/coston-bot-postgresql.json"
Setting up PostgreSQL Database Manually
To install the PostgreSQL database manually, refer to the official PostgreSQL documentation.
You can find PostgreSQL database connection parameters in the file listed as the value for the variable FASSET_BOT_CONFIG
in the .env
file.
Create a new user in PostgreSQL that will be used by the fasset-bots
to connect to the database. In this example, we will create a user with the username fassetbot
and password VerySafePassword
, which you must replace with a secure value.
Warning
You only need to create the user in the database and grant privileges to that user. Do not create the database.
-
Open your terminal or command prompt and login to PostgreSQL database using the
psql
command with the appropriate credentials. -
Create a new user
fassetbot
in the PostgreSQL database command with the password "VerySafePassword" and grant the superuser privileges:CREATE ROLE fassetbot WITH SUPERUSER LOGIN PASSWORD 'VerySafePassword';
-
Exit the PostgreSQL database prompt by typing:
exit;
-
Modify the
FASSET_BOT_CONFIG variable
in the.env
file located in the root of the repository.FASSET_BOT_CONFIG="./packages/fasset-bots-core/run-config/coston-bot-postgresql.json"
Configure the Access Keys#
The FAsset agents operate with multiple keys for the Flare and underlying network chains. You should generate these keys to make the agent operational.
-
Create or use an existing management wallet that will be your agent's management address. Fund this wallet with some CFLR so you can pay the gas fees for various smart contract calls using the Flare faucet.
-
Generate the secrets using this command by replacing the
MANAGEMENT_WALLET_ADDRESS
with your cold wallet address:yarn key-gen generateSecrets --user --agent MANAGEMENT_WALLET_ADDRESS --other -o secrets.json
Info
This command can only be executed once, after which all secret keys will be generated. You must use a separate directory for each role you want to perform: agent, bot, or minter and redeemer.
Warning
- The addresses in
secrets.json
are for hot wallets and should not hold large token amounts, as their private keys are on an always-online machine. Keep your main account in an offline wallet and transfer funds as needed. - As soon as you create the
secrets.json
file, back it up, and remember to back it up again whenever you add new keys. Store the backup securely, preferably on an external drive in a physical vault, as unauthorized access can compromise the agent. You need to make regular backups only if you make changes.
- The addresses in
-
Follow the whitelisting process to grant your agent's management address access to the FAssets system. While waiting for approval, you can proceed to the next steps.
-
The
secrets.json
file contains theowner.native.address
field, representing the Flare account responsible for funding agent vaults and covering gas fees for smart contract calls. Please ensure this wallet has enough CFLR tokens to cover gas fees for smart contract calls. You can obtain CFLR tokens from the Flare faucet. -
Prevent other users from reading the
secrets.json
file:chmod 600 secrets.json
-
Fill the
native_rpc
,xrp_rpc
andindexer
fields in thesecrets.json
file with the following values:"native_rpc": "AavSehMLhcgz3crQHH5YJ3Rt8GMQGdV9aViGilADXGnTcjij", "xrp_rpc": "4tg3AxysaZodxTqsCtcMnBdBIEkR6KDKGTdqBEA8g9MKq4bH", "indexer": "123456",
Info
These values apply only to the Coston Testnet and will be different for other networks.
-
Fill in the
database
field in thesecrets.json
with the MySQL database username and password you created during setup.
MySQL Setup for Existing Agents#
Agents who have already configured fasset-bots
to switch to MySQL or PostgreSQL should follow these steps:
- Install MySQL or PostgreSQL server.
- Create a user in the MySQL or PostgreSQL database.
-
Modify the
FASSET_BOT_CONFIG
variable in the.env
file located in the root of the repository.-
MySQL database:
FASSET_BOT_CONFIG="./packages/fasset-bots-core/run-config/coston-bot-mysql.json"
-
PostgreSQL database:
FASSET_BOT_CONFIG="./packages/fasset-bots-core/run-config/coston-bot-postgresql.json"
-
-
In the
secrets.json
file, add a new key,database
which is an object with two keysusername
andpassword
and fill with the values you used when creating the user in the MySQL or PostgreSQL database:"database": { "user": "fassetbot", "password": "VerySafePassword" }
Whitelist the Management Address#
To access the FAssets system during the open beta, you must be whitelisted for security reasons. This ensures only authorized participants interact with the system, maintaining a secure and controlled environment for testing and platform improvement. The whitelisting process will be removed after the opening beta.
- Find your agent owner address, which is the value from the
secrets.json
file in theowner.management.address
field. - Use the FlareFAssetsBot Telegram channel, specifically designed for registration, and provide the necessary information, including your agent name, description, and a link to your icon.
- Enter the information and confirm, and the Telegram bot will inform you about the successful process.
- You need to wait for Flare support engineers to approve registrations and issue test assets such as Coston Flare (CFLR), testUSDC, testUSDT, and testETH assets, which will be sent to your
owner.management.address
. While you wait, you can continue with the rest of this guide. - If the information you entered is correct, the Telegram Bot will notify you that you have been whitelisted for the FAssets Open Beta.
Check Whitelist Status#
Checking if your agent's management address has been whitelisted is a straightforward process. Follow these steps:
- Navigate with the Coston block explorer to
AgentOwnerRegistry
smart contract on address 0xDb6c11b8D074D4488f5fFd0129AA5F91C4f00fb6 and open the Read Contract tab. - Connect your wallet with any address to the block explorer so you can gain access to read functions from the smart contract.
- Execute the
isWhitelisted
function with the value ofowner.management.address
from thesecrets.json
file. This function returnsbool
:true
for whitelisted orfalse
for not whitelisted.
Setting Up the Agent#
Configure the Native Address#
Configuring the native address links your agent's work address to the management address and grants access.
-
Navigate with the Coston block explorer to
AgentOwnerRegistry
smart contract on address 0xDb6c11b8D074D4488f5fFd0129AA5F91C4f00fb6 and open the Write Contract tab. -
Connect the cold wallet you used to generate the access keys.
-
Register the work address by executing the
setWorkAddress
function with the value ofowner.native.address
from thesecrets.json
file.
Configure the Agent#
You need to set up your agent's parameters like name, collateral, and fund with underlying assets.
-
Prepare the agent settings
tmp.agent-settings.json
exchangingFASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you want to work on:yarn agent-bot --fasset FASSET create --prepare
-
Choose a suffix for your agent's collateral pool and fill in the
poolTokenSuffix
field in thetmp.agent-settings.json
file with it. ThepoolTokenSuffix
should only include uppercase letters, numbers, and the-
symbol. This suffix will be used for the FAsset Collateral Pool Token. For example, forFTestXRP
, if you useMY-ALPHA-AGENT-1
, it would beFCPT-TXRP-MY-ALPHA-AGENT-1
. -
Choose one of the stable tokens (
testUSDT
ortestUSDC
) or wrapped ETH invaultCollateralFtsoSymbol
to back up the agent vault collateral. -
In the
secrets.json
file, theowner.testXRP.address
,owner.testBTC.address
, andowner.testDOGE.address
fields represent the underlying testnet accounts that will pay transaction fees for XRP, BTC, and DOGE, respectively. Ensure each account is activated by sending a minimum required amount of test cryptocurrency from the appropriate faucet.-
for XRP activate your underlying XRP Ledger account by sending at least 100 test-XRP using one of these XRP Ledger testnet faucets:
-
for BTC use the following faucet to receive testnet Bitcoin TestBTC Faucet
-
for DOGE activate your Dogecoin account by sending test-DOGE using one of these faucets:
-
-
Create the agent by specifying the FAsset and agent settings, noting that this operation can take up to 10 minutes because the FAssets verifies the underlying assets. This command will print out your agent's address. Exchange
FASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you are creating the agent.yarn agent-bot --fasset FASSET create tmp.agent-settings.json
Deposit Collateral#
To make your newly created agent public, it must hold enough collateral to mint one lot.
This means its agent vault contract needs to be funded with the two collaterals (CFLR and a stablecoin or wrapped ETH) held by your owner.native.address
.
Flare support sends test assets to your owner.management.address
, so remember to move these funds to the owner.native.address
.
You have two options: either deposit the vault collateral and buy pool collateral separately or use the system function to calculate the needed collateral for you.
Deposit Collaterals Together#
To deposit both vault and pool collateral together and let the tool calculate the minimum required collateral to back the lots, you can use the depositCollateral
function to the agent, specifying your created agent address in the AGENT_ADDRESS
and lot size in the LOTS
, as well exchange FASSET
with FTestXRP
, FTestBTC
or FTestDOGE
according to which underlying network you are creating the agent:
yarn agent-bot depositCollaterals AGENT_ADDRESS LOTS --fasset FASSET
Deposit Collateral Separately#
-
Deposit enough vault collateral to the agent specifying your created agent address in the
AGENT_ADDRESS
and the amount of the stablecoin or wrapped ETH in theAMOUNT
field, as well exchangeFASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you are creating the agent.yarn agent-bot depositVaultCollateral AGENT_ADDRESS AMOUNT --fasset FASSET
-
Buy enough pool collateral for the agent specifying your agent's address in the
AGENT_ADDRESS
and the amount of the CFLR in theCFLR_AMOUNT
field, as well exchangeFASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you are creating the agent.yarn agent-bot buyPoolCollateral AGENT_ADDRESS CFLR_AMOUNT --fasset FASSET
Register the Agent as Available#
You need to make your agent available to mint and redeem FAssets.
-
Register your agent as available to the network by executing this command replacing the
AGENT_ADDRESS
with your agent address, as well exchangeFASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you are entering the agent:yarn agent-bot enter AGENT_ADDRESS --fasset FASSET
Info
Note that your agent owner's Flare account has to be whitelisted via the FlareFAssetsBot Telegram channel. Otherwise, it will fail.
-
If you deposited enough collateral, you should see that your agent has at least one lot available by running the command replacing
FASSET
withFTestXRP
,FTestBTC
orFTestDOGE
according to which underlying network you are running the agent.yarn user-bot agents --fasset FTestXRP
If you don't have available lots, check if the vault and pool collaterals are enough.
Upgrade Your Agent to Support BTC#
- Repeat the steps to clone and set up the Tools repository.
-
Generate a new
secrets.json
file using this command by replacing theMANAGEMENT_WALLET_ADDRESS
with your cold wallet address:yarn key-gen generateSecrets --user --agent MANAGEMENT_WALLET_ADDRESS --other -o secrets.json
-
Make a copy of your old
secrets.json
file, open it, and replace the owner and user testBTC addresses and private keys from the generatedsecrets.json
in the previous step. A new instance with your oldsecrets.json
file that includes your BTC addresses is created. - In the FlareFAssetsBot Telegram channel, run
/register_btc_address ADDRESS
, whereADDRESS
is your TestBTC address in thesecrets.json
file. Your TestBTC address is registered, an amount of TestBTC is sent to the address, and your API key is returned. - In your
secrets.json
file, add thebtc_rpc
parameter to theapiKey
section. -
Prepare the agent for FTestBTC:
yarn agent-bot --fasset FTestBTC create --prepare
-
Choose a suffix for your agent's collateral pool and fill in the
poolTokenSuffix
field in thetmp.agent-settings.json
file with it. ThepoolTokenSuffix
should only include uppercase letters, numbers, and the-
symbol. This suffix will be used for the FAsset Collateral Pool Token. For example, if you useMY-ALPHA-AGENT-1
, it would beFCPT-TBTC-MY-ALPHA-AGENT-1
. -
If you need more TestBTC, request more from the TestBTC faucet.
- Top up your
owner.testBTC
address fromsecrets.json
with at least 0.5 TestBTC. -
Create the agent by specifying the FAsset and agent settings, noting that this operation can take up to 10 minutes because the FAssets verifies the underlying assets. This command will print out your agent's address.
yarn agent-bot --fasset FTestBTC create tmp.agent-settings.json
-
Deposit collaterals for your agent:
yarn agent-bot depositCollaterals AGENT_ADDRESS LOTS --fasset FTestBTC
-
Register your agent as available to the network by executing this command replacing the
AGENT_ADDRESS
with your agent address:yarn agent-bot enter AGENT_ADDRESS --fasset FTestBTC
Upgrade Your Agent to Support DOGE#
- Repeat the steps to clone and set up the Tools repository.
-
Generate a new
secrets.json
file using this command by replacing theMANAGEMENT_WALLET_ADDRESS
with your cold wallet address:yarn key-gen generateSecrets --user --agent MANAGEMENT_WALLET_ADDRESS --other -o secrets.json
-
Make a copy of your old
secrets.json
file, open it, and replace the owner and user testDOGE addresses and private keys from the generatedsecrets.json
in the previous step. A new instance with your oldsecrets.json
file that includes your DOGE addresses is created. - In the FlareFAssetsBot Telegram channel, run
/register_btc_address ADDRESS
, whereADDRESS
is your TestBTC address in thesecrets.json
file. Your TestBTC address is registered, an amount of TestBTC is sent to the address, and your API key is returned. - In your
secrets.json
file, add thedoge_rpc
parameter to theapiKey
section. -
Prepare the agent for
FTestDOGE
:yarn agent-bot --fasset FTestDOGE create --prepare
-
Choose a suffix for your agent's collateral pool and fill in the
poolTokenSuffix
field in thetmp.agent-settings.json
file with it. ThepoolTokenSuffix
should only include uppercase letters, numbers, and the-
symbol. This suffix will be used for the FAsset Collateral Pool Token. For example, if you useMY-ALPHA-AGENT-1
, it would beFCPT-TDOGE-MY-ALPHA-AGENT-1
. -
If you need more TestDOGE, request more from the TestDOGE faucets:
- Top up your
owner.testDOGE
address fromsecrets.json
. -
Create the agent by specifying the FAsset and agent settings, noting that this operation can take up to 10 minutes because the FAssets verifies the underlying assets. This command will print out your agent's address.
yarn agent-bot --fasset FTestDOGE create tmp.agent-settings.json
-
Deposit collaterals for your agent:
yarn agent-bot depositCollaterals AGENT_ADDRESS LOTS --fasset FTestDOGE
-
Register your agent as available to the network by executing this command replacing the
AGENT_ADDRESS
with your agent address:yarn agent-bot enter AGENT_ADDRESS --fasset FTestDOGE
Running the Agent#
The agent bot responds to all requests made to the agent vaults you have created. To run the agent bot, you need to run the following command:
yarn run-agent
When you want to stop the server, press Ctrl + C.
To run the run-agent
as a service to maximize uptime for production use, follow instructions for running the agent as a system
service for running the bot as a daemon.
Warning
If you upgraded your agent code and see an error stating that owner.testBTC.address
isn't defined when running the agent, you need to generate it using this command:
yarn key-gen createAccount testBTC
This command generates a test BTC account and displays the address and private key as follows:
Address: tb1qtu86wueft8zafn3ppejsrq3c8z0rd2h9a8n6sa
Private key: cQ9tgyod95qw88LxwgAYXxnkJY9UWBauB1ejEHcJJsy3hHbchFbF
Then, add this object under the owner
and user
sections in the secrets.json
file, filling it out with the address and private key obtained when generating the test BTC account.
"owner": {
...
"testBTC": {
"address": "tb1qtu86wueft8zafn3ppejsrq3c8z0rd2h9a8n6sa",
"private_key": "cQ9tgyod95qw88LxwgAYXxnkJY9UWBauB1ejEHcJJsy3hHbchFbF"
}
},
...
"user" : {
...
"testBTC": {
"address": "tb1qtu86wueft8zafn3ppejsrq3c8z0rd2h9a8n6sa",
"private_key": "cQ9tgyod95qw88LxwgAYXxnkJY9UWBauB1ejEHcJJsy3hHbchFbF"
}
}
Verifying Collateral Pool Smart Contracts#
Verification of a smart contract on a block explorer allows future users of the smart contract to inspect the Solidity source code instead of the bytecode, greatly improving the security and transparency of the ecosystem. Follow these steps to upload the source code for the Collateral Pool and Collateral Pool Token smart contracts, verifying them on the block explorer.
-
Execute the FAssets system information command to determine your collateral pool smart contract address.
For XRP, run:
yarn agent-bot info AGENT_ADDRESS --fasset FTestXRP
For BTC, run:
yarn agent-bot info AGENT_ADDRESS --fasset FTestBTC
For DOGE, run:
yarn agent-bot info AGENT_ADDRESS --fasset FTestDOGE
Look for the value of the Agent collateral pool field and copy the address, as shown in the following example for XRP.
Tokens: Native token: CFLR Wrapped native token: WCFLR FAsset token: FTestXRP Underlying token: testXRP Vault collateral token: testETH Collateral pool token: FCPT-SIMX-KGR-25061612 Network exchange rates: CFLR/USD: 0.033 testETH/USD: 3800 testXRP/USD: 0.53 Agent mint and collateral: Status: healthy Public: true Free lots: 10 Minted: 0 FTestXRP (0 lots) Reserved: 0 FTestXRP (0 lots) Redeeming: 0 FTestXRP (0 lots) Vault CR: <inf> (minCR=1.4, mintingCR=1.6) Pool CR: <inf> (minCR=2, mintingCR=2.4) Free vault collateral: 0.046863112858734529 testETH (10 lots) Free pool collateral: 8071.878095157464265083 WCFLR (10 lots) Lots: Lot size: 20 testXRP Lot vault collateral: 0.004463157894736842 testETH Lot pool collateral: 770.909090909090909091 CFLR Agent address (vault): 0xa6d7dF2d68b4b687d7408Cd613192103DBdA1F33 Balance: 0.046863112858734529 testETH Balance: 8071.878095157464265083 FCPT-SIMX-KGR-25061612 Agent collateral pool: 0x5Bf5cD267F5a5185d0d91567979CCa397A2E504a Balance: 8071.878095157464265083 WCFLR Collected fees: 0 FTestXRP Agent vault underlying (testXRP) address: r4aiumSs3xrSeeeQ9frhrDkhJ6dL1Sr1iL Actual balance: 10 testXRP Tracked balance: 0 testXRP Required balance: 0 testXRP Free balance: 0 testXRP Agent owner management address: 0x6827101103BE87eDadf77202F8973c5046245401 Balance: 90.4216184475 CFLR Balance: 0 testETH Agent owner work address: 0xEfA4D9561fEc607eAe35D76a8034d9dBBe730449 Balance: 4105.334310744331909805 CFLR (5 lots) Balance: 0.042177240174410518 testETH (9 lots) Agent owner underlying (testXRP) address: rndED5w8xQ2sVC2hT5J5e8GTfxouRcKfjR Balance: 40.27988 testXRP
-
Clone the FAsset repository in a new directory and enter it:
git clone https://github.com/flare-labs-ltd/fassets.git cd fassets
-
Switch to the
open_beta
branch:git checkout open_beta
-
Install dependencies and build the project:
yarn && yarn c
Info
A fresh build can take more than 10 minutes, depending on if you have cached dependencies before.
-
Verify the Collateral Pool and Collateral Pool Token smart contracts by running the following command and specifying the collateral pool address that you obtained in the first step as
AGENT_POOL_ADDRESS
:yarn verify-collateral-pool-coston AGENT_POOL_ADDRESS
Verifying the smart contract on the blockchain will take a minute or two, and you should get an output stating that Collateral Pool and Collateral Pool Token smart contracts have been verified. It should be similar to this:
Verifying CollateralPool at 0x5Bf5cD267F5a5185d0d91567979CCa397A2E504a Successfully submitted source code for contract contracts/fasset/implementation/CollateralPool.sol:CollateralPool at 0x5Bf5cD267F5a5185d0d91567979CCa397A2E504a for verification on the block explorer. Waiting for verification result... Successfully verified contract CollateralPool on the block explorer. https://coston-explorer.flare.network/address/0x5Bf5cD267F5a5185d0d91567979CCa397A2E504a#code Verifying CollateralPoolToken at 0x63937c0AD9506C61B2Fca6103E1828E2fcEf8a08 Successfully submitted source code for contract contracts/fasset/implementation/CollateralPoolToken.sol:CollateralPoolToken at 0x63937c0AD9506C61B2Fca6103E1828E2fcEf8a08 for verification on the block explorer. Waiting for verification result... Successfully verified contract CollateralPoolToken on the block explorer. https://coston-explorer.flare.network/address/0x63937c0AD9506C61B2Fca6103E1828E2fcEf8a08#code
Visit the original Flare block explorer at the address of the contract you just verified:
https://coston-explorer.flare.network/address/{AGENT_POOL_ADDRESS}
And check that the Code tab has a green checkmark next to it.