Skip to content

413x5/mx-wcc24-rs

Repository files navigation

MultiversX Winter Coding Challenge 2024

Rust implementation

A series of smart contracts written in Rust for the MultiversX blockchain.

Environment Installation

Install the MultiversX Smart Contract Rust SDK

Building the contracts

Use sc-meta in the terminal to build all contracts:

cd mx-wcc24-rs
sc-meta all build

Deploying and Testing Contracts

Use the MultiversX Utility App

  • Login with your developer wallet on Devnet
  • If necessary, you can get funds from web wallet's Faucet
  • Go to the SC Interaction page
  • Select the Load ABI tab and select the contract [contract-name].abi.json file from the {contract-name}/output folder
  • Deploy the contracts by selecting the Deploy Contract tab and use the [contract-name].wasm file from the {contract-name}/output folder
  • Note the deployed contract's address after the deployment transaction is confirmed
  • You can also look at your scDeploy transaction in the Devnet Explorer. To find the contract's address, select the Logs section
  • Make sure your contract's address is entered in the Contract Address field
  • You are now ready to interact with the contract!

Contracts

A smart contract that allows users to issue and manage ESDT Fungible tokens (SNOW).

A smart contract that allows users to stake ESDT Fungible tokens (WINTER) and earn SNOW rewards.

A smart contract that allows users to stake ESDT Fungible tokens (WINTER) and mint game resources (WOOD, FOOD, STONE, GOLD) based on their stake amount and time intervals.

A smart contract that manages character NFTs for the game. The contract handles minting Citizens using resources (WOOD, FOOD), upgrading them to Soldiers (using GOLD, ORE), and further upgrading Soldiers with Tool NFTs (Shields and Swords).

A smart contract that allows users to transform STONE tokens into ORE tokens through a burning mechanism, where a specific amount of STONE is burned to mint ORE tokens.

A smart contract that manages tool NFTs for the game. The contract handles minting Shields (using ORE) and Swords (using ORE and GOLD), which can be used to upgrade Soldier NFTs.

A smart contract that manages game challenges and resolves battles between players. The contract handles creating game challenges, accepting challenges, and resolving battles between Soldiers.

A smart contract that serves as a unified interface for interacting with the other game contracts. It manages user resource deposits, character operations, tool crafting and game battles, by handling required MultiESDT token transfers between contracts.

Common Modules

A shared module used across game contracts that provides:

  • Common data structures for Characters and Tools
  • NFT attribute decoding
  • Token validation utilities
  • Shared constants and configurations

About

MultiversX Winter Coding Challenge 2024 - Rust Smart Contracts Implementation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages