Package: algoworld-contracts-legacy
📃 AboutThe following repository hosts the source codes for:AlgoWorld Swapper's algorand smart signatures.AlgoWorldExplorer's stateful smart contracts for card auctions and card trading. Modified version ofOpenNFT's smart contracts.⚠️ NOTE: These contracts are not formally audited by accredited third parties. However, contracts are a basis for certain functionality on the AlgoWorldExplorer.io platform and were created in collaboration with Solution Architect from Algorand (credits @cusma). Code is provided under MIT license.Prerequisitespoetrypre-commitAlgorand SandboxDocker🚀 OverviewAlgoWorld currently offers stateful contracts used for auction trading on AlgoWorldExplorer and several smart signatures used for swapping on AlgoWorld Swapper.If you are looking to install algoworld contracts into your project run the following command:pipinstallalgoworld-contractsExample usagefromalgoworld_contractsimportcontracts# Replace inputParams with real valuesasa_to_asa_swap=contracts.get_swapper_teal(inputParams.creator_address,inputParams.offered_asa_id,inputParams.offered_asa_amount,inputParams.requested_asa_id,inputParams.requested_asa_amount,inputParams.incentive_wallet,inputParams.incentive_fee,)# asa_to_asa_swap is a string of TEAL coderesponse=algod.compile(asa_to_asa_swap)...SwapperThere are two main types of smart signatures available:ASA to ASA swap | 🎴↔️🎴:  Smart signature that allows performing a swap of any single ASA of specified amount to any other single ASA of specified amount.Swap Configuration Proxy 📝: Smart signature that powers theAlgoWorld Swapperby allowing users to issue certain transactions that contain links to swap configuration files stored as.jsonfiles onipfs. Proxy is then used to obtain thoseipfsfiles by grabbing the latest pay transaction using Algorand Indexer queries.ASAs to ALGO swap | 🎴🎴🎴↔️💰: Smart signature that allows performing a swap of multiple ASAs of specified amount to ALGO of specified amount.AuctionA set of stateful smart contracts for card auctions and card trading:ASAs for ALGO with trades and bidding | 🎴💰🔨:Allows trading ASA via auctions, selling or purchasing directly.⚙️ InstallationThis section assumes that poetry and pre-commit are installed and executed from the root folder of this repository.Clone the repogitclonehttps://github.com/AlgoWorldNFT/algoworld-contractsInstall python requirementspoetryinstall# install all dependenciespoetryshell# activate virtual env(OPTIONAL) 3. Configurepre-commithookspre-commitinstallIf you are not going to setuppre-commitlocally, there is a Github Actions plugin that will autoformat your branch if you are opening a PR with commits that contain un-formatted code.🧪 TestingTesting assumes that docker-compose is installed and available. Project is relying onpytest-docker-composeplugin that automatically boots up temporary algorand sandbox and destroys the containers after the tests are finished.(.venv)pytestYou can also include[pytest]into your commit message to trigger the test in CI pipeline onpushaction (on pr it is triggered automatically).🚧 Contribution guidelineSeeCONTRIBUTING.md⭐️ StargazersSpecial thanks to everyone who forked or starred the repository ❤️