Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c38635e
add security permission matrix doc
vishalchangrani Feb 19, 2026
25fd067
docs: highlight EPosition over-grant risk in permission matrix
vishalchangrani Feb 19, 2026
7a1ea97
docs: restructure matrix by actor to expose beta over-grant clearly
vishalchangrani Feb 19, 2026
2780290
docs: clarify EPositionAdmin is user acting on own positions via storage
vishalchangrani Feb 19, 2026
4265852
Merge branch 'main' into taras/177-access-control-test
mts1715 Mar 3, 2026
f9f728b
Add comprehensive entitlement/capability access-control test suite
mts1715 Mar 6, 2026
491193a
fix comments
mts1715 Mar 6, 2026
4a2ea5e
Merge remote-tracking branch 'origin/main' into taras/177-access-cont…
mts1715 Mar 6, 2026
9e0b53b
Merge remote-tracking branch 'origin/main' into taras/177-access-cont…
mts1715 Mar 10, 2026
bd0dc05
fix wrong path for capability EGovernance
mts1715 Mar 10, 2026
dee9360
move some scripts from the `helper` folder to appropriate paths
mts1715 Mar 10, 2026
1a0d372
Merge remote-tracking branch 'origin/main' into taras/177-access-cont…
mts1715 Mar 10, 2026
27dc3b5
typo fix
mts1715 Mar 10, 2026
ca275cf
fix pool_pause_test.cdc to change from direct pool storage borrow to …
mts1715 Mar 10, 2026
ff18746
fix false description statement in comments;
mts1715 Mar 16, 2026
9bfe703
fix comments "do not use in production" at transactions that can be u…
mts1715 Mar 16, 2026
63cfe76
remove doubled test scripts; add some check to test
mts1715 Mar 16, 2026
628fd86
add additional verification that the intended action did actually hap…
mts1715 Mar 16, 2026
7098d3c
added neg_* tests for Egovernance methods
mts1715 Mar 16, 2026
dcd8ddd
Merge remote-tracking branch 'origin/main' into taras/177-access-cont…
mts1715 Mar 16, 2026
218fe0f
hotfix after merge
mts1715 Mar 16, 2026
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ FlowALP/

- `FungibleToken.Vault`: Standard token operations
- `DeFiActions.Sink/Source`: DeFi protocol composability
- Entitlements: `FlowALPv0.EParticipant`, `FlowALPv0.EPosition`, `FlowALPv0.EGovernance`, `FlowALPv0.ERebalance`
- Entitlements: `FlowALPModels.EParticipant`, `FlowALPModels.EPosition`, `FlowALPModels.EGovernance`, `FlowALPModels.ERebalance`

## 🛠️ Development

Expand Down
14 changes: 14 additions & 0 deletions cadence/scripts/flow-alp/position_max_health.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "FlowALPv0"
import "FlowALPPositionResources"

/// Returns the maximum health for the given position.
///
/// @param positionOwner: The account address that holds the PositionManager
/// @param pid: The position ID
access(all)
fun main(positionOwner: Address, pid: UInt64): UFix64 {
let manager = getAccount(positionOwner).capabilities
.borrow<&FlowALPPositionResources.PositionManager>(FlowALPv0.PositionPublicPath)
?? panic("Could not borrow PositionManager from \(positionOwner) at \(FlowALPv0.PositionPublicPath)")
return manager.borrowPosition(pid: pid).getMaxHealth()
}
14 changes: 14 additions & 0 deletions cadence/scripts/flow-alp/position_min_health.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "FlowALPv0"
import "FlowALPPositionResources"

/// Returns the minimum health for the given position.
///
/// @param positionOwner: The account address that holds the PositionManager
/// @param pid: The position ID
access(all)
fun main(positionOwner: Address, pid: UInt64): UFix64 {
let manager = getAccount(positionOwner).capabilities
.borrow<&FlowALPPositionResources.PositionManager>(FlowALPv0.PositionPublicPath)
?? panic("Could not borrow PositionManager from \(positionOwner) at \(FlowALPv0.PositionPublicPath)")
return manager.borrowPosition(pid: pid).getMinHealth()
}
14 changes: 14 additions & 0 deletions cadence/scripts/flow-alp/position_target_health.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "FlowALPv0"
import "FlowALPPositionResources"

/// Returns the target health for the given position.
///
/// @param positionOwner: The account address that holds the PositionManager
/// @param pid: The position ID
access(all)
fun main(positionOwner: Address, pid: UInt64): UFix64 {
let manager = getAccount(positionOwner).capabilities
.borrow<&FlowALPPositionResources.PositionManager>(FlowALPv0.PositionPublicPath)
?? panic("Could not borrow PositionManager from \(positionOwner) at \(FlowALPv0.PositionPublicPath)")
return manager.borrowPosition(pid: pid).getTargetHealth()
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fun testRecursiveWithdrawSource() {
// In this test, the topUpSource behavior is adversarial: it attempts to re-enter
// the pool during the pull/deposit flow. We expect the transaction to fail.
let withdrawRes = executeTransaction(
"./transactions/flow-alp/pool-management/withdraw_from_position.cdc",
"./transactions/flow-alp/epositionadmin/withdraw_from_position.cdc",
[positionID, flowTokenIdentifier, 1500.0, true], // pullFromTopUpSource: true
userAccount
)
Expand Down
2 changes: 1 addition & 1 deletion cadence/tests/adversarial_type_spoofing_test.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun testMaliciousSource() {

// withdraw 1337 Flow from the position
let withdrawRes = executeTransaction(
"./transactions/flow-alp/pool-management/withdraw_from_position.cdc",
"./transactions/flow-alp/epositionadmin/withdraw_from_position.cdc",
[1 as UInt64, flowTokenIdentifier, 1337.0, true],
hackerAccount
)
Expand Down
2 changes: 1 addition & 1 deletion cadence/tests/async_update_position_test.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun testUpdatePosition() {
depositToPosition(signer: user, positionID: 0, amount: 600.0, vaultStoragePath: FLOW_VAULT_STORAGE_PATH, pushToDrawDownSink: false)

let updatePositionRes = _executeTransaction(
"./transactions/flow-alp/pool-management/async_update_position.cdc",
"./transactions/flow-alp/eimplementation/async_update_position.cdc",
[ 0 as UInt64 ],
PROTOCOL_ACCOUNT
)
Expand Down
Loading
Loading