Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

feat: llama message broadcaster #96

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

0xrajath
Copy link
Contributor

@0xrajath 0xrajath commented Jan 12, 2024

Motivation:

We want to enable llama instances to arbitrarily broadcast messages. This can be used to voice an opinion on a social issue, to recommend an offchain software version number, or to make a prediction. The message can be a structured JSON blob or unstructured prose.

Modifications:

  • LlamaMessageBroadcaster peripheral contract.
  • Updated DeployLlamaTokenVotingFactory forge script to include the LlamaMessageBroadcaster deployment.
  • Tests

Result:

Llama instances can now broadcast arbitrary offchain messages though a new broadcaster module.

@0xrajath 0xrajath self-assigned this Jan 12, 2024
Comment on lines +16 to +17
// Duck testing to check if the caller is a Llama instance.
ILlamaCore(llamaExecutor.LLAMA_CORE()).actionsCount();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the duck test here to reduce possible spam since it's an open function.

Copy link
Contributor Author

@0xrajath 0xrajath Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have made a separate deployer script for just the LlamaMessageBroadcaster. I'm not opposed to the idea, but I think this would be simpler to manage.

@0xrajath 0xrajath marked this pull request as ready for review January 12, 2024 21:21
@0xrajath 0xrajath requested a review from AustinGreen as a code owner January 12, 2024 21:21
Copy link

Coverage after merging rajath/llama-broadcast into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/message-broadcaster
   LlamaMessageBroadcaster.sol100%100%100%100%
src/token-voting
   LlamaTokenGovernor.sol99.68%98.78%100%100%830
   LlamaTokenVotingFactory.sol88.89%66.67%100%100%67–68
src/token-voting/token-adapters
   LlamaTokenAdapterVotesTimestamp.sol100%100%100%100%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant