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
const express = require("express"); | |
const helmet = require("helmet"); | |
const cors = require("cors"); | |
const path = require("path"); | |
require('dotenv').config(); | |
let clientUrl = process.env.CLIENT_URL || 'http://localhost:3000'; | |
const app = express(); | |
app.use(helmet()); |
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
#[starknet::contract] | |
mod Demo { | |
#[storage] | |
struct Storage { | |
voters: LegacyMap::<ContractAddress, Voter>, | |
} | |
#[derive(Copy, Drop, Serde, starknet::Store)] | |
struct Voter { |
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
import { useCallback, useEffect, useState } from "react"; | |
import { Text } from "../atom/Text"; | |
import userImg from "../../assets/img/team01.png"; | |
import { ImageWrap } from "../atom/ImageWrap"; | |
import { Button } from "../atom/Button"; | |
import { toast } from "sonner"; | |
import signMessages from "../../utils/relayTransaction.js" | |
import readGameState from "../../utils/readState.js"; | |
import axios from "axios"; | |
import { useActiveAccount } from "thirdweb/react"; |
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
#[starknet::contract] | |
mod NftBase { | |
// use openzeppelin::access::ownable::ownable::OwnableComponent::InternalTrait; | |
use openzeppelin::token::erc721::erc721::ERC721Component::InternalTrait; | |
use openzeppelin::token::erc721::erc721::ERC721Component; | |
use openzeppelin::access::ownable::OwnableComponent; | |
use starknet::{ContractAddress}; | |
component!(path: ERC721Component, storage: ERC721, event: ERC721Event); | |
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent); |
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
// ANCHOR: library_dispatcher | |
#[starknet::interface] | |
pub trait IMathUtils<T> { | |
fn add(ref self: T, x: u32, y: u32) -> u32; | |
fn set_class_hash(ref self: T, class_hash: starknet::ClassHash); | |
} | |
// create and declare contract class for contract A | |
#[starknet::contract] | |
pub mod MathUtils { |
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
#[starknet::contract] | |
pub mod ArtPeace { | |
use core::option::OptionTrait; | |
use core::traits::TryInto; | |
use core::traits::Into; | |
use core::dict::Felt252DictTrait; | |
use starknet::ContractAddress; | |
use art_peace::{IArtPeace, Pixel}; | |
use art_peace::quests::interfaces::{IQuestDispatcher, IQuestDispatcherTrait}; | |
use art_peace::nfts::interfaces::{ |
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
#[starknet::contract] | |
pub mod ArtPeace { | |
use core::option::OptionTrait; | |
use core::traits::TryInto; | |
use core::traits::Into; | |
use core::dict::Felt252DictTrait; | |
use starknet::ContractAddress; | |
use art_peace::{IArtPeace, Pixel}; | |
use art_peace::quests::interfaces::{IQuestDispatcher, IQuestDispatcherTrait}; | |
use art_peace::nfts::interfaces::{ |
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
use core::traits::TryInto; | |
use starknet::ContractAddress; | |
use starknet::contract_address_const; | |
use starknet::get_block_timestamp; | |
use snforge_std::{ | |
declare, ContractClassTrait, test_address, spy_events, SpyOn, EventSpy, EventAssertions | |
}; | |
use openzeppelin::utils::serde::SerializedAppend; | |
use openzeppelin::token::erc721::ERC721Component; | |
use cairo_erc_7498::erc7498::interface::{ |
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
use core::fmt; | |
use sha2::{ Sha256, Digest }; | |
use std::{ | |
error::Error, | |
fmt::{Debug, Display}, | |
io, | |
}; | |
#[derive(Debug, Clone, Copy)] | |
struct AuctionDetails {} |
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
use core::option::OptionTrait; | |
use snforge_std::cheatcodes::contract_class::{ContractClassTrait, declare}; | |
use array::ArrayTrait; | |
use core::traits::TryInto; | |
use governance::traits::{ | |
IStakingDispatcher, IStakingDispatcherTrait, IERC20Dispatcher, IERC20DispatcherTrait, | |
IOptionTokenDispatcher, IOptionTokenDispatcherTrait | |
}; | |
use governance::staking::Staking::Multiplier; |
NewerOlder