diff --git a/.husky/pre-commit b/.husky/pre-commit index d658dae4..5f67a527 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,10 @@ +#!/bin/sh + +# Guard: Check that lint-staged is installed locally before executing if [ ! -x ./node_modules/.bin/lint-staged ]; then echo "lint-staged is not installed locally. Run 'npm install' before committing." >&2 exit 1 fi ./node_modules/.bin/lint-staged + diff --git a/contracts/stream_contract/src/lib.rs b/contracts/stream_contract/src/lib.rs index 5592851b..7fc78273 100644 --- a/contracts/stream_contract/src/lib.rs +++ b/contracts/stream_contract/src/lib.rs @@ -41,7 +41,7 @@ mod property_tests; mod test; use soroban_sdk::{ - contract, contractimpl, token, vec, Address, BytesN, Env, InvokeError, Symbol, Vec, + contract, contractimpl, token, vec, Address, BytesN, Env, IntoVal, InvokeError, Symbol, Vec, }; use errors::StreamError; @@ -426,7 +426,6 @@ impl StreamContract { withdrawn_amount: 0, start_time, last_update_time: start_time, - cliff_time: None, is_active: true, paused: false, paused_at: None, diff --git a/contracts/stream_contract/src/test.rs b/contracts/stream_contract/src/test.rs index 26d7daa4..a284f570 100644 --- a/contracts/stream_contract/src/test.rs +++ b/contracts/stream_contract/src/test.rs @@ -35,7 +35,7 @@ impl ReentrantFeeToken { 7 } - pub fn transfer(env: Env, _from: Address, to: Address, _amount: i128) { + pub fn transfer(env: Env, _from: Address, to: Address, amount: i128) { if to == env.current_contract_address() { let stream_contract: Address = env .storage() @@ -170,7 +170,6 @@ fn test_datakey_stream_serializes_deterministically() { withdrawn_amount: 0, start_time: 1, last_update_time: 1, - cliff_time: None, is_active: true, paused: false, paused_at: None, @@ -2476,7 +2475,6 @@ fn test_fuzz_claimable_overflow_and_cancel_invariants() { withdrawn_amount: withdrawn, start_time: 0, last_update_time: 0, - cliff_time: None, is_active: true, paused, paused_at: if paused { @@ -2493,6 +2491,9 @@ fn test_fuzz_claimable_overflow_and_cancel_invariants() { } else { StreamStatus::Active }, + arbiter: None, + dispute_status: DisputeStatus::None, + is_allowance_based: false, }; let claimable = StreamContract::calculate_claimable(&stream, elapsed); diff --git a/contracts/stream_contract/src/types.rs b/contracts/stream_contract/src/types.rs index a83a4778..a82718ca 100644 --- a/contracts/stream_contract/src/types.rs +++ b/contracts/stream_contract/src/types.rs @@ -227,8 +227,6 @@ pub struct Stream { pub start_time: u64, /// Ledger timestamp of the last state mutation, in Unix epoch seconds. pub last_update_time: u64, - /// Optional timestamp before which no tokens are claimable. - pub cliff_time: Option, /// `false` once fully withdrawn or cancelled. Always set. pub is_active: bool, /// `true` while the stream is paused; accrual is frozen at `paused_at`. Always set. diff --git a/package-lock.json b/package-lock.json index 742b4e8f..8f219062 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1754,6 +1754,9 @@ "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1770,6 +1773,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1786,6 +1792,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1802,6 +1811,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1818,6 +1830,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1834,6 +1849,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1850,6 +1868,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1866,6 +1887,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1882,6 +1906,9 @@ "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1904,6 +1931,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1926,6 +1956,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1948,6 +1981,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1970,6 +2006,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1992,6 +2031,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2014,6 +2056,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2036,6 +2081,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2296,6 +2344,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2312,6 +2363,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2328,6 +2382,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2344,6 +2401,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -9930,9 +9990,9 @@ "license": "MIT" }, "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", "funding": [ { "type": "individual", @@ -10780,6 +10840,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -11915,7 +11988,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.25.4", @@ -12987,6 +13060,47 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkg-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" + } + }, + "node_modules/playwright": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.0.tgz", + "integrity": "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.64.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.0.tgz", + "integrity": "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/pkg-types": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz",