Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions call.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
command: call
response: [0x56f89e14f6abb50dad1c0eb26c7274cb58f8ab64bd77a3d7a8f7e18f1bf0b1, 0x56f89e14f6abb50dad1c0eb26c7274cb58f8ab64bd77a3d7a8f7e18f1bf0b1, 0x56bc75e2d63100000, 0x0, 0x0, 0x0, 0xa, 0x1, 0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d, 0x12, 0x0, 0x0, 0x0, 0x6943fdbce684, 0x0, 0x68592bda, 0x1, 0x68592bda]
2 changes: 2 additions & 0 deletions deployment_state.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ new_contract_address: 0x02da884ed8dd050de67d8393f7c3da9a152ed51fcb559f557af515a6
new_contract_address: 0x02db239f61e13178681019289a3a4dc85433d33e8106da9a2c6a5b2924908a43
new_contract_address: 0x03115635c7604543aadf247cc367355195613b32d3de0988d3d292cfa9f6b582
new_contract_address: 0x062ba518fb3742015e98361ba47547a3fa07de00cb0932fbf5303b0e0ddb825a
new_contract_address: 0x04485cece1543a0ccd24101900fb86e1ed83c752817db61b8a72e0d24b3d33d0
new_contract_address: 0x047aec658ea204139aa161a638a5519e072c61734ab3d4a8e5aec3f410c684d1
6 changes: 3 additions & 3 deletions scripts/call.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sncast \
call \
--network sepolia \
--contract-address 0x06203b21e738d4afa4ded5f89c5796907cef4b6f74c7d163d81e4e7914a34156 \
--function "get_stream" \
--arguments 5 > call.txt
--contract-address 0x062ba518fb3742015e98361ba47547a3fa07de00cb0932fbf5303b0e0ddb825a \
--function "get_withdrawable_amount" \
--arguments 0 > call.txt
8 changes: 5 additions & 3 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# Configuration
ACCOUNT_NAME="dev" # Replace with your account name
NETWORK="sepolia" # Replace with your target network (sepolia, mainnet, etc.)
CLASS_HASH="0x056a6295d66416b47b128ed7feb5a40d4c2de6c066fd7b3bd8f45c708c6f1199" # Replace with your contract's class hash after declaration # Replace with the protocol owner address
PROTOCOL_OWNER=0x023345e38d729e39128c0cF163e6916a343C18649f07FcC063014E63558B20f3 # Replace with the protocol owner address
CLASS_HASH="0x05319cc180d885f87f25300452e822491d2a412f4042c02f969291a6e3f3e95b" # Replace with your contract's class hash after declaration # Replace with the protocol owner address
PROTOCOL_OWNER=0x023345e38d729e39128c0cF163e6916a343C18649f07FcC063014E63558B20f3
GENERAL_PROTOCOL_FEE_RATE=100
PROTOCOL_FEE_ADDRESS=0x023345e38d729e39128c0cF163e6916a343C18649f07FcC063014E63558B20f3

# Check if sncast is installed
if ! command -v sncast &> /dev/null; then
Expand All @@ -29,7 +31,7 @@ DEPLOY_OUTPUT=$(sncast --account $ACCOUNT_NAME \
deploy \
--network $NETWORK \
--class-hash $CLASS_HASH \
--constructor-calldata $PROTOCOL_OWNER $RECIPIENT $DECIMALS)
--constructor-calldata $PROTOCOL_OWNER $GENERAL_PROTOCOL_FEE_RATE $PROTOCOL_FEE_ADDRESS)

# Check if the deployment was successful
if [ $? -eq 0 ]; then
Expand Down
10 changes: 5 additions & 5 deletions scripts/invoke.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sncast \
sncast --account utility \
invoke \
--network sepolia \
--contract-address 0x06203b21e738d4afa4ded5f89c5796907cef4b6f74c7d \
--function "create_stream" \
--arguments 5
--contract-address 0x062ba518fb3742015e98361ba47547a3fa07de00cb0932fbf5303b0e0ddb825a \
--function "withdraw_max" \
--calldata 0x0 0x0 0x63783605f5f8a4c716ec82453815ac5a5d9bb06fe27c0df022495a137a5a74f \
--network sepolia \
3 changes: 2 additions & 1 deletion src/base/types.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ pub struct Stream {
pub rate_per_second: u256,
pub last_update_time: u64,
pub transferable: bool,
pub first_update_time: u64,
pub start_time: u64,
pub end_time: u64,
}

#[derive(Drop, starknet::Event)]
Expand Down
12 changes: 10 additions & 2 deletions src/interfaces/IPaymentStream.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,18 @@ pub trait IPaymentStream<TContractState> {
/// @notice Sets the protocol fee rate for a specific token
/// @param token The token address to set the fee rate for
/// @param new_fee_rate The new fee rate in fixed-point (e.g., 0.01 for 1%)
fn set_protocol_fee_rate(ref self: TContractState, token: ContractAddress, new_fee_rate: u256);
fn set_protocol_fee_rate(ref self: TContractState, token: ContractAddress, new_fee_rate: u64);

/// @notice Gets the protocol fee rate for a specific token
/// @param token The token address to get the fee rate for
/// @return The current fee rate in fixed-point
fn get_protocol_fee_rate(self: @TContractState, token: ContractAddress) -> u256;
fn get_protocol_fee_rate(self: @TContractState, token: ContractAddress) -> u64;

/// @notice Sets the general protocol fee rate
/// @param new_general_protocol_fee_rate The new fee rate in fixed-point
fn set_general_protocol_fee_rate(ref self: TContractState, new_general_protocol_fee_rate: u64);

/// @notice Gets the general protocol fee rate
/// @return The current fee rate in fixed-point
fn get_general_protocol_fee_rate(self: @TContractState) -> u64;
}
Loading