Giter Site home page Giter Site logo

solana-solquad-excercise's Introduction

Introduction to the Solquad Project Testing Exercise

Welcome to the Solquad Project Testing Exercise! This unique and hands-on exercise is designed to help you test your skills. The Solquad Project presents a series of tests and challenges centered around a hypothetical blockchain application built on the Solana network. This exercise is particularly focused on the Anchor framework, which you have learned about in the previous modules. Your task involves reviewing and improving the given Solquad smart contract code.

Code Overview

This code includes various functionalities such as initializing escrow and pool accounts, creating and managing projects, and handling voting and reward distribution mechanisms. The exercise is designed to test your understanding of Solana's programming model, smart contract logic, and the particularities of handling transactions and accounts on a blockchain.

Challenges

  1. Prevent Double Addition of Projects in Pool: In Test 2, the same project is added twice to the pool, allowing for potential double funding. Modify the program logic to prevent a project from being added more than once.

Hint: Consider adding a boolean field to the project account that flags whether it's already in a pool.

  1. Restrict Projects to a Single Pool: In Test 3, a project is added to multiple pools, which shouldn't be possible. Implement a check in the program to ensure a project can only be associated with one pool.

Hint: This might involve seed checks on the project account.

  1. Safe Arithmetic in Escrow Distribution: In the distribute_escrow_amount instruction, current arithmetic operations are unchecked, risking overflow errors. Introduce safe arithmetic practices to handle potential overflows.

  2. Analysis of Weighted Reward Distribution: Test 4 reveals that a project receives double the intended amount. Investigate and address this issue, considering whether resolving the first challenge also fixes this or if additional modifications are needed.

By tackling these challenges, you will not only improve the Solquad project but also deepen your understanding of smart contract security and efficiency.

solana-solquad-excercise's People

Contributors

nizhunt avatar

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.