A repository for Algogenous Smart Contracts created on the Algorand Blockchain.

Overview

Smart Contacts

Alogrand Smart Contracts using Choice Coin. Read Docs for how to implement Algogenous Smart Contracts for your own applications. Smart contracts are programs that automatically execute, transferring cryptocurrency between parties. In other words, smart contracts are logically executed on a blockchain to transfer assets without only computational or formalized oversight. Algorand Smart Contracts (ASCs) allow for global payments and financial transactions, with instantaneous processing and only marginal fees – less than $0.01 in total value. As typically described the three types of ASCs are: (1) Stateful Smart Contracts; (2) Stateless Smart Contracts; and (3) Algogeneous Smart Contracts.

Stateful

Stateful refers to the contract’s ability to store information in a specific state on the network. For example, one type of stateful smart contract is a request payment function, allowing a user to request payment from another user. Generally, Stateful Smart Contracts are logical programs which store data on the blockchain.

Stateless

Stateless Smart Contracts differ in that they validate transactions between parties, like an escrow and more like a contract in the traditional sense. Stateless Smart Contracts on the Algorand Network also act as signature delegators, signing transactions, thus validating them on the main blockchain network. By analogy, many describe Stateless Smart Contracts as essentially equivalent to escrow functions. Indeed, the essential design purpose for Stateless Smart Contracts were to approve or deny blockchain transactions.

Algogeneous

Representing a technical convergence of Stateless and Stateful Smart Contracts, Algogeneous Smart Contracts include an innovative integration with artificial intelligence. Where previous ASCs must be stateful or stateless, Algogeneous contracts may be stateful, stateless, or both.

Docs

Files

  • The “Algogenous_Contracts” Folder contains examples of Algogenous Smart Contracts.
  • The “Single_State_Contracts” Folder contains examples of Stateful and Stateless Contracts.

Dependencies

  • To run the code in the Algogenous_Contracts Folder, you first must have Python installed. Please download the latest version of Python, and create a virutal environment specifcally for this directory. Python Download: https://www.python.org/downloads/.
  • Second, your Python Virtual Envrionment must have all of the packages listed in the requirements.txt file, which is also found in the Algogenous_Contracts Folder.

Run Steps

  • To run the code found in the Algogenous_Contracts folder, make sure to first download the dependencies as described above using pip.
  • Use Choice Coin or create a new Algorand Standard Asset as described in the asset_creation.py file in the Algogenous_Contracts folder. Once this is done, change the value of asset_id in the AlgoG.py file to the id of the asset you just created. Additionally, assign the manager address and mnemonic to the fund_address and fund_mnemonic variables in the AlgoG.py file.
  • Furthermore, connect to the Algorand Network through a service such as the PureStake API or the Algorand Sandbox, the code was tested using the PureStake API, and assign your new address and token to algod_address and algod_token respectively.
  • In the algo_switch function, found in AlgoG.py, change the script exectuable in the comment variable to fit organizational or application need.
  • To test code in the Python terminal, import the function you are testing from AlgoG, choice_transaction for transfer, request_funds for the charge function, and algo_switch for the Algogenous smart contract. It is reccomended to add a reciever_address and reciever_mnemonic in the AlgoG file for code that is being tested in the terminal to avoid potential errors associated with a copy-paste method. Once this is done, import the fund_address, fund_mnemonic, receiver_address, receiver_mnemonic, and asset_id variables from AlgoG. Then, run the function with the appropriate inputs as described in the AlgoG file.

License

Copyright Fortior Blockchain, LLLP 2021

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.

You might also like...
Ethereum ETL lets you convert blockchain data into convenient formats like CSVs and relational databases.

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions.

Learn Blockchains by Building One, A simple Blockchain in Python using Flask as a micro web framework.
Learn Blockchains by Building One, A simple Blockchain in Python using Flask as a micro web framework.

Blockchain ✨ Learn Blockchains by Building One Yourself Installation Make sure Python 3.6+ is installed. Install Flask Web Framework. Clone this repos

Tools for running airdrop and token distribution campaigns on the Solana blockchain.
Tools for running airdrop and token distribution campaigns on the Solana blockchain.

