Coder Social home page Coder Social logo

interoperability-examples's Introduction

Using GaaS and CaaS for better UX

Developers integrating with RenVM can implement a few different strategies to enhance user experience and create truly interoperable cryptocurrency applications.

Check out a hosted version of the app here.

GaaS: remove the need for users to have ETH

When building smart contracts that interact with RenVM, you can use patterns to enable methods to be called via the OpenZeppelin Gas Station Network (GSN). The GSN is a decentralized solution for solving user onboarding to Ethereum applications. It allows dapps to pay for their users' transactions in a secure way, so users don’t need to hold ETH to pay for their gas or even set up an account.

CaaS: accelerate the time to complete transactions

One thing that developers can do to improve cross-chain user experience is to help users complete actions faster by using funds that have already been shifted. These funds can be accessed in a variety of trustful and trustless ways, however the goal is the same - facilitate a cross-chain transaction in a shorter time that it would take the user to first fully shift in an asset and then complete an action.

1. Deploy adapter

Deploy one of the adapter contracts in the /contracts directory using the same owner address parameter as the wallet you plan fill transactions with.

2. Deposit shifted tokens and fund GSN RelayHub

Deposit shifted tokens to the adapter address through the deposit() method. The adapter will use these funds to complete swaps faster when selected by the user via the UI. Please note: you'll need to approve the adapter contract on the shifted token contract before depositing.

justsmartcontracts.dev is an easy way to interact with smart contracts using just the contract address and ABI.

The adapter contract will also need to maintain an ETH balance with the GSN RelayHub. Gas fees paid by relay nodes will be refunded from this balance. To deposit funds, use the GSN dapp tool.

3) Set environment variables

Create a .env file at the root directory with the following variables and their real world values:

WALLET_ADDRESS=""
WALLET_KEY=""
ADAPTER_ADDRESS=""

4) Install dependencies and run

In main terminal window run npm install && npm start

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.