Skip to content

The first Swift smart contract framework with a built-in testing suite and a Swift-replica VM for contract testing.

License

Notifications You must be signed in to change notification settings

gfusee/SpaceKit

Repository files navigation

Version Documentation License: GPL v3

🚀 SpaceKit: The First Swift Smart Contract Framework

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.

🔥 Features

  • 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, and BigUint 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.

🛠 SwiftVM Features

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.

📖 Documentation

For detailed guidance and examples, check out the following resources:


📬 Contributing

Contributions are welcome! If you’d like to improve SpaceKit, submit an issue, suggest a feature, or contribute code.

How to Contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit changes and push to your fork.
  4. Submit a pull request.

Contributing guide is not written yet. Feel free to contact me on GitHub or X!


📝 License

SpaceKit is licensed under the GPLv3 License. See the LICENSE file for details.


⚡ Stay Connected

🐦 Follow on X: @gfusee33 for development insights, @SpaceKitWeb3 for official announcements.

About

The first Swift smart contract framework with a built-in testing suite and a Swift-replica VM for contract testing.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages