Submissions
# SUID - Staking pool module The SUID module is a simple staking pool that allows users to stake SUI and receive SUID in return. User can also stake and unstake SUI with the given validator. ## Functions #### 1. add_liquidity: - Add liquidity to the pool by transferring SUI to the pool and receiving SUID in return. #### 2. remove_liquidity: - Remove liquidity from the pool by burning SUID and receiving SUI in return. #### 3. stake: - Stake the SUI with the given validator. #### 4. unstake: - Unstake the SUI. 5. get_supply: Return the total supply of SUID. 6. get_assets: Return the total amount of SUI in the pool.
FEEDBACK
# DefiPay ## Overview DefiPay is a simple payment system that enables users deposit and also transfer funds to friends. It includes functionalities for managing administrators and customers, handling deposits, withdrawals, transfers, and flagging customers. **Disclaimer: Use of Unaudited Code for Educational Purposes Only** This code is provided strictly for educational purposes and has not undergone any formal security audit. It may contain errors, vulnerabilities, or other issues that could pose risks to the integrity of your system or data. By using this code, you acknowledge and agree to the terms outlined in the disclaimer. ## Installation To deploy and use the DefiPay smart contract, follow these steps: 1. **Move Compiler Installation:** Ensure you have the Move compiler installed. You can find the Move compiler and instructions on how to install it at [Sui Docs](https://docs.sui.io/). 2. **Compile the Smart Contract:** For this contract to compile successfully, please ensure you switch the dependencies to whichever you installed. `framework/devnet` for Devnet, `framework/testnet` for Testnet ```bash Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" } ``` then build the contract by running ``` sui move build ``` 3. **Deployment:** Deploy the compiled smart contract to your blockchain platform of choice. ``` sui client publish --gas-budget 100000000 --json ``` ## Functions ### `init` - **Description:** Initializes the DefiPay smart contract by creating an admin account. ### `admin_address` - **Description:** Retrieves the address of the admin. ### `customer_address` - **Parameters:** - `customer: &Customer` - **Description:** Retrieves the address of a customer. ### `is_flagged` - **Parameters:** - `customer: &Customer` - **Description:** Checks if a customer is flagged. ### `create_customer` - **Parameters:** - `ctx: &mut TxContext` - `date: u64` - **Description:** Creates a new customer account. ### `deposit` - **Parameters:** - `admin: &mut Admin` - `customer: &mut Customer` - `amount: &mut Coin<SUI>` - `ctx: &mut TxContext` - **Description:** Deposits funds into a customer's account. ### `withdraw` - **Parameters:** - `admin: &mut Admin` - `customer: &mut Customer` - `amount: Balance<SUI>` - `ctx: &mut TxContext` - **Description:** Withdraws funds from a customer's account. ### `pay_transfer` - **Parameters:** - `recipient_address: address` - `sender: &mut Customer` - `amount: &mut Coin<SUI>` - `ctx: &mut TxContext` - **Description:** Transfers funds from one customer to another. ### `flag` - **Parameters:** - `admin: &Admin` - `customer: &mut Customer` - `ctx: &mut TxContext` - **Description:** Flags or unflags a customer account. ## Security Considerations - This code is provided for educational purposes only. It has not undergone a formal security audit, and there may be vulnerabilities. - Before deploying in a production environment, conduct a thorough security review.
Hello buddy, I hope your doing well, i have reviewed your code and i have few suggestions and improvements.
deposit
and pay_transfer
handled whether enough balance is there in amount bye adding an assert checking the amount required is less tha or equal to the amount.Please try to make changes in documentation with adding the detailed functionalities of the code.
This is my solution for overmind suiss-bank quest. This quest features a portion of a simple lending protocol. This module provides the functionality for users to deposit and withdraw collateral, borrow and repay coins, and calculate their borrowing health factor. This lending protocol is based on the NAVI lending protocol on the Sui network. Lending protocol: A lending protocol is a smart contract system that allows users to lend and borrow coins. Users can lend out their coins by supplying the liquidity pools, and can borrow coins from the liquidity pools. This module is the basis for an overcollateralized lending protocol. This means that borrowers need to have lended more coins than they are borrowing. This is to ensure that the lenders are protected. Depositing: Lenders can deposit their coins to the liquidity pools at anytime with the deposit function. Withdrawing: Lenders can withdraw the coins that they have lended out with the withdrawal function. In production, the withdrawal function should ensure that withdrawing their collateral does not result in the user's health factor falling below a certain threshold. More on this below. Borrowing: Borrowers can borrow coins from any available liquidity pools with the borrow function. In production, the borrowing function should ensure that the borrower has enough collateral to cover the borrowed amount. Ensuring that the health factor of this use is above a certain threshold after the borrowing is typically good practice. More on this below. Repaying: Borrowers can repay coins they have borrowed with the repay function. Admin: Only the admin is able to create new pools. Whoever holds the AdminCap capablity resource can use create_pool to create a pool for a new coin type.
Hello buddy,, I have seen and reviewed your code, here are the improvements, fixes and suggestion that i have made.
Suggestion: Add readme.md file in your repo.
This is an Auction contract where people can list items for sale. Other users get to place bids and the highest bidder gets the item.
Hello buddy, I have seen your project and it's a good project, here are few changes and fixes in the code
list_item
function doesn't have custom auction duration, instead of having constant 20 mints duration i have added custom auction duration by adding a extra parameter called duration_in_seconds
and then calculated end time accordingly.bid
function a condition that missed to check amount is greater than or equal to bid starting price and corrected the highest bid assigning logic(removed one condition that amount must be greater than highest bid and added condition to assign highest bid ).Dacade is an open-sourced platform and is created in collaboration with multiple contributors. Go to the repository to start contributing.