ICPHackathon / ICP-Hackathon-2023

1 stars 0 forks source link

Dawnlight(曦光)- bonding curve for public goods on IC #10

Open NashAiomos opened 6 months ago

NashAiomos commented 6 months ago

Product Name

Dawnlight (曦光)- bonding curve for public goods on IC

Product Introduction

We're all about supporting the good stuff that benefits everyone.

Think open-source codes, blogs, novels, videos, and more – things that make our world a bit brighter.

Some code needs to be open to gain trust, some videos only shine when you hit play, and certain blogs just have that magic touch for a few.

These goodies bring value to society, yet struggle to make a dime.

Left on their own, they either get freeloaded or collect dust in the corner. So, how do we give them a hand?

We're trying something cool – turning these public goods into tokens and putting them out there for everyone. And hey, if you buy in, expect some shine back – gold always glows.

It's like launching public goods with a twist, inspired by bodhi and FT: the more folks join in, the fancier it gets.

In the past, only companies had this model, but now, with a blockchain project, you can issue your own FT. It's a move towards greater decentralization, meaning virtually any public good can now issue FT tokens.

By offering donors a shot at an investment return, we're hoping people will jump in to support the good stuff early on.

And the whole process – from assets to returns – is all transparent, thanks to smart contracts. Because hey, good deeds deserve a spotlight.

Product Preview Image

image

image

Presentation Slides

https://docs.google.com/presentation/d/1R25hULFJtul6JEwo6vei1FP2sYMiUvlGyIbI_T4DASw/edit?usp=sharing

Code URL

https://github.com/xiaoyuanxun/Dawnlight

The code provides a comprehensive set of features to manage assets and facilitate decentralized transactions. Users can create, delete, buy, and sell assets, and retrieve information related to assets and transactions through various queries. The main Canister utilizes TrieMap for efficient storage and retrieval, with assets stored in the Bucket Canister.

Transaction Management The userBuyedAssets records the assets held by each user along with their quantities. The pool keeps track of the total amounts in the transaction pools for each asset. The buy and sell functions facilitate the purchase and sale of assets. When transactions occur, the code invokes WICP for transfers and collects transaction fees.

Price Management Functions like _curve and _getPrice implement the price curve algorithm. The getBuyPrice and getSellPrice functions are used to query buying and selling prices.

Event Logging Arrays such as CreateEvent, RemoveEvent, and TradeEvent record events related to asset creation, removal, and transactions.

Metadata The uri function allows for metadata queries.

Deployed URL

https://g2qzj-vyaaa-aaaan-qlguq-cai.icp0.io

Team Information

Two years ago, we began learning DApp development on the Internet computer, back in November 2021. After two years of continuous learning, we now have a deep understanding of the underlying principles of the Internet computer.

By Core Engineer @xiaoyuanxun , @Shuaige1234567 .

Function List

Public Query Functions

Several public query functions enable users to retrieve information from the Canister: getAssetsEntries getUserAssetsEntries getFileKeyToAssetIdEntries getTotalSupplyEntries getPoolEntries getAssetIdToTokenEntries getUserBuyedAssetsEntries getAsset getTokenCanisterByAssetId getUserCreated getUserBuyed getWicp getPrice getBuyPrice getSellPrice getBuyPriceAfterFee getSellPriceAfterFee uri

Public Shared Functions

create remove buy sell

Users can utilize these functions to create assets, delete assets, purchase assets, and sell assets.