Giter Site home page Giter Site logo

newbie-teen / sc-delegation-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from multiversx/mx-delegation-sc

0.0 0.0 0.0 3.43 MB

Smart contract for managing staking delegation in Elrond.

License: GNU General Public License v3.0

Shell 1.45% Rust 98.55%

sc-delegation-rs's Introduction

sc-delegation-rs

Smart contract for managing staking delegation in Elrond.

Build

Run

./compile-wasm.sh 

in root, it will produce delegation.wasm and auction-mock.wasm (a dummy used in tests instead of a auction contract).

Rust configuration

rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
rustc --version
cargo install wasm-snip

Advanced

Wasm is built with this line:

cargo build --bin wasm --target=wasm32-unknown-unknown --release

To debug macros:

  • wasm mode:
cargo +nightly rustc --bin wasm -- -Z unstable-options --pretty=expanded > demacroed.rs
  • debug mode:
cargo +nightly rustc --lib -- -Z unstable-options --pretty=expanded > demacroed.rs

To check wasm size:

twiggy top -n 20 target/wasm32-unknown-unknown/release/wasm.wasm

To work with unpublished elrond-wasm crates, clone https://github.com/ElrondNetwork/elrond-wasm-rs in the same parent directory and replace dependencies in Cargo.toml with:

elrond-wasm = { path = "../../elrond-wasm-rs/elrond-wasm" }
elrond-wasm-node = { path = "../../elrond-wasm-rs/elrond-wasm-node" }
elrond-wasm-derive = { path = "../../elrond-wasm-rs/elrond-wasm-derive" }

And the same for debug:

elrond-wasm = { path = "../../../elrond-wasm-rs/elrond-wasm" }
elrond-wasm-debug = { path = "../../../elrond-wasm-rs/elrond-wasm-debug" }

sc-delegation-rs's People

Contributors

andrei-marinica avatar sasurobert avatar beniamindrasovean avatar claudiu725 avatar alyn509 avatar andreibancioiu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.