Implements the Smart Contract for the Unity Proposal.

Overview

cw-unity-prop

A CosmWasm Smart Contract to implement the Juno Unity Prop.

For information on verifying the on-chain smart contract, see VERIFYING.md.

Developing

Develop features and write unit tests.

Before committing, run ./scripts/check.sh.

Structure

The contract assumes a low-trust environment where the withdrawal_address might want to withdraw their funds.

However, there is a configurable delay to do so.

The governance module, meanwhile, can take several actions immediately, using the sudo functionality in CW.

This exposes an entrypoint that can only be used by governance.

This means that any arbitrary vesting or release schedule can be executed via governance, if an agreement is reached.

Withdraw

The withdraw_address has only one action available, on a timer:

Actions available to the withdraw address

This is implemented via two messages:

  1. The first initiates a withdrawal
  2. The second claims a withdrawal, if available

Governance

Governance has three actions available. All three are executed without delay:

  1. Burn all funds held by the contract
  2. Send x quantity of native funds held by the contract
  3. Send all funds held by the contract

Actions available via the governance module

You might also like...
realize XPBD with rust and render in Unity
realize XPBD with rust and render in Unity

XPBD Simulation with Rust & Unity 上次看了XPBD的论文,最近又恰好在学习Rust,于是就想着用Rust来实现一个XPBD Solver练一下手,正好一箭双雕。 XPBD结论公式可参考此篇 - XPBD论文解读(Extended Position-Based Dyn

Port of my AST3 asteroids clone Bevy/rust from Unity/C#.

Port of my AST3 asteroids clone Bevy/rust from Unity/C#. This is my first rust program. Be gentle. Still working on it, but actually playable. You can

Translates JetBrains Rider invocations to emacsclient invocations (for Unity)

rider2emacs What? rider2emacs is a command-line utility which translates JetBrains Rider invocations to emacsclient invocations. Why? The Unity game e

Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage
Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage

Extensions supported ( .xls, .xlsx, .xlsm, .xlsb, .xla, .xlam, .ods ) Speed Test Image shows the results of 5000defs synced from 2 workbooks and 5 she

Substrate NFT !ink smart contract base

Substrate !ink NFT simple implementation This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0

Showing how to deploy a Terra smart contract using Chainlink Data Feeds

Chainlink Terra Developing Requirements This demo requires the following components: Rust: rustup with cargo 1.44.1+. rustc and cargo 1.44.1+. Install

clockchain is a system for benchmarking smart contract execution times across blockchains.
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

Testing a smart contract on the Solana blockchain

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

clockchain is a system for benchmarking smart contract execution times across blockchains.
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

The NFT smart contract powering xyz on Terra

xyz NFT Contract This repository contains the core NFT smart contract that implements xyz, a base layer for metaverses on the Terra blockchain. The xy

An example smart contract that builds on top of xyz

xyz Guestbook Tutorial Contract This repository contains an example smart contract that illustrates how to build on top of the xyz NFT contract. This

Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

Smart Contract for Terra Name Service

TERRA NAME SERVICE CONTRACTS Terra Name Service is to create easy-to-remember names for your Terra address like ‘dokwon.ust’ instead of ‘terra1...whez

Emerging smart contract language for the Ethereum blockchain.

Emerging smart contract language for the Ethereum blockchain.

This is a smart contract running on NEAR Protocol. It could be used to run a token sale.

Token Sale This is a smart contract running on NEAR Protocol. It could be used to run a token sale. Sale rules There are 2 periods: Sale and Grace. In

Vectis - Smart Contract Wallet

A smart contract wallet project to add functionality for users of DApps to manage their keys by allowing for recovery and account freeze, whilst preserving user control, and enabling relayer capability for gas provisioning

CosmWasm smart contract to bundle up cw assets (cw20, cw721, cw1155)

CosmWasm CW Bundler This repo is a CosmWasm smart contract that allows users and other contracts to bundle any combination of cw20, cw721, cw1155 toke

Smart Contract built in Rust to run inside Cosmos SDK module on all chains that enable it

CoinSwap is a Smart Contract that is built on the terra blockchain and can be used to swap cryptocurrencies such as LUNA, UST, TerraUSD, Anchor, Mirror Protocol, LUNI and other CW20 tokens. The Project also contains a smart contract which works as a analysis tool for the gas fees on the Terra Blockchain.

Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.
Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.

Heimdall is an advanced EVM toolkit which aims to make dealing with smart contracts on EVM based chains easier. Installation & Usage Heimdall's update

Comments
  • Security Dao Audit Complete

    Security Dao Audit Complete

    Security Dao has completed the audit for the code base in its current state. We have identified a serious bug in the sudo entrypoint which is not allowed officially in cosmwasm. We feel that that this must be addressed before deploying to mainnet. We would be happy to collaborate on getting the security for the sudo entrypoints / functions working correctly due to the time sensitivity of prop18. @the-frey @bmorphism

    see attached draft pdf report below Draft 0.1 CW-Unity-Prop Audit-1.pdf

    bug 
    opened by rakataprime 1
  • Add test for starting claim with no withdraw.

    Add test for starting claim with no withdraw.

    This adds a small test for verifying that calling the Withdraw message before calling the StartWithdraw message fails. The specific failure is that TIMESTAMP.load fails as no value has been saved.

    opened by 0xekez 0
  • Better query error messages

    Better query error messages

    Not essential, but clears up the case where queries fall back to an ugly default CW error if called with no withdraw specified.

    • Add explicit error handling for query cases
    • Update rust optimizer in CI and scripts
    opened by the-frey 0
Releases(v0.3.4-alpha)
  • v0.3.4-alpha(Sep 22, 2022)

    Changes to check support of wasmd v0.29.0-rc1

    What's Changed

    • Update CI script by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/13
    • tooling: help test latest junod/wasmd combo by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/14

    Full Changelog: https://github.com/CosmosContracts/cw-unity-prop/compare/v0.3.2...v0.3.4-alpha

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(85 bytes)
    cw_unity_prop.wasm(153.31 KB)
  • v0.3.3(Sep 9, 2022)

  • v0.3.2(May 25, 2022)

  • v0.3.1(May 25, 2022)

    A point release so the contracts can be exposed to Juno for CI purposes

    What's Changed

    • More integration tests by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/7
    • Add test for starting claim with no withdraw. by @ezekiiel in https://github.com/CosmosContracts/cw-unity-prop/pull/8
    • Bump versions of docker container by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/9
    • Upgrade juno to v6 rc by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/10
    • Bump CI to latest juno version with latest wasmd by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/11
    • Add scripts so mainline juno repo can build by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/12

    New Contributors

    • @ezekiiel made their first contribution in https://github.com/CosmosContracts/cw-unity-prop/pull/8

    Full Changelog: https://github.com/CosmosContracts/cw-unity-prop/compare/v0.3.0...v0.3.1

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(85 bytes)
    cw_unity_prop.wasm(153.31 KB)
  • v0.3.0(Apr 24, 2022)

    Non-essential changes, but improves error handling in query cases. Also adds checksums file to releases so it can be verified.

    Link to audit: https://github.com/securityDAO/audits/blob/main/cosmwasm/cw-unity-prop/v0.4_cw-unity-prop_audit.pdf

    To use:

    export WALLET="<wallet-name>"
    export TXFLAG="--gas-prices 0.1ujuno --gas auto --gas-adjustment 1.3 -y -b block --chain-id juno-1"
    
    # get wasm and store
    mkdir cw-unity-prop && cd cw-unity-prop
    wget https://github.com/CosmosContracts/cw-unity-prop/releases/download/v0.3.0/cw_unity_prop.wasm
    UNITY_PROP_CODE_ID=$(junod tx wasm store "cw_unity_prop.wasm" --from $WALLET $TXFLAG --output json | jq -r '.logs[0].events[-1].attributes[0].value')
    
    # init it
    INIT='{
      "native_denom": "ujuno",
      "withdraw_address": "<admin-address>",
      "withdraw_delay_in_days": 28
    }'
    junod tx wasm instantiate $UNITY_PROP_CODE_ID "$INIT" --from $WALLET --label "Juno Unity Prop v0.3.0" $TXFLAG --no-admin
    

    What's Changed

    • Spike a gov prop CI action by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/5
    • Better query error messages by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/6

    Full Changelog: https://github.com/CosmosContracts/cw-unity-prop/compare/v0.2.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(85 bytes)
    cw_unity_prop.wasm(153.31 KB)
  • v0.2.0(Apr 11, 2022)

    Upgrade dependencies to current ahead of testing cycle.

    What's Changed

    • Update to cosmwasm beta8 by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/4

    Full Changelog: https://github.com/CosmosContracts/cw-unity-prop/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
    cw_unity_prop.wasm(154.11 KB)
  • v0.1.0(Apr 8, 2022)

    The first stable, provisionally audited version of the contract.

    What's Changed

    • Add additional CI by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/2
    • Add release hook that builds every github tag by @the-frey in https://github.com/CosmosContracts/cw-unity-prop/pull/3

    New Contributors

    • @the-frey made their first contribution in https://github.com/CosmosContracts/cw-unity-prop/pull/2

    Full Changelog: https://github.com/CosmosContracts/cw-unity-prop/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
    cw_unity_prop.wasm(154.11 KB)
