{"id":24995430,"url":"https://github.com/compolabs/fuel-token-standard","last_synced_at":"2025-09-10T06:33:48.763Z","repository":{"id":103206668,"uuid":"578632159","full_name":"compolabs/fuel-token-standard","owner":"compolabs","description":"Fuel network Fungible token standard","archived":false,"fork":false,"pushed_at":"2023-02-23T21:03:30.000Z","size":82,"stargazers_count":43,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T14:55:55.194Z","etag":null,"topics":["blockchain","cryptocurrency","erc-20","fuel","rust","sway","token"],"latest_commit_sha":null,"homepage":"https://discord.gg/PxqxqxugwW","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compolabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T14:13:04.000Z","updated_at":"2025-08-09T12:43:33.000Z","dependencies_parsed_at":"2023-03-13T15:09:12.486Z","dependency_job_id":null,"html_url":"https://github.com/compolabs/fuel-token-standard","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/compolabs/fuel-token-standard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Ffuel-token-standard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Ffuel-token-standard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Ffuel-token-standard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Ffuel-token-standard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compolabs","download_url":"https://codeload.github.com/compolabs/fuel-token-standard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Ffuel-token-standard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274422223,"owners_count":25282123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cryptocurrency","erc-20","fuel","rust","sway","token"],"created_at":"2025-02-04T15:37:57.266Z","updated_at":"2025-09-10T06:33:48.722Z","avatar_url":"https://github.com/compolabs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuel network Fungible token standard: FRC-20\n## INTRODUCTION\n\n### What is a Token?\n\nTokens can represent virtually anything in Fuel ⚡️:\n\n- reputation points in an online platform\n- skills of a character in a game\n- lottery tickets\n- financial assets like a share in a company\n- a fiat currency like USD\n- an ounce of gold\n- and more...\n\nSuch a powerful feature of Fuel must be handled by a robust standard, right? That's exactly where the FRC-20 plays its role! This standard allows developers to build token applications that are interoperable with other products and services.\n\n### What is ERC-20?\n\nThe FRC-20 introduces a standard for Fungible Tokens, in other words, they have a property that makes each Token be exactly the same (in type and value) as another Token. For example, a FRC-20 Token acts just like the ETH, meaning that 1 Token is and will always be equal to all the other Tokens.\n\n## BODY\n\nThe FRC-20, proposed by the SWAY GANG TEAM on December 2022, is a Token Standard that implements an API for tokens within Smart Contracts.\n\nExample functionalities FRC-20 provides:\n\n- transfer tokens from one account to another\n- get the current token balance of an account\n- get the total supply of the token available on the network *(soon)*\n- approve whether an amount of token from an account can be spent by a third-party account\n\nIf a Smart Contract implements the following methods and events it can be called an FRC-20 Contract and, once deployed, it will be responsible to keep track of the created tokens on Fuel.\n\nHello, fuel!!\nContinuing [the topic](https://forum.fuel.network/t/which-token-contract-i-should-to-use/373), I want to tell you about how to deploy and use your own token in your dapp\n\n# How to issue my own token on the fuel testnet?\n\n# How to issue my own token on the fuel testnet using Rust SDK?\n\n## Intro\nIn the continuation of [this topic](https://forum.fuel.network/t/which-token-contract-i-should-to-use/373), I wrote a tutorial on how to work with tokens. This tutorial walks you through the process of issuing your own token on the Fuel testnet using Rust SDK.\n\n## Deploy\n\n### Clone repository\nThis step involves cloning the fuel-token-standard repository from GitHub onto your local computer. To do this, you will need to use the `git clone` command.\n\n`git clone https://github.com/sway-gang/fuel-token-standard`\n\nAfter that let's go to the project folder\n\n`cd fuel-token-standard`\n\n### Setup env\nIn this step, you will set up the environment for the fuel-token-standard repository. Here we should use  `forc-wallet`.  To create this, you will need to follow the instructions provided in the `forc-wallet` [repository on GitHub](https://github.com/FuelLabs/forc-wallet). \n\nAfter creating a wallet, you can see a list of your accounts by using this command\n\n`forc-wallet list` \n\nYou also need to visit the Fuel faucet  [to get some testnet FUEL tokens](https://faucet-beta-2.fuel.network/) , which you will use to deploy and interact with your token contract.\n\n\nHere will involve creating a `.env` file and adding your wallet secret to it. To do this, you can rename the template:\n\n`mv ./.env.example ./.env`\n\nAnd insert your secret inside the `.env` file\n```\nSECRET=YOUR_SECRET_HERE\n```\n\n\n### Build and deploy\n\n\u003e In this section I will explain in detail how to deploy, initialize, mint and transfer tokens. If you just want to deploy tokens in one click, then skip this section and move on to the next\n\nIn this step, you will build and deploy your token contract using the `forc` command-line tool. This involves compiling the contract code, generating the required bytecode, and deploying the contract to the Fuel testnet.\n\nTo build the contract, you will use the `forc build` command, which will compile the contract code and generate the bytecode required for deployment.\n\n```\n\u003e forc build\n  Compiled library \"core\".\n  Compiled library \"std\".\n  Compiled contract \"token_contract\".\n  Bytecode size is 13912 bytes.\n```\n\n\n\nTo deploy the contract, you will use the `forc deploy` command, which will send the deployment transaction to the Fuel testnet. \n\n`forc deploy --url http://node-beta-2.fuel.network/graphql --gas-price 1  `\n\nOutput:\n```\n  Compiled library \"core\".\n  Compiled library \"std\".\n  Compiled contract \"token_contract\".\n  Bytecode size is 13912 bytes.\nContract id: \u003cACCOUNT ID\u003e\nPlease provide the address of the wallet you are going to sign this transaction with:fuel1s0ul05vsv84ltlxfn7fwmv0765ghah4nm5zj84z6zwy9mcutnz6q97zrcl\nTransaction id to sign: 4232f9c81c5104f3f9a81a120d0bec084c8fa8be40ad6397fd7f2aa79bd8af91\nPlease provide the signature: \u003cYOUR SIGNATURE\u003e\n```\nBefore the deployment can be completed, you will need to sign the transaction with your wallet. To do this, you will need to use the `forc-wallet` command-line tool. First, you will need to open another terminal and use the `forc-wallet list` command to view the available wallets on your machine.  \n\nNext, you will need to use the `forc-wallet sign` command to sign the transaction with the desired wallet. The command requires you to specify the transaction ID and the index of the wallet you want to use.\n\n`forc-wallet sign \u003cTRANSACTION ID\u003e \u003cWALLET INDEX\u003e`\n\n```\nPlease enter your password to decrypt initialized wallet's phrases: \nSignature: 8d9c894fcbb5ae3f1a0318cca5c783e9a67b150ca953350023c673cb640171ad12e68716d17cf7bfb2e201dd72c506ede78ccf762bed621fa37275863a2010c3\n```\n\nFinally, you will need to enter the signature in the first terminal to complete the deployment. If the deployment is successful, the output will include the contract ID and the block number in which the contract was deployed.\n\n```\nWaiting 1s before retrying    \ncontract 777923117c7772c0680806d2a0d3a0eb5e654fa65e48d8de85516f6f85ba4887 deployed in block 0xcc6320caa393126b98bdbd0d90fba9cd659a36546b567f7d90ba8b591020133d\n```\n\n## Initialize\nThe `initialize` test case initializes the token contract by setting its name, symbol, and number of decimals. \n\nTo run the test case, update the `TOKEN_ADDRESS` constant in the `tests/testnet_tests/initialize.rs` file with the address of your token contract, then run the following command:\n\n```\ncargo test --package tests --test tests -- testnet_tests::initialize::initialize --exact --nocapture \n```\n\nExample output:\n\n\n\n```\nrunning 1 test\n👛 Account address     @ fuel1gzv3z02hz863dhtxzhz2d30jh62verdx7lfrzxkq9txxr3jgx4qsqgstc4\n🗞 Token address   @ fuel1waujxytuwaevq6qgqmf2p5aqad0x2naxteyd3h5929hklpd6fzrsyjw5jy      \n✅ Initialize\nDecimals: 9\nSymbol:  BTC\nMint amount 1000 BTC   \ntest testnet_tests::initialize::initialize ... ok\n```\n\n\n## Mint\n\nThe `mint` test case mints tokens to the wallet specified in the test configuration.\n\nTo run the test case, update the `TOKEN_ADDRESS` constant in the `tests/testnet_tests/mint.rs` file with the address of your token contract, then run the following command:\n\n```\ncargo test --package tests --test tests -- testnet_tests::mint::mint --exact --nocapture \n```\n\nExample output:\n\n```\nrunning 1 test\n👛 Account address     @ fuel1gzv3z02hz863dhtxzhz2d30jh62verdx7lfrzxkq9txxr3jgx4qsqgstc4\n🗞 Token address   @ fuel1waujxytuwaevq6qgqmf2p5aqad0x2naxteyd3h5929hklpd6fzrsyjw5jy\nDecimals: 1\nSymbol: BBC     \nMint amount: 1000 BBC     \nWallet balance: 1000 BBC     \n✅ Mint\nWallet balance: 1000 BBC     \ntest testnet_tests::mint::mint ... ok\n```\n## Transfer\n\nThe `transfer` test case transfers a specified amount of tokens from the wallet specified in the test configuration to the recipient specified in the test configuration.\n\nTo run the test case, update the `TOKEN_ADDRESS`, `TRANSFER_AMOUNT`, and `RECIPIENT_ADDRESS` constants in the `tests/testnet_tests/transfer.rs` file with the address of your token contract, the amount of tokens to transfer (without decimals), and the recipient address, respectively, then run the following command:\n\n```\ncargo test --package tests --test tests -- testnet_tests::transfer::transfer --exact --nocapture \n```\n\nExample output:\n\n```\nrunning 1 test\n👛 Account address     @ fuel1gzv3z02hz863dhtxzhz2d30jh62verdx7lfrzxkq9txxr3jgx4qsqgstc4\n🗞  Token address   @ fuel1waujxytuwaevq6qgqmf2p5aqad0x2naxteyd3h5929hklpd6fzrsyjw5jy\nDecimals: 1\nSymbol: BBC     \nWallet balance: 1000 BBC     \nWallet balance: 990 BBC     \nRecipient balance: 10 BBC     \ntest testnet_tests::transfer::transfer ... ok\n```\n\n\n## Deploy multiple tokens in one click\n\nTo deploy multiple tokens in one click, you will need to use the `tests/testnet_tests/deploy.rs` script. In this script, you can specify an array of token configurations, each containing the name, symbol, decimals, and mint amount for the desired tokens.\n\nTo specify the tokens you want to deploy, modify the `configs` array in the script. For example:\n\n```\n // YOUR TOKENS ARRAY HERE\n    let configs: Vec\u003cDeployConfig\u003e = vec![\n        DeployConfig {\n            name: String::from(\"Tether\"),\n            symbol: String::from(\"USDT\"),\n            decimals: 6,\n            mint_amount: 10000,\n        },\n        DeployConfig {\n            name: String::from(\"USD Coin\"),\n            symbol: String::from(\"USDC\"),\n            decimals: 6,\n            mint_amount: 10000,\n        },\n\n...\n\n   ]\n```\n\nOnce you have specified the desired tokens, you can run the script with the following command:\n\n```\ncargo test --package tests --test tests -- testnet_tests::deploy::deploy --exact --nocapture \n```\n\nThis will build and deploy the specified tokens. The output of the command will show the initialization details for each token, as well as any additional information relevant to the deployment process.\n\nExample output:\n\n```\nrunning 1 test\n✅ Initialize\n\nownerAddress: fuel1gzv3z02hz863dhtxzhz2d30jh62verdx7lfrzxkq9txxr3jgx4qsqgstc4\nname:         Tether                          \nsymbol:       USDT    \ndecimals:     6\nassetId:      fuel1v4eezwvca24cn9xkp84kf26wm06cvfwef0zgsyk7mfvpqw3tm2qqf0rqha\nhash:         6573913998eaab8994d609eb64ab4edbf58625d94bc48812deda58103a2bda80\nsalt:         [229, 154, 86, 240, 24, 119, 67, 186, 120, 209, 57, 181, 200, 35, 138, 119, 12, 183, 120, 179, 122, 172, 253, 77, 193, 37, 107, 157, 45, 225, 60, 163]\n\n...\n\ntest testnet_tests::deploy::deploy ... ok\n```\n\n### Can I just use your tokens?\n\nIf you don't want to spend your time deploying your own contract here is the config to the token that already exists in testnet:\n\nhttps://github.com/sway-gang/sway-lend/blob/master/frontend/src/constants/tokens.json\n\nAnd here is the link where you can mint them: https://app.swaylend.com/#/faucet.\n\n## Conclusion\nIn this tutorial, you have learned how to build and deploy a token contract using the `forc` command-line tool. You have also seen how to perform various actions with the token, such as initialize, mint, transfer, and deploy multiple tokens in one click. By following the steps outlined in this tutorial, you can quickly and easily create and manage your own token on the Fuel network.\n\n## Resources\n\nhttps://fuellabs.github.io/fuel-docs/master/index.html\n\nhttps://fuellabs.github.io/sway/v0.32.2/book/\n\nhttps://fuellabs.github.io/fuels-rs/v0.33.0/\n\nhttps://github.com/FuelLabs/swayswap\n\nhttps://forum.fuel.network/t/src-20-fungible-token-standard/186\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolabs%2Ffuel-token-standard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompolabs%2Ffuel-token-standard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolabs%2Ffuel-token-standard/lists"}