Open dekanbro opened 1 year ago
schema
{
controller: string;
target: string;
type: string;
description: string;
link: string;
}
space deliminator
reason:
tag: CookieJar <_uid>
content:
reaction
tag: CookieJar.reaction
content: <_uid> <DOWN/UP>
emits:
SummonCookieJar(address(_cookieJar), details, _initializer, uid);
uid
:
string uid = bytes32ToString(keccak256(abi.encodePacked(address(cookieJar), chainId)));
String because otherwise it needs to be parsed for every concat
details
:
{
"type":"Baal",
"name":"Moloch Pastries",
"description":"This is where you add some more content",
"link":"app.daohaus.club/0x64/0x0....666"
}
emits:
GiveCookie(cookieMonster, amount, fee, cookieUid);
IPoster(POSTER_ADDR).post(_reason, tag));
Can infer jarID from
event.address
andchainId
uid
:
string cookieUid = bytes32ToString(keccak256(abi.encodePacked(address(cookieJar), cookieMonster, _reason)));
tag
:
string memory reasonTag = string.concat(POSTER_TAG, ".reason");
tag = string.concat(reasonTag, ".reason.", cookieUid))`
POSTER_TAG
:
CookieJar
emits:
if (_isGood) {
IPoster(POSTER_ADDR).post(string.concat(_uid, " UP ", senderString), tag);
} else {
IPoster(POSTER_ADDR).post(string.concat(_uid, " DOWN ", senderString), tag);
}
uid
:
cookieUid
provided in call data
senderString
:
string memory senderString = Strings.toHexString(uint256(uint160(msg.sender)), 20);
tag
:
string memory reactionTag = string.concat(POSTER_TAG, ".reaction.", _uid);
tag = string.concat(reactionTag))`
We could render the tags on init to save gas for future txs
string
)GiveCookie
event
add a way to do reactions by people on allow list (like thumbs up and thumbs down)