Smart contract security
Check the token contract
[[eosio::on_notify("*::transfer")]]
void on_payment (name from, name to, asset quantity, string memo) {...}Check that to == _self
to == _self[[eosio::on_notify("*::transfer")]]
void on_payment (name from, name to, asset quantity, string memo) {
if(to == _self) {
name tkcontract = get_first_receiver();
// look up tkcontract in your list of accepted currencies
// verify the token symbol
// process the payment
}
}Do not query tables from speculative nodes
Assume that an intruder injects inline actions between yours
Asset can be negative
Other checks
Last updated