Skip to content

Instantly share code, notes, and snippets.

@dshulyak
dshulyak / payments.sol
Last active April 2, 2018 06:27
protected payments for service model
pragma solidity 0.4.21;
import './ecrecovery.sol';
contract Payments {
event LogExit(address recepient, uint256 value, uint id);
struct Exit {
address recipient;
@dshulyak
dshulyak / policies.py
Last active December 18, 2015 20:35
basic policy engine
#!/usr/bin/env python
"""
Q/A
1. What is operation?
Solar client/api action
2. What is rule?
Condition, based on which we produce operations.
Condition should work only with local data, passing correct data will
be responsibility of fuel or solar
"""Expression parser based on some templater
Pros:
- it is not a new language
- it has very strict api, so atleast we can try to guarantee its stability
- complex abstract logic can be hidden in simple python methods
Stements will be expressed in the form of:
api.cluster_status == 'operational'
api.role_in_deployment('ceph-osd')