{"id":29089627,"url":"https://github.com/openzeppelin/openzeppelin-pallet-abstractions","last_synced_at":"2025-06-28T04:04:16.902Z","repository":{"id":255031575,"uuid":"847410495","full_name":"OpenZeppelin/openzeppelin-pallet-abstractions","owner":"OpenZeppelin","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-12T08:21:55.000Z","size":358692,"stargazers_count":2,"open_issues_count":18,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-12T09:24:24.916Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenZeppelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.MD","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.MD","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T18:37:55.000Z","updated_at":"2024-11-12T08:21:59.000Z","dependencies_parsed_at":"2024-08-27T16:43:21.671Z","dependency_job_id":"f3be54c8-52ee-49d1-ab35-79be3437e714","html_url":"https://github.com/OpenZeppelin/openzeppelin-pallet-abstractions","commit_stats":null,"previous_names":["openzeppelin/polkadot-runtime-wrappers","openzeppelin/openzeppelin-pallet-abstractions"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/OpenZeppelin/openzeppelin-pallet-abstractions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-pallet-abstractions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-pallet-abstractions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-pallet-abstractions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-pallet-abstractions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenZeppelin","download_url":"https://codeload.github.com/OpenZeppelin/openzeppelin-pallet-abstractions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-pallet-abstractions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262371684,"owners_count":23300595,"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-06-28T04:04:16.136Z","updated_at":"2025-06-28T04:04:16.892Z","avatar_url":"https://github.com/OpenZeppelin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenZeppelin Pallet Abstractions\n\nThis repository contains a set of Rust macros designed to streamline the configuration of Polkadot Parachain Runtimes. These macros reduce the lines of code (LOC) necessary for configuring a secure and optimized runtime, providing a balance between customizability and ease of use.\n\n\u003e [!WARNING]\n\u003e This project has not been audited yet.\n\u003e Do not use in production.\n\nFeatures:\n\n- Reduced LOC: Minimize boilerplate by using macros to handle repetitive configurations.\n- Sensible Defaults: Default configurations that meet most standard use cases, ensuring security and functionality without requiring extensive customization.\n- High Configurability: Enable advanced users to customize runtime configurations, offering flexible settings without sacrificing simplicity for common setups.\n- Security-Focused: Built with security in mind, ensuring that configurations adhere to best practices for Polkadot parachains.\n\n## Installation\n\nTo use `openzeppelin-pallet-abstractions`, add it to your Cargo.toml file:\n\n```toml\n[dependencies]\nopenzeppelin-pallet-abstractions = { git = \"https://github.com/OpenZeppelin/openzeppelin-pallet-abstractions\", tag = \"v0.1.0\" }\n```\n\nThen, import the necessary macros in your runtime configuration file.\n\n## Usage\n\n\u003e [!NOTE]\n\u003e For examples of how to use the abstractions, see the [Polkadot runtime templates](https://github.com/OpenZeppelin/polkadot-runtime-templates).\n\nThe macros are intended to streamline runtime configuration for Polkadot parachains. Here’s a basic example from the EVM parachain runtime maintained in the [Polkadot runtime templates](https://github.com/OpenZeppelin/polkadot-runtime-templates):\n\n```rust, ignore\nuse openzeppelin_pallet_abstractions::{impl_openzeppelin_system, SystemConfig};\n\npub struct OpenZeppelinRuntime;\nimpl SystemConfig for OpenZeppelinRuntime {\n    // Basic configuration options:\n    type AccountId = AccountId;\n    type ExistentialDeposit = ConstU128\u003cEXISTENTIAL_DEPOSIT\u003e;\n    type PreimageOrigin = EnsureRoot\u003cAccountId\u003e;\n    type ScheduleOrigin = EnsureRoot\u003cAccountId\u003e;\n    type Version = Version;\n    //...\n}\nimpl_openzeppelin_system!(OpenZeppelinRuntime);\n```\n\nThe `impl_openzeppelin_system!` macro call takes as input the user configuration specified in the `SystemConfig` implementation by `OpenZeppelinRuntime`. The macro call expands to implement the system grouping pallets for the Runtime:\n\n- `frame_system`\n- `pallet_timestamp`\n- `parachain_info`\n- `pallet_scheduler`\n- `pallet_preimage`\n- `pallet_proxy`\n- `pallet_balances`\n- `pallet_utility`\n- `cumulus_pallet_parachain_system`\n- `pallet_multisig`\n\nHere are the other pallet groupings:\n\n- Assets\n- Consensus\n- EVM\n- Governance\n- XCM\n\nHere are their configurations in the EVM parachain runtime:\n\n```rust, ignore\nuse openzeppelin_pallet_abstractions::{\n    impl_openzeppelin_assets, impl_openzeppelin_consensus, impl_openzeppelin_evm,\n    impl_openzeppelin_governance, impl_openzeppelin_xcm, AssetsConfig,\n    ConsensusConfig, EvmConfig, GovernanceConfig, XcmConfig,\n};\n//...other imported types used in the configuration\n\nimpl ConsensusConfig for OpenZeppelinRuntime {\n    type CollatorSelectionUpdateOrigin = CollatorSelectionUpdateOrigin;\n    // Some types may be left unassigned to use defaults\n}\nimpl GovernanceConfig for OpenZeppelinRuntime {\n    type ConvictionVoteLockingPeriod = ConstU32\u003c{ 7 * DAYS }\u003e;\n    type DispatchWhitelistedOrigin = EitherOf\u003cEnsureRoot\u003cAccountId\u003e, WhitelistedCaller\u003e;\n    //...\n}\nimpl XcmConfig for OpenZeppelinRuntime {\n    type BaseXcmWeight = BaseXcmWeight;\n    type LocalOriginToLocation = LocalOriginToLocation;\n    type LocationToAccountId = LocationToAccountId;\n    type MessageQueueHeapSize = ConstU32\u003c{ 64 * 1024 }\u003e;\n    type MessageQueueMaxStale = ConstU32\u003c8\u003e;\n    //...\n}\nimpl EvmConfig for OpenZeppelinRuntime {\n    type AddressMapping = IdentityAddressMapping;\n    type CallOrigin = EnsureAccountId20;\n    type PrecompilesType = OpenZeppelinPrecompiles\u003cRuntime\u003e;\n    type PrecompilesValue = PrecompilesValue;\n    //...\n}\nimpl AssetsConfig for OpenZeppelinRuntime {\n    type AssetDeposit = ConstU128\u003c{ 10 * CENTS }\u003e;\n    type AssetId = u128;\n    type ForceOrigin = EnsureRoot\u003cAccountId\u003e;\n    //...\n}\nimpl_openzeppelin_assets!(OpenZeppelinRuntime);\nimpl_openzeppelin_consensus!(OpenZeppelinRuntime);\nimpl_openzeppelin_governance!(OpenZeppelinRuntime);\nimpl_openzeppelin_xcm!(OpenZeppelinRuntime);\nimpl_openzeppelin_evm!(OpenZeppelinRuntime);\n```\n\nHere are a few ways `openzeppelin-pallet-abstractions` simplifies parachain configuration:\n\n- Basic Setup: Only a few LOC required to get a secure, functioning runtime.\n- Advanced Configuration: Customize each aspect of the runtime by passing additional parameters to the macros.\n- Default Overrides: Override defaults for specific settings while letting the abstractions handle the rest.\n\n## Security\n\nRefer to our [Security Policy](./SECURITY.MD) for more details.\n\n## Contributing\n\nContributions are welcome! Please see our [`CONTRIBUTING.md`](./CONTRIBUTING.MD) for guidelines.\n\n## License\n\nThis project is licensed under the GPLv3 License. See the [LICENSE](./LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzeppelin%2Fopenzeppelin-pallet-abstractions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenzeppelin%2Fopenzeppelin-pallet-abstractions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzeppelin%2Fopenzeppelin-pallet-abstractions/lists"}