-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
732fa98
commit 47e44bd
Showing
18 changed files
with
373 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
add_contract(eosio.fees eosio.fees ${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.fees.cpp) | ||
|
||
target_include_directories(eosio.fees PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
${CMAKE_CURRENT_SOURCE_DIR}/../eosio.system/include) | ||
|
||
set_target_properties(eosio.fees | ||
PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
target_compile_options( eosio.fees PUBLIC ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include <eosio/asset.hpp> | ||
#include <eosio/eosio.hpp> | ||
#include <eosio.system/eosio.system.hpp> | ||
|
||
#include <string> | ||
|
||
namespace eosiosystem { | ||
class system_contract; | ||
} | ||
|
||
namespace eosio { | ||
|
||
using std::string; | ||
/** | ||
* The eosio.fees smart contract facilitates the collection of transaction fees from system accounts and their subsequent distribution to the Resource Exchange (REX) pool. | ||
* | ||
* This contract serves as an essential component for inclusion in system-level unit tests. | ||
* | ||
* A comprehensive implementation of the eosio.fees contract can be accessed at EOS Network Foundation GitHub repository. | ||
* https://github.com/eosnetworkfoundation/eosio.fees | ||
*/ | ||
class [[eosio::contract("eosio.fees")]] fees : public contract { | ||
public: | ||
using contract::contract; | ||
|
||
[[eosio::on_notify("eosio.token::transfer")]] | ||
void on_transfer( const name from, const name to, const asset quantity, const string memo ); | ||
|
||
[[eosio::action]] | ||
void noop(); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <eosio.fees/eosio.fees.hpp> | ||
|
||
namespace eosio { | ||
|
||
void fees::on_transfer( const name from, const name to, const asset quantity, const string memo ) | ||
{ | ||
if ( to != get_self() ) { | ||
return; | ||
} | ||
if (eosiosystem::system_contract::rex_available()) { | ||
eosiosystem::system_contract::donatetorex_action donatetorex( "eosio"_n, { get_self(), "active"_n }); | ||
donatetorex.send(get_self(), quantity, memo); | ||
} | ||
} | ||
|
||
void fees::noop() | ||
{ | ||
require_auth( get_self() ); | ||
} | ||
|
||
} /// namespace eosio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.