Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaffold template and implement ERC20JDI contract #1

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2e73cda
feat: add template
FelixGibson May 23, 2023
c4b399f
feat: modify template
FelixGibson May 23, 2023
55f1ef8
feat: add erc20_mesh
FelixGibson May 25, 2023
3ef7176
feat: rename to jedi
FelixGibson May 26, 2023
ab866b5
feat: fix tons of compile issue
FelixGibson May 26, 2023
87dfde8
feat: add fast_power
FelixGibson May 27, 2023
10b6f7f
feat: compile pass
FelixGibson May 27, 2023
1fcd8f0
feat: add ownable
FelixGibson May 28, 2023
751bce1
feat: fmt
FelixGibson May 28, 2023
699a51e
feat: compile pass
FelixGibson May 29, 2023
9c08b84
feat: add fill_rate_in_array
FelixGibson May 29, 2023
0dd0c28
feat: add test
FelixGibson May 30, 2023
8e38c27
feat: add test2
FelixGibson May 30, 2023
8f414a7
bug: fix constructor get_caller_address problem
FelixGibson May 30, 2023
34bf981
feat: add ci
FelixGibson May 30, 2023
cbc37f3
feat: reorganize
FelixGibson May 31, 2023
4557da4
feat: compile pass
FelixGibson May 31, 2023
9a55f88
feat: remove as_u256
FelixGibson May 31, 2023
9b1536f
feat: fix bugs
FelixGibson Jun 1, 2023
53a3f34
bug: fix fill_rate_in_array problem
FelixGibson Jun 1, 2023
1fcbea7
feat: add more test
FelixGibson Jun 1, 2023
8a01bdb
feat: add more test
FelixGibson Jun 2, 2023
8b262e2
bug: fix mintable_in_timeframe function
FelixGibson Jun 2, 2023
fa714c7
feat: add more test
FelixGibson Jun 2, 2023
f203c51
bug: fix mint bug
FelixGibson Jun 2, 2023
ffb39c0
feat: add more test
FelixGibson Jun 3, 2023
dd3036f
feat: add comment
FelixGibson Jun 3, 2023
29ae3ba
feat: fix INITIAL_RATE
FelixGibson Jun 3, 2023
667c7d7
doc: add more comment
FelixGibson Jun 9, 2023
2937b83
doc: add more comment
FelixGibson Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cairo linguist-language=rust
66 changes: 66 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on: [push, pull_request]

env:
ARTIFACT_RELEASE_ARCHIVE_LINK: https://api.github.com/repos/starkware-libs/cairo/actions/artifacts/689746858/zip
ARTIFACT_RELEASE_ARCHIVE_NAME: cairo.zip
RELEASE_ARCHIVE_NAME: x86_64-unknown-linux-musl.tar.gz
SCARB_VERSION: v0.2.1
PROTOSTAR_VERSION: 0.11.0

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install cairo compiler
run: |
curl -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -L -o $ARTIFACT_RELEASE_ARCHIVE_NAME $ARTIFACT_RELEASE_ARCHIVE_LINK
unzip $ARTIFACT_RELEASE_ARCHIVE_NAME
tar -xvf $RELEASE_ARCHIVE_NAME

- name: Check Cairo compiler version and add to path
run: |
$(pwd)/cairo/bin/cairo-compile --version
echo "$(pwd)/cairo/bin" >> $GITHUB_PATH

- name: Cache Scarb binary
uses: actions/cache@v2
with:
path: ~/.scarb
key: scarb-${{ env.SCARB_VERSION }}-${{ runner.os }}
restore-keys: scarb-${{ env.SCARB_VERSION }}-

- name: Scarb Setup
run: |
if [[ ! -f $HOME/.scarb/bin/scarb ]]; then
wget https://github.com/software-mansion/scarb/releases/download/${{ env.SCARB_VERSION }}/scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
mkdir $HOME/.scarb
tar -xvzf scarb-${{ env.SCARB_VERSION }}-x86_64-unknown-linux-gnu.tar.gz -C $HOME/.scarb --strip-components=1
fi
echo "$HOME/.scarb/bin" >> $GITHUB_PATH


- name: Scarb Build
run: scarb build

- name: Cache Protostar installation
uses: actions/cache@v2
with:
path: ~/.protostar
key: protostar-${{ env.PROTOSTAR_VERSION }}-${{ runner.os }}
restore-keys: protostar-${{ env.PROTOSTAR_VERSION }}-

- name: Protostar Setup
run: |
if [[ ! -d $HOME/.protostar/dist/protostar ]]; then
curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash -s -- -v $PROTOSTAR_VERSION
fi
echo "$HOME/.protostar/dist/protostar" >> $GITHUB_PATH

- name: Test the code
run: |
cairo-test --starknet .
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#######
Scarb
#######

target
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Auditless Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "jediswap_dao"
version = "0.1.0"
description = "A minimal template for developing with Cairo 1.0"
homepage = "https://github.com/auditless/cairo-template"

[scripts]
test = "protostar test"
# Add your own custom commands and run them with `scarb run <command>`

[dependencies]
starknet = ">=1.1.0"
# quaireaux_math = { git = "https://github.com/keep-starknet-strange/quaireaux.git" }

[[target.starknet-contract]]
2 changes: 2 additions & 0 deletions cairo_project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[crate_roots]
jediswap_dao = "src"
3 changes: 3 additions & 0 deletions protostar.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]
protostar-version = "0.11.0"
lib-path = "lib"
Loading