Protocol
V0 Legacy version
Before the V2 Rouge Network, there was the precursor version V0. You can find the smart contracts and the associated applications on our Github. The Rouge Network V0 has been deprecated and is not maintained.
V0 contracts are available on the POA blockchain (and its Sokol testnet), or can be deployed using the Javascript library rouge.js.
- testnet Sokol (id=77)
- POA mainnet (id=99)
Before using rouge.js, you will need legacy RGE tokens on the ethereum address of the notes issuers. Please contact us if you need to use the legacy RGE Ethereum/POA bridge or need RGE test tokens.
Installing rouge.js v0
rouge.js v0 was designed to work both in the browser and in Node.js. We have also been been able to use it successfully in nativescript mobile app.
Rouge was depending on the web3.js library (1.0 version). It may not work with newer versions.
rouge.js v0 API
First step
The second step is to create an instance of the Rouge protocol.
This instance will be able to directly call all read-only & point-of-view-neutral attributs (see below) of the API, but you need to assign an Ethereum address to request information from the point of view of a "notes issuer" or "note bearer" for any campaign.
V0, Assigning the point of view to an Ethereum account
Most methods in the API need an account "point of view". The read-only attribut "canRedeem" will return true or false from the point of view of a specific acount. Similarly, the transaction method "redeem()" can only be used the point of view of a specific acount for which the private key is unlocked.
To assign a point of view, you just need to chain the rouge instance with the method 'as'. This method can accept several types of arguments to point the view to a specific Ethereum account
- mode 1: a public Ethereum address (*)
- mode 2: an object with the private key as attribut
- mode 3: directly a web3.js account object
(*) Using the mode 1, you will only access the read-only API methods of the protocol, and you won't be able to change state on the blockchain (creating campaign, notes acquisition and redemption).
V0 Rouge campaign object
You can instantiate a rouge.js campaign object either by creating a new campaign
(issued by the account set as the point of view) or by chaining the method
campaign$
and passing the campaign contract address as argument.
V0 Methods available on the Rouge campaign object:
Read-only attributes
For issuers:
For note bearers: