π‘οΈTrustee
Key to Key Distribution Permissions
Design Ethos
Storage
ILocksmith public locksmith; // key validation
ITrustEventLog public trustEventLog; // event detection
ILedger public ledger; // ledger manipulation
// A trust Policy enables a keyholder
// to distribute key trust funds.
struct Policy {
bool enabled; // is this policy enabled
bytes32[] requiredEvents; // the events needed to enable
uint256 rootKeyId; // the root key used to establish the policy
uint256 sourceKeyId; // where the funds can be moved from
EnumerableSet.UintSet beneficiaries; // where funds can be moved to
}
// maps trustee Keys, to the metadata.
// each key is limited to one policy in this implementation.
mapping(uint256 => Policy) private trustees;
// maps trusts to keys with policies on them
// this prevents UIs from having to spam the RPC
// with every key in the trust to get the set of policies.
mapping(uint256 => EnumerableSet.UintSet) private trustPolicyKeys;locksmith
trustEventLog
ledger
struct Policy
enabled
requiredEvents
rootKeyId
sourceKeyId
beneficiaries
trustees
trustPolicyKeys
Operations
setPolicy
removePolicy
distribute
ensureEventActivation
Last updated