Installing rouge.js


npm install rouge.js --save   # using Npm
yarn add rouge.js             # using Yarn
            

ES6 Importing


import Web3 from 'web3' // web3 >= 1.0.0-beta.51
import { RougeProtocol } from 'rouge.js'

const rougeActorPromise = RougeProtocol({
  web3: new Web3(ETH_provider),
  pkey: actor_private_key
})
            

Creating & issuing a campaign


const campaign = await (await rougeActorPromise).createCampaign({
    name: 'your campaign name',
    // How many voucher notes to issue
    issuance: 10,
     // RGE deposit
    tokens: 10 * 0.1 * 1000000,
    // when the campaign will expire (timestamp)
    expiration: (new Date().getTime() / 1000) + 3600 * 24 * 10
  }
)
            

Distributing voucher notes


// optional test: is the current rougeActor
// authorized to distribute notes?
if (campaign.canDistribute) {
   // if yes, send one voucher to any Ethereum account
   campaign.distributeNote(receiver_address)
}
            

Redeeming voucher notes


const campaign = (await rougeActorPromise).campaignAt(address)
campaign.redeemNote()
            

The Rouge protocol

is an open-source blockchain voucher and note protocol

built as a suite of smart contracts using a specific token — the Rouge token — on Ethereum compatible blockchains (tested on Ethereum and POA).

Rouge is for all types of usage of non-repudiable and unique usage digital vouchers (for example, e-tickets, e-coupons, cashback notes, etc).

Using the javascript rouge.js package you can easily add non-repudiable and unique usage digital vouchers in a web site or a nativescript mobile ÐApps without learning Solidity.

Join our official mailing-list