Repository navigation
Expand file tree
/
Copy patheos.cpp
More file actions
119 lines (101 loc) · 3.82 KB
/
Copy patheos.cpp
File metadata and controls
119 lines (101 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
* @file
* @copyright defined in eos/LICENSE.txt
*/
namespace native {
/**
@defgroup eoscontract EOS Contract
@brief Documents the interface to the EOS currency contract
@ingroup contracts
@{
*/
/**
* @ingroup contracts
* @brief Defines the base class for all contracts
*/
struct contract {
/**
* @brief updates the code that will be executed for this contract
*
* <h3> Required Authority </h3>
*
* Requires authority of *this* contract.
*
* <h3> Required Scope </h3>
*
* Requires scope of *this* contract.
*
* @note the change in code does not take effect until the start of the next block
*/
void setcode( Bytes code,
Abi abi,
uint8_t vm = 0,
uint8_t vm_version = 0 ) final;
/**
* @brief updates the authority required for a named permission
*
* <h3> Required Authority </h3>
*
* Requires authority of *this* contract.
*
* <h3> Required Scope </h3>
*
* Requires scope of *this* contract.
*/
void setauth( Name permission, ///< the name for the permission being set
Name parent, ///< the parent permission to this permission
Authority auth ///< the set of keys/accounts and threshold );
) final;
/**
* @brief set the local named permission required for `this` account/contract to
* call `con::act(...)`
*
* <h3> Required Authority </h3>
*
* Requires authority of *this* contract.
*
* <h3> Required Scope </h3>
*
* Requires scope of *this* contract.
*
* @pre myperm must be defined by prior call to @ref setauth
*
* @param con - the name of the contract this permission applies
* @param act - the name of the action on @ref con this permission applies to
* @param myperm - the name of a permission set by @ref setauth on `this` contract
*/
void setperm( Name con, Name act, Name myperm );
};
/**
* @class eos
* @brief A *native* currency contract implemented with account named `eos`
* @ingroup contracts
*
* @details The EOS contract is a *native* currency contract implemented with account named `eos`. This contract enables
* users to transfer EOS tokens to each other. This contract is designed to work the @ref stakedcontract and
* @ref systemcontract when creating new accounts, claiming staked EOS.
*/
struct eos : public contract {
/**
@brief This action will transfer funds from one account to another.
@pre `from`'s balance must be greaterthan or equal to `amount` transferred.
@pre The amount transferred must be greater than 0
@pre `to` and `from` may not be the same account.
<h3> Required Authority </h3>
This action requires the authority of the `from` account.
<h3>Required Scope </h3>
This action requires access to `from` and `to` account scopes. It does not require
access to the `eos` scope which means that multiple transfers can execute in parallel
as long as they don't have any overlapping scopes.
<h3> Required Recipients </h3>
This message requires that the accounts `from` and `to` are listed in the required recipients. This ensures
other contracts are notified anytime EOS tokens are transferred.
*/
void transfer (
account_name from, ///< account from which EOS will be withdrawn
account_name to, ///< account to receive EOS, may not be same as `from`
uint64_t amount ///< must be greater than 0 and less or equal to `from`'s balance
);
}; /// class EOS
/// @}
}