Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_PUBLIC_API_KEY="AIzaSyBs3rH_4KQnO1FO7xqigU33uv654_aFI5E",
NEXT_PUBLIC_AUTH_DOMAIN="realtor-clone-ad19c.firebaseapp.com",
NEXT_PUBLIC_PROJECT_ID="realtor-clone-ad19c",
NEXT_PUBLIC_STORAGE_BUCKET="realtor-clone-ad19c.appspot.com",
NEXT_PUBLIC_MESSAGING_SENDER_ID="347563487697",
NEXT_PUBLIC_APP_ID="1:347563487697:web:ecc1c0eff0221f743f30f0",
NEXT_PUBLIC_RPC_URL="https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/dvHmwiGiA_uE22lKpZKLk4FoGlC_Xzy4"
4 changes: 1 addition & 3 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run Frontend Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
run: npm install --legacy-peer-deps
working-directory: frontend

- name: Run build
run: npm run build
working-directory: frontend
45 changes: 45 additions & 0 deletions .github/workflows/test_contract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Test

on: [push, pull_request]
permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: 2.11.3
- uses: actions/cache@v3
with:
path: ~/.cache/scarb
key: ${{ runner.os }}-scarb-${{ hashFiles('contract/Scarb.lock') }}
restore-keys: |
${{ runner.os }}-scarb-
- name: Check cairo format
working-directory: contract
run: scarb fmt --check
- name: Build cairo programs
working-directory: contract
run: scarb build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: 2.11.2
- uses: actions/cache@v3
with:
path: ~/.cache/scarb
key: ${{ runner.os }}-scarb-${{ hashFiles('contract/Scarb.lock') }}
restore-keys: |
${{ runner.os }}-scarb-
- uses: foundry-rs/setup-snfoundry@v3
with:
starknet-foundry-version: 0.39.0
- name: Run cairo tests
working-directory: contract
run: snforge test
2 changes: 2 additions & 0 deletions contract/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scarb 2.11.3
starknet-foundry 0.39.0
150 changes: 150 additions & 0 deletions contract/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "contract"
version = "0.1.0"
dependencies = [
"pragma_lib",
"snforge_std",
]

[[package]]
name = "openzeppelin"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:320185f3e17cf9fafda88b1ce490f5eaed0bfcc273036b56cd22ce4fb8de628f"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_merkle_tree",
"openzeppelin_presets",
"openzeppelin_security",
"openzeppelin_token",
"openzeppelin_upgrades",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_access"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:a39a4ea1582916c637bf7e3aee0832c3fe1ea3a3e39191955e8dc39d08327f9b"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_account"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:7e943a2de32ddca4d48e467e52790e380ab1f49c4daddbbbc4634dd930d0243f"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_finance"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:9fa9e91d39b6ccdfa31eef32fdc087cd06c0269cc9c6b86e32d57f5a6997d98b"
dependencies = [
"openzeppelin_access",
"openzeppelin_token",
]

[[package]]
name = "openzeppelin_governance"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:c05add2974b3193c3a5c022b9586a84cf98c5970cdb884dcf201c77dbe359f55"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_introspection"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:34e088ecf19e0b3012481a29f1fbb20e600540cb9a5db1c3002a97ebb7f5a32a"

[[package]]
name = "openzeppelin_merkle_tree"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:a5341705514a3d9beeeb39cf11464111f7355be621639740d2c5006786aa63dc"

[[package]]
name = "openzeppelin_presets"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:4eb098e2ee3ac0e67b6828115a7de62f781418beab767d4e80b54e176808369d"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_upgrades",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_security"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1deb811a239c4f9cc28fc302039e2ffcb19911698a8c612487207448d70d2e6e"

[[package]]
name = "openzeppelin_token"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:33fcb84a1a76d2d3fff9302094ff564f78d45b743548fd7568c130b272473f66"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_upgrades"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:36f7a03e7e7111577916aacf31f88ad0053de20f33ee10b0ab3804849c3aa373"

[[package]]
name = "openzeppelin_utils"
version = "1.0.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:fd348b31c4a4407add33adc3c2b8f26dca71dbd7431faaf726168f37a91db0c1"

[[package]]
name = "pragma_lib"
version = "1.0.0"
source = "git+https://github.com/astraly-labs/pragma-lib#c429179ed6153004b79657337c589548b73d5151"
dependencies = [
"openzeppelin",
]

[[package]]
name = "snforge_scarb_plugin"
version = "0.39.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.39.0#13ee73d44807f57b7e2c64be766161f48ca04c27"

