Skip to content

Instantly share code, notes, and snippets.

View bwbush's full-sized avatar

Brian W Bush bwbush

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bwbush on github.
  • I am bwbush (https://keybase.io/bwbush) on keybase.
  • I have a public key whose fingerprint is D8A4 7E20 1EC5 BF28 A3F2 3193 4C37 75D6 866A 0B54

To claim this, I am signing this object:

@bwbush
bwbush / blockly.xml
Last active January 10, 2021 00:21
Simple
<xml xmlns="https://developers.google.com/blockly/xml"><block type="BaseContractType" id="root_contract" deletable="false" x="13" y="187"><statement name="BaseContractType"><block type="WhenContractType" id="1$^G-OM+X4CanW*|DYCy"><field name="timeout">10</field><statement name="case"><block type="DepositActionType" id="euJ@CL!I+}FI#_XZ+l@M"><value name="from_party"><block type="RolePartyType" id="NgyPP@kP;niOIVce:Zc#"><field name="role">donor</field></block></value><value name="value"><block type="ConstantValueType" id="#1b#CAIVfD!,0:;h%:9p"><field name="constant">1000</field></block></value><value name="token"><block type="AdaTokenType" id="PBo!tksEMb{cQSfcRMv1"/></value><value name="party"><block type="RolePartyType" id="SG?YM{^2{m]F/l,jpJ3="><field name="role">recipient</field></block></value><statement name="contract"><block type="PayContractType" id="G:PK|RMy_Mw4g.7Q#B8@"><value name="payee"><block type="PartyPayeeType" id="`E5z:`c;N!7,]uRsj%`X"><value name="party"><block type="RolePartyType" id="!Hbkm`-
@bwbush
bwbush / Playground.hs
Created January 10, 2021 18:01
Plutus Playground Smart Contract
-- This is a starter contract, based on the Game contract,
-- containing the bare minimum required scaffolding.
--
-- What you should change to something more suitable for
-- your use case:
-- * The DataScript type
-- * The Redeemer type
--
-- And add function implementations (and rename them to
@bwbush
bwbush / actus.xml
Last active January 16, 2021 04:10
New Project
<xml xmlns="https://developers.google.com/blockly/xml"><block type="BaseContractType" id="root_contract" deletable="false" x="13" y="187"><statement name="BaseContractType"><block type="PaymentAtMaturity" id="{=}_ITjLvl4@`q(3yb.1"><value name="start_date"><block type="ActusDate" id="HP|!CTeJ5^81UiX~}:%]"><field name="yyyy">2020</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="maturity_date"><block type="ActusDate" id="sRa@%r-g[$FoEiXaD4{F"><field name="yyyy">2040</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="notional"><block type="ActusDecimalType" id="][{za^q3]:v{^(!Nre.G"><field name="value">1000</field></block></value></block></statement></block></xml>
@bwbush
bwbush / actus.xml
Last active January 16, 2021 04:29
Zero Coupon with Guarantor
<xml xmlns="https://developers.google.com/blockly/xml"><block type="BaseContractType" id="root_contract" deletable="false" x="13" y="187"><statement name="BaseContractType"><block type="PaymentAtMaturity" id="{=}_ITjLvl4@`q(3yb.1"><value name="start_date"><block type="ActusDate" id="HP|!CTeJ5^81UiX~}:%]"><field name="yyyy">2020</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="maturity_date"><block type="ActusDate" id="sRa@%r-g[$FoEiXaD4{F"><field name="yyyy">2040</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="notional"><block type="ActusDecimalType" id="][{za^q3]:v{^(!Nre.G"><field name="value">1000</field></block></value></block></statement></block></xml>
@bwbush
bwbush / actus.xml
Last active January 16, 2021 04:37
Zero Coupon with Collateral
<xml xmlns="https://developers.google.com/blockly/xml"><block type="BaseContractType" id="root_contract" deletable="false" x="13" y="187"><statement name="BaseContractType"><block type="PaymentAtMaturity" id="{=}_ITjLvl4@`q(3yb.1"><value name="start_date"><block type="ActusDate" id="HP|!CTeJ5^81UiX~}:%]"><field name="yyyy">2020</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="maturity_date"><block type="ActusDate" id="sRa@%r-g[$FoEiXaD4{F"><field name="yyyy">2040</field><field name="mm">1</field><field name="dd">1</field></block></value><value name="notional"><block type="ActusDecimalType" id="][{za^q3]:v{^(!Nre.G"><field name="value">1000</field></block></value></block></statement></block></xml>
@bwbush
bwbush / blockly.xml
Created May 12, 2021 22:04
PIGY Example
When
[Case
(Deposit
(Role "BOBS POOL")
(Role "BOBS POOL")
(Token "2aa9c1557fcf8e7caa049fa0911a8724a1cdaf8037fe0b431c6ac664" "PIGY")
(ConstantParam "reward")
)
(When
[Case
@bwbush
bwbush / blockly.xml
Last active May 13, 2021 03:53
PIGY Example 2
When
[Case
(Deposit
(Role "BOBS POOL")
(Role "BOBS POOL")
(Token "2aa9c1557fcf8e7caa049fa0911a8724a1cdaf8037fe0b431c6ac664" "PIGY")
(ConstantParam "reward")
)
(When
[Case
@bwbush
bwbush / proof-of-burn.hs
Created October 15, 2021 23:30
Proof of Burn for Cardano
---------------------------------------------------------------
--
-- Module : Main
-- Copyright : (c) 2021 Brian W Bush
-- License : MIT
--
-- Maintainer : Brian W Bush <code@functionally.io>
-- Stability : Stable
-- Portability : Portable
--
@bwbush
bwbush / debugging-plutus.md
Last active August 31, 2022 09:30
Debugging Plutus

Debugging Plutus

This example illustrates manually passing serialized data from a Plutus validator and then deserializing it. It uses Plutus.Debug.

Instrument the validator

Change traceIfFalse to Plutus.Debug.debugIfFalse with added arguments containing the data to be passed out of the script. Here we change

traceIfFalse "R" $ any (checkScriptOutput addr hsh value) allOutputs