SpaceKit is the first-ever smart contract framework built for Swift, bringing a powerful, intuitive, and high-level approach to blockchain development. It is designed to offer a seamless developer experience, making smart contract development as natural as writing Swift applications.
- Swift-Native Development: Write smart contracts entirely in Swift with familiar syntax and high-level abstractions.
- Cross-Platform Support: Develop on macOS, Linux, and Windows (via WSL).
- Xcode & VSCode Compatibility: Use your preferred IDE with full autocompletion and syntax highlighting.
- Advanced Type System: High-level types such as
Buffer
,Vector
, andBigUint
abstract away low-level operations. - Flexible Storage Management: Use
@Storage
annotations or create custom storage mappers (WhitelistMapper
,VecMapper
,SetMapper
). - Easy Contract Interactions: Deploy, upgrade, or call other contracts seamlessly from your contracts.
- Async Calls with Callbacks: Mark functions with
@Callback
for asynchronous calls handling. - Full ESDT Support: Mint, burn, and manage fungible, non-fungible, and semi-fungible tokens.
- Secure Randomness: Generate random numbers via SpaceVM’s built-in random features.
- Built-in CLI: Initialize projects, compile to WebAssembly, and generate ABI files.
- Rust Compatibility: Swift smart contracts can interact seamlessly with Rust contracts.
- SwiftVM for Testing: A Swift-based replica of SpaceVM to test contracts natively with the Swift debugger.
The SwiftVM is a core part of SpaceKit, designed to reproduce the behavior of the SpaceVM directly in a Swift environment. With SwiftVM, you can:
- Run any endpoint of your contract and check its result.
- Handle endpoint failures and view the reason for failure, allowing you to test all edge cases.
- Set the state of each address before running tests, including initializing wallets with token balances.
- Choose which address is calling an endpoint for controlled test execution.
- Simulate payment inputs, including EGLD and ESDT tokens.
- Support synchronous contract-to-contract calls, ensuring state reversion in case of failure.
- Support asynchronous contract-to-contract calls, maintaining non-reverting behavior with callback execution.
- Implement the ESDT GoVM system contract, enabling token issuance and operations.
- Debug efficiently using Xcode’s built-in debugging tools and breakpoints.
For detailed guidance and examples, check out the following resources:
- Interactive tutorial & getting started – Step-by-step instructions on using SpaceKit.
- GPT assistant – AI assistant trained to help you using SpaceKit.
- Contract examples – Ready-to-use contract implementations.
- SwiftVM test examples – Examples showcasing how to test contracts using SwiftVM.
Contributions are welcome! If you’d like to improve SpaceKit, submit an issue, suggest a feature, or contribute code.
- Fork the repository.
- Create a feature branch.
- Commit changes and push to your fork.
- Submit a pull request.
Contributing guide is not written yet. Feel free to contact me on GitHub or X!
SpaceKit is licensed under the GPLv3 License. See the LICENSE file for details.
🐦 Follow on X: @gfusee33 for development insights, @SpaceKitWeb3 for official announcements.