{"id":24995385,"url":"https://github.com/compolabs/multiasset-contract","last_synced_at":"2025-03-29T14:43:58.221Z","repository":{"id":258965583,"uuid":"839390180","full_name":"compolabs/multiasset-contract","owner":"compolabs","description":"SRC20 compatible MultiAsset contract","archived":false,"fork":false,"pushed_at":"2025-02-17T14:55:56.000Z","size":335,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T15:45:39.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":"2024-08-07T14:07:57.000Z","updated_at":"2025-02-17T14:56:02.000Z","dependencies_parsed_at":"2025-01-28T11:23:39.746Z","dependency_job_id":"f93f1bbb-fdfe-4e0c-9374-23a4b78ea941","html_url":"https://github.com/compolabs/multiasset-contract","commit_stats":null,"previous_names":["compolabs/multiasset-contract"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Fmultiasset-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Fmultiasset-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Fmultiasset-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compolabs%2Fmultiasset-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compolabs","download_url":"https://codeload.github.com/compolabs/multiasset-contract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200300,"owners_count":20739563,"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","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":[],"created_at":"2025-02-04T15:37:32.100Z","updated_at":"2025-03-29T14:43:58.203Z","avatar_url":"https://github.com/compolabs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MultiAsset Contract\n\nMultiAsset is a temporary asset contract developed by the Composability Labs team for smoother testing of the Spark Orderbook on the testnet. It allows users to mint a specified amount of tokens. Please note, the asset standard for the mainnet is still under consideration.\n\n## Features\n\n- **SRC20 Compatible**: The MultiAsset contract is designed to be SRC20-compatible, enabling flexible token minting.\n- **Rust SDK**: Provides an SDK with transactional and informational methods for interacting with the MultiAsset contract.\n\n---\n\n## MultiAsset Rust SDK\n\n### Transactional Methods\n\n#### Deploy a New Contract\n```rust\npub async fn deploy(wallet: \u0026WalletUnlocked) -\u003e anyhow::Result\u003cSelf\u003e\n```\nDeploys a new MultiAsset contract and returns a `MultiAssetContract` object.\n\n#### Create a New Asset\n```rust\npub async fn asset_new(\n    \u0026self,\n    name: \u0026String,\n    symbol: \u0026String,\n    decimals: u8,\n) -\u003e anyhow::Result\u003cCallResponse\u003cAssetId\u003e\u003e\n```\nCreates a new asset with `name`, `symbol`, and `decimals`. Returns the `AssetId`.\n\n#### Mint Asset Amount\n```rust\npub async fn mint(\n    \u0026self,\n    recipient: Identity,\n    asset: \u0026AssetId,\n    amount: u64,\n) -\u003e anyhow::Result\u003cCallResponse\u003c()\u003e\u003e {\n```\nMints the specified `amount` of `asset` to the `recipient`.\n\n---\n\n### Read Methods\n\n#### Total Assets\n```rust\npub async fn total_assets(\u0026self) -\u003e anyhow::Result\u003cCallResponse\u003cu64\u003e\u003e\n```\nReturns the total number of assets deployed.\n\n#### Total Supply\n```rust\npub async fn total_supply(\u0026self, asset: \u0026AssetId) -\u003e anyhow::Result\u003cCallResponse\u003cOption\u003cu64\u003e\u003e\u003e\n```\nReturns the total minted supply of the specified `asset`.\n\n#### Name\n```rust\npub async fn name(\u0026self, asset: \u0026AssetId) -\u003e anyhow::Result\u003cCallResponse\u003cOption\u003cString\u003e\u003e\u003e\n```\nReturns the name of the specified `asset`.\n\n#### Decimals\n```rust\npub async fn decimals(\u0026self, asset: \u0026AssetId) -\u003e anyhow::Result\u003cCallResponse\u003cOption\u003cu8\u003e\u003e\u003e\n```\nReturns the number of decimals for the specified `asset`.\n\n#### Get Asset by Name\n```rust\npub async fn asset_get(\u0026self, name: \u0026String) -\u003e anyhow::Result\u003cCallResponse\u003cOption\u003cAssetId\u003e\u003e\u003e\n```\nReturns the `AssetId` of an asset based on its `name`.\n\n---\n\n## CLI Core Functions\n\nThese contract calls change the state of the market contract and require a funded wallet.\n\n### Deploy\nTo deploy the MultiAsset contract, run the following command from the project root:\n```bash\n./target/release/multiasset_sdk core deploy --rpc \"testnet.fuel.network\"\n```\nExample output:\n```\nMultiAsset contract deployed to: 0xdc527289bdef8ec452f350c9b2d36d464a9ebed88eb389615e512a78e26e3509\nDeployment cost: 24112\nDeployer: 0xf47e0ef744ac8c993550e03d17f1c4844494553a12cac11ab8c568c8999fdbbf\n```\n\n```bash\n./target/release/multiasset_sdk core deploy --rpc \"mainnet.fuel.network\"\n```\nExample output:\n```\nMultiAsset contract deployed to: 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a\nDeployment cost: 2269\nDeployer: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\nUpdate\n```\nMultiAsset contract deployed to: 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c\nDeployment cost: 2554\nDeployer: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\n### Create a New Asset\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name USDC \\\n    --symbol USDC \\\n    --decimals 6 \\\n    --restricted-mint \\\n    --contract-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --rpc \"testnet.fuel.network\"\n```\nExample output:\n```\nA new asset created with id: 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05\nTransaction cost: 5216\nCreator: 0xf47e0ef744ac8c993550e03d17f1c4844494553a12cac11ab8c568c8999fdbbf\n```\n\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name TESTUSDC \\\n    --symbol tUSDC \\\n    --decimals 6 \\\n    --restricted-mint \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\nExample output:\n```\nA new asset created with id: 0x22dfb618b9fc621a7d53f0f599dd427fb5688e280062a8de8883a27819d3f276\nTransaction cost: 225\nCreator: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name TESTBTC \\\n    --symbol tBTC \\\n    --decimals 8 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\nExample output:\n```\nA new asset created with id: 0x0dc8cdbe2798cb45ebc99180afc0bc514ffb505a80f122004378955c1d23892c\nTransaction cost: 225\nCreator: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name TESTETH \\\n    --symbol tETH \\\n    --decimals 9 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\nExample output:\n```\nA new asset created with id: 0xf169e13e98ae8908199148380684894458b7916f074b85ebad2aaad489ce0d54\nTransaction cost: 225\nCreator: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name Trump \\\n    --symbol TRMP \\\n    --decimals 9 \\\n    --restricted-mint \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\nA new asset created with id: 0x0b2d808a898cdae8b8661d398a98f8ff45e1e0f536ba2e498f6c7e53a71932cd\nTransaction cost: 245\nCreator: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n\n```bash\n./target/release/multiasset_sdk core asset-new \\\n    --name Kamala \\\n    --symbol KMLA \\\n    --decimals 9 \\\n    --restricted-mint \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\nA new asset created with id: 0x368f9275e7d072794527b57d5b54688300008a400f41d926a013195e7074029c\nTransaction cost: 245\nCreator: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n\n### Mint Tokens\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0xf47e0ef744ac8c993550e03d17f1c4844494553a12cac11ab8c568c8999fdbbf \\\n    --recipient-type address \\\n    --asset 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05 \\\n    --amount 200000000 \\\n    --contract-id 0xdc527289bdef8ec452f350c9b2d36d464a9ebed88eb389615e512a78e26e3509 \\\n    --rpc \"testnet.fuel.network\"\n```\nExample output:\n```\nAn asset 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05 amount minted 200000000 to: 0xf47e0ef744ac8c993550e03d17f1c4844494553a12cac11ab8c568c8999fdbbf\nTransaction cost: 2164\nMinter: 0xf47e0ef744ac8c993550e03d17f1c4844494553a12cac11ab8c568c8999fdbbf\n```\n\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --recipient-type address \\\n    --asset 0xf169e13e98ae8908199148380684894458b7916f074b85ebad2aaad489ce0d54 \\\n    --amount 1000000000000000 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\nExample output:\n```\nAn asset 0xf169e13e98ae8908199148380684894458b7916f074b85ebad2aaad489ce0d54 amount minted 200000000 to: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\nTransaction cost: 111\nMinter: 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7\n```\n\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --recipient-type address \\\n    --asset 0x22dfb618b9fc621a7d53f0f599dd427fb5688e280062a8de8883a27819d3f276 \\\n    --amount 1000000000000 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --recipient-type address \\\n    --asset 0x0dc8cdbe2798cb45ebc99180afc0bc514ffb505a80f122004378955c1d23892c \\\n    --amount 100000000000000 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --recipient-type address \\\n    --asset 0x0b2d808a898cdae8b8661d398a98f8ff45e1e0f536ba2e498f6c7e53a71932cd \\\n    --amount 10000000000000 \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk core mint \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n    --recipient-type address \\\n    --asset 0x368f9275e7d072794527b57d5b54688300008a400f41d926a013195e7074029c \\\n    --amount 10000000000000 \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk core mint-many \\\n    --recipient-id 0x1ef9ec55122609502d923f8a7831f50ac05e02bdd640522a2ef18fd0f26d5fc7 \\\n   --recipient-type address \\\n    --asset 0x0b2d808a898cdae8b8661d398a98f8ff45e1e0f536ba2e498f6c7e53a71932cd \\\n    --amount 10000000000000 \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n---\n\n## CLI Info Commands\n\n### Retrieve Asset number\n```bash\n./target/release/multiasset_sdk info total-assets \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n### Retrieve Asset Name\n```bash\n./target/release/multiasset_sdk info name \\\n    --asset 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05 \\\n    --contract-id 0xdc527289bdef8ec452f350c9b2d36d464a9ebed88eb389615e512a78e26e3509 \\\n    --rpc \"testnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk info name \\\n    --asset 0x22dfb618b9fc621a7d53f0f599dd427fb5688e280062a8de8883a27819d3f276 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n### Retrieve Asset Symbol\n```bash\n./target/release/multiasset_sdk info symbol \\\n    --asset 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05 \\\n    --contract-id 0xdc527289bdef8ec452f350c9b2d36d464a9ebed88eb389615e512a78e26e3509 \\\n    --rpc \"testnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk info symbol \\\n    --asset 0x22dfb618b9fc621a7d53f0f599dd427fb5688e280062a8de8883a27819d3f276 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n### Retrieve Asset Decimals\n```bash\n./target/release/multiasset_sdk info decimals \\\n    --asset 0x336b7c06352a4b736ff6f688ba6885788b3df16e136e95310ade51aa32dc6f05 \\\n    --contract-id 0xdc527289bdef8ec452f350c9b2d36d464a9ebed88eb389615e512a78e26e3509 \\\n    --rpc \"testnet.fuel.network\"\n```\n\n```bash\n./target/release/multiasset_sdk info decimals \\\n    --asset 0x22dfb618b9fc621a7d53f0f599dd427fb5688e280062a8de8883a27819d3f276 \\\n    --contract-id 0x8672a6eedf79ac029f6ae37a5138bc2542c332b008ca786c80b0de9513395f8a \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n### Retrieve Asset Total Supply\n```bash\n./target/release/multiasset_sdk info total-supply \\\n    --asset 0x368f9275e7d072794527b57d5b54688300008a400f41d926a013195e7074029c \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n4340000\n\n### Retrieve Restrcited Mint\n```bash\n./target/release/multiasset_sdk info restricted-mint \\\n    --asset 0x368f9275e7d072794527b57d5b54688300008a400f41d926a013195e7074029c \\\n    --contract-id 0xe957f456070eccec99ad0378bafb13c7c019d4a3299589f7fc059c2564a0d60c \\\n    --rpc \"mainnet.fuel.network\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolabs%2Fmultiasset-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompolabs%2Fmultiasset-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolabs%2Fmultiasset-contract/lists"}