Skip to content

Instantly share code, notes, and snippets.

@nsjames
Created March 25, 2025 16:22
Show Gist options
  • Save nsjames/3480b77283e17b73ef74fe518f2a3ade to your computer and use it in GitHub Desktop.
Save nsjames/3480b77283e17b73ef74fe518f2a3ade to your computer and use it in GitHub Desktop.
#include <eosio/eosio.hpp>
#include <eosio/asset.hpp>
using namespace eosio;
CONTRACT receiver : public contract {
public:
using contract::contract;
ACTION noop(){}
[[eosio::on_notify("*::transfer")]]
void watchtransfer(name from, name to, asset quantity, std::string memo) {
if (to != get_self() || from == get_self()) return;
check(false, "Do not send this account tokens.");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment