Skip to content

Commit

Permalink
fix id template + typo
Browse files Browse the repository at this point in the history
  • Loading branch information
MSghais committed Aug 21, 2024
1 parent cb70c70 commit 2c25034
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 32 deletions.
10 changes: 6 additions & 4 deletions apps/data-backend/src/routes/indexer/deploy-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ const Router = express.Router()

Router.get('/', async (req, res) => {
try {
const launchs = await prisma.token_launch.findMany({})
// console.log("launchs", launchs)
res.status(HTTPStatus.OK).json(launchs)
const launches = await prisma.token_launch.findMany({})
// console.log("launches", launches)
res.status(HTTPStatus.OK).json({
data:launches
})
// res.status(HTTPStatus.OK).json({
// data: launchs
// data: launches
// })
} catch (error) {
res.status(HTTPStatus.InternalServerError).send(error)
Expand Down
4 changes: 1 addition & 3 deletions apps/mobile/src/screens/Launchpad/LaunchpadComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export const LaunchpadComponent: React.FC<AllKeysComponentInterface> = ({
const {show: showKeyModal} = useKeyModal();
const {show: showModal} = useTokenCreatedModal();
const [menuOpen, setMenuOpen] = useState(false);
const {data: launchs} = useGetTokenLaunch();
// console.log("Launchs", launchs)

// const {data: launches} = useGetTokenLaunch();
const {publicKey} = useAuth();
// const width = Dimensions.get("window").width
// const isDesktop = width >= 1024
Expand Down
22 changes: 11 additions & 11 deletions onchain/cairo/.snfoundry_cache/.prev_tests_failed
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
afk::social::account::tests::wrong_token
afk::social::account::tests::get_public_key
afk::social::account::tests::successful_transfer
afk::social::account::tests::incorrect_signature
afk::social::account::tests::wrong_recipient
afk::social::account::tests::wrong_sender
afk::social::namespace::tests::link_incorrect_signature
afk::social::namespace::tests::linked_wallet_to
afk::social::account::tests::double_transfer
afk::social::account::tests::is_valid_signature
afk::social::account::tests::validate_transaction
afk::tests::launchpad_tests::launchpad_tests::launchpad_integration
afk::tests::launchpad_tests::launchpad_tests::launchpad_buy_more_then_liquidity_threshold
afk::social::namespace::tests::link_incorrect_signature
afk::social::namespace::tests::linked_wallet_to
afk::social::deposit::tests::deposit_claim
afk::social::deposit::tests::claim_incorrect_gas_amount
afk::social::deposit::tests::deposit_claim_gas_fee
afk::social::deposit::tests::claim_incorrect_gas_amount
afk::social::account::tests::get_public_key
afk::social::account::tests::successful_transfer
afk::social::account::tests::incorrect_signature
afk::social::account::tests::wrong_sender
afk::social::account::tests::wrong_recipient
afk::social::account::tests::wrong_token
afk::tests::launchpad_tests::launchpad_tests::launchpad_buy_more_then_liquidity_threshold
afk::tests::launchpad_tests::launchpad_tests::launchpad_integration
1 change: 1 addition & 0 deletions onchain/cairo/src/afk_id.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod afk_id;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use starknet::{
contract_address_const, get_block_timestamp, get_contract_address, ClassHash
};

use afk::types::identity_types:: {

};
#[starknet::interface]
pub trait IAfkId<T> {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ use starknet::{
contract_address_const, get_block_timestamp, get_contract_address, ClassHash
};

use afk::types::identity_types::{
AfkIdentiyState

Check warning on line 7 in onchain/cairo/src/afk_id/id_factory.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
};

#[starknet::interface]
pub trait IFactoryAfkId<T> {
fn get_afk_id(self: @T, user:ContractAddress) -> AfkIdentiyState;

Check warning on line 12 in onchain/cairo/src/afk_id/id_factory.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
Expand All @@ -16,15 +20,15 @@ mod FactoryAfkIdentity {
contract_address_const, get_block_timestamp, get_contract_address, ClassHash
};
use core::num::traits::Zero;
use afk::types::identity_types::{
AfkIdentiyState,

Check warning on line 24 in onchain/cairo/src/afk_id/id_factory.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
AfkIdentityCreated
};

#[storage]
struct Storage {
id_user_exist:LegacyMap<ContractAddress, bool>
}

#[event]
#[derive(Drop, starknet::Event)]
enum Event {
id_user_exist:LegacyMap<ContractAddress, bool>,
user_identity:LegacyMap<ContractAddress,AfkIdentiyState>

Check warning on line 31 in onchain/cairo/src/afk_id/id_factory.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
}

#[abi(embed_v0)]
Expand All @@ -34,8 +38,8 @@ mod FactoryAfkIdentity {

}

fn get_afk_id(self:@ContractState, user:ContractAddress) {

fn get_afk_id(self:@ContractState, user:ContractAddress) -> AfkIdentiyState {

Check warning on line 41 in onchain/cairo/src/afk_id/id_factory.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
self.user_identity.read(user)
}
}
}
4 changes: 4 additions & 0 deletions onchain/cairo/src/afk_id/mod.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod afk_id {
pub mod afk_identity;
pub mod id_factory;
}
6 changes: 3 additions & 3 deletions onchain/cairo/src/launchpad/launchpad.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,15 @@ mod LaunchpadMarketplace {

fn get_all_launch(self: @ContractState) -> Span<TokenLaunch> {
let max_key_id = self.total_launch.read() + 1;
let mut launchs: Array<TokenLaunch> = ArrayTrait::new();
let mut launches: Array<TokenLaunch> = ArrayTrait::new();
let mut i = 0; //Since the stream id starts from 0
loop {
if i >= max_key_id {}
let pool = self.array_launched_coins.read(i);
if pool.owner.is_zero() {
break launchs.span();
break launches.span();
}
launchs.append(pool);
launches.append(pool);
i += 1;
}
}
Expand Down
14 changes: 11 additions & 3 deletions onchain/cairo/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ pub mod launchpad;
pub mod sha256;
pub mod social;
pub mod utils;
pub mod quests {
pub mod tap;
}

pub mod afk_id {
pub mod afk_identity;
pub mod id_factory;
}

pub mod types {
pub mod jediswap_types;
pub mod keys_types;
pub mod launchpad_types;
pub mod tap_types;
pub mod identity_types;
}
pub mod quests {
pub mod tap;
}


pub mod examples {
pub mod counter;
Expand Down
21 changes: 21 additions & 0 deletions onchain/cairo/src/types/identity_types.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use starknet::{ContractAddress};

pub const ADMIN_ROLE: felt252 = selector!("ADMIN_ROLE");

#[derive(Drop, Copy, starknet::Store, Serde)]
pub struct AfkIdentiyState {

Check warning on line 6 in onchain/cairo/src/types/identity_types.cairo

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Identiy" should be "Identify" or "Identity".
pub owner: ContractAddress,
pub last_tap:u64,
pub total_tap:u256,
pub token_address:ContractAddress,
}


#[derive(Drop, starknet::Event)]
pub struct AfkIdentityCreated {
#[key]
pub owner: ContractAddress,
pub last_tap:u64,
pub total_tap:u256,
}

1 change: 1 addition & 0 deletions onchain/cairo/src/types/mod.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ pub mod types {
pub mod keys_types;
pub mod launchpad_types;
pub mod tap_types;
pub mod identity_types;
}

0 comments on commit 2c25034

Please sign in to comment.