Calculates the best possible answer for multiple-choice questions using techniques to maximize accuracy without any other outside resources or knowledge.
Functional, type-safe, stateless reactive Java API for efficient implementation of the API Composition Pattern for querying/merging data from multiple datasources/services, with a specific focus on solving the N + 1 query problem
Design patterns are a commonly used technique to encode design guide-lines or best practices. They express an abstract or conceptual solution to a concrete, complex, and reoccurring problem.
Action and Control
Action and Control is a group of patterns that provide mechanisms
for typical operational tasks.
_
PULL PAYMENT PATTERN
Problem
When a contract sends funds to another party, the send operation can fail.
All data and every transaction is publicly visible on the blockchain, but an application scenario requires that contract interactions, specifically submitted parameter values, are treated confidentially.
Solution
Apply a commitment scheme to ensure that a value submission is binding and concealed until a consolidation phase runs out, after which the value is revealed, and it is publicly verifiable that the value remained unchanged.
An application scenario requires knowledge contained outside the blockchain, but Ethereum contracts cannot directly acquire information from the outside world. On the contrary, they rely on the outside world pushing information into the network.
Solution
Request external data through an oracle service that is connected to the outside world and acts as a data carrier.
Authorization is a group of patterns that control access to
smart contract functions and provide basic authorization control,
which simplify the implementation of "user permissions".
_
OWNERSHIP PATTERN
Problem
By default any party can call a contract method, but it must be ensured that sensitive contract methods can only be executed by the owner of a contract.
Solution
Store the contract creator’s address as owner of a contract and restrict method execution dependent on the callers address.
By default a contract method is executed without any preconditions being checked, but it is desired that the execution is only allowed if certain requirements are met.
Solution
Define generally applicable modifiers that check the desired requirements and apply these modifiers in the function definition.
Lifecycle is a group of patterns that control the creation and
destruction of smart contracts.
_
MORTAL PATTERN
Problem
A deployed contract will exist as long as the Ethereum network exists. If a contract’s lifetime is over, it must be possible to destroy a contract and stop it from operating.
Solution
Use a selfdestruct call within a method that does a preliminary authorization check of the invoking party.
Maintenance is a group of patterns that provide mechanisms
for live operating contracts.
_
DATA SEGREGATION PATTERN
Problem
Contract data and its logic are usually kept in the same contract, leading to a closely entangled coupling. Once a contract is replaced by a newer version, the former contract data must be migrated to the new contract version.
Solution
Decouple the data from the operational logic into separate contracts.
Contracts are immutable. Changing contract functionality requires the deployment of a new contract.
Solution
Outsource functional units that are likely to change into separate so-called satellite contracts and use a reference to these contracts in order to utilize needed functionality.
Contract participants must be referred to the latest contract version.
Solution
Let contract participants pro-actively query the latest contract address through a register contract that returns the address of the most recent version.
Security is a group of patterns that introduce safety measures
to mitigate damage and assure a reliable contract execution.
_
CHECKS-EFFECTS-INTERACTION PATTERN
Problem
When a contract calls another contract, it hands over control to that other contract. The called contract can then, in turn, re-enter the contract by which it was called and try to manipulate its state or hijack the control flow through malicious code.
Solution
Follow a recommended functional code order, in which calls to external contracts are always the last step, to reduce the attack surface of a contract being manipulated by its own externally called contracts.
Since a deployed contract is executed autonomously on the Ethereum network, there is no option to halt its execution in case of a major bug or security issue.
Solution
Incorporate an emergency stop functionality into the contract that can be triggered by an authenticated party to disable sensitive functions.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].