Skip to content

Instantly share code, notes, and snippets.

View 0xChqrles's full-sized avatar
🌱
building on starknet

Chqrles 0xChqrles

🌱
building on starknet
View GitHub Profile
use array::SpanTrait;
use zeroable::Zeroable;
trait SpanExtTrait<T> {
fn is_deeply_empty(self: Span<T>) -> bool;
}
impl SpanExtImpl<T, impl TZeroable: Zeroable<T>, impl TCopy: Copy<T>> of SpanExtTrait<T> {
fn is_deeply_empty(mut self: Span<T>) -> bool {
match self.pop_front() {
@0xChqrles
0xChqrles / c-score.md
Last active August 24, 2023 18:38
[RULES] C-Score formule

EXPLICATION DE LA FORMULE DU C-SCORE

Prenons l'exemple de la collection suivante:

Le Règlement - Common #25
Le Règlement - Common #400
Le Règlement - Common #2500

Zinée - Common #25
Zinée - Common #100

@0xChqrles
0xChqrles / uint256_memset.cairo
Created April 16, 2022 21:06
A Uint256 version of the "official" cairo memset, to initiate an array of Uint256
from starkware.cairo.common.uint256 import Uint256
func uint256_memset(dst: Uint256*, value: Uint256, n: felt):
struct LoopFrame:
member dst : Uint256*
end
if n == 0:
return ()
end