SpaceKit

8 posts

SpaceKit banner
SpaceKit

SpaceKit

@SpaceKitWeb3

A complete framework and testing-suite to write smart contracts using @swiftlang | Created with ❤️ for developers by @gfusee33

加入时间 Ekim 2024
1 关注135 粉丝
SpaceKit
SpaceKit@SpaceKitWeb3·
SpaceKit 0.2.7 is out 🔥 The latest release of SpaceKit introduces several powerful features, along with seven brand-new interactive tutorial chapters. In this guided experience, you’ll build and test a coin flip smart contract from scratch, learning how to handle randomness, token interactions, and more. What’s New in This Release This version adds new capabilities to help you express logic more clearly and test smart contracts more effectively. 1) Compare BigUInt Values with .min and .max You can now retrieve the minimum or maximum of two BigUInt values using the .min and .max static methods. Use these methods to simplify numeric comparisons within your contract logic. 2) Check for Smart Contracts with isSmartContract Use the isSmartContract opcode to verify whether an Address represents a contract or a wallet. This makes it easy to restrict access to specific endpoints: 3) Add Randomness to Your Contracts The SwiftVM now supports randomness, allowing you to test smart contracts that depend on random number generation. To ensure tests are deterministic, you can provide a custom seed: Use this feature when simulating behavior like betting outcomes or lottery draws. 4) Return Mappers from View Functions You can now return SingleValueMapper results directly from view functions. Mark your custom mappers as public to automatically generate the corresponding view: This makes your data model both powerful and easy to access. New Interactive Tutorial: Build a Coin Flip Contract Start from a blank slate and implement a full-featured coin flip smart contract in Swift. In this seven-part tutorial, you’ll: - Define admin-only endpoints to set minimum and maximum bet amounts - Let users bet using either EGLD or ESDT tokens - Use randomness to resolve outcomes - Simulate success and failure cases in the SwiftVM - Explore advanced testing features like setting block time, random seeds, multiple caller contexts, and various token types A preview of the final contract view is included so you can visualize the outcome as you build. To explore these updates, try the latest tutorials or upgrade your existing projects to use SpaceKit 0.2.7. Ready to dive in? Let’s flip the coin.
SpaceKit tweet mediaSpaceKit tweet mediaSpaceKit tweet mediaSpaceKit tweet media
English
1
13
36
5.9K
SpaceKit
SpaceKit@SpaceKitWeb3·
Tips: The second argument of the SpaceKit require function is an error message and is marked as an autoclosure This means it is only evaluated when needed, so if the assertion is true, the error message is never computed, resulting in no gas consumption at all
SpaceKit tweet media
English
0
3
10
693
SpaceKit
SpaceKit@SpaceKitWeb3·
🚀 SpaceKit 0.2.6 is out! This update introduces a new type: TokenIdentifier, a Buffer designed for handling operations on tokens. You can use it as an endpoint parameter or instantiate it directly from a Buffer or a string literal: It also includes helper functions to validate identifiers: More details on the release: github.com/gfusee/SpaceKi…
SpaceKit tweet mediaSpaceKit tweet media
English
3
17
42
6K
Robert Sasu | dev/acc
Robert Sasu | dev/acc@SasuRobert·
Write your contracts and full dApps easily using @SwiftLang . The power of WASM makes it possible for @MultiversX to be really a general processing layer for everything. As you can just write your business logic and deploy it instantly on the chain using your language, your tools. Rust and Swift has millions of developers and insanely good tools to develop simple and complex apps/contracts. Just join the revolution and BUIDL!
SpaceKit@SpaceKitWeb3

🚀 SpaceKit 0.2.6 is out! This update introduces a new type: TokenIdentifier, a Buffer designed for handling operations on tokens. You can use it as an endpoint parameter or instantiate it directly from a Buffer or a string literal: It also includes helper functions to validate identifiers: More details on the release: github.com/gfusee/SpaceKi…

English
2
31
128
4.6K
SpaceKit
SpaceKit@SpaceKitWeb3·
note to myself: I could have used $USH instead of $USDC in the example
English
1
0
8
222
SpaceKit
SpaceKit@SpaceKitWeb3·
🚀 SpaceKit 0.2.5 is out! This update fixes the install CLI script when upgrading 🛠️ Check out the full changelog here: github.com/gfusee/spaceki…
English
0
7
20
414