Overview This repository contains some of the scripts we have used for running our airdrop campaigns and other distributions. Initially, all of these

 seno-blockchain is just a fork of Chia, designed to be efficient, decentralized, and secure
seno-blockchain is just a fork of Chia, designed to be efficient, decentralized, and secure

seno-blockchain https://seno.uno Seno is just a fork of Chia, designed to be efficient, decentralized, and secure. Here are some of the features and b

Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) consensus algorithm.
Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) consensus algorithm.

Ceres Combine-Harvester Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) c

blockchain address database

Blockchain Address Ownership Database The database is in data/addresses.db This is a SQLite database of addresses from several blockchains. It's obtai

High Performance Blockchain Deserializer

bitcoin_explorer is an efficient library for reading bitcoin-core binary blockchain file as a database (utilising multi-threading).

Python implementation of a blockchain.

The goal of this project is to explain and to make clearer how is a blockchain structured at the very core. It's not built with the intention to replicate an advanced blockchain like Bitcoin or Ethereum

An BlockChain Based solution for storing the medical records

Blockchain-based Medical Records 📄 Abstract Blockchain has the ability to keep an incorruptible, decentralized, and transparent log of all patient da

Comments
  • Compiling React App

    Compiling React App

    Error

    Working on new smart contracts for the interchain converter in SSC. Running into a bug.

    Failed to compile.
    
    ./src/index.js
    Cannot find file: 'App.js' does not match the corresponding name on disk: './src/app.js'.
    

    index.js file, app.js file

    opened by Bhaney44 4
  • Smarter Contracts Bash

    Smarter Contracts Bash

    Prizes Gold Badge | 150,000.00 Choice Silver Badge | 105,000.00 Choice Bronze Badge | 35,000.00 Choice Copper Badge | 10,000.00 Choice

    Timeline

    • All PRs must be complete by Tuesday May 17 at 5PM EST
    • All winners will be announced and awarded by Wednesday May 18 at 5PM EST

    Task Build your best Algogeneous smart contract using either the Python-SDK, PyTeal, or the JavaScript-SDK. The task is otherwise intentionally open ended. The fewer files and fewer lines of code, the better.

    Rules

    • Put all your files in one folder called [User_Name]_Smart_Contract
    • Add the folder to the Smarter_Contracts_Bash folder.
    • Add a Readme.md file with run steps.
    opened by ChoiceCoin 1
  • Jessika0_Smarter_Contracts_Bash

    Jessika0_Smarter_Contracts_Bash

    Project logo

    THE PRICE IS RIGHT


    This is a guessing game with a wager

    🖼 OVERVIEW

    • The Price Is Right is a console game which allows a player to either gain or lose funds.
    • The player has 6 trials to guess the right number
    • If the player manages to guess the right number within his/her 6 trials the player gets the wager chosen by he/her transferred to their wallet.
    • But if the player doesn't get the right guess in 6 trials the player loses the wager and the wager is transferred from his wallet to the creators wallet

    ⚧ Proof Of Fairness

    If you look at the game.py file you'll see on line 113 winning_number = r.randint(1,100) This is where the random number is been chosen from 1 to 100 and if the user guesses it right he gets the award.

    ❗️ NOTE

    • The user has to have sufficent algos and sufficent amount of the asa he/her uses as a wager
    • The user would have to paste his mneomic phrase and address appropriately
    • This transactions happen on the TESTNET

    Requirements

    • This was tested with sandbox docker

    • Algorand Python SDK was used

    • Choice coin can implement this inovation to increase transactions and also to increase value but there would have to be a limit to avoid the players winning all the choice coin in the creators account 😅

    🏃🏻 RUN STEPS

    • First of all make sure you have docker and sandbox installed and running, then make sure you have the algorand python sdk installed.
    • And finally make sure you have your virtual environment created and activated.

    💼 FOR IMPLEMENTING THIS CODE IN CHOICE COIN

    • You'll have to change the asset ID to thatof choice coin
    • Change the creator address and creator mneomics
    • And thats all

    🎈 FOR USING THE CODE AS A USER (THIS IS JUST FOR FUN)

    • You'll need to have sandbox container on your docker
    • Then you'll have to go to the transfer.py file call the asset_transfer_fund function with the appropriate arguements and also the recievers address to have the minimum amount of Tee coin to play the game
    • Once you have sufficent algos and Teecoin on your wallet you can go ahead and and run the game.py file with the right inputs and test out your guessing skills
    • Check out this video for a demo of how the game can be played

    🧌 FOR IMPLEMENTING THIS CODE AS AN ALGORAND ASSET CREATOR

    • In this I created my own asset, using the asset_creation.py file you can also create your own asset, just navigate to the file and follow the instructions to create your own asset.
    • You can also decide to create another address of your choice using the create.py file. Check out this video for more info on how to generate another address and pass phrase
    • Once your asset has been created it will output a link that directs you to the explorer where you can see the details of your asset. It will be adviceable to copy the asset ID and the creator address cause it would be needed to configure the game using your own asset
    • Navigate back to the game.py file and edit the creator_address, creator_mnemonic and the asset id to the newly created asset and the creator address and mnemonics
    • And thats all you're good to go.

    ⛏️ Building Tools

    • Python
    • Algorand Python SDK
    • Sandbox Docker

    🎉 ACKNOWLEDGEMENTS

    • My discord name is jessika0

    Thanks to Brian Haney AKA greenrex for putting my work to use and also Thanks to the choice coin community for being here for us I am so glad to be able to contribute to the development. LETS BUILD SOMETHING GREAT !!! 🧑‍💻

    opened by terrykeng 0
  • Pyteal Voting smart contract

    Pyteal Voting smart contract

    • [x] Allows user to register and vote arbitrary choices
    • [x] An account can not vote more than once
    • [x] An account must register before voting
    • [x] Winner is the candidate with the highest number of votes
    opened by farsh268 0
