From 65aaa4fbcec4bbaad89bb93702cf536fc2bbe270 Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Fri, 3 May 2024 21:45:38 +0200 Subject: [PATCH] ignore eosio incoming transfers --- README.md | 10 +++++++++- eosio.bpay.cpp | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0dc002..adcd78f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,15 @@ ## Overview -The `eosio.bpay` contract handles system block pay distribution. +The `eosio.bpay` contract handles system block pay distribution earned by fees. + +```mermaid +stateDiagram-v2 + [*] --> eosio + eosio --> eosio.fees + eosio.fees --> eosio.bpay + eosio.bpay --> [*] +``` ## Development and Testing diff --git a/eosio.bpay.cpp b/eosio.bpay.cpp index f735f1f..cdae137 100644 --- a/eosio.bpay.cpp +++ b/eosio.bpay.cpp @@ -26,6 +26,8 @@ void bpay::on_transfer( const name from, const name to, const asset quantity, co if (from == get_self() || to != get_self()) { return; } + // ignore eosio system incoming transfers (caused by bpay income transfers eosio => eosio.bpay => producer) + if ( from == "eosio"_n) return; check( get_first_receiver() == "eosio.token"_n, "only eosio.token allowed") ; check( quantity.symbol == eosio::symbol("EOS", 4), "only EOS token allowed" );