Giter VIP home page Giter VIP logo

astraly-contracts's Introduction

Tests codecov Discord Twitter

banner

☄️ Astraly Launch Smart Contracts

Smart Contracts for Astraly Launch, Fundraising powered by on-chain reputation on Starknet. Learn more about it here.

Contracts

Contract Title Description
AstralyIDO IDO Contract Handles the whole business logic of the IDO.
AstralyINO INO Contract Handles the whole business logic of the INO.
AstralyIDOFactory IDO/INO Factory Instanciates AstralyIDO/INO contracts for every new IDO/INO.
AstralyReferral Referral Handles the referral logic, one referral contract is deployed per IDO.
Utils Cairo utils

Development Workflow

This repository has been bootstrapped using Nile and Poetry.

Note: Mac and Mac M1 have special instructions you can refer to this article

  1. Install Dependencies poetry install

  2. Spin up a node (in a separate terminal window w/ the python environment running) poetry run nile node

  3. Compile contracts poetry run nile compile

  4. Run tests poetry run pytest tests/

These commands will test and deploy against your local node. If you want to deploy to the goerli testnet, use --network goerli instead.

Contributing

We encourage pull requests.

  1. Create an issue to describe the improvement/issue. Provide as much detail as possible in the beginning so the team understands your improvement/issue.
  2. Fork the repo so you can make and test changes in your local repository.
  3. Test your changes Make sure your tests (manual and/or automated) pass.
  4. Create a pull request and describe the changes you made. Include a reference to the Issue you created.
  5. Monitor and respond to comments made by the team around code standards and suggestions. Most pull requests will have some back and forth.

If you have further questions, visit #technology in our discord and make sure to reference your issue number.

Thank you for taking the time to make our project better!

astraly-contracts's People

Contributors

evolveart avatar filiplaurentiu avatar developermarwan avatar jordyro1 avatar

Stargazers

Mehdi-DeFiesta avatar code46ash avatar bloc13k avatar Shun Kakinoki avatar ownerlesswhisper avatar nnamdi obiagwu avatar 0xandee avatar Gabin Marignier avatar sudo rm -rf --no-preserve-root / avatar  avatar nael avatar  avatar Andrei Stefan avatar Louis Delbosc avatar Marwan Hilmi avatar xenon avatar Martin Spasovski avatar sagar jethi avatar kiran143.eth avatar Bahtiar Lutfi avatar Sean Luke avatar CyberOrange avatar Filip "botafi" Botai avatar moon avatar xstarlight avatar  avatar advaith avatar bigq avatar Mentor Reka avatar Etch avatar Dhruv Bodani avatar sam avatar takez0_o avatar illusiondevour avatar Peteris Erins avatar  avatar Marcello Bardus avatar dcbuilder.eth avatar neoTINS avatar

Watchers

 avatar  avatar  avatar  avatar

astraly-contracts's Issues

lark.exceptions.ConfigurationError: Got 'standard', expected one of ('basic', 'contextual', 'dynamic', 'dynamic_complete')

I have the following issue trying to run or compile the project:

nile compile
Traceback (most recent call last):
  File "/Users/louisdelbosc/.pyenv/versions/astaly/bin/nile", line 5, in <module>
    from nile.cli import cli
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/nile/cli.py", line 7, in <module>
    from nile.core.account import Account
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/nile/core/account.py", line 11, in <module>
    from nile.signer import Signer
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/nile/signer.py", line 4, in <module>
    from starkware.starknet.core.os.transaction_hash.transaction_hash import (
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/starknet/core/os/transaction_hash/transaction_hash.py", line 7, in <module>
    from starkware.starknet.core.os.class_hash import compute_class_hash
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/starknet/core/os/class_hash.py", line 12, in <module>
    from starkware.cairo.common.cairo_function_runner import CairoFunctionRunner
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/common/cairo_function_runner.py", line 4, in <module>
    from starkware.cairo.common.structs import CairoStructFactory
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/common/structs.py", line 4, in <module>
    from starkware.cairo.lang.compiler.identifier_definition import StructDefinition
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/lang/compiler/identifier_definition.py", line 14, in <module>
    from starkware.cairo.lang.compiler.fields import CairoTypeAsStr
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/lang/compiler/fields.py", line 4, in <module>
    from starkware.cairo.lang.compiler.parser import parse_expr, parse_type
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/lang/compiler/parser.py", line 40, in <module>
    GRAMMAR_PARSER = get_grammar_parser(grammar=open(GRAMMER_FILE, "r").read())
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/starkware/cairo/lang/compiler/parser.py", line 22, in get_grammar_parser
    return lark.Lark(
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/lark/lark.py", line 357, in __init__
    assert_config(lexer, ('basic', 'contextual', 'dynamic', 'dynamic_complete'))
  File "/Users/louisdelbosc/.pyenv/versions/3.8.13/envs/astaly/lib/python3.8/site-packages/lark/exceptions.py", line 21, in assert_config
    raise ConfigurationError(msg % (value, options))
lark.exceptions.ConfigurationError: Got 'standard', expected one of ('basic', 'contextual', 'dynamic', 'dynamic_complete')
make: *** [build] Error 1

Do you know how to solve this ? I'm on osx M1, maybe it's part of the issue.

Add tests for ZkPadVesting contract

Description

Test the ZkPadVesting.cairo contract and improve/fix it if necessary.

Acceptance Criteria

Tests should cover the whole contract including edge cases.

Refactor scripts to be more concise

Description

Currently written scripts are a bit cumbersome to navigate into.
Would be great to refractor them perhaps by doing a PR to nile to improve their nre object.
Also implementing the following PR would be great to run multiple txs at once in a nile run script.

Acceptance Criteria

Scripts should run correctly on a local devnet.

Create & Design Investment Strategies

Description

Design new investment strategies that could be used by the ZkPadStaking vault.
Investment strategies are simply smart contracts that use part of the vault holding which is composed of ZKP and ZKP-LP tokens to generate yield throughout other DeFi protocols.
Strategies can get as technical and complex as possible, although it's best to focus on battle-tested protocols.

Acceptance Criteria

A strategy should at least include the following functions :

@view
func underlying{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}() -> (
    address : felt
):
end

@external
func mint{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(amount : Uint256) -> (
    res : Uint256
):
end

@external
func redeemUnderlying{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
    amount : Uint256
) -> (res : Uint256):
end

@external
func balanceOfUnderlying{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(user : felt) -> (
    res : Uint256
):
end

Lottery Tickets Auto-burn 🔥

Description

Right now, we loose a lot of people between each step of the IDO.
To solve this issue, we want to add an auto-burn mechanism which users can choose to use or not.

As a user, when I check the auto-burn option I want my lottery tickets to be burned automatically when the allocation round begins.

Be careful there are 2 burn functions depending on the number of quests a user has completed as you can see here

You can see here how burn is triggered from the frontend.

Acceptance Criteria

When developing this system, one should keep performance in mind. In fact, there might be around ~50-100k lottery tickets minted for each fundraise.
The whole process shouldn't take more than a few hours to run.
One should use account abstraction multicall to execute as many calls as possible at once.

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.