Skip to content

Commit

Permalink
resolved commnets
Browse files Browse the repository at this point in the history
  • Loading branch information
byteZorvin committed Jul 22, 2024
1 parent 83a324f commit 848bbc7
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 145 deletions.
20 changes: 10 additions & 10 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "cairo_appchain_bridge"
version = "0.1.0"
dependencies = [
"openzeppelin",
"piltover",
"snforge_std",
]

[[package]]
name = "openzeppelin"
version = "0.14.0"
Expand All @@ -18,7 +9,7 @@ source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.14.0#f0
[[package]]
name = "piltover"
version = "0.1.0"
source = "git+https://github.com/byteZorvin/piltover?branch=main#34be166da6ec295f950c65ad231890127da68b5e"
source = "git+https://github.com/byteZorvin/piltover?branch=bridge-testing#a4021a0bb5e1638e3aebf634f5810ebb17da6a38"
dependencies = [
"openzeppelin",
]
Expand All @@ -27,3 +18,12 @@ dependencies = [
name = "snforge_std"
version = "0.26.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.26.0#50eb589db65e113efe4f09241feb59b574228c7e"

[[package]]
name = "starknet_bridge"
version = "0.1.0"
dependencies = [
"openzeppelin",
"piltover",
"snforge_std",
]
9 changes: 2 additions & 7 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "cairo_appchain_bridge"
name = "starknet_bridge"
version = "0.1.0"
edition = "2023_11"

Expand All @@ -8,7 +8,7 @@ edition = "2023_11"
[dependencies]
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.14.0" }
starknet = "2.6.4"
piltover = { git = "https://github.com/byteZorvin/piltover", branch="main"}
piltover = { git = "https://github.com/byteZorvin/piltover", branch="bridge-testing"}

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.26.0" }
Expand All @@ -17,10 +17,5 @@ snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v
casm = true
build-external-contracts = ["piltover::appchain::appchain"]

[[tool.snforge.fork]]
name = "mainnet"
url = "https://starknet-mainnet.public.blastapi.io"
block_id.tag = "Latest"

[scripts]
test = "snforge test"
23 changes: 3 additions & 20 deletions src/bridge/interface.cairo
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
use starknet::ContractAddress;

#[derive(Serde, Drop, starknet::Store, PartialEq)]
pub enum TokenStatus {
#[default]
Unknown,
Pending,
Active,
Blocked
}

#[derive(Serde, Drop, starknet::Store)]
pub struct TokenSettings {
pub token_status: TokenStatus,
pub deployment_message_hash: felt252,
pub pending_deployment_expiration: u64,
pub max_total_balance: u256,
pub withdrawal_limit_applied: bool
}
use starknet_bridge::bridge::types::{TokenStatus, TokenSettings};

#[starknet::interface]
pub trait ITokenBridgeAdmin<TContractState> {
Expand All @@ -34,8 +17,8 @@ pub trait ITokenBridgeAdmin<TContractState> {
pub trait ITokenBridge<TContractState> {
fn appchain_bridge(self: @TContractState) -> ContractAddress;
fn identity(self: @TContractState) -> ByteArray;
fn getStatus(self: @TContractState, token: ContractAddress) -> TokenStatus;
fn isServicingToken(self: @TContractState, token: ContractAddress) -> bool;
fn get_status(self: @TContractState, token: ContractAddress) -> TokenStatus;
fn is_servicing_token(self: @TContractState, token: ContractAddress) -> bool;
fn is_withdrawal_limit_applied(self: @TContractState, token: ContractAddress) -> bool;

fn enroll_token(ref self: TContractState, token: ContractAddress);
Expand Down
Loading

0 comments on commit 848bbc7

Please sign in to comment.