Skip to content

Commit

Permalink
Remove mentions of Carmine in this repository (#73)
Browse files Browse the repository at this point in the history
* Update Scarb.toml, add [lib]

* Add custom proposal implementation

Lacks setting of custom proposal configuration during deployment

* Add arbitrary proposal

* Polish apply_passed_proposal

* Polish scarb fmt

* Cherry pick setup.cairo from 1fab54f

* Move test setup to src/

* Remove unrelated functions from setup.cairo

* Fix setup

* Polish tests

* Fix import naming

* Add addition of custom proposal

* Remove part of Carmine code

* Remove rest of Carmine stuff

* Polish with scarb fmt

* Bump version to 0.4.0

* Fix imports in tests

* Remove unused test from lib.cairo

* Remove cubit as dependency

* Update package description

* Update error message to not mention CARM

* Move snforge_std to dev-dependency

* Update snforge_std to v0.23.0

* Update snforge in CI

* Trigger CI

* Format
  • Loading branch information
tensojka committed Jun 8, 2024
1 parent 5b5a56d commit b3900b0
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 698 deletions.
9 changes: 2 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,21 @@
// "type": "volume"
// }
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | bash -s -- -v 2.6.3",
"postCreateCommand": "curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | bash -s -- -v 2.6.3; curl -L https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh; snfoundryup -v 0.23.0",
"customizations": {
"vscode": {
"extensions": [
"StarkWare.cairo1"
]
}
}

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
SCARB_VERSION: 2.6.4
FOUNDRY_VERSION: 0.20.1
FOUNDRY_VERSION: 0.23.0

jobs:
build:
Expand Down
12 changes: 3 additions & 9 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "cubit"
version = "1.3.0"
source = "git+https://github.com/influenceth/cubit.git#8eacc2b1d952d6266f9725776445c7fb97453403"

[[package]]
name = "konoha"
version = "0.3.0"
version = "0.4.0"
dependencies = [
"cubit",
"openzeppelin",
"snforge_std",
]
Expand All @@ -22,5 +16,5 @@ source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.10.0#d7

[[package]]
name = "snforge_std"
version = "0.20.1"
source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.20.1#fea2db8f2b20148cc15ee34b08de12028eb42942"
version = "0.23.0"
source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.23.0#f2bff8f796763ada77fe6033ec1b034ceee22abd"
15 changes: 10 additions & 5 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[package]
name = "konoha"
description = "A flexible monolithic governance contract, developed for use with Carmine Options AMM"
version = "0.3.0"
description = "Flexible monolithic governance components for Starknet"
version = "0.4.0"
cairo-version = "2.6.3"

[dependencies]
cubit = { git = "https://github.com/influenceth/cubit.git", commit = "62756082bf2555d7ab25c69d9c7bc30574ff1ce8" }
starknet = ">=1.3.0"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.20.1" }
starknet = ">=2.0.0"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.10.0" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.23.0" }


# can be fixed by doing import super::testing from tests
# [dev-dependencies] sadly can't use this because we have testing in src/

[lib]

[[target.starknet-contract]]

Expand Down
16 changes: 0 additions & 16 deletions src/amm_types/basic.cairo

This file was deleted.

13 changes: 0 additions & 13 deletions src/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const NEW_PROPOSAL_QUORUM: u128 =
const QUORUM: u128 = 10; // 1/10 of totalSupply required to participate to pass
const MINUS_ONE: felt252 = 0x800000000000011000000000000000000000000000000000000000000000000;
const TEAM_TOKEN_BALANCE: u128 = 1000000000000000000;
const OPTION_CALL: felt252 = 0;
const OPTION_PUT: felt252 = 1;
const TRADE_SIDE_LONG: felt252 = 0;
const TRADE_SIDE_SHORT: felt252 = 1;
const PROPOSAL_VOTING_SECONDS: u64 = consteval_int!(60 * 60 * 24 * 7);


Expand All @@ -15,12 +11,3 @@ const PROPOSAL_VOTING_SECONDS: u64 = consteval_int!(60 * 60 * 24 * 7);
const USDC_ADDRESS: felt252 = 0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8;
const ETH_ADDRESS: felt252 = 0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7;
const BTC_ADDRESS: felt252 = 0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac;

// CLASS HASHES

// corresponds to commit 7b7db57419fdb25b93621fbea6a845005f7725d0 in protocol-cairo1 repo, branch audit-fixes
const LP_TOKEN_CLASS_HASH: felt252 =
0x06d15bc862ce48375ec98fea84d76ca67b7ac5978d80c848fa5496108783fbc2;
const AMM_CLASS_HASH: felt252 = 0x045fb686c8875f31966e7308d71c03e9ae78f9566a61870a2b616dc225dd3313;
const OPTION_TOKEN_CLASS_HASH: felt252 =
0x07fc0b6ecc96a698cdac8c4ae447816d73bffdd9603faacffc0a8047149d02ed;
6 changes: 0 additions & 6 deletions src/contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ trait IGovernance<TContractState> {
// UPGRADES

fn get_governance_token_address(self: @TContractState) -> ContractAddress;
fn get_amm_address(self: @TContractState) -> ContractAddress;
// fn apply_passed_proposal(ref self: TContractState, prop_id: felt252);
// AIRDROPS

Expand Down Expand Up @@ -53,7 +52,6 @@ mod Governance {
struct Storage {
proposal_initializer_run: LegacyMap::<u64, bool>,
governance_token_address: ContractAddress,
amm_address: ContractAddress,
#[substorage(v0)]
proposals: proposals_component::Storage,
#[substorage(v0)]
Expand Down Expand Up @@ -99,9 +97,5 @@ mod Governance {
fn get_governance_token_address(self: @ContractState) -> ContractAddress {
self.governance_token_address.read()
}

fn get_amm_address(self: @ContractState) -> ContractAddress {
self.amm_address.read()
}
}
}
4 changes: 2 additions & 2 deletions src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod airdrop;
mod amm_types {
mod basic;
mod treasury_types {
mod carmine;
}
mod constants;
mod contract;
Expand Down
Loading

0 comments on commit b3900b0

Please sign in to comment.