Skip to content

Commit b680cb5

Browse files
Merge branch 'main' into copilot/fix-7234666a-8876-4b43-bf02-bc3894530c83
Signed-off-by: Paulpete Cercenia <imfromfuture3000@gmail.com>
2 parents aca41dc + 29d9670 commit b680cb5

File tree

218 files changed

+53827
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+53827
-189
lines changed

.devcontainer/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV TZ=UTC
5+
6+
# Install base dependencies
7+
RUN apt-get update && apt-get install -y \
8+
software-properties-common \
9+
curl \
10+
wget \
11+
git \
12+
sudo \
13+
python3 \
14+
python3-pip \
15+
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
16+
&& apt-get update \
17+
&& apt-get install -y \
18+
libprocps-dev \
19+
gcc-11 \
20+
g++-11 \
21+
valgrind \
22+
gawk \
23+
sed \
24+
libffi-dev \
25+
ccache \
26+
libgoogle-perftools-dev \
27+
yasm \
28+
texinfo \
29+
autotools-dev \
30+
automake \
31+
cmake \
32+
libtool \
33+
build-essential \
34+
pkg-config \
35+
autoconf \
36+
libargtable2-dev \
37+
libmicrohttpd-dev \
38+
libhiredis-dev \
39+
redis-server \
40+
openssl \
41+
libssl-dev \
42+
doxygen \
43+
libgcrypt20-dev
44+
45+
# Install Node.js 18 LTS
46+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
47+
&& apt-get install -y nodejs
48+
49+
# Install Docker CLI (optional)
50+
RUN apt-get install -y docker.io
51+
52+
# Install solc
53+
RUN npm install -g solc
54+
55+
# Create workspace user
56+
ARG USERNAME=vscode
57+
ARG USER_UID=1000
58+
ARG USER_GID=$USER_UID
59+
RUN groupadd --gid $USER_GID $USERNAME || true && \
60+
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME || true && \
61+
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME
62+
63+
USER $USERNAME
64+
WORKDIR /workspace
65+
66+
# Install python deps later via postCreateCommand

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "Dream-Mind-Lucid SKALE Dev Environment",
3+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
4+
"features": {
5+
"ghcr.io/devcontainers/features/python:1": {
6+
"version": "3.11"
7+
},
8+
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
9+
},
10+
"postCreateCommand": "pip install -r requirements.txt && sudo apt update && sudo apt install -y solc cmake g++-11 libssl-dev libprocps-dev",
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"github.copilot",
15+
"github.copilot-chat",
16+
"ms-python.python",
17+
"nomicfoundation.hardhat-solidity",
18+
"juanblanco.solidity",
19+
"redhat.yaml",
20+
"eamodio.gitlens",
21+
"esbenp.prettier-vscode"
22+
],
23+
"settings": {
24+
"terminal.integrated.defaultProfile.linux": "bash",
25+
"editor.formatOnSave": true
26+
}
27+
}
28+
}
29+
}

.devcontainer/postCreate.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
echo "🚀 Setting up SKALE Consensus development environment..."
5+
6+
# Setup GCC 11 as default
7+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
8+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
9+
10+
# Clone SKALE consensus if not exists
11+
CONSENSUS_DIR="/workspace/skale-consensus"
12+
if [ ! -d "$CONSENSUS_DIR" ]; then
13+
echo "📦 Cloning SKALE consensus..."
14+
git clone --recurse-submodules https://github.com/skalenetwork/skale-consensus.git "$CONSENSUS_DIR"
15+
fi
16+
17+
# Build SKALE consensus deps
18+
echo "🔨 Building SKALE consensus dependencies..."
19+
cd "$CONSENSUS_DIR/deps"
20+
./build.sh DEBUG=1
21+
22+
# Configure and build consensus
23+
echo "🏗️ Building SKALE consensus..."
24+
cd ..
25+
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Debug
26+
cmake --build build -- -j$(nproc)
27+
28+
# Install Node.js and npm
29+
echo "📦 Installing Node.js..."
30+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
31+
sudo apt-get install -y nodejs
32+
33+
# Install project dependencies
34+
echo "📚 Installing project dependencies..."
35+
cd /workspace/evm
36+
npm install --silent || true
37+
38+
cd /workspace
39+
if [ -f requirements.txt ]; then
40+
pip install -r requirements.txt --user || true
41+
fi
42+
43+
echo "✅ Development environment ready!"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dream-Mind-Lucid Devcontainer Notes
2+
3+
Use this devcontainer to build and test EVM/Skale integration.
4+
5+
Open the project in VS Code and choose 'Reopen in Container'. The container will install local dev dependencies and run `postCreateCommand`.

