Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkendall committed Jul 31, 2024
0 parents commit 372b873
Show file tree
Hide file tree
Showing 13 changed files with 1,606 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tests

on:
push:
branches: ["main"]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: aiken-lang/[email protected]
with:
version: v1.0.29-alpha

- run: aiken fmt --check
- run: aiken check -D
- run: aiken build
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Aiken compilation artifacts
artifacts/
# Aiken's project working directory
build/
# Aiken's default documentation export
docs/
node_modules/
.DS_Store
plutus.json
24 changes: 24 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
7 changes: 7 additions & 0 deletions LICENSE2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 MICAH KENDALL

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 changes: 13 additions & 0 deletions LICENSE3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2024 MICAH KENDALL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ourovoting

Ouravoting is a family of protocols that allows for voting on proposals and the allocation of treasury funds. We aim to replicate Cardano's principles of governance & security within the EUTXO framework. This allows token-governance for decentralised autonomous organisations (DAOs) and the associated tokenomics.

Thanks to Zygomeb (Optim) & Riley (Summon) for various design ideas and discussions.

# Licensing

This repository is released under any of:
- [Public Domain](LICENSE.md)
- [MIT](LICENSE2.md)
- [Apache](LICENSE3.md)
15 changes: 15 additions & 0 deletions aiken.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Aiken
# You typically do not need to edit this file

[[requirements]]
name = "aiken-lang/stdlib"
version = "1.9.0"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "1.9.0"
requirements = []
source = "github"

[etags]
16 changes: 16 additions & 0 deletions aiken.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "butaneprotocol/ourovoting"
version = "0.0.0"
compiler = "v1.0.29-alpha"
plutus = "v2"
license = "Apache-2.0"
description = "Aiken contracts for project 'butaneprotocol/ourovoting'"

[repository]
user = "butaneprotocol"
project = "ourovoting"
platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "1.9.0"
source = "github"
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scripts": {
"build": "aiken build && blueprint plutus.json -o plutus.ts"
},
"dependencies": {
"@blaze-cardano/blueprint": "latest"
}
}
50 changes: 50 additions & 0 deletions plutus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { type Script } from "@blaze-cardano/core";
import { applyParamsToScript, cborToScript, ScriptType } from "@blaze-cardano/uplc";import { type PlutusData } from "@blaze-cardano/core";

export interface ProposalsNewProposal {
new (requiredCollateral:{policyId:string;assetName:string;quantity:bigint}): Script;
proposal: {owner:string;data:PlutusData};
};

