Giter VIP home page Giter VIP logo

rif-relay's Introduction

RIF Relay

A secure transaction relay system to enable users to pay fees using ERC-20 tokens.

Description

RIF Relay takes its inspiration from the Gas Station Network (GSN) project. GSN is a decentralized system that improves dApp usability without sacrificing security. In a nutshell, GSN abstracts away gas (used to pay transaction fees) to minimize onboarding and UX friction for dApps. With GSN, “gasless clients” can interact with smart contracts paying for gas with tokens instead of native-currency.

Our main objective is to provide the RSK ecosystem with the means to enable blockchain applications and end-users (wallet-apps) to pay for transaction fees using tokens (e.g. RIF tokens), and thereby remove the need to acquire RBTC in advance.

It is important to recall that - as a security measure - the version 1 contracts deployed on Mainnet have limits on the staked amounts to operate, these limits were removed in version 2.

Modules

RIF Relay is built in modules, the entire system is made up by 3 modules.

  1. RIF Relay Contracts contains all the contracts used by the RIF Relay System.
  2. RIF Relay Client contains a library to interact with the relay server.
  3. RIF Relay Server has all the relay server code. You can run the server directly from there.

Each module has instructions for development and usage.

Getting Started with the RIF Relay Sample dApp SDK

We've created a sample dApp to showcase how users can submit relayed transactions to the Rootstock blockchain using the RIF Relay Sample dApp SDK. For details, see RIF Relaying Services SDK sample dApp.

Testing

This repository contains all the integration tests. These tests verify the behavior of the entire system. You have two ways to run tests:

  1. Executing npm test will run all the test suite and verify all the system. This could take a few hours since executing the entire test suite is a heavy task.
  2. Running npm run testOnly <TEST_FILE> where <TEST_FILE> it’s the typescript file that contains the test code inside will execute only that test and make the verifications inside it. An example could be npm run testOnly ./test/relayserver/RelayServer.test.ts.

Important Note: when you run the tests you will see folders like contracts, migrations and some other files appearing during the tests and disappearing after, that’s because we need to have the contracts on the same context as this repository during tests, this is a normal behavior.

Scripts

This repository contains a script that analyzes gas consumption for relay and deploy transactions. It prints different metrics related to gas usage when relaying a transaction or deploying a smart wallet. To run it, execute the command:

npm run analyze:gas <NETWORK_NAME>

where:

  • <NETWORK_NAME> is a required parameter for the network name, taken from the hardhat.config.ts, and must correspond to a valid RSK Node (commonly, regtest is used). Do not use this with the default network (hardhat) as it will fail.

Example: npm run analyze:gas regtest

Deprecated Doc

rif-relay's People

Contributors

diegomasini avatar drortirosh avatar forshtat avatar julianlen avatar raullaprida avatar shahafn avatar nventuro avatar mortelli avatar spalladino avatar antomor avatar smcsicardi avatar wilsoniovlabs avatar lucasvuotto avatar dependabot[bot] avatar mauricioirace avatar yoav-tabookey avatar franciscotobar avatar zdaodu-iov avatar nervehammer avatar smishraiov avatar ppedemon avatar lirazsiri avatar jjtechuy avatar david-iov avatar dmihal avatar amaurer avatar andresquijano avatar chaitanyapotti avatar ironfe93 avatar dev1644 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.