Proposal to Upgrade PasscodeManager Canister
Summary
GitHub commit
https://github.com/ICPSwap-Labs/icpswap-v3-service/commit/94eeb92ad6ecc2713d38fd3bef48cd4f328a3513
Changelog
- Log buffer converted to a fixed-size circular buffer. Added stable _logsWriteIndex : Nat; once _logs.size() >= MAX_LOGS, new entries overwrite via _logs.put(_logsWriteIndex % MAX_LOGS, entry) instead of Buffer.remove(0), eliminating the O(n) shift on every append.
- getLogs(count) rewritten to read the circular buffer correctly via modular arithmetic, preserving chronological order in both pre-wrap and post-wrap states.
- deposit, depositFrom, withdraw, and createPasscode catch blocks now call _addLog(caller, "... exception (ambiguous): ..." , ?amount). The (ambiguous) tag is intentional — async exceptions cannot distinguish ledger success from failure.
- withdraw: when TOKEN.transfer returns #Err(msg), the function nletDeposit(caller, args.amount) before returning the error, insteadof silently leaving the debit in place.
- withdraw: removed the redundant AccountUtils.isEmptyIdentity(caby the Principal.isAnonymous guard above it).
- destoryPasscode now sorts (token0, token1) by principal text before calling FACTORY.deletePasscode, mirroring createPasscode. Previously, callers passing the tokens in non-canonical order would fail to match the stored passc
- transfer exception log now includes the recipient principal in addition to the error message.
- Version bumped from 3.6.0 to 3.7.0.
- The creation fee has been changed from 1 ICP to 5 ICP.
Wasm Verification
git fetch
git checkout 94eeb92ad6ecc2713d38fd3bef48cd4f328a3513
./build.sh
sha256sum .dfx/local/canisters/PasscodeManager/PasscodeManager.wasm
Payload
Proposal to Upgrade an SNS Controlled Canister
Target canister: 7eikv-2iaaa-aaaag-qdgwa-cai
Wasm info
Embedded module with 436647 bytes and SHA256 3d19f055a42387b3d279d27a7b9f6b3e89735dacc44718d623e7c74911558093.
Mode: Upgrade
Argument info
Upgrade argument with 51 bytes and SHA256 4449444c0004687c6868010a0000000000000002010180cab5ee01010a0000000000d00ad70101010a00000000020000ab0101.
Overview