Skip to content

Instantly share code, notes, and snippets.

View ramanan12345's full-sized avatar

Venkata ramanan ramanan12345

  • Insurance
  • Bangalore india
View GitHub Profile
{"valueParameterInfo":[["Price",{"valueParameterFormat":{"contents":[6,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"The price of the item."}]],"timeParameterDescriptions":[["Payment deadline","The _**buyer**_ must pay the _price_ of the item by this time, otherwise the contract is cancelled."],["Complaint deadline","The _**buyer**_ can only complain until this deadline, otherwise the contract will assume the transaction went smoothly and pay the _**seller**_."],["Complaint response deadline","If the _**buyer**_ complained, the _**seller**_ must respond before this deadline, otherwise the contract will assume there was a problem with the transaction and refund the _**buyer**_."],["Mediation deadline","If the _**buyer**_ and the _**seller**_ disagree, the _**mediator**_ must weigh in before this deadline, otherwise the contract will assume there was a problem with the transaction and refund the _**buyer**_."]],"roleDescriptions":[["Buyer","The buyer of the item."],["Mediator","The mediator decides w
def keep_dice(self):
'''
method function returning a dice list to reroll.
It also stores the dice you want to keep in a separate keep list.
- returns list
'''
keep_input = input('which dice do you want to keep (comma separated: e.g. 1,1,5)? ')
split_input = keep_input.split(',')
if keep_input == '':
@ramanan12345
ramanan12345 / Marlowe.hs
Last active December 6, 2019 09:59
Marlowe Smart Contract
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- What does the vanilla contract look like?
@ramanan12345
ramanan12345 / Playground.hs
Last active July 10, 2019 23:22
Plutus Playground Smart Contract
module MyFirstPlutusSmartContract where
import qualified Language.PlutusTx as PlutusTx
import qualified Language.PlutusTx.Prelude as P
import Ledger
import Wallet
import Ledger.Validation
import Playground.Contract
@ramanan12345
ramanan12345 / Playground.hs
Last active July 10, 2019 23:07
Plutus Playground Smart Contract
-- Contract endpoints that generate different kinds of errors for the log:
-- logAMessage produces a log message from a wallet
-- submitInvalidTxn submits an invalid txn which should result in a
-- "Validation failed" message throwWalletAPIError throws an error from
-- a wallet (client)
import Language.PlutusTx.Prelude
import qualified Data.Map as Map
import qualified Data.Set as Set
@ramanan12345
ramanan12345 / Playground.hs
Created June 8, 2019 09:10
Plutus Playground Smart Contract
-- | A game with two players. Player 1 thinks of a secret word
-- and uses its hash, and the game validator script, to lock
-- some funds (the prize) in a pay-to-script transaction output.
-- Player 2 guesses the word by attempting to spend the transaction
-- output. If the guess is correct, the validator script releases the funds.
-- If it isn't, the funds stay locked.
import qualified Language.PlutusTx as PlutusTx
import qualified Language.PlutusTx.Prelude as P
import Ledger
import qualified Ledger.Value as Value
@ramanan12345
ramanan12345 / Playground.hs
Last active June 7, 2019 22:03
Plutus Playground Smart Contract
-- | Vesting scheme as a PLC contract
import Control.Monad (void)
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Language.PlutusTx as P
import Ledger (Address, DataScript(..), RedeemerScript(..), Signature, Slot, TxOutRef, TxIn, ValidatorScript(..))
import qualified Ledger as L
import Ledger.Value (Value)
@ramanan12345
ramanan12345 / Playground.hs
Created June 4, 2019 03:52
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Slot (SlotRange)
import qualified Ledger.Slot as Slot
@ramanan12345
ramanan12345 / example.go
Created October 28, 2017 02:37 — forked from bryfry/gzip.go
Idiomatic golang net/http gzip transparent compression (works with Alice)
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
// Gzip Compression