Giter Club home page Giter Club logo

algodepo's Introduction

AlgoDepo

The aim of the application and PyTeal contract is to deposit Algo or Algorant Standard Assets in a single Transaction.

User compiles a deposit app call transaction and sets the rekeyTo field to the address of the contract.

This is the building block for more complex applications on Algorand and its ecosystem.

Submission for https://gitcoin.co/issue/c3protocol/hackalgo/1/100028569

Contract Args

The contract takes 2 args.

The first arg is the type fo transaction: deposit or asa_deposit. The second arg is the amount deposited.

Installation

Required instalation of Python3 and NPM.

Python Environment

pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

One line if virtualenv is installed:

virtualenv venv && source venv/bin/activate && pip install -r requirements.txt

To convert Pyteal to teal contract:

python3 /contracts/contract.py

NPM

To install packages:

npm i

Run the Deposit App

First add Mnemonic passphrase to .env. Next go to the testnet dispenser to obtain Algo. Create an asset using createasset.py or obtain one from a faucet and enter its id in config.js.

To illustrate the app run:

npm start

Such that

img

Illustration of the working app on AlgoExplorer:

https://testnet.algoexplorer.io/application/85314426

Overview of the .js files

asa_deposit.js deposits asa asset

config.js contains the user instance and id of the asset to transfer

deploy.js deploys contract ie approval and clear state teal files

deposit.js deposits Algo

index.js runs deploy, deposit and asa_deposit

utils.js contains instance of Algorand Client, submitTransaction function to sign, send and wait for transaction confirmation

Further Resources

Pyteal

algodepo's People

Contributors

dependabot[bot] avatar pfed-prog avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gconnect

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.