{"id":27742602,"url":"https://github.com/astarnetwork/chain-extension-contracts","last_synced_at":"2025-04-28T16:44:03.970Z","repository":{"id":74085003,"uuid":"509518283","full_name":"AstarNetwork/chain-extension-contracts","owner":"AstarNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-09T15:47:49.000Z","size":637,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-04-14T01:58:36.569Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstarNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-01T16:15:49.000Z","updated_at":"2024-04-14T01:58:36.570Z","dependencies_parsed_at":null,"dependency_job_id":"67325dc3-28a3-415d-a7e0-459773583d83","html_url":"https://github.com/AstarNetwork/chain-extension-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fchain-extension-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fchain-extension-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fchain-extension-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fchain-extension-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstarNetwork","download_url":"https://codeload.github.com/AstarNetwork/chain-extension-contracts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251347860,"owners_count":21575168,"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-04-28T16:44:03.452Z","updated_at":"2025-04-28T16:44:03.957Z","avatar_url":"https://github.com/AstarNetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chain Extension contracts\nThis repository contains crates of chain extension that you can use in your contracts.\n\n### Extended documentation\nTo know which chain extension is available in which networks and have more info about it please visit the official [Chain Extension docs](https://docs.astar.network/docs/build/wasm/contract_environment/chain-extension/chain_extensions/)\n\n### Purpose\nIn `crates` folder you will find the chain extension struct that implements callable functions.\nIn `contracts` folder you will find full implementation of the chain extension struct and its integration tests in `tests` folder\n\n### Versions\n[ink! v5.0.0-rc](https://github.com/paritytech/ink/releases/tag/v5.0.0-rc)\n\n### Chain Extensions\n\n#### Pallet Assets\nThis crate exposes `AssetsExtension` struct that implement all functions of pallet-assets chain extension.    \n\n**Usage**\n1. add `assets_extension` in your `Cargo.toml` and to the `std` `features`\n```toml\nassets_extension = {  git = \"https://github.com/AstarNetwork/chain-extension-contracts\", default-features = false }\n\n[features]\ndefault = [\"std\"]\nstd = [\n    \"ink/std\",\n    \"scale/std\",\n    \"scale-info/std\",\n    \"assets_extension/std\",\n]\n```\n\n2. Add use statement in your contract module and declare AssetsExtension type\n```rust\nuse assets_extension::{AssetsError, AssetsExtension as _AssetsExtension};\n\ntype AssetsExtension = _AssetsExtension\u003cDefaultEnvironment\u003e;\n```\n\n3. Use struct functions directly in your contract\n```rust\nAssetsExtension::mint(asset_id, beneficiary, amount)?;\n```\n\nNote: As precompiles in Solidity, the contract is the `caller` (the Origin of the call in the runtime)\n\n### License\nApache 2.0\n\n## 🏗️ How to use - Contracts\n##### 💫 Build\nUse these [instructions](https://use.ink/getting-started/setup) to set up your ink!/Rust environment    \nRun this command to compile contract:\n\n```sh\nyarn\nyarn compile\n```\n\n2. Run the tests\nEnsure a local node is running\n```sh\nyarn test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fchain-extension-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastarnetwork%2Fchain-extension-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fchain-extension-contracts/lists"}