Closed turbolent closed 1 year ago
Transactions are passed AuthAccount
objects, which are essentially capabilities to the accounts which signed the transaction. They do have an address
field, but a good analogy is how a "directory capability" might get passed and it provides the path.
These account objects are only available as arguments in the transaction entry point, and not implicitly available anywhere else, so unlike msg.sender
in Solidity.
You can learn more at https://developers.flow.com/cadence/solidity-to-cadence#msgsender-considered-harmful
Interesting... Cadence has interesting support for capabilities...
I also see
That seems like ethereum's
msg.sender
or (non-strict) JavaScript's caller, which aren't consistent with complete encapsulation.To what extent is the
address
field used in Cadence smart contracts likemsg.sender
is used in ethereum to control access to contracts, such as giving administrative access?