Skip to content

Instantly share code, notes, and snippets.

View anixon604's full-sized avatar

Alch3mist anixon604

View GitHub Profile
@anixon604
anixon604 / simpleDrugContract
Last active July 30, 2020 16:19
A Corda contract demonstrating business process for issuance and sale of medical drug.
public void verify(@NotNull LedgerTransaction tx) throws IllegalArgumentException {
CommandWithParties<DrugCommands> command = requireSingleCommand(tx.getCommands(), DrugCommands.class);
DrugCommands commandType = command.getValue();
if (commandType instanceof DrugCommands.IssueDrug) {
verifyIssuance(tx, command);
} else if (commandType instanceof DrugCommands.SellDrug) {
verifySale(tx, command);
} else {
throw new IllegalArgumentException("Command not recognized");
@anixon604
anixon604 / compliantDrugContract
Last active July 30, 2020 15:03
A Corda contract demonstrating business process for issuance and sale of medical drug (multi-regulatory).
// For simplicity, batches will be sold in whole
private void verifySale(LedgerTransaction tx, CommandWithParties<DrugContract.DrugCommands> command) {
requireThat(require -> {
require.using("Drug sale should consume one input statet",
tx.getInputs().size() == 1);
require.using("Drug sale should have one output state",
tx.getOutputs().size() == 1);
Drug in = tx.inputsOfType(Drug.class).get(0);
Drug out = tx.outputsOfType(Drug.class).get(0);
With the persona, attitude, and unique tone that defines you, analyze the following:
- External context: {external_context}
- Short-term memory: {short_term_memory}
- Long-term memories: {long_term_memories}
- Recent posts: {recent_posts}
Based on this analysis, create an original tweet. Your tweet should:
- Align with your perspective and style.
- Touch on key themes, emotions, or ideas that resonate with the current context.