Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ImgBot] Optimize images #1

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f6e713f
:memo: Update readme add formatting rules (#227)
dalmasonto Oct 23, 2023
6889a9c
:memo: edit forge chapter
omarespejel Oct 23, 2023
1685328
:tada: [i18n]Translation/zh-cn 1019 (#225)
cryptonerdcn Oct 23, 2023
bb1f8d0
:tada: add catpuccin themes
omarespejel Oct 23, 2023
b29bd21
:tada: add all contributors
omarespejel Oct 23, 2023
ef82193
:tada: add transactions chapter
omarespejel Oct 24, 2023
26cef9d
:tada: Add a web3 erc20 example for StarknetJS (#223)
devnet0x Oct 25, 2023
a143a95
:tada: Add Introduction to Scarb, Katana and Scarb section (#234)
gianalarcon Oct 26, 2023
fc2fc48
:memo: edit basic installation and intro
omarespejel Oct 26, 2023
1a899d3
:memo: format
omarespejel Oct 26, 2023
c84e4d7
:memo: add links and key take aways. (#229)
Akinbola247 Oct 26, 2023
c337f23
:lipstick: reorder chapter 2
omarespejel Oct 26, 2023
cd9eee9
:tada: add Solidity verifier subchapter (#235)
faytey Oct 26, 2023
db84091
:bug: fix several sections and add testnet section (#237)
gianalarcon Oct 29, 2023
c8dc714
:tada: Forces linter check before commit (#224)
ccolorado Oct 29, 2023
c122e14
:bug: change StarkNet for Starknet
omarespejel Oct 29, 2023
b20f63d
:memo: edit testnet deployment
omarespejel Oct 29, 2023
33e940f
:memo: ch04-02-hello-account update (#232)
CyndieKamau Oct 29, 2023
357a59e
:tada: add Ch04-02-02 account deployment (#238)
CyndieKamau Oct 31, 2023
42baa4a
:tada: revamp transactions section
omarespejel Nov 1, 2023
3da8504
:memo: add link to ch04-00-account-abstraction.md (#240)
estheroche Nov 1, 2023
7638f4f
:memo: Update scarb, cairo and sierra to latest versions, update Scar…
CyndieKamau Nov 7, 2023
cc2144b
:bug: edit content order in AA chapter
omarespejel Nov 7, 2023
a65e469
:memo: edit hello account contract
omarespejel Nov 7, 2023
1998a09
:memo: professional edit deploy account contract
omarespejel Nov 7, 2023
00f73dc
:memo: Update ch02-08-01-01-erc20-ui.md (#247)
neilydhan Nov 7, 2023
49785fb
:memo: fix nit
omarespejel Nov 7, 2023
ad7a071
:bug: fix bug in account contract
omarespejel Nov 7, 2023
a060537
:memo: format
omarespejel Nov 7, 2023
d0f145b
:bug: typos in the docs (#255)
tudorpintea999 Nov 20, 2023
0db49c1
:tada: Update sncast script, add rust node (#254)
dalmasonto Nov 20, 2023
ee369a2
:memo: move devnet subchapter before sncast
omarespejel Nov 20, 2023
96943c4
:bug: change JSON-RPC endpoint to Infura from Alchemy (#251)
CyndieKamau Nov 20, 2023
223a4b2
:tada: add ch02-11-starkli (#244)
gianalarcon Nov 21, 2023
e2242b5
:memo: edit starkli and connection example
omarespejel Nov 21, 2023
0477e0b
:memo: reorder chapter 2
omarespejel Nov 21, 2023
891504f
:tada: add new hello account contract
omarespejel Nov 22, 2023
4f579ef
added smart-contracts subsection
Nonnyjoe Nov 22, 2023
71b1de4
:tada: add intro to madara sequencer (#241)
onchezz Nov 22, 2023
1896ea0
:memo: add and edit madara subchapter
omarespejel Nov 22, 2023
fc2d1af
:tada: Security considerations new format (#248)
devnet0x Nov 22, 2023
055d592
:memo: edit security subchapters
omarespejel Nov 22, 2023
b05236e
chore: added an introduction to webwallet (#272)
Darlington02 Dec 19, 2023
346ca7d
:memo: style web wallet
omarespejel Dec 19, 2023
697b27d
:tada: update node chapter
ayoade96 Dec 19, 2023
e7e2d5a
Enchance the user experience for Documentation
hardiktheprogrammer Dec 22, 2023
6d98487
Feat: Add .all-contributorsrc (#274)
gianalarcon Dec 24, 2023
a77c3f2
Update scarb section (#269)
gianalarcon Dec 24, 2023
dba0b06
add voting-contract (#276)
gianalarcon Dec 24, 2023
9c4c1f1
Added piggyBank contract example
Nonnyjoe Dec 27, 2023
eb75c2b
Fix examples storage
gianalarcon Dec 31, 2023
eb8fbaf
complete migration to sepolia
Nonnyjoe Jan 4, 2024
29428c4
Fix link to contribution guide
estensen Jan 6, 2024
a4e4be1
Update Starknet plugin activation process in getting started guide
machuwey Jan 10, 2024
01c86a7
Add code and images for deploying and interacting with smart contracts
machuwey Jan 10, 2024
5e5dce0
update: Add instructions for getting SEPOLIA tokens
machuwey Jan 12, 2024
c750c6f
update: more descriptive naming
machuwey Jan 12, 2024
fc99024
feat: Multisig example
Jan 12, 2024
3c909fe
feat: add auto-payment (#300)
estheroche Jan 13, 2024
1dbd7d8
Add contributors
gianalarcon Jan 13, 2024
750cb93
Add LearnWeb3 sepolia faucet (#305)
haardikk21 Jan 16, 2024
401b498
Update foundry cast verion: (#307)
machuwey Jan 16, 2024
c3e15d8
updated RPC for interaction in ch03-08-01 to sepolia (#308)
Nonnyjoe Jan 16, 2024
f27405a
chore: docs proofreading (#311)
sqltrigger Jan 20, 2024
b9001e9
:tada: add data availability subchapter
omarespejel Jan 25, 2024
6c7e7b0
Tooling section: General update (#314)
gianalarcon Jan 26, 2024
4d2b6c9
[ImgBot] Optimize images
ImgBotApp Jan 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .all-contributorsrc

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples/Ownable-Components"]
path = examples/Ownable-Components
url = https://github.com/gianalarcon/ownable-components
86 changes: 0 additions & 86 deletions README.md

This file was deleted.

3 changes: 3 additions & 0 deletions examples/Ownable-Starknet/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export STARKNET_ACCOUNT=/home/gianm/.starkli-wallets/deployer/my_account_argent.json
export STARKNET_KEYSTORE=/home/gianm/.starkli-wallets/deployer/my_keystore_argent.json
export STARKNET_RPC=https://starknet-testnet.public.blastapi.io/rpc/v0_6 # you can keep this rpc url unchanged
8 changes: 0 additions & 8 deletions examples/Ownable-Starknet/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@ version = 1
[[package]]
name = "ownable_starknet"
version = "0.1.0"
dependencies = [
"snforge_std",
]

[[package]]
name = "snforge_std"
version = "0.1.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.7.1#d1bd8b9a361d437e8eaeb4ebffac291a48b4c920"
3 changes: 1 addition & 2 deletions examples/Ownable-Starknet/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ version = "0.1.0"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest

[dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.7.1" } #v0.7.0
starknet = ">=2.2.0"
starknet = ">=2.5.0"

[[target.starknet-contract]]
sierra = true
Expand Down
1 change: 0 additions & 1 deletion examples/Ownable-Starknet/data/calldata.txt

This file was deleted.

32 changes: 28 additions & 4 deletions examples/Ownable-Starknet/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ mod ownable {
}

#[constructor]
fn constructor(ref self: ContractState, initial_owner: ContractAddress,) {
fn constructor(ref self: ContractState, initial_owner: ContractAddress) {
self.owner.write(initial_owner);
self.data.write(1);
// Any variable of the storage that is not initialized
// will have default value -> data = 0.
}

#[external(v0)]
#[abi(embed_v0)]
impl OwnableDataImpl of IData<ContractState> {
fn other_func(self: @ContractState, other_contract: ContractAddress) -> felt252 {
IDataDispatcher { contract_address: other_contract }.get_data()
Expand All @@ -63,14 +63,14 @@ mod ownable {
}
}

#[external(v0)]
#[abi(embed_v0)]
impl OwnableTraitImpl of OwnableTrait<ContractState> {
fn transfer_ownership(ref self: ContractState, new_owner: ContractAddress) {
self.only_owner();
let prev_owner = self.owner.read();
self.owner.write(new_owner);

self.emit(OwnershipTransferred { prev_owner, new_owner, });
self.emit(OwnershipTransferred { prev_owner, new_owner });
}

fn owner(self: @ContractState) -> ContractAddress {
Expand All @@ -87,3 +87,27 @@ mod ownable {
}
}

#[cfg(test)]
mod tests {
use ownable_starknet::ownable;
use ownable_starknet::{OwnableTraitDispatcher, OwnableTraitDispatcherTrait};
use starknet::{ContractAddress, Into, TryInto, OptionTrait};
use starknet::syscalls::deploy_syscall;
use result::ResultTrait;
use array::{ArrayTrait, SpanTrait};

#[test]
#[available_gas(10_000_000)]
fn unit_test() {
let admin_address: ContractAddress = 'admin'.try_into().unwrap();
let mut calldata = array![admin_address.into()];
let (address0, _) = deploy_syscall(
ownable::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false
)
.unwrap();
let mut contract0 = OwnableTraitDispatcher { contract_address: address0 };

assert(contract0.owner() == admin_address, 'Wrong owner');
}
}

87 changes: 0 additions & 87 deletions examples/Ownable-Starknet/tests/test_ownable.cairo

This file was deleted.

14 changes: 14 additions & 0 deletions examples/foundry-example/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "casttest"
version = "0.1.0"
dependencies = [
"snforge_std",
]

[[package]]
name = "snforge_std"
version = "0.14.0"
source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.14.0#e8cbecee4e31ed428c76d5173eaa90c8df796fe3"
14 changes: 14 additions & 0 deletions examples/foundry-example/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "casttest"
version = "0.1.0"
edition = "2023_10"

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

[dependencies]
starknet = "2.4.1"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.14.0" }

[[target.starknet-contract]]
casm = true
sierra = true
53 changes: 53 additions & 0 deletions examples/foundry-example/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#[starknet::interface]
trait IHelloStarknet<TContractState> {
fn increase_balance(ref self: TContractState, amount: felt252);
fn get_balance(self: @TContractState) -> felt252;
}

#[starknet::contract]
mod HelloStarknet {
#[storage]
struct Storage {
balance: felt252,
}

#[abi(embed_v0)]
impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {
// Increases the balance by the given amount.
fn increase_balance(ref self: ContractState, amount: felt252) {
self.balance.write(self.balance.read() + amount);
}

// Gets the balance.
fn get_balance(self: @ContractState) -> felt252 {
self.balance.read()
}
}
}

#[cfg(test)]
mod tests {
use casttest::{IHelloStarknetDispatcherTrait, IHelloStarknetDispatcher};
use snforge_std::{declare, ContractClassTrait};

#[test]
fn call_and_invoke() {
// Declare and deploy a contract
let contract = declare('HelloStarknet');
let contract_address = contract.deploy(@ArrayTrait::new()).unwrap();

// Create a Dispatcher object for interaction with the deployed contract
let dispatcher = IHelloStarknetDispatcher { contract_address };

// Query a contract view function
let balance = dispatcher.get_balance();
assert(balance == 0, 'balance == 0');

// Invoke a contract function to mutate state
dispatcher.increase_balance(100);

// Verify the transaction's effect
let balance = dispatcher.get_balance();
assert(balance == 100, 'balance == 100');
}
}
1 change: 1 addition & 0 deletions examples/multisig_contract
Submodule multisig_contract added at 3bb0aa
6 changes: 6 additions & 0 deletions examples/ownable-components/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "ownable_project"
version = "0.1.0"
12 changes: 12 additions & 0 deletions examples/ownable-components/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "ownable_project"
version = "0.1.0"

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

[dependencies]
starknet = ">=2.3.1"

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