bancorprotocol / contracts_eos

Bancor Protocol Contracts for EOS
Other
113 stars 45 forks source link

Enforce `open` action in `setreserve` #62

Open DenisCarriere opened 4 years ago

DenisCarriere commented 4 years ago

Reserves should not be allowed to be created if open action does not exists.

// enforce opening token balance to smart contract
Token::open_action open( contract, { get_self(), "active"_n });
open.send( get_self(), currency, get_self() );

Can be added as a last check to setreserve

https://github.com/bancorprotocol/contracts_eos/blob/master/contracts/eos/BancorConverter/BancorConverter.cpp#L197

RAM payer must be contract itself since the action can't bill user for RAM