Giter Club home page Giter Club logo

casper-event-standard's Introduction

Casper Event Standard

The Casper Event Standard is a Rust library that provides a simple and standardized way for smart contracts on the Casper Network to emit events. Events are an important tool for decentralized applications, as they allow contracts to communicate with external services in a transparent and decentralized way.

With the Casper Event Standard, developers can easily define custom event types and register them in the contract. The library provides a convenient API for emitting events. This makes it easy to build complex applications that rely on event-driven architecture.

Whether you're building a decentralized exchange, a prediction market, or any other type of blockchain application, the Casper Event Standard is an essential tool for creating reliable and scalable smart contracts. So why wait? Start using the Casper Event Standard today and take your decentralized application to the next level!

Usage

use casper_event_standard::Event;

// Turn a struct into an event.
#[derive(Event)]
struct Transfer {
    amount: U256,
    from: Key,
    to: Key
}

// Register event schemas.
fn init_events() {
    let schemas = Schemas::new()
        .with::<Transfer>();
    casper_event_standard::init(schemas);
}

// Emit event.
fn emit_transfer(transfer: Transfer) {
    casper_event_standard::emit(transfer);
}

Tests

To test the code run:

$ just test

casper-event-standard's People

Contributors

zie1ony avatar mrkara avatar davidatwhiletrue 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.