-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add transaction model and base model*** ***Update user model*** ***Update token controller*** ***Update routes*** ***Update open_db_connection*** ***Add token query*** ***Add user query*** ***Delete token service * Sc/token manager (#65) * Cleaning contracts folder * listToken and delistToken * event order declaration * getTokenInfo and getListedTokens * Tests for TokenManager --------- Co-authored-by: Vincent Rainaud <[email protected]> * feat: get coin by address * fix: swagger config for routes * feat: maj env.local api * Merge branch 'develop' of https://github.com/MTthoas/Dex into develop * feat: create crud / model / queries for pools * feat: init next-app * feat: layout with walletConnect * delete package-lock.json * feat: TanStack / WalletConnect ClientSide Provider Rendering & Create Users in backend in WalletConnect Hook * migration to next finish * migration to next finish * feat: create users front & back * react-query * dynamic profil * fix stylesheet * correct header and api call * feat: dashboard for users * feat: dashboard layout, dynamic routing, transactions tab & hooks, walletConnect fixes * feat: fix api * Adding AccessManager (and Upgradeability) from OpenZeppelin lib (#84) * feat(accessManager): adding accessManager contract and adapting contracts * feat(accessManager): a lot * feat(accessManager): submodules * feat(accessManager): submodules * feat(accessManager): submodules * feat(accessManager): submodules * feat(accessManager): submodulesssssssss * feat(AccessMananger) Adding tests and deploy script --------- Co-authored-by: Vincent Rainaud <[email protected]> * fix(project): Cleaning projet * feat: factoryPool contract, FactoryPool contract, gensToken contract / test / deploy --------- Co-authored-by: MTthoas <[email protected]> Co-authored-by: Guiiz94 <[email protected]> Co-authored-by: Vincent Rainaud <[email protected]> Co-authored-by: Matteo <[email protected]> Co-authored-by: Matthias <[email protected]>
- Loading branch information
1 parent
2848f9a
commit 2180940
Showing
274 changed files
with
21,528 additions
and
10,759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/contracts/.yarn/** linguist-vendored | ||
/contracts/.yarn/releases/* binary | ||
/contracts/.yarn/plugins/**/* binary | ||
/contracts/.pnp.* binary linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
node_modules | ||
.env | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
broadcast/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env | ||
|
||
# Node modules | ||
!/node_modules | ||
node_modules/* | ||
|
||
# Package lock files | ||
package-lock.json | ||
|
||
# Yarn | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# System files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[submodule "contracts/lib/forge-std"] | ||
path = contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/ds-test"] | ||
path = lib/ds-test | ||
url = https://github.com/dapphub/ds-test | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "contracts/lib/openzeppelin-contracts-upgradeable"] | ||
path = contracts/lib/openzeppelin-contracts-upgradeable | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable | ||
[submodule "contracts/lib/openzeppelin-contracts"] | ||
path = contracts/lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
No files changed, compilation skipped | ||
Traces: | ||
[3104957] [32mDeployDexContracts[0m::[32mrun[0m()[33m[0m | ||
├─ [2141636] [33m→ [0m[33mnew[0m DexAccessManager@0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141 | ||
│ ├─ emit [36mRoleGranted[0m(roleId: 0, account: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38], delay: 0, since: 1714038168 [2;49;39m[1.714e9][0m, newMember: true) | ||
│ └─ [32m← [0m[32m[Return] [0m10568 bytes of code | ||
├─ [892133] [33m→ [0m[33mnew[0m UserRegistry@0xdaE97900D4B184c5D2012dcdB658c008966466DD | ||
│ ├─ emit [36mAuthorityUpdated[0m(authority: DexAccessManager: [0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141]) | ||
│ └─ [32m← [0m[32m[Return] [0m4339 bytes of code | ||
├─ [0] [32mconsole[0m::[32mlog[0m("UserRegistry deployed to:", UserRegistry: [0xdaE97900D4B184c5D2012dcdB658c008966466DD])[33m [staticcall][0m | ||
│ └─ [32m← [0m[32m[Stop] [0m | ||
├─ [0] [32mconsole[0m::[32mlog[0m("DexRegistry deployed to:", DexAccessManager: [0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141])[33m [staticcall][0m | ||
│ └─ [32m← [0m[32m[Stop] [0m | ||
└─ [32m← [0m[32m[Stop] [0m | ||
|
||
|
||
[32mScript ran successfully.[0m | ||
|
||
== Logs == | ||
UserRegistry deployed to: 0xdaE97900D4B184c5D2012dcdB658c008966466DD | ||
DexRegistry deployed to: 0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
<<<<<<< HEAD | ||
# Server settings: | ||
SERVER_URL="0.0.0.0:5000" | ||
SERVER_READ_TIMEOUT=60 | ||
|
||
# JWT settings: | ||
JWT_SECRET_KEY="" | ||
JWT_SECRET_KEY= | ||
JWT_SECRET_KEY_EXPIRE_MINUTES_COUNT=15 | ||
|
||
CG_API_KEY= | ||
|
||
# Database settings: | ||
DB_SERVER_URL="host=localhost port=5432 user=postgres password= dbname=postgres sslmode=disable" | ||
DB_SERVER_URL="host= port=5432 user= password= dbname= sslmode=disable" | ||
DB_MAX_CONNECTIONS=100 | ||
DB_MAX_IDLE_CONNECTIONS=10 | ||
DB_MAX_LIFETIME_CONNECTIONS=2 | ||
|
||
# CoinGecko settings: | ||
API_URL=https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=ethereum-ecosystem&x_cg_demo_api_key= | ||
======= | ||
API_URL=https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=ethereum-ecosystem&x_cg_demo_api_key= | ||
>>>>>>> develop | ||
DB_MAX_LIFETIME_CONNECTIONS=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,47 @@ | ||
# Utilisation d'une image de builder Go avec Alpine pour un environnement minimal. | ||
FROM golang:1.21-alpine AS builder | ||
|
||
# Move to working directory (/build). | ||
WORKDIR /build | ||
# Installation de git, nécessaire pour récupérer les modules Go et Swaggo. | ||
RUN apk add --no-cache git | ||
|
||
# Copy and download dependency using go mod. | ||
# Installation des certificats CA, cruciaux pour les appels HTTPS. | ||
RUN apk add --no-cache ca-certificates | ||
|
||
# Installation de Swag CLI pour la documentation Swagger. | ||
RUN go install github.com/swaggo/swag/cmd/swag@latest | ||
|
||
# Définir le répertoire de travail où se trouve le code source. | ||
WORKDIR /api | ||
|
||
# Copie des fichiers de module Go et téléchargement des dépendances. | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Copy the code into the container. | ||
# Copie du reste de l'API dans l'image. | ||
COPY . . | ||
|
||
# Set necessary environmet variables needed for our image and build the API server. | ||
# Génération de la documentation Swagger. | ||
RUN swag init --generalInfo ./routes/swagger_routes.go --output ./docs | ||
|
||
# Configuration des variables d'environnement nécessaires pour la construction. | ||
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 | ||
|
||
# Construction du serveur API. | ||
RUN go build -ldflags="-s -w" -o apiserver . | ||
|
||
# Utilisation d'une image scratch pour un environnement d'exécution minimal. | ||
FROM scratch | ||
|
||
# Copy binary and config files from /build to root folder of scratch container. | ||
COPY --from=builder ["/build/apiserver", "/build/.env", "/"] | ||
# Copie du binaire, des fichiers de configuration, et de la documentation Swagger. | ||
COPY --from=builder /api/apiserver / | ||
COPY --from=builder /api/.env / | ||
COPY --from=builder /api/docs /docs | ||
|
||
# Copie des certificats CA. | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
# Export necessary port. | ||
# Exposition du port sur lequel le serveur API s'exécute. | ||
EXPOSE 5000 | ||
|
||
# Command to run when starting the container. | ||
ENTRYPOINT ["/apiserver"] | ||
# Commande pour exécuter le serveur API lors du démarrage du conteneur. | ||
CMD ["/apiserver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
# Create Network | ||
|
||
docker network create -d bridge dev-network | ||
|
||
# PostgreSQL and initial Migration | ||
docker run --rm -d \ | ||
--name dev-postgres \ | ||
--network dev-network \ | ||
-e POSTGRES_USER=postgres \ | ||
-e POSTGRES_PASSWORD=password \ | ||
-e POSTGRES_DB=postgres \ | ||
-v ${HOME}/dev-postgres/data/:/var/lib/postgresql/data \ | ||
-p 5432:5432 \ | ||
postgres | ||
|
||
docker run --rm -d --name dev-postgres --network dev-network -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres -v ${HOME}/dev-postgres/data/:/var/lib/postgresql/data -p 5432:5432 postgres | ||
docker run --rm -d --name dev-postgres --network dev-network -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres -v \${HOME}/dev-postgres/data/:/var/lib/postgresql/data -p 5432:5432 postgres | ||
|
||
docker run --rm -d \ | ||
--name dev-postgres \ | ||
--network dev-network \ | ||
-e POSTGRES_USER=postgres \ | ||
-e POSTGRES_PASSWORD=password \ | ||
-e POSTGRES_DB=postgres \ | ||
-v \${HOME}/dev-postgres/data/:/var/lib/postgresql/data \ | ||
-p 5432:5432 \ | ||
postgres | ||
|
||
# Migrate | ||
|
||
migrate -path ./migrations -database "postgres://postgres:password@localhost/postgres?sslmode=disable" up | ||
|
||
# Build Fiber docker Image ( DockerFile ) | ||
|
||
docker build -t fiber . | ||
|
||
# Create and start container from image | ||
|
||
docker run --rm -d --name dev-fiber --network dev-network -p 5000:5000 fiber | ||
|
||
## IN LOCAL | ||
|
||
docker build -t api-build . | ||
|
||
go install github.com/swaggo/swag/cmd/swag@latest | ||
swag init --generalInfo ./routes/swagger_routes.go --output ./docs | ||
>> go run main.go |
Oops, something went wrong.