.env

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SKALE Mainnet Configuration - Mint Gene Integration
2+
SKALE_RPC=https://mainnet.skalenodes.com/v1/elated-tan-skat
3+
SKALE_CHAIN_ID=2046399126
4+
INFURA_GAS_API=https://gas.api.infura.io/v3/96e56809f7fc4662b56852c0f3f63c1a
5+
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
6+
7+
# Solana Mainnet Configuration - QuickNode RPC
8+
SOLANA_RPC_URL=https://cosmopolitan-divine-glade.solana-mainnet.quiknode.pro/7841a43ec7721a54d6facb64912eca1f1dc7237e/
9+
SOLANA_WS_URL=wss://cosmopolitan-divine-glade.solana-mainnet.quiknode.pro/7841a43ec7721a54d6facb64912eca1f1dc7237e/
10+
TREASURY_ADDRESS=4eJZVbbsiLAG6EkWvgEYEWKEpdhJPFBYMeJ6DBX98w6a
11+
12+
# Legacy compatibility
13+
DEPLOYER_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
14+
15+
# SPL Token 2022 Mint Addresses (to be set after deployment)
16+
DREAM_TOKEN_MINT=
17+
SMIND_TOKEN_MINT=
18+
LUCID_TOKEN_MINT=

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Environment variables for Dream-Mind-Lucid deployment
2+
# Copy this file to .env and edit values
3+
4+
# SKALE Network
5+
SKALE_RPC="http://127.0.0.1:1234"
6+
SKALE_CHAIN_ID="54173"
7+
8+
# Deployment
9+
DEPLOYER_KEY="your-private-key-here"
10+
GAS_PRICE="0"
11+
GAS_LIMIT="20000000"
12+
13+
# Optional: Docker settings
14+
USE_DOCKER="false" # Set to "true" to use Docker mode
15+
DOCKER_IMAGE="skalenetwork/skale-node:latest"
16+
17+
# Optional: Local node settings
18+
USE_LOCAL_NODE="true" # Set to "false" to skip local node
19+
LOCAL_PORT="8545"