Owner
Junø
A public permissionless network for interoperable smart contracts. Fast, secure and built for global adoption. Cosmos SDK | Tendermint BFT | CosmWasm
Junø
realize XPBD with rust and render in Unity

XPBD Simulation with Rust & Unity 上次看了XPBD的论文,最近又恰好在学习Rust,于是就想着用Rust来实现一个XPBD Solver练一下手,正好一箭双雕。 XPBD结论公式可参考此篇 - XPBD论文解读(Extended Position-Based Dyn

zilch 23 Nov 15, 2022
Port of my AST3 asteroids clone Bevy/rust from Unity/C#.

Port of my AST3 asteroids clone Bevy/rust from Unity/C#. This is my first rust program. Be gentle. Still working on it, but actually playable. You can

Jorge Monasterio 2 Mar 24, 2022
Translates JetBrains Rider invocations to emacsclient invocations (for Unity)

rider2emacs What? rider2emacs is a command-line utility which translates JetBrains Rider invocations to emacsclient invocations. Why? The Unity game e

Eliza 6 Nov 25, 2022
EVM contract for Aurora.

Aurora Engine Prerequisites Rust nightly (2021-01-30) with the WebAssembly toolchain GNU Make (3.81+) rustup install nightly-2021-01-30 rustup target

Project Aurora 258 Dec 30, 2022
The project brings the IC ecosystem to Unity, allowing Unity developers to call the functions of canisters on IC,

Agent of Internet Computer for Unity The Intro The project brings the IC ecosystem to Unity, allowing Unity developers to call the functions of canist

Shiku Labs 9 Nov 18, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Ethereum Improvement Proposal Validator

EIP validator An engine which ensures Ethereum Improvement Proposals meet certain requirements. Getting Started To install eipv and validate the EIPs

null 4 Dec 6, 2021
This contract implements simple vote for the best coffe in indonesia using near protocol.

vote-coffe-near Description This contract implements simple vote for the best coffe in indonesia using near protocol. Contract in contract/src/lib.rs

RickhySis25 1 Nov 15, 2021
A quick way to decode a contract's transaction data with only the contract address and abi.

tx-decoder A quick way to decode a contract's transaction data with only the contract address and abi. E.g, let tx_data = "0xe70dd2fc00000000000000000

DeGatchi 15 Feb 13, 2023
a prototype crate for creating modular and performant 3D CPU particle systems, inspired by Unity's Shuriken Particle System.

bevy_prototype_particles This is a prototype crate for creating modular and performant 3D CPU particle systems, inspired by Unity's Shuriken Particle

James Liu 28 Sep 12, 2022