[[package]]
name = "snforge_std"
version = "0.39.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.39.0#13ee73d44807f57b7e2c64be766161f48ca04c27"
dependencies = [
"snforge_scarb_plugin",
]
50 changes: 50 additions & 0 deletions contract/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "contract"
version = "0.1.0"
edition = "2024_07"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = ">=2.11.2"
pragma_lib = { git = "https://github.com/astraly-labs/pragma-lib" }

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.39.0" }
assert_macros = "2.8.4"

[[target.starknet-contract]]
sierra = true

[scripts]
test = "snforge test"

# Visit https://foundry-rs.github.io/starknet-foundry/appendix/scarb-toml.html for more information

# [tool.snforge] # Define `snforge` tool section
# exit_first = true # Stop tests execution immediately upon the first failure
# fuzzer_runs = 1234 # Number of runs of the random fuzzer
# fuzzer_seed = 1111 # Seed for the random fuzzer

# [[tool.snforge.fork]] # Used for fork testing
# name = "SOME_NAME" # Fork name
# url = "http://your.rpc.url" # Url of the RPC provider
# block_id.tag = "latest" # Block to fork from (block tag)

# [[tool.snforge.fork]]
# name = "SOME_SECOND_NAME"
# url = "http://your.second.rpc.url"
# block_id.number = "123" # Block to fork from (block number)

# [[tool.snforge.fork]]
# name = "SOME_THIRD_NAME"
# url = "http://your.third.rpc.url"
# block_id.hash = "0x123" # Block to fork from (block hash)

# [profile.dev.cairo] # Configure Cairo compiler
# unstable-add-statements-code-locations-debug-info = true # Should be used if you want to use coverage
# unstable-add-statements-functions-debug-info = true # Should be used if you want to use coverage/profiler
# inlining-strategy = "avoid" # Should be used if you want to use coverage

# [features] # Used for conditional compilation
# enable_for_tests = [] # Feature name and list of other features that should be enabled with it
20 changes: 20 additions & 0 deletions contract/snfoundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Visit https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html for more information

# [sncast.myprofile1] # Define a profile name
# url = "http://127.0.0.1:5050/" # Url of the RPC provider
# accounts_file = "../account-file" # Path to the file with the account data
# account = "mainuser" # Account from `accounts_file` or default account file that will be used for the transactions
# keystore = "~/keystore" # Path to the keystore file
# wait_params = { timeout = 500, retry_interval = 10 } # Wait for submitted transaction parameters
# block_explorer = "StarkScan" # Block explorer service used to display links to transaction details

[sncast.predifi]
account = "predifi"
accounts-file = "/home/akshola00/.starknet_accounts/starknet_open_zeppelin_accounts.json"
url = "https://free-rpc.nethermind.io/sepolia-juno/"

# 0x4287a17fc57912782dbcbf43b9cdf8b9d8133e275ded2f03bd2617c3fa1974d
[sncast.predifi2]
account = "predifi2"
accounts-file = "/home/codespace/.starknet_accounts/starknet_open_zeppelin_accounts.json"
url = "https://free-rpc.nethermind.io/sepolia-juno/"
18 changes: 18 additions & 0 deletions contract/src/base/errors.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pub mod Errors {
pub const REQUIRED_PAYMENT: u128 = 1000;
pub const INVALID_POOL_OPTION: felt252 = 'Invalid Pool Option';
pub const INACTIVE_POOL: felt252 = 'Pool is inactive';
pub const AMOUNT_BELOW_MINIMUM: felt252 = 'Amount is below minimum';
pub const AMOUNT_ABOVE_MAXIMUM: felt252 = 'Amount is above maximum';
pub const INVALID_POOL_DETAILS: felt252 = 'Invalid Pool Details';
pub const INVALID_VOTE_DETAILS: felt252 = 'Invalid Vote Details';
pub const LOCKED_PREDICTION_POOL: felt252 = 'PREDICTION POOL HAS BEEN LOCKED';
pub const PAYMENT_FAILED: felt252 = 'TRANSFER FAILED';
pub const TOTAL_STAKE_MUST_BE_ONE_STRK: felt252 = 'Total stake should be 1 STRK';
pub const TOTAL_SHARE_MUST_BE_ONE_STRK: felt252 = 'Total shares should be 1 STRK';
pub const USER_SHARE_MUST_BE_ONE_STRK: felt252 = 'User shares should be 1 STRK';
pub const UNAUTHORIZED: felt252 = 'Caller is not authorized';
pub const INVALID_ROLE: felt252 = 'Role is invalid';
pub const SELF_REVOKE_ERROR: felt252 = 'Cannot revoke own admin role';
pub const ROLE_NOT_ASSIGNED: felt252 = 'Role not assigned to address';
}
Loading
Loading