diff --git a/src/core/lockup_linear.cairo b/src/core/lockup_linear.cairo index 3819d58..19a6be4 100644 --- a/src/core/lockup_linear.cairo +++ b/src/core/lockup_linear.cairo @@ -671,6 +671,7 @@ mod TokeiLockupLinear { if (TokeiInternalImpl::_status_of(self, stream_id) == Status::SETTLED) { let stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1447,6 +1448,7 @@ mod TokeiLockupLinear { assert(amount <= withdrawable_amount, OVERDRAW); let stream = self.streams.read(stream_id); let stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1470,6 +1472,7 @@ mod TokeiLockupLinear { if (amounts.withdrawn >= amounts.deposited - amounts.refunded) { let _stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1503,6 +1506,7 @@ mod TokeiLockupLinear { // Checks: the stream is cancelable. assert(stream.is_cancelable, STREAM_NOT_CANCELABLE); let stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1546,6 +1550,7 @@ mod TokeiLockupLinear { if (recipient_amount == 0) { let stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1567,6 +1572,7 @@ mod TokeiLockupLinear { self.streams.write(stream_id, stream_updated); } else { let stream_updated = LockupLinearStream { + stream_id: stream.stream_id, sender: stream.sender, asset: stream.asset, recipient: stream.recipient, @@ -1702,6 +1708,7 @@ mod TokeiLockupLinear { // Effects: create the stream. let stream = LockupLinearStream { + stream_id: stream_id, sender, asset, recipient, diff --git a/src/scripts/admin_interaction.ts b/src/scripts/admin_interaction.ts index c8a7c26..3330fd3 100644 --- a/src/scripts/admin_interaction.ts +++ b/src/scripts/admin_interaction.ts @@ -176,9 +176,9 @@ export async function initialize_account() { "0x075b1b684be1cd0f08a4a59a22994dedb6d3f5851e630b3f1a895459ef754e87"; const tokeiClassHash = - "0x0642757913747e242c09cbbe73a3ab5733dfde42bc9293ed1b3642202dde7ff8"; + "0x01f9313b620810859fb1aa2b6920bb80a00d6bf5b13d1329b9a82424c8c272ab"; const tokeiaddress = - "0x682799e0ba490a32a4e24cf8a349b8d3560ee48f7ef2b9349b5cb4a527e99ae"; + "0x04bf83b5554b165b5f0ff5e797a8f57162840c78915b4864bdbfbdc71649ef1b"; console.log("✅ ERC20 Contract declared with classHash =", erc20ClassHash); console.log("✅ Tokei Contract declared with classHash =", tokeiClassHash); diff --git a/src/scripts/deployment.ts b/src/scripts/deployment.ts index 3dc8be8..258c79a 100644 --- a/src/scripts/deployment.ts +++ b/src/scripts/deployment.ts @@ -67,7 +67,7 @@ async function main() { //**************************************************************************************** */ const contractClassHash = - "0x0642757913747e242c09cbbe73a3ab5733dfde42bc9293ed1b3642202dde7ff8"; + "0x01f9313b620810859fb1aa2b6920bb80a00d6bf5b13d1329b9a82424c8c272ab"; console.log("✅ Test Contract declared with classHash =", contractClassHash); @@ -90,5 +90,4 @@ main() }); //Deployed Address -// Updated deployed contract address: 0x682799e0ba490a32a4e24cf8a349b8d3560ee48f7ef2b9349b5cb4a527e99ae -// 0x0661bd47eb4c872cd316a305dc673221a8f8a27379e6aa3a97a21a542efbb76f on goerli +// Updated deployed contract_address : 0x04bf83b5554b165b5f0ff5e797a8f57162840c78915b4864bdbfbdc71649ef1b on goerli diff --git a/src/tests/test_lockup_linear.cairo b/src/tests/test_lockup_linear.cairo index 8b63abb..0067051 100644 --- a/src/tests/test_lockup_linear.cairo +++ b/src/tests/test_lockup_linear.cairo @@ -317,6 +317,7 @@ fn test_create_with_duration() { let expected_Broker_balance = 3; let expected_protocol_revenue = 1; let expected_stream = LockupLinearStream { + stream_id: 1, sender: ALICE(), asset: token, recipient: RECIPIENT(), @@ -576,6 +577,7 @@ fn test_get_stream_when_status_settled() { let actual_stream = tokei.get_stream(stream_id); let expected_stream = LockupLinearStream { + stream_id: 1, sender: ALICE(), asset: token.contract_address, recipient: RECIPIENT(), @@ -602,6 +604,7 @@ fn test_get_stream_when_not_settled() { let actual_stream = tokei.get_stream(stream_id); let expected_stream = LockupLinearStream { + stream_id: 1, sender: ALICE(), asset: token.contract_address, recipient: RECIPIENT(), diff --git a/src/tests/utils/defaults.cairo b/src/tests/utils/defaults.cairo index 1e21318..a74e6ef 100644 --- a/src/tests/utils/defaults.cairo +++ b/src/tests/utils/defaults.cairo @@ -61,6 +61,7 @@ mod Defaults { fn lockup_linear_stream() -> LockupLinearStream { let (START_TIME, CLIFF_TIME, END_TIME) = setup_1(); LockupLinearStream { + stream_id: 1, sender: contract_address_const::<'sender'>(), asset: contract_address_const::<'asset'>(), recipient: contract_address_const::<'recipient'>(), diff --git a/src/types/lockup_linear.cairo b/src/types/lockup_linear.cairo index 2e8a2c9..86465b0 100644 --- a/src/types/lockup_linear.cairo +++ b/src/types/lockup_linear.cairo @@ -15,6 +15,8 @@ use tokei::types::lockup::LockupAmounts; /// Represent a Lockup Linear Stream. #[derive(Copy, Drop, starknet::Store, Serde, PartialEq)] struct LockupLinearStream { + /// The stream's ID. + stream_id: u64, /// The address streaming the assets, with the ability to cancel the stream. sender: ContractAddress, /// The contract address of the ERC-20 asset used for streaming.