.env.sample

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Network Configuration
2+
SKALE_RPC="https://mainnet.skalenodes.com/v1/elated-tan-skat"
3+
SKALE_CHAIN_ID=2046399126
4+
PRIVATE_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" # Replace with your private key
5+
6+
# Token Supply Configuration (with 18 decimals)
7+
DREAM_TOTAL_SUPPLY=777777777
8+
SMIND_TOTAL_SUPPLY=777777777
9+
LUCID_TOTAL_SUPPLY=333333333
10+
11+
# Oracle Addresses (SKALE Mainnet)
12+
CHAINLINK_COORDINATOR="0x86dE0cF3D13f9C4181dE51729a8EA8F732FFC5Cd"
13+
CHAINLINK_LINK_TOKEN="0x72446b672452Ce63a8AAE41411B6D52e155C6F21"
14+
15+
# Dream Oracle Network
16+
DREAM_PRICE_FEED="0x1234567890123456789012345678901234567890" # Price oracle for DREAM
17+
SMIND_PRICE_FEED="0x2345678901234567890123456789012345678901" # Price oracle for SMIND
18+
LUCID_PRICE_FEED="0x3456789012345678901234567890123456789012" # Price oracle for LUCID
19+
20+
# Performance Settings
21+
MIN_PERFORMANCE_SCORE=500 # 50% minimum performance
22+
REBALANCE_PERIOD=604800 # 7 days in seconds
23+
BURN_LOCK_PERIOD=7776000 # 90 days in seconds
24+
25+
# Staking Configuration
26+
MIN_STAKE_AMOUNT=1000 # Minimum stake in tokens
27+
MAX_LOCK_BONUS=5000 # 50% maximum bonus for long-term staking
28+
29+
# Lock Periods (in seconds)
30+
DREAM_MIN_LOCK=604800 # 7 days
31+
DREAM_MAX_LOCK=31536000 # 365 days
32+
SMIND_MIN_LOCK=1209600 # 14 days
33+
SMIND_MAX_LOCK=63072000 # 730 days (2 years)
34+
LUCID_MIN_LOCK=2592000 # 30 days
35+
LUCID_MAX_LOCK=126144000 # 1460 days (4 years)
36+
37+
# Economic Engine Parameters (in basis points, 10000 = 100%)
38+
BASE_REWARD_RATE=1000 # 10% base reward rate
39+
BURN_RATE_MIN=200 # 2% minimum burn rate
40+
BURN_RATE_MAX=1000 # 10% maximum burn rate
41+
STAKING_WEIGHT=4000 # 40% importance on staking
42+
PERFORMANCE_WEIGHT=6000 # 60% importance on performance
43+
44+
# Initial Distribution
45+
TREASURY_INITIAL_DREAM=100000000 # 100M DREAM tokens
46+
TREASURY_INITIAL_SMIND=100000000 # 100M SMIND tokens
47+
TREASURY_INITIAL_LUCID=50000000 # 50M LUCID tokens
48+
49+
STAKING_INITIAL_DREAM=200000000 # 200M DREAM for staking rewards
50+
STAKING_INITIAL_SMIND=200000000 # 200M SMIND for staking rewards
51+
STAKING_INITIAL_LUCID=100000000 # 100M LUCID for staking rewards
52+
53+
# Contract Addresses
54+
TREASURY_ADDRESS="0x777D7e7777777777777777777777777De7777777"
55+
56+
# Contract Verification
57+
VERIFY_CONTRACTS=true # Set to false if network doesn't support verification
58+
59+
# Gas Reporter
60+
REPORT_GAS=true # Set to false to disable gas reporting
61+
62+
# Additional Settings
63+
DEPLOYER_ADDRESS="0xE38FB59ba3AEAbE2AD0f6FB7Fb84453F6d145D23" # Your deployer address
64+
DEPLOYMENT_TIMEOUT=120000 # 2 minutes timeout for deployment transactions
65+
66+
# Development Settings
67+
DEBUG_LOGS=true # Enable detailed logging during deployment
68+
SIMULATION_MODE=false # Enable simulation mode for testing
69+
70+
# Network Backup RPC (Optional)
71+
BACKUP_RPC="https://backup.skalenodes.com/v1/elated-tan-skat"
72+
73+
# For local development/testing
74+
# Uncomment these for local testnet
75+
#SKALE_RPC="http://localhost:8545"
76+
#SKALE_CHAIN_ID=1337
77+
#PRIVATE_KEY="0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
78+
79+
# Economic Parameters for Testing
80+
#TEST_MODE=true
81+
#TEST_ACCELERATED_TIME=true # Accelerate time-based functions for testing
82+
#TEST_MIN_LOCK_PERIOD=300 # 5 minutes for testing
83+
#TEST_REBALANCE_PERIOD=900 # 15 minutes for testing

.github/workflows/codeql.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '17 2 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: c-cpp
47+
build-mode: autobuild
48+
- language: javascript-typescript
49+
build-mode: none
50+
- language: python
51+
build-mode: none
52+
- language: rust
53+
build-mode: none
54+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
55+
# Use `c-cpp` to analyze code written in C, C++ or both
56+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
57+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
58+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
59+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
60+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
61+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@v4
65+
66+
# Add any setup steps before running the `github/codeql-action/init` action.
67+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68+
# or others). This is typically only required for manual builds.
69+
# - name: Setup runtime (example)
70+
# uses: actions/setup-example@v1
71+
72+
# Initializes the CodeQL tools for scanning.
73+
- name: Initialize CodeQL
74+
uses: github/codeql-action/init@v3
75+
with:
76+
languages: ${{ matrix.language }}
77+
build-mode: ${{ matrix.build-mode }}
78+
# If you wish to specify custom queries, you can do so here or in a config file.
79+
# By default, queries listed here will override any specified in a config file.
80+
# Prefix the list here with "+" to use these queries and those in the config file.
81+
82+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83+
# queries: security-extended,security-and-quality
84+
85+
# If the analyze step fails for one of the languages you are analyzing with
86+
# "We were unable to automatically build your code", modify the matrix above
87+
# to set the build mode to "manual" for that language. Then modify this step
88+
# to build your code.
89+
# ℹ️ Command-line programs to run using the OS shell.
90+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91+
- if: matrix.build-mode == 'manual'
92+
shell: bash
93+
run: |
94+
echo 'If you are using a "manual" build mode for one or more of the' \
95+
'languages you are analyzing, replace this with the commands to build' \
96+
'your code, for example:'
97+
echo ' make bootstrap'
98+
echo ' make release'
99+
exit 1
100+
101+
- name: Perform CodeQL Analysis
102+
uses: github/codeql-action/analyze@v3
103+
with:
104+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)