Project

General

Profile

Payment ยป TUTemplate.yml

Stepan Mamontov, 02/24/2018 13:09

 
1
---
2
__type: SmartContract
3

    
4
# minimum Universa smart contract API level required to process this contract
5
api_level: 3
6

    
7
# this is an required and immutable section that must be copied between states. it defines main contract
8
# properties and permissions.
9
definition:
10

    
11
  issuer:
12
   # required. contract must have issuer (or issuers). on creation, the root contract must be signed by
13
   # all issuers.
14

    
15
     key: >
16
          HggcAQABxAABucfLG7o8MIDQiylUlWFBOZ7GuxVWeLhy3JdYn4OOoLeYnrupHUWhbycvYeAm
17
          eNSdqcIvKcu295+XYPMD7VxYJydjO9MytYJq+1TqJhTpF7ZMXWD3SfvjLyZSFgSmXm540XiF
18
          Tc17cesr/jE56eAkT1g6Ha4b2kHKjEIrGTVLES5FAq2qolVFMzmp/dHzH/r+VEwu7vF1ybQa
19
          J1zpwEJNCK0+ooiZo6KfcJ6To98cdeAZqx/ggk3/JNpdtCKgPKd5YUH9twJc+XRvLP6a3TZE
20
          mKI3ZxUo6YGsQM7vBaqeNo9W2pcQ5BBqMkYW0Dtv74BB88zaFHTRv2OsKODxBGlj9w==
21
     # tu_key.public.unikey
22

    
23
     # to show to the user
24
     description: >
25
       TU.
26

    
27
  # required. time of contract creation. must not be in the futute or too long in the past (few days are allowed,
28
  # consult current Universa state, maximum delayed contract creation time varies. This time we make a template
29
  # which will be substituted by the creation time on issuing client:
30

    
31
  # will keep the time of root contract creation
32
  created_at: now()
33

    
34
  # required key, can be empty if the contract uses only standard roles, issues and creator.
35
  roles:
36
   # no extra roles, issuer and owner are predefined, so empty list.
37

    
38
  # required key, if left empty, the contract can not be changed or revoked. Be careful.
39
  permissions:
40
     # owner have a right to transfer ownership. Note that if the creator will be mentioned here, only the creator
41
     # will have permission to change owner. It is very important to allow it, so the owner can pay with a coin, or
42
     # split a part of it for another beneficiary
43
    change_owner: owner
44

    
45
    # who can revoke the contract: owner, and issuer altogether. Usually it means - when the issuer posess the contract
46
    # for example by bying it back from the customer, it is possible ro revoke it. Very much like destroying banknotes
47
    # by its owner - but we require also issuer signature on it:
48
    revoke:
49
      - issuer
50
      - owner
51
#      - role:
52
#        name: list_role
53
#        type: ALL_OF
54
#        roles:
55
#          - issuer
56
#          - owner
57

    
58

    
59
    decrement_permission:
60
      - role: owner
61
        min_value: 1
62
        max_step: -1
63
        field_name: transaction_units
64

    
65
  # required section, could be empty. Any immutable structured data issuer might need to include into the contract
66
  # this data will be also copied without change during any contract changes.
67
  data:
68
    # optional, but almost always needed name or four currency
69
    name: TU
70

    
71
    description: TU.
72

    
73
# required section. Data that represent current contract state, could be modified in accordance with
74
# 'permissions' section above
75
state:
76
 # required. most often, we should specify contract owner. we could specify 'issuer' or provide a key
77
  owner:
78
    # we create contract to be owned by another person, so we must provide a key:
79
    key: HggcAQABxAABnfB84zQkv23K46BM0iBsKvmDtGst/Rd62/0A30ep7SW21u1wPmcRJgy+3+/E
80
         tdgYKvrTiTJxV4pM+iXGzqBTA6eV4n/8QfvF1w/U1iaR2JYP2rsTbaj6dCLjX9JJ95qRvLQm
81
         RgQpcaNreuKDJdqkrJ3I/g9eAHbvLcnoAWyUwKH+zgXhBa7ZCYYy62V0nCa5B9T27X10t8zx
82
         r+PPBrzzkNup+18kCyv+aimKStY4mgAQvRPqzET7WZN57n9z4xvfA6aA9in0dG7P8Wfw5mms
83
         yFVFyKqld+3KdZfhSsxvvO+4jm2VG3spX0BkP1/t2PbRmiYxnUkI8ZUB4SDlldUp6w==
84
    # stepan_mamontov.unikey
85

    
86
    # the rest is optional and application-specific
87
    name:
88
      salutation: Mr.
89
      first: Stepan
90
      last: Mamontov
91

    
92
  # required. who has created this document. for the root contract it is always the issues, for changed
93
  # states it is almost always the owner. The contract should be signed by this key.
94
  created_by: issuer
95

    
96
   # required. must be in distant future.
97
  expires_at:
98
    __t: unixtime
99
    seconds: 1659720337
100

    
101
  # required. revision increments on any contract edit. the root contract has always revision of 1
102
  revision: 1
103

    
104
  # required. the contract based on which has created this one. it could be previous state of the contract in the
105
  # case of the edit or another contract that generates child contract and so on. this time it is a new chain
106
  # root so it is empty:
107
  parent: ~
108

    
109
  # required. the contract origin. when the contract state changes, the origin should always point to the root
110
  # contract, to which it is empty. This field mutates once, so it is part of the state, not definition.
111
  # this is a root contract, so:
112
  origin: ~
113

    
114
  # required except root contracts. creation time of this revision (e.g. state). As it is a root contract, we
115
  # leave it empty:
116
  created_at: ~
117

    
118
  # required section. any application data that could be changed.
119
  data:
120
    transaction_units : 1000000
121

    
122

    
    (1-1/1)