Propuestas
A zkLogin defi-app that you can create merchant with random power(up to 0xdeadbeef), and trade them on market! Usage Instruction Publish required package and create market, edit the .env in frontend/ according to READMD.md. In DApp user can login with Google account using zkLogin. User can see thier merchants, create new one and trading on markets. Contracts API definition soldier::merchant::new_merchant(name_vec:vector<u8>, clock: &Clock, ctx:&mut TxContext) create a merchant with custom name. suimarket::merchantmarket::create_marketplace(ctx:&mut TxContext) create a market place to sell&buy merchant suimarket::merchantmarket::sell_merchant(market:&mut Market,merchant: Merchant,price: u64,ctx:&mut TxContext) sell the merchant with price in MIST, which would emit a MerchantListed{order_id: u64,seller: address} event. suimarket::merchantmarket::buy_merchant(market:&mut Market,order_id: u64,payment: Coin<SUI>,ctx:&mut TxContext) buy the merchant in order id with SUI coin as payment, which would emit a MerchantBought{merchant_id:ID,buyer:address} event. suimarket::merchantmarket::get_profits(market:&mut Market,ctx:&mut TxContext) let user get profits, transfer the SUI coin to user account.
FEEDBACK
A zkLogin defi-app that you can create merchant with random power(up to 0xdeadbeef), and trade them on market! Usage Instruction Publish required package and create market, edit the .env in frontend/ according to READMD.md. In DApp user can login with Google account using zkLogin. User can see thier merchants, create new one and trading on markets. Contracts API definition soldier::merchant::new_merchant(name_vec:vector<u8>, clock: &Clock, ctx:&mut TxContext) create a merchant with custom name. suimarket::merchantmarket::create_marketplace(ctx:&mut TxContext) create a market place to sell&buy merchant suimarket::merchantmarket::sell_merchant(market:&mut Market,merchant: Merchant,price: u64,ctx:&mut TxContext) sell the merchant with price in MIST, which would emit a MerchantListed{order_id: u64,seller: address} event. suimarket::merchantmarket::buy_merchant(market:&mut Market,order_id: u64,payment: Coin<SUI>,ctx:&mut TxContext) buy the merchant in order id with SUI coin as payment, which would emit a MerchantBought{merchant_id:ID,buyer:address} event. suimarket::merchantmarket::get_profits(market:&mut Market,ctx:&mut TxContext) let user get profits, transfer the SUI coin to user account.
This is a DAO based on a certain kind of `Governance Coin` to publish, vote for and finally execute the `Proposal`s. ### Governance Coin Based on the standard `Coin` library in `sui`. It is used to vote for proposals, and one coin stands for one vote. The coin was first created with a certain amout and could be minted by the TreasuryCap owner. ### Proposal The `Proposal`s are defined with a `start_time` and an `end_time` to indicate the voting time interval. Besides, `Proposal`s also have a `minimal votes required` limit to indicate the minimal votes for execution(both for and against would count) ### Voting When voting starts, anyone holding the `Governance Coin` could vote for/against the proposal and the coin will **NOT** be consumed. Each address could vote only once for each proposal. ### Proposal Execution When the voting period ends, any one could invoke the `execute_proposal` function to execute the proposal. ## Code Structure `Governance Coin` and `MyDao` are separated into two move files ## Events Proposal creation, voting, proposal execution will be logged as events.
Hello xerath, your code is well organized and tested, and I made some changes for better readbility:
All error code is now prefixed with "E_" for better calssification
Some minor changes to comment is made for clarity
Dacade es una plataforma de código abierto y se creó en colaboración con múltiples contribuyentes. Visita el repositorio para empezar a contribuir.