Owner
Choice Coin
Official Github for Choice Coin, a utility token focusing on governance and democratic participation. Built on the Algorand Blockchain.
Choice Coin
This demo is an on-chain NFT auction using smart contracts on the Algorand blockchain.

Algorand Auction Demo This demo is an on-chain NFT auction using smart contracts on the Algorand blockchain. Usage The file auction/operations.py prov

null 1 Jan 27, 2022
Smart-contracts - open sourcing our upcoming smart contracts for better security and transparency

Smart-contracts - open sourcing our upcoming smart contracts for better security and transparency

Rand Gallery 16 Jul 10, 2022
Algorand-app - This tutorial is designed to get you started with Algorand development in a step by step process

Getting Started This tutorial is designed to get you started with Algorand devel

Connor 1 Jan 6, 2022
ETHGreen blockchain is a fork from STAI and Chia blockchain including features implemented by Covid blockchain.

Welcome to ETHGreen Blockchain ETHGreen blockchain is a fork from STAI and Chia blockchain including features implemented by Covid blockchain. About t

null 11 Dec 23, 2022
Gearbox-vyper-contracts - Auxillary contracts for the Gearbox Protocol written in Vyper

Gearbox Vyper Contracts Auxillary contracts for the Gearbox Protocol written in

Edward Amor 4 Jan 7, 2022
Algo-burner - Burner account for the Algorand blockchain

algo-burner Burner address for Algorand's blockchain Apparently it was a problem

null 1 Jan 12, 2022
Tool to compare smart contracts source code

smartdiffer Tool to compare smart contracts source code. Heavily relies on API of Etherscan and Diffchecker. Installation pip install smartdiffer API

Roman Moskalenko 23 Nov 16, 2022
A workshop to build an NFT smart contract on the polygon blockchain

Polygon NFT Workshop This is an interactive workshop that guides you through the steps to deploy an NFT smart contract on the Polygon blockchain. By t

Banjo Obayomi 56 Oct 14, 2022
Audit of classmate's smart contract in blockchain seminar

Solidity-contract-audit Audit of classmate's smart contract in blockchain seminar Assignment: The task was to create a complete audit, including unit

smrza 0 Feb 4, 2022
Python based project to pull useful account statistics from the Algorand block chain.

PlanetWatchStats Python based project to pull useful account statistics from the Algorand block chain. Setup pip install -r requirements.txt Run pytho

M0x40 1 Jan 27, 2022