Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Change annotations to match the standardese style #426

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 79 additions & 129 deletions contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp

Large diffs are not rendered by default.

96 changes: 39 additions & 57 deletions contracts/eosio.msig/include/eosio.msig/eosio.msig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@
namespace eosio {

/**
* The `eosio.msig` system contract allows for creation of proposed transactions which require authorization from a list of accounts, approval of the proposed transactions by those accounts required to approve it, and finally, it also allows the execution of the approved transactions on the blockchain.
* \details The `eosio.msig` system contract allows for creation of proposed transactions which require authorization from a list of accounts, approval of the proposed transactions by those accounts required to approve it, and finally, it also allows the execution of the approved transactions on the blockchain.
*
* In short, the workflow to propose, review, approve and then executed a transaction it can be described by the following:
* - first you create a transaction json file,
* - then you submit this proposal to the `eosio.msig` contract, and you also insert the account permissions required to approve this proposal into the command that submits the proposal to the blockchain,
* - the proposal then gets stored on the blockchain by the `eosio.msig` contract, and is accessible for review and approval to those accounts required to approve it,
* The proposal then gets stored on the blockchain by the `eosio.msig` contract, and is accessible for review and approval to those accounts required to approve it,
* - after each of the appointed accounts required to approve the proposed transactions reviews and approves it, you can execute the proposed transaction. The `eosio.msig` contract will execute it automatically, but not before validating that the transaction has not expired, it is not cancelled, and it has been signed by all the permissions in the initial proposal's required permission list.
*/
class [[eosio::contract("eosio.msig")]] multisig : public contract {
public:
using contract::contract;

/**
* Create proposal
*
* @details Creates a proposal containing one transaction.
* \details Creates a proposal containing one transaction.
* Allows an account `proposer` to make a proposal `proposal_name` which has `requested`
* permission levels expected to approve the proposal, and if approved by all expected
* permission levels then `trx` transaction can we executed by this proposal.
Expand All @@ -33,92 +31,76 @@ namespace eosio {
* saved in the proposals table and the `requested` permission levels to the
* approvals table (for the `proposer` context). Storage changes are billed to `proposer`.
*
* @param proposer - The account proposing a transaction
* @param proposal_name - The name of the proposal (should be unique for proposer)
* @param requested - Permission levels expected to approve the proposal
* @param trx - Proposed transaction
* \param proposer The account proposing a transaction.
* \param proposal_name The name of the proposal (should be unique for proposer).
* \param requested The permission levels expected to approve the proposal.
* \param trx The proposed transaction.
*/
[[eosio::action]]
void propose(ignore<name> proposer, ignore<name> proposal_name,
[[eosio::action]] void propose(ignore<name> proposer, ignore<name> proposal_name,
ignore<std::vector<permission_level>> requested, ignore<transaction> trx);
/**
* Approve proposal
*
* @details Approves an existing proposal
* \details Approves an existing proposal
* Allows an account, the owner of `level` permission, to approve a proposal `proposal_name`
* proposed by `proposer`. If the proposal's requested approval list contains the `level`
* permission then the `level` permission is moved from internal `requested_approvals` list to
* internal `provided_approvals` list of the proposal, thus persisting the approval for
* the `proposal_name` proposal. Storage changes are billed to `proposer`.
*
* @param proposer - The account proposing a transaction
* @param proposal_name - The name of the proposal (should be unique for proposer)
* @param level - Permission level approving the transaction
* @param proposal_hash - Transaction's checksum
* \param proposer The account proposing a transaction.
* \param proposal_name The name of the proposal (should be unique for proposer).
* \param level The permission level approving the transaction.
* \param proposal_hash The transaction's checksum.
*/
[[eosio::action]]
void approve( name proposer, name proposal_name, permission_level level,
[[eosio::action]] void approve( name proposer, name proposal_name, permission_level level,
const eosio::binary_extension<eosio::checksum256>& proposal_hash );
/**
* Revoke proposal
*
* @details Revokes an existing proposal
* \details Revokes an existing proposal
* This action is the reverse of the `approve` action: if all validations pass
* the `level` permission is erased from internal `provided_approvals` and added to the internal
* `requested_approvals` list, and thus un-approve or revoke the proposal.
*
* @param proposer - The account proposing a transaction
* @param proposal_name - The name of the proposal (should be an existing proposal)
* @param level - Permission level revoking approval for proposal
* \param proposer The account proposing a transaction.
* \param proposal_name The name of the proposal (should be an existing proposal).
* \param level The permission level revoking approval for proposal.
*/
[[eosio::action]]
void unapprove( name proposer, name proposal_name, permission_level level );
[[eosio::action]] void unapprove( name proposer, name proposal_name, permission_level level );
/**
* Cancel proposal
* \details Cancels an existing proposal.
*
* @details Cancels an existing proposal
*
* @param proposer - The account proposing a transaction
* @param proposal_name - The name of the proposal (should be an existing proposal)
* @param canceler - The account cancelling the proposal (only the proposer can cancel an unexpired transaction, and the canceler has to be different than the proposer)
* \param proposer The account proposing a transaction.
* \param proposal_name The name of the proposal (should be an existing proposal).
* \param canceler The account cancelling the proposal (only the proposer can cancel an unexpired transaction, and the canceler has to be different than the proposer).
*
* Allows the `canceler` account to cancel the `proposal_name` proposal, created by a `proposer`,
* only after time has expired on the proposed transaction. It removes corresponding entries from
* internal proptable and from approval (or old approvals) tables as well.
*/
[[eosio::action]]
void cancel( name proposer, name proposal_name, name canceler );
[[eosio::action]] void cancel( name proposer, name proposal_name, name canceler );
/**
* Execute proposal
*
* @details Allows an `executer` account to execute a proposal.
* \details Allows an `executer` account to execute a proposal.
*
* Preconditions:
* - `executer` has authorization,
* - `proposal_name` is found in the proposals table,
* - all requested approvals are received,
* - proposed transaction is not expired,
* - and approval accounts are not found in invalidations table.
* \preconditions
* `executer` has authorization,
* `proposal_name` is found in the proposals table,
* all requested approvals are received,
* proposed transaction is not expired,
* and approval accounts are not found in invalidations table.
*
* If all preconditions are met the transaction is executed as a deferred transaction,
* and the proposal is erased from the proposals table.
*
* @param proposer - The account proposing a transaction
* @param proposal_name - The name of the proposal (should be an existing proposal)
* @param executer - The account executing the transaction
* \param proposer The account proposing a transaction.
* \param proposal_name The name of the proposal (should be an existing proposal).
* \param executer The account executing the transaction.
*/
[[eosio::action]]
void exec( name proposer, name proposal_name, name executer );
[[eosio::action]] void exec( name proposer, name proposal_name, name executer );
/**
* Invalidate proposal
*
* @details Allows an `account` to invalidate itself, that is, its name is added to
* \details Allows an `account` to invalidate itself, that is, its name is added to
* the invalidations table and this table will be cross referenced when exec is performed.
*
* @param account - The account invalidating the transaction
* \param account The account invalidating the transaction.
*/
[[eosio::action]]
void invalidate( name account );
[[eosio::action]] void invalidate( name account );

using propose_action = eosio::action_wrapper<"propose"_n, &multisig::propose>;
using approve_action = eosio::action_wrapper<"approve"_n, &multisig::approve>;
Expand Down Expand Up @@ -173,4 +155,4 @@ namespace eosio {

typedef eosio::multi_index< "invals"_n, invalidation > invalidations;
};
} /// namespace eosio
}
2 changes: 1 addition & 1 deletion contracts/eosio.msig/src/eosio.msig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ void multisig::invalidate( name account ) {
}
}

} /// namespace eosio
}
Loading