export const ProposalsNewProposal = Object.assign(
function (requiredCollateral:{policyId:string;assetName:string;quantity:bigint}) {return cborToScript(applyParamsToScript("5905f70100003232323232323222253232333006300130073754006264a66600e64646464646464a66601c6012601e6ea80184c8c8c8c8c8c8c8c94ccc058cdc3a4008602e6ea80084c94ccc05cc04cc060dd50010a99980b9809180c1baa001132323232533301e30210021533301b3370e6e3400d203813253323301d3375e6e98cc00802d220100374c6464646464646464a66604a60400042002264646600200200644a66605600226605866ec0dd48041ba60034bd6f7b630099191919299981619b9000c002133030337606ea4030dd30038028a99981619b8f00c002132533302d3028302e375400226606266ec0dd4806981918179baa001004100432533302d533303000114a22940530103d87a80001301133031374c00297ae03233001001002225333031001133032337606ea4030dd4005a5eb7bdb1804c8c8c8c94ccc0c8cdc800800109981b19bb037520206ea003c01454ccc0c8cdc780800109929998199817181a1baa001133037337606ea4044c0e0c0d4dd5000802080219299981998170008a6103d87a80001301733037375000297ae03370000201e26606c66ec0dd48011ba800133006006003375a60660066eb8c0c4008c0d4008c0cc0044cc0c0cdd81ba9002374c0026600c00c0066eacc0b400cdd7181580118178011816800991900118040009981499bb037520066ea00092f5bded8c0a666048604090000a5eb7bdb1804c8c8cc0040052f5bded8c044a66605400226605666ec0dd480c9ba60034bd6f7b630099191919299981599b9001d00213302f337606ea4074dd30038028a99981599b8f01d00213302f337606ea4074dd300380189981799bb037520046e98004cc01801800cdd598160019bae302a002302e002302c00132330010014bd6f7b63011299981480089981519bb04c01094850524f504f53414c004c010101004bd6f7b630099191919299981519b904890850524f504f53414c0000213302e337609801094850524f504f53414c004c010101000051533302a3371e91010850524f504f53414c0000213302e337609801094850524f504f53414c004c0101010000313302e337606ea4008dd4000998030030019bad302b003375c6052004605a00460560026eb4c0a0c0a4008dd7181380098138011bae30250013021375403c600200244a66604400229309929998118008a4c26464a66604466e40dd7181198138021bae302300213300500533026002001163027002302500130250011533301d3375e6044603e6ea8034cdd2a4004660426ea403d2f5c0266ebcdd319299980f180d180f9baa00114bd6f7b63009bab30233020375400264660020026600602291010022533302200114c103d87a800013232323253330233372202a0042a66604666e3c0540084c01ccc09cdd3000a5eb80530103d87a8000133006006003375660480066eb8c088008c098008c09000530010ba14850524f504f53414c010014a06e95200014a044646600200200644a666044002297adef6c6013232323253330233372200e0042a66604666e3c01c008400c40144cc09ccdd81ba9002374c0026600c00c0066eacc09000cdd71811001181300118120008a5016301f001301f002375c603a00260326ea80045858c06cc060dd50010b180d180d801180c800980c8011bab3017001301700230150013011375460280066eb8c04cc040dd50030b1bab30123013301300237586022002602260220046eb0c03c004c02cdd518070011806980700098049baa00414984d9594ccc018c004c01cdd5002099191919299980698080010a4c2c601c002601c0046eb8c030004c020dd50020b09991129998049919192999806180418069baa002132533300d32323300100100422533301300114a0264a66602266e3cdd7180b0010020a511330030030013016001375c6024601e6ea802c5288a503011300e37540042c6eb0c040c044c044c044c044c044c044c044c044c034dd518080011807980800098059baa00114984d9594ccc018c004c01cdd5002099191919299980698080010a4c2c601c002601c0046eb8c030004c020dd50020b180598041baa003370e90001b87480095cd2ab9d5573caae7d5d02ba15745", [requiredCollateral], {"dataType":"list","items":[{"title":"CollateralValue","anyOf":[{"title":"CollateralValue","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"policyId"},{"dataType":"bytes","title":"assetName"},{"dataType":"integer","title":"quantity"}]}]}]} as any), ScriptType.PlutusV2);},

{proposal: {"title":"Proposal","anyOf":[{"title":"Proposal","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"owner"},{"title":"data","description":"Any Plutus data."}]}]}},
) as unknown as ProposalsNewProposal;

export interface ProposalsReclaimCollateral {
new (requiredCollateral:{policyId:string;assetName:string;quantity:bigint}): Script;
datum: {owner:string;data:PlutusData};
redeemer: {wrapper:PlutusData};
};

export const ProposalsReclaimCollateral = Object.assign(
function (requiredCollateral:{policyId:string;assetName:string;quantity:bigint}) {return cborToScript(applyParamsToScript("5905f70100003232323232323222253232333006300130073754006264a66600e64646464646464a66601c6012601e6ea80184c8c8c8c8c8c8c8c94ccc058cdc3a4008602e6ea80084c94ccc05cc04cc060dd50010a99980b9809180c1baa001132323232533301e30210021533301b3370e6e3400d203813253323301d3375e6e98cc00802d220100374c6464646464646464a66604a60400042002264646600200200644a66605600226605866ec0dd48041ba60034bd6f7b630099191919299981619b9000c002133030337606ea4030dd30038028a99981619b8f00c002132533302d3028302e375400226606266ec0dd4806981918179baa001004100432533302d533303000114a22940530103d87a80001301133031374c00297ae03233001001002225333031001133032337606ea4030dd4005a5eb7bdb1804c8c8c8c94ccc0c8cdc800800109981b19bb037520206ea003c01454ccc0c8cdc780800109929998199817181a1baa001133037337606ea4044c0e0c0d4dd5000802080219299981998170008a6103d87a80001301733037375000297ae03370000201e26606c66ec0dd48011ba800133006006003375a60660066eb8c0c4008c0d4008c0cc0044cc0c0cdd81ba9002374c0026600c00c0066eacc0b400cdd7181580118178011816800991900118040009981499bb037520066ea00092f5bded8c0a666048604090000a5eb7bdb1804c8c8cc0040052f5bded8c044a66605400226605666ec0dd480c9ba60034bd6f7b630099191919299981599b9001d00213302f337606ea4074dd30038028a99981599b8f01d00213302f337606ea4074dd300380189981799bb037520046e98004cc01801800cdd598160019bae302a002302e002302c00132330010014bd6f7b63011299981480089981519bb04c01094850524f504f53414c004c010101004bd6f7b630099191919299981519b904890850524f504f53414c0000213302e337609801094850524f504f53414c004c010101000051533302a3371e91010850524f504f53414c0000213302e337609801094850524f504f53414c004c0101010000313302e337606ea4008dd4000998030030019bad302b003375c6052004605a00460560026eb4c0a0c0a4008dd7181380098138011bae30250013021375403c600200244a66604400229309929998118008a4c26464a66604466e40dd7181198138021bae302300213300500533026002001163027002302500130250011533301d3375e6044603e6ea8034cdd2a4004660426ea403d2f5c0266ebcdd319299980f180d180f9baa00114bd6f7b63009bab30233020375400264660020026600602291010022533302200114c103d87a800013232323253330233372202a0042a66604666e3c0540084c01ccc09cdd3000a5eb80530103d87a8000133006006003375660480066eb8c088008c098008c09000530010ba14850524f504f53414c010014a06e95200014a044646600200200644a666044002297adef6c6013232323253330233372200e0042a66604666e3c01c008400c40144cc09ccdd81ba9002374c0026600c00c0066eacc09000cdd71811001181300118120008a5016301f001301f002375c603a00260326ea80045858c06cc060dd50010b180d180d801180c800980c8011bab3017001301700230150013011375460280066eb8c04cc040dd50030b1bab30123013301300237586022002602260220046eb0c03c004c02cdd518070011806980700098049baa00414984d9594ccc018c004c01cdd5002099191919299980698080010a4c2c601c002601c0046eb8c030004c020dd50020b09991129998049919192999806180418069baa002132533300d32323300100100422533301300114a0264a66602266e3cdd7180b0010020a511330030030013016001375c6024601e6ea802c5288a503011300e37540042c6eb0c040c044c044c044c044c044c044c044c044c034dd518080011807980800098059baa00114984d9594ccc018c004c01cdd5002099191919299980698080010a4c2c601c002601c0046eb8c030004c020dd50020b180598041baa003370e90001b87480095cd2ab9d5573caae7d5d02ba15745", [requiredCollateral], {"dataType":"list","items":[{"title":"CollateralValue","anyOf":[{"title":"CollateralValue","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"policyId"},{"dataType":"bytes","title":"assetName"},{"dataType":"integer","title":"quantity"}]}]}]} as any), ScriptType.PlutusV2);},
{datum: {"title":"Proposal","anyOf":[{"title":"Proposal","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"owner"},{"title":"data","description":"Any Plutus data."}]}]}},
{redeemer: {"title":"Wrapped Redeemer","description":"A redeemer wrapped in an extra constructor to make multi-validator detection possible on-chain.","anyOf":[{"dataType":"constructor","index":1,"fields":[{"description":"Any Plutus data."}]}]}},
) as unknown as ProposalsReclaimCollateral;

export interface StakingStake {
new (quorumNft:{policyid:string;assetname:string}): Script;
redeemer: "Stake" | "Unstake";
};

export const StakingStake = Object.assign(
function (quorumNft:{policyid:string;assetname:string}) {return cborToScript(applyParamsToScript("587d0100003232323232222533233005300130063754004264a66600ca66600c6004600e6ea8010585852613656325333006300200115333009300837540082930b0a99980319b874800800454ccc024c020dd50020a4c2c2c600c6ea800cdc3a40002644a66600cc29309b2b180418031baa0015734aae7555cf2ab9f5743", [quorumNft], {"dataType":"list","items":[{"title":"AssetClass","anyOf":[{"title":"AssetClass","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"policyid"},{"dataType":"bytes","title":"assetname"}]}]}]} as any), ScriptType.PlutusV2);},

{redeemer: {"title":"Redeemer","anyOf":[{"title":"Stake","dataType":"constructor","index":0,"fields":[]},{"title":"Unstake","dataType":"constructor","index":1,"fields":[]}]}},
) as unknown as StakingStake;

export interface StakingUnstake {
new (quorumNft:{policyid:string;assetname:string}): Script;
datum: PlutusData;
redeemer: {wrapper:PlutusData};
};

export const StakingUnstake = Object.assign(
function (quorumNft:{policyid:string;assetname:string}) {return cborToScript(applyParamsToScript("587d0100003232323232222533233005300130063754004264a66600ca66600c6004600e6ea8010585852613656325333006300200115333009300837540082930b0a99980319b874800800454ccc024c020dd50020a4c2c2c600c6ea800cdc3a40002644a66600cc29309b2b180418031baa0015734aae7555cf2ab9f5743", [quorumNft], {"dataType":"list","items":[{"title":"AssetClass","anyOf":[{"title":"AssetClass","dataType":"constructor","index":0,"fields":[{"dataType":"bytes","title":"policyid"},{"dataType":"bytes","title":"assetname"}]}]}]} as any), ScriptType.PlutusV2);},
{datum: {"title":"Data","description":"Any Plutus data."}},
{redeemer: {"title":"Wrapped Redeemer","description":"A redeemer wrapped in an extra constructor to make multi-validator detection possible on-chain.","anyOf":[{"dataType":"constructor","index":1,"fields":[{"description":"Any Plutus data."}]}]}},
) as unknown as StakingUnstake;
Loading

0 comments on commit 372b873

Please sign in to comment.