Ride

Less code, more power
Ride is Waves’ functional purpose-designed smart contract language inspired by Scala for dApp development, designed for applying scripts to assets and accounts on the Waves blockchain, as well as creating sophisticated programmable logic for the decentralised environment
wallet.ride
fomo.ride
multisig.ride
@Callable(i)
func deposit() = {
   let pmt = extract(i.payment)
   if (isDefined(pmt.assetId)) then throw("can hodl waves only at the moment")
   else {
        let currentKey = toBase58String(i.caller.bytes)
        let currentAmount = match getInteger(this, currentKey) {
            case a:Int => a
            case _ => 0
        }
        let newAmount = currentAmount + pmt.amount
        WriteSet([DataEntry(currentKey, newAmount)])
   }
}
 
@Callable(i)
func withdraw(amount: Int) = {
    let currentKey = toBase58String(i.caller.bytes)
    let currentAmount = match getInteger(this, currentKey) {
        case a:Int => a
        case _ => 0
    }
    let newAmount = currentAmount - amount
    if (amount < 0)
            then throw("Can't withdraw negative amount")
    else if (newAmount < 0)
            then throw("Not enough balance")
            else ScriptResult(
                    WriteSet([DataEntry(currentKey, newAmount)]),
                    TransferSet([ScriptTransfer(i.caller, amount, unit)])
                )
    }
 
@Verifier(tx)
func verify() = false
@Callable(i)
func fearmissing() = {
   let payment = match i.payment {
       case p:AttachedPayment =>
            match p.assetId  {
                   case assetId: ByteVector => throw("fomo waves only")
                   case _ => p.amount
               }
 
       case _ => throw("payment must be attached")
   }
    let lastPayment = match getInteger(this, "lastPayment") {
        case p:Int => p
        case _ => 0
    }
 
    if(payment <= lastPayment)
        then throw("min payment is " +toString(payment))
        else # storing best payment, caller and height
            WriteSet([
                DataEntry(lpKey, payment),
                DataEntry(liKey, i.caller.bytes),
                DataEntry(lhKey, height)
            ])
}
 
@Callable(i)
func withdraw() = {
    let callerCorrect = i.caller.bytes == extract(getBinary(this, liKey))
    let heightCorrect = extract(getInteger(this, lhKey)) - height >= day
    let canWithdraw = heightCorrect && callerCorrect
 
    if (canWithdraw)
        then TransferSet([ScriptTransfer(i.caller, wavesBalance(this), unit)])
        else throw("behold")
}
 
#define public keys
let alicePubKey  = base58'5AzfA9UfpWVYiwFwvdr77k6LWupSTGLb14b24oVdEpMM'
let bobPubKey    = base58'2KwU4vzdgPmKyf7q354H9kSyX9NZjNiq4qbnH2wi2VDF'
let cooperPubKey = base58'GbrUeGaBfmyFJjSQb9Z8uTCej5GzjXfRDVGJGrmgt5cD'
 
#check whoever provided the valid proof
let aliceSigned  = if(sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey  )) then 1 else 0
let bobSigned    = if(sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey    )) then 1 else 0
let cooperSigned = if(sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubKey )) then 1 else 0
 
#sum up every valid proof to get at least 2
aliceSigned + bobSigned + cooperSigned >= 2
 

Features

Straightforward
Concise, human-readable language, offering reduced development time and resources.
Failproof
Strongly-typed non-Turing complete language, designed to avoid common critical mistakes.
Modern
Ride is formal-verification friendly, with lazy execution and a modern typed functional approach.
Predictable
Waves protocol has flat fees and no gas, so the cost of dApp operations is known in advance.
Developer-friendly
Comes with Waves IDE for learning and sandbox development and Visual Studio Code plugin for advanced users.
Useful
Anyone can create a decentralized application on Waves Protocol for numerous different areas, such as: DAOs, Donations, Escrow, Referral and Loyalty systems, Marketplaces, P2P-lending, Gaming, Identityand more.
  1. Healthcare (records, data sharing)
  2. Identity & Access management
  3. Charity
  4. CrowdFunding
  5. CrowdLending
  6. p2p-Lending
  7. Charity
  8. DAOs
  9. Marketplaces b2c
  10. Marketplaces c2c
  11. MMO games
  12. Escrow services
  13. Motivation programs
  14. Referral marketing
  15. Public DBs
  16. loyalty and gift cards, coupons
  17. Votings
  18. Decentralized Finance (DeFi)
  19. FOG Computing
  20. Storages
  21. Crowdsource data (wiki, social networks)
  22. Insurance
  23. Prediction Markets
  24. Digital Collectibles Markets
  25. Physical Collectibles Markets
  26. Donations
  27. Automated Payments
  28. Ricardian contracts (templates)

Waves IDE

Waves IDE allows easy prototyping for dApps and comes with a built-in toolkit for testing

Convenient

Syntax Highlighting, intelliSense, Error

Inspections

Interoperable

Work with mainnet, testnet or custom

networks.

All-in-one

REPL, Script Code, Tests Code.

Waves IDE
img
Make your first dApp

Learn the basics of Waves development cycle

Join the course

Videos

Ride promo