Replies: 2 comments
-
We discussed this question in this week's office hours. See especially capability-based access control with continuing invitations. |
Beta Was this translation helpful? Give feedback.
-
WIP DRAFTI'm sharing a draft done by an LLM. I think it will be useful to track the fixes we make. In Agoric, access control is handled differently than in traditional Ethereum smart contracts, where the Using JavaScript Objects to Represent Rights (Capabilities)In Agoric, rights (or capabilities) are represented by JavaScript objects. Each object encapsulates the authority to perform specific actions. For example: const myCapability = {
doX: () => {
console.log('Action X performed');
},
};
// Only the holder of `myCapability` can call `doX`.
myCapability.doX(); The key concept here is object references as capabilities:
This design eliminates the need for a global The Continuing Invitation Pattern in AgoricAgoric uses the continuing invitation pattern to provide dynamic, secure, and extensible access control that integrates seamlessly with its platform. Here's how it works:
const initialInvitation = contract.makeInitialInvitation();
const editInvitation = initialInvitation.makeEditInvitation();
Contracts return invitation makers as part of their interface. For example, an Agoric vault contract may return an object like this: const invitationMakers = {
makeDepositInvitation: () => depositCapability,
makeWithdrawInvitation: () => withdrawCapability,
};
Why Use This Approach?
In summary, Agoric’s approach to access control—based on JavaScript objects and the continuing invitation pattern—provides a robust, secure, and flexible alternative to traditional |
Beta Was this translation helpful? Give feedback.
-
based on a question from discord
I would like to see the addresses that are using my contract, and add them to information I store in it.
This should be a very simple operation, but I don't find anything on the documentation.
aZCFSeat.getSubscriber() is the place where my research got stuck: it seems the seat subscriber might contain the address currently interacting with my contract, but I can't find any documentation on the subscriber and when I try to print it to the console I don't get much information:
Object [Alleged: zoe Seat publisher subscriber] {}
Beta Was this translation helpful? Give feedback.
All reactions