flow-core-contracts icon indicating copy to clipboard operation
flow-core-contracts copied to clipboard

Balance Capability target check

Open janezpodhostnik opened this issue 3 years ago • 0 comments

Issue To Be Solved

The target of the balance capability in Flow core contracts here:

  • https://github.com/onflow/flow-core-contracts/blob/ed4310c774493f584d4eaea665c3b5e87617179d/contracts/FlowStorageFees.cdc#L69
  • https://github.com/onflow/flow-core-contracts/blob/ed4310c774493f584d4eaea665c3b5e87617179d/contracts/FlowStorageFees.cdc#L119
  • https://github.com/onflow/flow-core-contracts/blob/ed4310c774493f584d4eaea665c3b5e87617179d/contracts/FlowServiceAccount.cdc#L53

Is not verified that it is in fact targeting the default FLOW vault.

Suggest A Solution

This can be verified, using the getLinkTarget method.

But you are currently not able to due paths not being comparable https://github.com/onflow/cadence/issues/1815. A workaround would be to compare the "path.toString()" values, but this seems dirty.

janezpodhostnik avatar Jul 15 '22 15:07 janezpodhostnik